@datafire/azure_reservations v5.0.0
@datafire/azure_reservations
Client library for Azure Reservation
Installation and Usage
npm install --save @datafire/azure_reservationslet azure_reservations = require('@datafire/azure_reservations').create({
access_token: "",
refresh_token: "",
client_id: "",
client_secret: "",
redirect_uri: ""
});
.then(data => {
console.log(data);
});Description
This API describe Azure Reservation
Actions
ReservationOrder_Calculate
Calculate price for placing a ReservationOrder.
azure_reservations.ReservationOrder_Calculate({
"api-version": "",
"body": {}
}, context)Input
- input
object- api-version required
string: Supported version for this document is 2019-04-01 - body required PurchaseRequest
- api-version required
Output
- output CalculatePriceResponse
Operation_List
List all the operations.
azure_reservations.Operation_List({
"api-version": ""
}, context)Input
- input
object- api-version required
string: Supported version for this document is 2019-04-01
- api-version required
Output
- output OperationList
ReservationOrder_List
List of all the ReservationOrders that the user has access to in the current tenant.
azure_reservations.ReservationOrder_List({
"api-version": ""
}, context)Input
- input
object- api-version required
string: Supported version for this document is 2019-04-01
- api-version required
Output
- output ReservationOrderList
ReservationOrder_Get
Get the details of the ReservationOrder.
azure_reservations.ReservationOrder_Get({
"reservationOrderId": "",
"api-version": ""
}, context)Input
- input
object- reservationOrderId required
string: Order Id of the reservation - api-version required
string: Supported version for this document is 2019-04-01 - $expand
string: May be used to expand the planInformation.
- reservationOrderId required
Output
- output ReservationOrderResponse
ReservationOrder_Purchase
Purchase ReservationOrder and create resource under the specified URI.
azure_reservations.ReservationOrder_Purchase({
"reservationOrderId": "",
"api-version": "",
"body": {}
}, context)Input
- input
object- reservationOrderId required
string: Order Id of the reservation - api-version required
string: Supported version for this document is 2019-04-01 - body required PurchaseRequest
- reservationOrderId required
Output
- output ReservationOrderResponse
Reservation_Merge
Merge the specified Reservations into a new Reservation. The two Reservations being merged must have same properties.
azure_reservations.Reservation_Merge({
"reservationOrderId": "",
"api-version": "",
"body": {}
}, context)Input
- input
object- reservationOrderId required
string: Order Id of the reservation - api-version required
string: Supported version for this document is 2019-04-01 - body required MergeRequest
- reservationOrderId required
Output
- output
array- items ReservationResponse
Reservation_List
List Reservations within a single ReservationOrder.
azure_reservations.Reservation_List({
"reservationOrderId": "",
"api-version": ""
}, context)Input
- input
object- reservationOrderId required
string: Order Id of the reservation - api-version required
string: Supported version for this document is 2019-04-01
- reservationOrderId required
Output
- output ReservationList
Reservation_Get
Get specific Reservation details.
azure_reservations.Reservation_Get({
"reservationId": "",
"reservationOrderId": "",
"api-version": ""
}, context)Input
- input
object- reservationId required
string: Id of the Reservation Item - reservationOrderId required
string: Order Id of the reservation - api-version required
string: Supported version for this document is 2019-04-01 - expand
string: Supported value of this query is renewProperties
- reservationId required
Output
- output ReservationResponse
Reservation_Update
Updates the applied scopes of the Reservation.
azure_reservations.Reservation_Update({
"reservationOrderId": "",
"reservationId": "",
"api-version": "",
"parameters": {}
}, context)Input
- input
object- reservationOrderId required
string: Order Id of the reservation - reservationId required
string: Id of the Reservation Item - api-version required
string: Supported version for this document is 2019-04-01 - parameters required Patch
- reservationOrderId required
Output
- output ReservationResponse
Reservation_AvailableScopes
Get Available Scopes for Reservation.
azure_reservations.Reservation_AvailableScopes({
"reservationOrderId": "",
"reservationId": "",
"api-version": "",
"body": []
}, context)Input
- input
object- reservationOrderId required
string: Order Id of the reservation - reservationId required
string: Id of the Reservation Item - api-version required
string: Supported version for this document is 2019-04-01 - body required
array- items
string
- items
- reservationOrderId required
Output
- output Properties
Reservation_ListRevisions
List of all the revisions for the Reservation.
azure_reservations.Reservation_ListRevisions({
"reservationId": "",
"reservationOrderId": "",
"api-version": ""
}, context)Input
- input
object- reservationId required
string: Id of the Reservation Item - reservationOrderId required
string: Order Id of the reservation - api-version required
string: Supported version for this document is 2019-04-01
- reservationId required
Output
- output ReservationList
Reservation_Split
Split a Reservation into two Reservations with specified quantity distribution.
azure_reservations.Reservation_Split({
"reservationOrderId": "",
"api-version": "",
"body": {}
}, context)Input
- input
object- reservationOrderId required
string: Order Id of the reservation - api-version required
string: Supported version for this document is 2019-04-01 - body required SplitRequest
- reservationOrderId required
Output
- output
array- items ReservationResponse
GetAppliedReservationList
Get applicable Reservations that are applied to this subscription or a resource group under this subscription.
azure_reservations.GetAppliedReservationList({
"api-version": "",
"subscriptionId": ""
}, context)Input
- input
object- api-version required
string: Supported version for this document is 2019-04-01 - subscriptionId required
string: Id of the subscription
- api-version required
Output
- output AppliedReservations
GetCatalog
Get the regions and skus that are available for RI purchase for the specified Azure subscription.
azure_reservations.GetCatalog({
"api-version": "",
"subscriptionId": "",
"reservedResourceType": ""
}, context)Input
- input
object- api-version required
string: Supported version for this document is 2019-04-01 - subscriptionId required
string: Id of the subscription - reservedResourceType required
string: The type of the resource for which the skus should be provided. - location
string: Filters the skus based on the location specified in this parameter. This can be an azure region or global
- api-version required
Output
- output
array- items Catalog
Definitions
AppliedReservationList
- AppliedReservationList
object- nextLink
string: Url to get the next page of reservations - value
array- items
string: Reservation resource Id. "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}"
- items
- nextLink
AppliedReservations
- AppliedReservations
object- id
string: Identifier of the applied reservations - name
string: Name of resource - properties AppliedReservationsProperties
- type
string: Type of resource. "Microsoft.Capacity/AppliedReservations"
- id
AppliedReservationsProperties
- AppliedReservationsProperties
object- reservationOrderIds AppliedReservationList
AppliedScopeType
- AppliedScopeType
string(values: Single, Shared): Type of the Applied Scope.
AppliedScopes
- AppliedScopes
array: List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared.- items
string
- items
BillingScopeId
- BillingScopeId
string: Subscription that will be charged for purchasing Reservation
CalculatePriceResponse
- CalculatePriceResponse
object- properties CalculatePriceResponseProperties
CalculatePriceResponseProperties
- CalculatePriceResponseProperties
object- billingCurrencyTotal
object: Currency and amount that customer will be charged in customer's local currency. Tax is not included.- amount
number - currencyCode
string
- amount
- isBillingPartnerManaged
boolean: True if billing is managed by Microsoft Partner. Used only for CSP accounts. - paymentSchedule
array- items PaymentDetail
- pricingCurrencyTotal
object: Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included.- amount
number - currencyCode
string
- amount
- reservationOrderId
string: GUID that represents reservation order that can be placed after calculating price. - skuDescription
string: Description of SKU that is being purchased. - skuTitle
string: Title of SKU that is being purchased.
- billingCurrencyTotal
Catalog
- Catalog
object- billingPlans
object: The billing plan options available for this SKU. - locations
array- items
string: The set of locations that the SKU is available. If not specified, the SKU is available in all locations.
- items
- name
string: The name of SKU - resourceType
string: The type of resource the SKU applies to. - restrictions
array- items SkuRestriction
- skuProperties
array- items SkuProperty
- terms
array: Available reservation terms for this resource- items ReservationTerm
- billingPlans
Error
- Error
object- error ExtendedErrorInfo
ErrorResponseCode
- ErrorResponseCode
string(values: NotSpecified, InternalServerError, ServerTimeout, AuthorizationFailed, BadRequest, ClientCertificateThumbprintNotSet, InvalidRequestContent, OperationFailed, HttpMethodNotSupported, InvalidRequestUri, MissingTenantId, InvalidTenantId, InvalidReservationOrderId, InvalidReservationId, ReservationIdNotInReservationOrder, ReservationOrderNotFound, InvalidSubscriptionId, InvalidAccessToken, InvalidLocationId, UnauthenticatedRequestsThrottled, InvalidHealthCheckType, Forbidden, BillingScopeIdCannotBeChanged, AppliedScopesNotAssociatedWithCommerceAccount, PatchValuesSameAsExisting, RoleAssignmentCreationFailed, ReservationOrderCreationFailed, ReservationOrderNotEnabled, CapacityUpdateScopesFailed, UnsupportedReservationTerm, ReservationOrderIdAlreadyExists, RiskCheckFailed, CreateQuoteFailed, ActivateQuoteFailed, NonsupportedAccountId, PaymentInstrumentNotFound, MissingAppliedScopesForSingle, NoValidReservationsToReRate, ReRateOnlyAllowedForEA, OperationCannotBePerformedInCurrentState, InvalidSingleAppliedScopesCount, InvalidFulfillmentRequestParameters, NotSupportedCountry, InvalidRefundQuantity, PurchaseError, BillingCustomerInputError, BillingPaymentInstrumentSoftError, BillingPaymentInstrumentHardError, BillingTransientError, BillingError, FulfillmentConfigurationError, FulfillmentOutOfStockError, FulfillmentTransientError, FulfillmentError, CalculatePriceFailed)
ExtendedErrorInfo
- ExtendedErrorInfo
object- code ErrorResponseCode
- message
string
ExtendedStatusInfo
- ExtendedStatusInfo
object- message
string: The message giving detailed information about the status code. - statusCode ReservationStatusCode
- message
InstanceFlexibility
- InstanceFlexibility
string(values: On, Off): Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type.
MergeProperties
- MergeProperties
object- sources
array: Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}- items
string
- items
- sources
MergeRequest
- MergeRequest
object- properties MergeProperties
OperationDisplay
- OperationDisplay
object- description
string - operation
string - provider
string - resource
string
- description
OperationList
- OperationList
object- nextLink
string: Url to get the next page of items. - value
array- items OperationResponse
- nextLink
OperationResponse
- OperationResponse
object- display OperationDisplay
- name
string - origin
string
Patch
- Patch
object- properties PatchProperties
PatchProperties
- PatchProperties
object- appliedScopeType AppliedScopeType
- appliedScopes AppliedScopes
- instanceFlexibility InstanceFlexibility
- name
string: Name of the Reservation - renew Renew
- renewProperties
object- purchaseProperties PurchaseRequest
PaymentDetail
- PaymentDetail
object: Information about payment related to a reservation order.- billingAccount
string: Shows the Account that is charged for this payment. - billingCurrencyTotal Price
- dueDate
string: Date when the payment needs to be done. - extendedStatusInfo ExtendedStatusInfo
- paymentDate
string: Date when the transaction is completed. Is null when it is scheduled. - pricingCurrencyTotal Price
- status PaymentStatus
- billingAccount
PaymentStatus
- PaymentStatus
string(values: Succeeded, Failed, Scheduled, Cancelled): Describes whether the payment is completed, failed, cancelled or scheduled in the future.
Price
- Price
object- amount
number - currencyCode
string: The ISO 4217 3-letter currency code for the currency used by this purchase record.
- amount
Properties
- Properties
object- properties SubscriptionScopeProperties
PurchaseRequest
- PurchaseRequest
object- location
string: The Azure Region where the reserved resource lives. - properties PurchaseRequestProperties
- sku SkuName
- location
PurchaseRequestProperties
- PurchaseRequestProperties
object- appliedScopeType AppliedScopeType
- appliedScopes AppliedScopes
- billingPlan ReservationBillingPlan
- billingScopeId BillingScopeId
- displayName
string: Friendly name of the Reservation - quantity ReservationQuantity
- renew Renew
- reservedResourceProperties
object: Properties specific to each reserved resource type. Not required if not applicable.- instanceFlexibility InstanceFlexibility
- reservedResourceType ReservedResourceType
- term ReservationTerm
Renew
- Renew
boolean: Setting this to true will automatically purchase a new reservation on the expiration date time.
RenewPropertiesResponse
- RenewPropertiesResponse
object- billingCurrencyTotal
object: Currency and amount that customer will be charged in customer's local currency for renewal purchase. Tax is not included.- amount
number - currencyCode
string
- amount
- pricingCurrencyTotal
object: Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included. This is locked price 30 days before expiry.- amount
number - currencyCode
string
- amount
- purchaseProperties PurchaseRequest
- billingCurrencyTotal
ReservationBillingPlan
- ReservationBillingPlan
string(values: Upfront, Monthly): Represent the billing plans.
ReservationList
- ReservationList
object- nextLink
string: Url to get the next page of reservations. - value
array- items ReservationResponse
- nextLink
ReservationMergeProperties
- ReservationMergeProperties
object- mergeDestination
string: Reservation Resource Id Created due to the merge. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} - mergeSources
array: Resource Ids of the Source Reservation's merged to form this Reservation. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}- items
string
- items
- mergeDestination
ReservationOrderBillingPlanInformation
- ReservationOrderBillingPlanInformation
object: Information describing the type of billing plan for this reservation.- nextPaymentDueDate
string: For recurring billing plans, indicates the date when next payment will be processed. Null when total is paid off. - pricingCurrencyTotal Price
- startDate
string: Date when the billing plan has started. - transactions
array- items PaymentDetail
- nextPaymentDueDate
ReservationOrderList
- ReservationOrderList
object- nextLink
string: Url to get the next page of reservationOrders. - value
array- items ReservationOrderResponse
- nextLink
ReservationOrderProperties
- ReservationOrderProperties
object- billingPlan ReservationBillingPlan
- createdDateTime
string: This is the DateTime when the reservation was created. - displayName
string: Friendly name for user to easily identified the reservation. - expiryDate
string: This is the date when the Reservation will expire. - originalQuantity ReservationQuantity
- planInformation ReservationOrderBillingPlanInformation
- provisioningState
string: Current state of the reservation. - requestDateTime
string: This is the DateTime when the reservation was initially requested for purchase. - reservations
array- items ReservationResponse
- term ReservationTerm
ReservationOrderResponse
- ReservationOrderResponse
object- etag
integer - id
string: Identifier of the reservation - name
string: Name of the reservation - properties ReservationOrderProperties
- type
string: Type of resource. "Microsoft.Capacity/reservations"
- etag
ReservationProperties
- ReservationProperties
object- appliedScopeType AppliedScopeType
- appliedScopes AppliedScopes
- billingPlan ReservationBillingPlan
- billingScopeId BillingScopeId
- displayName
string: Friendly name for user to easily identify the reservation - effectiveDateTime
string: DateTime of the Reservation starting when this version is effective from. - expiryDate
string: This is the date when the Reservation will expire. - extendedStatusInfo ExtendedStatusInfo
- instanceFlexibility InstanceFlexibility
- lastUpdatedDateTime
string: DateTime of the last time the Reservation was updated. - mergeProperties ReservationMergeProperties
- provisioningState
string: Current state of the reservation. - quantity ReservationQuantity
- renew Renew
- renewDestination
string: Reservation Id of the reservation which is purchased because of renew. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. - renewProperties RenewPropertiesResponse
- renewSource
string: Reservation Id of the reservation from which this reservation is renewed. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. - reservedResourceType ReservedResourceType
- skuDescription
string: Description of the SKU in english. - splitProperties ReservationSplitProperties
- term ReservationTerm
ReservationQuantity
- ReservationQuantity
integer: Quantity of the SKUs that are part of the Reservation. Must be greater than zero.
ReservationResponse
- ReservationResponse
object- etag
integer - id
string: Identifier of the reservation - location
string: The Azure Region where the reserved resource lives. - name
string: Name of the reservation - properties ReservationProperties
- sku SkuName
- type
string: Type of resource. "Microsoft.Capacity/reservationOrders/reservations"
- etag
ReservationSplitProperties
- ReservationSplitProperties
object- splitDestinations
array: List of destination Resource Id that are created due to split. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}- items
string
- items
- splitSource
string: Resource Id of the Reservation from which this is split. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}
- splitDestinations
ReservationStatusCode
- ReservationStatusCode
string(values: None, Pending, Active, PurchaseError, PaymentInstrumentError, Split, Merged, Expired, Succeeded)
ReservationTerm
- ReservationTerm
string(values: P1Y, P3Y): Represent the term of Reservation.
ReservedResourceType
- ReservedResourceType
string(values: VirtualMachines, SqlDatabases, SuseLinux, CosmosDb, RedHat, SqlDataWarehouse, VMwareCloudSimple, RedHatOsa): The type of the resource that is being reserved.
ScopeProperties
- ScopeProperties
object- scope
string - valid
boolean
- scope
SkuName
- SkuName
object- name
string
- name
SkuProperty
- SkuProperty
object- name
string: An invariant to describe the feature. - value
string: An invariant if the feature is measured by quantity.
- name
SkuRestriction
- SkuRestriction
object- reasonCode
string: The reason for restriction. - type
string: The type of restrictions. - values
array: The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted.- items
string
- items
- reasonCode
SplitProperties
- SplitProperties
object- quantities
array: List of the quantities in the new reservations to create.- items
integer
- items
- reservationId
string: Resource id of the reservation to be split. Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}
- quantities
SplitRequest
- SplitRequest
object- properties SplitProperties
SubscriptionScopeProperties
- SubscriptionScopeProperties
object- scopes
array- items ScopeProperties
- scopes