Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk/reservations/arm-reservations/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2019 Microsoft
Copyright (c) 2020 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
20 changes: 13 additions & 7 deletions sdk/reservations/arm-reservations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ npm install @azure/arm-reservations

### How to use

#### nodejs - Authentication, client creation and list reservation as an example written in TypeScript.
#### nodejs - Authentication, client creation and listStatus quota as an example written in TypeScript.

##### Install @azure/ms-rest-nodeauth

Expand All @@ -35,8 +35,11 @@ const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];

msRestNodeAuth.interactiveLogin().then((creds) => {
const client = new AzureReservationAPI(creds, subscriptionId);
const reservationOrderId = "testreservationOrderId";
client.reservation.list(reservationOrderId).then((result) => {
const subscriptionId = "testsubscriptionId";
const providerId = "testproviderId";
const location = "westus";
const resourceName = "testresourceName";
client.quota.listStatus(subscriptionId, providerId, location, resourceName).then((result) => {
console.log("The result is:");
console.log(result);
});
Expand All @@ -45,7 +48,7 @@ msRestNodeAuth.interactiveLogin().then((creds) => {
});
```

#### browser - Authentication, client creation and list reservation as an example written in JavaScript.
#### browser - Authentication, client creation and listStatus quota as an example written in JavaScript.

##### Install @azure/ms-rest-browserauth

Expand Down Expand Up @@ -79,8 +82,11 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
authManager.login();
}
const client = new Azure.ArmReservations.AzureReservationAPI(res.creds, subscriptionId);
const reservationOrderId = "testreservationOrderId";
client.reservation.list(reservationOrderId).then((result) => {
const subscriptionId = "testsubscriptionId";
const providerId = "testproviderId";
const location = "westus";
const resourceName = "testresourceName";
client.quota.listStatus(subscriptionId, providerId, location, resourceName).then((result) => {
console.log("The result is:");
console.log(result);
}).catch((err) => {
Expand All @@ -98,4 +104,4 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to

- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)

![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Freservations%2Farm-reservations%2FREADME.png)
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/reservations/arm-reservations/README.png)
16 changes: 13 additions & 3 deletions sdk/reservations/arm-reservations/src/azureReservationAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ import { AzureReservationAPIContext } from "./azureReservationAPIContext";

class AzureReservationAPI extends AzureReservationAPIContext {
// Operation groups
quota: operations.Quota;
quotaRequest: operations.QuotaRequest;
quotas: operations.Quotas;
quotaRequests: operations.QuotaRequests;
autoQuotaIncrease: operations.AutoQuotaIncrease;
reservation: operations.Reservation;
reservationOrder: operations.ReservationOrder;
operation: operations.Operation;
Expand All @@ -29,6 +34,11 @@ class AzureReservationAPI extends AzureReservationAPIContext {
*/
constructor(credentials: msRest.ServiceClientCredentials, options?: Models.AzureReservationAPIOptions) {
super(credentials, options);
this.quota = new operations.Quota(this);
this.quotaRequest = new operations.QuotaRequest(this);
this.quotas = new operations.Quotas(this);
this.quotaRequests = new operations.QuotaRequests(this);
this.autoQuotaIncrease = new operations.AutoQuotaIncrease(this);
this.reservation = new operations.Reservation(this);
this.reservationOrder = new operations.ReservationOrder(this);
this.operation = new operations.Operation(this);
Expand Down Expand Up @@ -107,9 +117,9 @@ const getCatalogOperationSpec: msRest.OperationSpec = {
Parameters.subscriptionId
],
queryParameters: [
Parameters.apiVersion,
Parameters.apiVersion1,
Parameters.reservedResourceType,
Parameters.location
Parameters.location1
],
headerParameters: [
Parameters.acceptLanguage
Expand Down Expand Up @@ -143,7 +153,7 @@ const getAppliedReservationListOperationSpec: msRest.OperationSpec = {
Parameters.subscriptionId
],
queryParameters: [
Parameters.apiVersion
Parameters.apiVersion1
],
headerParameters: [
Parameters.acceptLanguage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ import * as msRest from "@azure/ms-rest-js";
import * as msRestAzure from "@azure/ms-rest-azure-js";

const packageName = "@azure/arm-reservations";
const packageVersion = "4.0.0";
const packageVersion = "5.0.0";

export class AzureReservationAPIContext extends msRestAzure.AzureServiceClient {
credentials: msRest.ServiceClientCredentials;
apiVersion?: string;

/**
* Initializes a new instance of the AzureReservationAPI class.
Expand All @@ -39,7 +38,6 @@ export class AzureReservationAPIContext extends msRestAzure.AzureServiceClient {

super(credentials, options);

this.apiVersion = '2019-04-01';
this.acceptLanguage = 'en-US';
this.longRunningOperationRetryTimeout = 30;
this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/

export {
AqiSettings,
AutoQuotaIncreaseDetail,
BaseResource,
CurrentQuotaLimit,
CurrentQuotaLimitBase,
CurrentQuotaLimitBaseName,
EmailAction,
ExceptionResponse,
ExtendedStatusInfo,
OnFailure,
OnFailureEmailActions,
OnFailurePhoneActions,
PaymentDetail,
PhoneAction,
Price,
PurchaseRequest,
PurchaseRequestPropertiesReservedResourceProperties,
QuotaRequestDetails,
QuotaRequestOneResourceSubmitResponse,
QuotaRequestProperties,
QuotaRequestSubmitResponse,
RenewPropertiesResponse,
RenewPropertiesResponseBillingCurrencyTotal,
RenewPropertiesResponsePricingCurrencyTotal,
ReservationMergeProperties,
ReservationOrderBillingPlanInformation,
ReservationOrderResponse,
ReservationProperties,
ReservationResponse,
ReservationSplitProperties,
ServiceError,
ServiceErrorDetail,
SkuName,
SubRequest,
SubRequestName,
SupportRequestAction
} from "../models/mappers";
Loading