Documentation ¶
Index ¶
- type AppliedReservationList
- type AppliedReservations
- type AppliedReservationsProperties
- type AppliedScopeType
- type AvailableScopeProperties
- type AvailableScopeRequest
- type AvailableScopeRequestProperties
- type AzureReservationAPIClient
- func (client *AzureReservationAPIClient) GetAppliedReservationList(ctx context.Context, subscriptionID string, ...) (AzureReservationAPIClientGetAppliedReservationListResponse, error)
- func (client *AzureReservationAPIClient) GetCatalog(ctx context.Context, subscriptionID string, ...) (AzureReservationAPIClientGetCatalogResponse, error)
- type AzureReservationAPIClientGetAppliedReservationListOptions
- type AzureReservationAPIClientGetAppliedReservationListResponse
- type AzureReservationAPIClientGetCatalogOptions
- type AzureReservationAPIClientGetCatalogResponse
- type BillingInformation
- type CalculateExchangeClient
- type CalculateExchangeClientBeginPostOptions
- type CalculateExchangeClientPostResponse
- type CalculateExchangeOperationResultResponse
- type CalculateExchangeOperationResultStatus
- type CalculateExchangeRequest
- type CalculateExchangeRequestProperties
- type CalculateExchangeResponseProperties
- type CalculatePriceResponse
- type CalculatePriceResponseProperties
- type CalculatePriceResponsePropertiesBillingCurrencyTotal
- type CalculatePriceResponsePropertiesPricingCurrencyTotal
- type CalculateRefundClient
- type CalculateRefundClientPostOptions
- type CalculateRefundClientPostResponse
- type CalculateRefundRequest
- type CalculateRefundRequestProperties
- type CalculateRefundResponse
- type Catalog
- type CatalogMsrp
- type ChangeDirectoryRequest
- type ChangeDirectoryResponse
- type ChangeDirectoryResult
- type CreateGenericQuotaRequestParameters
- type CreatedByType
- type CurrentQuotaLimit
- type CurrentQuotaLimitBase
- type DisplayProvisioningState
- type Error
- type ErrorDetails
- type ErrorResponse
- type ErrorResponseCode
- type ExceptionResponse
- type ExchangeClient
- type ExchangeClientBeginPostOptions
- type ExchangeClientPostResponse
- type ExchangeOperationResultResponse
- type ExchangeOperationResultStatus
- type ExchangePolicyError
- type ExchangePolicyErrors
- type ExchangeRequest
- type ExchangeRequestProperties
- type ExchangeResponseProperties
- type ExtendedErrorInfo
- type ExtendedStatusInfo
- type InstanceFlexibility
- type ListResult
- type Location
- type MergeProperties
- type MergeRequest
- type OperationClient
- type OperationClientListOptions
- type OperationClientListResponse
- type OperationDisplay
- type OperationList
- type OperationResponse
- type OperationResultError
- type OperationStatus
- type Patch
- type PatchProperties
- type PatchPropertiesRenewProperties
- type PaymentDetail
- type PaymentStatus
- type Price
- type Properties
- type PropertiesUtilization
- type ProvisioningState
- type PurchaseRequest
- type PurchaseRequestProperties
- type PurchaseRequestPropertiesReservedResourceProperties
- type QuotaClient
- func (client *QuotaClient) BeginCreateOrUpdate(ctx context.Context, subscriptionID string, providerID string, location string, ...) (*runtime.Poller[QuotaClientCreateOrUpdateResponse], error)
- func (client *QuotaClient) BeginUpdate(ctx context.Context, subscriptionID string, providerID string, location string, ...) (*runtime.Poller[QuotaClientUpdateResponse], error)
- func (client *QuotaClient) Get(ctx context.Context, subscriptionID string, providerID string, location string, ...) (QuotaClientGetResponse, error)
- func (client *QuotaClient) NewListPager(subscriptionID string, providerID string, location string, ...) *runtime.Pager[QuotaClientListResponse]
- type QuotaClientBeginCreateOrUpdateOptions
- type QuotaClientBeginUpdateOptions
- type QuotaClientCreateOrUpdateResponse
- type QuotaClientGetOptions
- type QuotaClientGetResponse
- type QuotaClientListOptions
- type QuotaClientListResponse
- type QuotaClientUpdateResponse
- type QuotaLimits
- type QuotaLimitsResponse
- type QuotaProperties
- type QuotaRequestDetails
- type QuotaRequestDetailsList
- type QuotaRequestOneResourceProperties
- type QuotaRequestOneResourceSubmitResponse
- type QuotaRequestProperties
- type QuotaRequestState
- type QuotaRequestStatusClient
- func (client *QuotaRequestStatusClient) Get(ctx context.Context, subscriptionID string, providerID string, location string, ...) (QuotaRequestStatusClientGetResponse, error)
- func (client *QuotaRequestStatusClient) NewListPager(subscriptionID string, providerID string, location string, ...) *runtime.Pager[QuotaRequestStatusClientListResponse]
- type QuotaRequestStatusClientGetOptions
- type QuotaRequestStatusClientGetResponse
- type QuotaRequestStatusClientListOptions
- type QuotaRequestStatusClientListResponse
- type QuotaRequestStatusDetails
- type QuotaRequestSubmitResponse
- type QuotaRequestSubmitResponse201
- type RefundBillingInformation
- type RefundPolicyError
- type RefundPolicyResult
- type RefundPolicyResultProperty
- type RefundRequest
- type RefundRequestProperties
- type RefundResponse
- type RefundResponseProperties
- type RenewPropertiesResponse
- type RenewPropertiesResponseBillingCurrencyTotal
- type RenewPropertiesResponsePricingCurrencyTotal
- type ReservationBillingPlan
- type ReservationClient
- func (client *ReservationClient) Archive(ctx context.Context, reservationOrderID string, reservationID string, ...) (ReservationClientArchiveResponse, error)
- func (client *ReservationClient) BeginAvailableScopes(ctx context.Context, reservationOrderID string, reservationID string, ...) (*runtime.Poller[ReservationClientAvailableScopesResponse], error)
- func (client *ReservationClient) BeginMerge(ctx context.Context, reservationOrderID string, body MergeRequest, ...) (*runtime.Poller[ReservationClientMergeResponse], error)
- func (client *ReservationClient) BeginSplit(ctx context.Context, reservationOrderID string, body SplitRequest, ...) (*runtime.Poller[ReservationClientSplitResponse], error)
- func (client *ReservationClient) BeginUpdate(ctx context.Context, reservationOrderID string, reservationID string, ...) (*runtime.Poller[ReservationClientUpdateResponse], error)
- func (client *ReservationClient) Get(ctx context.Context, reservationID string, reservationOrderID string, ...) (ReservationClientGetResponse, error)
- func (client *ReservationClient) NewListAllPager(options *ReservationClientListAllOptions) *runtime.Pager[ReservationClientListAllResponse]
- func (client *ReservationClient) NewListPager(reservationOrderID string, options *ReservationClientListOptions) *runtime.Pager[ReservationClientListResponse]
- func (client *ReservationClient) NewListRevisionsPager(reservationID string, reservationOrderID string, ...) *runtime.Pager[ReservationClientListRevisionsResponse]
- func (client *ReservationClient) Unarchive(ctx context.Context, reservationOrderID string, reservationID string, ...) (ReservationClientUnarchiveResponse, error)
- type ReservationClientArchiveOptions
- type ReservationClientArchiveResponse
- type ReservationClientAvailableScopesResponse
- type ReservationClientBeginAvailableScopesOptions
- type ReservationClientBeginMergeOptions
- type ReservationClientBeginSplitOptions
- type ReservationClientBeginUpdateOptions
- type ReservationClientGetOptions
- type ReservationClientGetResponse
- type ReservationClientListAllOptions
- type ReservationClientListAllResponse
- type ReservationClientListOptions
- type ReservationClientListResponse
- type ReservationClientListRevisionsOptions
- type ReservationClientListRevisionsResponse
- type ReservationClientMergeResponse
- type ReservationClientSplitResponse
- type ReservationClientUnarchiveOptions
- type ReservationClientUnarchiveResponse
- type ReservationClientUpdateResponse
- type ReservationList
- type ReservationMergeProperties
- type ReservationOrderBillingPlanInformation
- type ReservationOrderClient
- func (client *ReservationOrderClient) BeginPurchase(ctx context.Context, reservationOrderID string, body PurchaseRequest, ...) (*runtime.Poller[ReservationOrderClientPurchaseResponse], error)
- func (client *ReservationOrderClient) Calculate(ctx context.Context, body PurchaseRequest, ...) (ReservationOrderClientCalculateResponse, error)
- func (client *ReservationOrderClient) ChangeDirectory(ctx context.Context, reservationOrderID string, body ChangeDirectoryRequest, ...) (ReservationOrderClientChangeDirectoryResponse, error)
- func (client *ReservationOrderClient) Get(ctx context.Context, reservationOrderID string, ...) (ReservationOrderClientGetResponse, error)
- func (client *ReservationOrderClient) NewListPager(options *ReservationOrderClientListOptions) *runtime.Pager[ReservationOrderClientListResponse]
- type ReservationOrderClientBeginPurchaseOptions
- type ReservationOrderClientCalculateOptions
- type ReservationOrderClientCalculateResponse
- type ReservationOrderClientChangeDirectoryOptions
- type ReservationOrderClientChangeDirectoryResponse
- type ReservationOrderClientGetOptions
- type ReservationOrderClientGetResponse
- type ReservationOrderClientListOptions
- type ReservationOrderClientListResponse
- type ReservationOrderClientPurchaseResponse
- type ReservationOrderList
- type ReservationOrderProperties
- type ReservationOrderResponse
- type ReservationResponse
- type ReservationSplitProperties
- type ReservationStatusCode
- type ReservationSummary
- type ReservationTerm
- type ReservationToExchange
- type ReservationToPurchaseCalculateExchange
- type ReservationToPurchaseExchange
- type ReservationToReturn
- type ReservationToReturnForExchange
- type ReservationUtilizationAggregates
- type ReservedResourceType
- type ResourceName
- type ResourceType
- type ReturnClient
- type ReturnClientPostOptions
- type ReturnClientPostResponse
- type SKUCapability
- type SKUName
- type SKUProperty
- type SKURestriction
- type ScopeProperties
- type ServiceError
- type ServiceErrorDetail
- type SplitProperties
- type SplitRequest
- type SubRequest
- type SubscriptionScopeProperties
- type SystemData
- type UserFriendlyAppliedScopeType
- type UserFriendlyRenewState
Examples ¶
- AzureReservationAPIClient.GetAppliedReservationList
- AzureReservationAPIClient.GetCatalog
- CalculateExchangeClient.BeginPost
- CalculateRefundClient.Post
- ExchangeClient.BeginPost
- OperationClient.NewListPager
- QuotaClient.BeginCreateOrUpdate (QuotasRequestPutForCompute)
- QuotaClient.BeginCreateOrUpdate (QuotasRequestPutForMachineLearningServicesDedicatedResource)
- QuotaClient.BeginCreateOrUpdate (QuotasRequestPutForMachineLearningServicesLowPriorityResource)
- QuotaClient.BeginUpdate
- QuotaClient.Get
- QuotaClient.NewListPager (QuotasListUsagesForCompute)
- QuotaClient.NewListPager (QuotasListUsagesMachineLearningServices)
- QuotaRequestStatusClient.Get (QuotaRequestFailed)
- QuotaRequestStatusClient.Get (QuotaRequestInProgress)
- QuotaRequestStatusClient.Get (QuotaRequestStatus)
- QuotaRequestStatusClient.NewListPager
- ReservationClient.Archive
- ReservationClient.BeginAvailableScopes
- ReservationClient.BeginMerge
- ReservationClient.BeginSplit
- ReservationClient.BeginUpdate
- ReservationClient.Get
- ReservationClient.NewListAllPager
- ReservationClient.NewListPager
- ReservationClient.NewListRevisionsPager
- ReservationClient.Unarchive
- ReservationOrderClient.BeginPurchase
- ReservationOrderClient.Calculate
- ReservationOrderClient.ChangeDirectory
- ReservationOrderClient.Get (GetReservation)
- ReservationOrderClient.Get (GetReservationWithExpandPayments)
- ReservationOrderClient.NewListPager
- ReturnClient.Post
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppliedReservationList ¶
type AppliedReservationList struct { // Url to get the next page of reservations NextLink *string `json:"nextLink,omitempty"` Value []*string `json:"value,omitempty"` }
func (AppliedReservationList) MarshalJSON ¶
func (a AppliedReservationList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AppliedReservationList.
func (*AppliedReservationList) UnmarshalJSON ¶ added in v1.1.0
func (a *AppliedReservationList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AppliedReservationList.
type AppliedReservations ¶
type AppliedReservations struct { Properties *AppliedReservationsProperties `json:"properties,omitempty"` // READ-ONLY; Identifier of the applied reservations ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; Name of resource Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; Type of resource. "Microsoft.Capacity/AppliedReservations" Type *string `json:"type,omitempty" azure:"ro"` }
func (AppliedReservations) MarshalJSON ¶ added in v1.1.0
func (a AppliedReservations) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AppliedReservations.
func (*AppliedReservations) UnmarshalJSON ¶ added in v1.1.0
func (a *AppliedReservations) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AppliedReservations.
type AppliedReservationsProperties ¶
type AppliedReservationsProperties struct {
ReservationOrderIDs *AppliedReservationList `json:"reservationOrderIds,omitempty"`
}
func (AppliedReservationsProperties) MarshalJSON ¶ added in v1.1.0
func (a AppliedReservationsProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AppliedReservationsProperties.
func (*AppliedReservationsProperties) UnmarshalJSON ¶ added in v1.1.0
func (a *AppliedReservationsProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AppliedReservationsProperties.
type AppliedScopeType ¶
type AppliedScopeType string
AppliedScopeType - Type of the Applied Scope.
const ( AppliedScopeTypeSingle AppliedScopeType = "Single" )
func PossibleAppliedScopeTypeValues ¶
func PossibleAppliedScopeTypeValues() []AppliedScopeType
PossibleAppliedScopeTypeValues returns the possible values for the AppliedScopeType const type.
type AvailableScopeProperties ¶
type AvailableScopeProperties struct {
Properties *SubscriptionScopeProperties `json:"properties,omitempty"`
}
func (AvailableScopeProperties) MarshalJSON ¶ added in v1.1.0
func (a AvailableScopeProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AvailableScopeProperties.
func (*AvailableScopeProperties) UnmarshalJSON ¶ added in v1.1.0
func (a *AvailableScopeProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AvailableScopeProperties.
type AvailableScopeRequest ¶
type AvailableScopeRequest struct { // Available scope request properties Properties *AvailableScopeRequestProperties `json:"properties,omitempty"` }
AvailableScopeRequest - Available scope
func (AvailableScopeRequest) MarshalJSON ¶ added in v1.1.0
func (a AvailableScopeRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AvailableScopeRequest.
func (*AvailableScopeRequest) UnmarshalJSON ¶ added in v1.1.0
func (a *AvailableScopeRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AvailableScopeRequest.
type AvailableScopeRequestProperties ¶
type AvailableScopeRequestProperties struct {
Scopes []*string `json:"scopes,omitempty"`
}
AvailableScopeRequestProperties - Available scope request properties
func (AvailableScopeRequestProperties) MarshalJSON ¶
func (a AvailableScopeRequestProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AvailableScopeRequestProperties.
func (*AvailableScopeRequestProperties) UnmarshalJSON ¶ added in v1.1.0
func (a *AvailableScopeRequestProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AvailableScopeRequestProperties.
type AzureReservationAPIClient ¶
type AzureReservationAPIClient struct {
// contains filtered or unexported fields
}
AzureReservationAPIClient contains the methods for the AzureReservationAPI group. Don't use this type directly, use NewAzureReservationAPIClient() instead.
func NewAzureReservationAPIClient ¶
func NewAzureReservationAPIClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*AzureReservationAPIClient, error)
NewAzureReservationAPIClient creates a new instance of AzureReservationAPIClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*AzureReservationAPIClient) GetAppliedReservationList ¶
func (client *AzureReservationAPIClient) GetAppliedReservationList(ctx context.Context, subscriptionID string, options *AzureReservationAPIClientGetAppliedReservationListOptions) (AzureReservationAPIClientGetAppliedReservationListResponse, error)
GetAppliedReservationList - Get applicable Reservations that are applied to this subscription or a resource group under this subscription. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-03-01 subscriptionID - Id of the subscription options - AzureReservationAPIClientGetAppliedReservationListOptions contains the optional parameters for the AzureReservationAPIClient.GetAppliedReservationList method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/GetAppliedReservations.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewAzureReservationAPIClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.GetAppliedReservationList(ctx, "23bc208b-083f-4901-ae85-4f98c0c3b4b6", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // TODO: use response item _ = res }
Output:
func (*AzureReservationAPIClient) GetCatalog ¶
func (client *AzureReservationAPIClient) GetCatalog(ctx context.Context, subscriptionID string, options *AzureReservationAPIClientGetCatalogOptions) (AzureReservationAPIClientGetCatalogResponse, error)
GetCatalog - Get the regions and skus that are available for RI purchase for the specified Azure subscription. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-03-01 subscriptionID - Id of the subscription options - AzureReservationAPIClientGetCatalogOptions contains the optional parameters for the AzureReservationAPIClient.GetCatalog method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/GetCatalog.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewAzureReservationAPIClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.GetCatalog(ctx, "23bc208b-083f-4901-ae85-4f98c0c3b4b6", &armreservations.AzureReservationAPIClientGetCatalogOptions{ReservedResourceType: to.Ptr("VirtualMachines"), Location: to.Ptr("eastus"), PublisherID: nil, OfferID: nil, PlanID: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // TODO: use response item _ = res }
Output:
type AzureReservationAPIClientGetAppliedReservationListOptions ¶ added in v0.2.0
type AzureReservationAPIClientGetAppliedReservationListOptions struct { }
AzureReservationAPIClientGetAppliedReservationListOptions contains the optional parameters for the AzureReservationAPIClient.GetAppliedReservationList method.
type AzureReservationAPIClientGetAppliedReservationListResponse ¶ added in v0.2.0
type AzureReservationAPIClientGetAppliedReservationListResponse struct {
AppliedReservations
}
AzureReservationAPIClientGetAppliedReservationListResponse contains the response from method AzureReservationAPIClient.GetAppliedReservationList.
type AzureReservationAPIClientGetCatalogOptions ¶ added in v0.2.0
type AzureReservationAPIClientGetCatalogOptions struct { // Filters the skus based on the location specified in this parameter. This can be an azure region or global Location *string // Offer id used to get the third party products OfferID *string // Plan id used to get the third party products PlanID *string // Publisher id used to get the third party products PublisherID *string // The type of the resource for which the skus should be provided. ReservedResourceType *string }
AzureReservationAPIClientGetCatalogOptions contains the optional parameters for the AzureReservationAPIClient.GetCatalog method.
type AzureReservationAPIClientGetCatalogResponse ¶ added in v0.2.0
type AzureReservationAPIClientGetCatalogResponse struct { // Array of Catalog CatalogArray []*Catalog }
AzureReservationAPIClientGetCatalogResponse contains the response from method AzureReservationAPIClient.GetCatalog.
type BillingInformation ¶
type BillingInformation struct { BillingCurrencyProratedAmount *Price `json:"billingCurrencyProratedAmount,omitempty"` BillingCurrencyRemainingCommitmentAmount *Price `json:"billingCurrencyRemainingCommitmentAmount,omitempty"` BillingCurrencyTotalPaidAmount *Price `json:"billingCurrencyTotalPaidAmount,omitempty"` }
BillingInformation - billing information
func (BillingInformation) MarshalJSON ¶ added in v1.1.0
func (b BillingInformation) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type BillingInformation.
func (*BillingInformation) UnmarshalJSON ¶ added in v1.1.0
func (b *BillingInformation) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type BillingInformation.
type CalculateExchangeClient ¶
type CalculateExchangeClient struct {
// contains filtered or unexported fields
}
CalculateExchangeClient contains the methods for the CalculateExchange group. Don't use this type directly, use NewCalculateExchangeClient() instead.
func NewCalculateExchangeClient ¶
func NewCalculateExchangeClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*CalculateExchangeClient, error)
NewCalculateExchangeClient creates a new instance of CalculateExchangeClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*CalculateExchangeClient) BeginPost ¶
func (client *CalculateExchangeClient) BeginPost(ctx context.Context, body CalculateExchangeRequest, options *CalculateExchangeClientBeginPostOptions) (*runtime.Poller[CalculateExchangeClientPostResponse], error)
BeginPost - Calculates price for exchanging Reservations if there are no policy errors. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-03-01 body - Request containing purchases and refunds that need to be executed. options - CalculateExchangeClientBeginPostOptions contains the optional parameters for the CalculateExchangeClient.BeginPost method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/CalculateExchange.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewCalculateExchangeClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := client.BeginPost(ctx, armreservations.CalculateExchangeRequest{ Properties: &armreservations.CalculateExchangeRequestProperties{ ReservationsToExchange: []*armreservations.ReservationToReturn{ { Quantity: to.Ptr[int32](1), ReservationID: to.Ptr("/providers/microsoft.capacity/reservationOrders/1f14354c-dc12-4c8d-8090-6f295a3a34aa/reservations/c8c926bd-fc5d-4e29-9d43-b68340ac23a6"), }}, ReservationsToPurchase: []*armreservations.PurchaseRequest{ { Location: to.Ptr("westus"), Properties: &armreservations.PurchaseRequestProperties{ AppliedScopeType: to.Ptr(armreservations.AppliedScopeTypeShared), BillingPlan: to.Ptr(armreservations.ReservationBillingPlanUpfront), BillingScopeID: to.Ptr("/subscriptions/ed3a1871-612d-abcd-a849-c2542a68be83"), DisplayName: to.Ptr("testDisplayName"), Quantity: to.Ptr[int32](1), Renew: to.Ptr(false), ReservedResourceProperties: &armreservations.PurchaseRequestPropertiesReservedResourceProperties{ InstanceFlexibility: to.Ptr(armreservations.InstanceFlexibilityOn), }, ReservedResourceType: to.Ptr(armreservations.ReservedResourceTypeVirtualMachines), Term: to.Ptr(armreservations.ReservationTermP1Y), }, SKU: &armreservations.SKUName{ Name: to.Ptr("Standard_B1ls"), }, }}, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // TODO: use response item _ = res }
Output:
type CalculateExchangeClientBeginPostOptions ¶ added in v0.2.0
type CalculateExchangeClientBeginPostOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
CalculateExchangeClientBeginPostOptions contains the optional parameters for the CalculateExchangeClient.BeginPost method.
type CalculateExchangeClientPostResponse ¶ added in v0.2.0
type CalculateExchangeClientPostResponse struct {
CalculateExchangeOperationResultResponse
}
CalculateExchangeClientPostResponse contains the response from method CalculateExchangeClient.Post.
type CalculateExchangeOperationResultResponse ¶
type CalculateExchangeOperationResultResponse struct { // Required if status == failed or status == canceled. Error *OperationResultError `json:"error,omitempty"` // It should match what is used to GET the operation result. ID *string `json:"id,omitempty"` // It must match the last segment of the id field, and will typically be a GUID / system generated value. Name *string `json:"name,omitempty"` // CalculateExchange response properties Properties *CalculateExchangeResponseProperties `json:"properties,omitempty"` // Status of the operation. Status *CalculateExchangeOperationResultStatus `json:"status,omitempty"` }
CalculateExchangeOperationResultResponse - CalculateExchange operation result
func (CalculateExchangeOperationResultResponse) MarshalJSON ¶ added in v1.1.0
func (c CalculateExchangeOperationResultResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CalculateExchangeOperationResultResponse.
func (*CalculateExchangeOperationResultResponse) UnmarshalJSON ¶ added in v1.1.0
func (c *CalculateExchangeOperationResultResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CalculateExchangeOperationResultResponse.
type CalculateExchangeOperationResultStatus ¶
type CalculateExchangeOperationResultStatus string
CalculateExchangeOperationResultStatus - Status of the operation.
const ( CalculateExchangeOperationResultStatusCancelled CalculateExchangeOperationResultStatus = "Cancelled" CalculateExchangeOperationResultStatusFailed CalculateExchangeOperationResultStatus = "Failed" CalculateExchangeOperationResultStatusPending CalculateExchangeOperationResultStatus = "Pending" CalculateExchangeOperationResultStatusSucceeded CalculateExchangeOperationResultStatus = "Succeeded" )
func PossibleCalculateExchangeOperationResultStatusValues ¶
func PossibleCalculateExchangeOperationResultStatusValues() []CalculateExchangeOperationResultStatus
PossibleCalculateExchangeOperationResultStatusValues returns the possible values for the CalculateExchangeOperationResultStatus const type.
type CalculateExchangeRequest ¶
type CalculateExchangeRequest struct { // Calculate exchange request properties Properties *CalculateExchangeRequestProperties `json:"properties,omitempty"` }
CalculateExchangeRequest - Calculate exchange request
func (CalculateExchangeRequest) MarshalJSON ¶ added in v1.1.0
func (c CalculateExchangeRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CalculateExchangeRequest.
func (*CalculateExchangeRequest) UnmarshalJSON ¶ added in v1.1.0
func (c *CalculateExchangeRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CalculateExchangeRequest.
type CalculateExchangeRequestProperties ¶
type CalculateExchangeRequestProperties struct { // List of reservations that are being returned in this exchange. ReservationsToExchange []*ReservationToReturn `json:"reservationsToExchange,omitempty"` // List of reservations that are being purchased in this exchange. ReservationsToPurchase []*PurchaseRequest `json:"reservationsToPurchase,omitempty"` }
CalculateExchangeRequestProperties - Calculate exchange request properties
func (CalculateExchangeRequestProperties) MarshalJSON ¶
func (c CalculateExchangeRequestProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CalculateExchangeRequestProperties.
func (*CalculateExchangeRequestProperties) UnmarshalJSON ¶ added in v1.1.0
func (c *CalculateExchangeRequestProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CalculateExchangeRequestProperties.
type CalculateExchangeResponseProperties ¶
type CalculateExchangeResponseProperties struct { NetPayable *Price `json:"netPayable,omitempty"` // Exchange policy errors PolicyResult *ExchangePolicyErrors `json:"policyResult,omitempty"` PurchasesTotal *Price `json:"purchasesTotal,omitempty"` RefundsTotal *Price `json:"refundsTotal,omitempty"` // Details of the reservations being returned ReservationsToExchange []*ReservationToExchange `json:"reservationsToExchange,omitempty"` // Details of the reservations being purchased ReservationsToPurchase []*ReservationToPurchaseCalculateExchange `json:"reservationsToPurchase,omitempty"` // Exchange session identifier SessionID *string `json:"sessionId,omitempty"` }
CalculateExchangeResponseProperties - CalculateExchange response properties
func (CalculateExchangeResponseProperties) MarshalJSON ¶
func (c CalculateExchangeResponseProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CalculateExchangeResponseProperties.
func (*CalculateExchangeResponseProperties) UnmarshalJSON ¶ added in v1.1.0
func (c *CalculateExchangeResponseProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CalculateExchangeResponseProperties.
type CalculatePriceResponse ¶
type CalculatePriceResponse struct {
Properties *CalculatePriceResponseProperties `json:"properties,omitempty"`
}
func (CalculatePriceResponse) MarshalJSON ¶ added in v1.1.0
func (c CalculatePriceResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CalculatePriceResponse.
func (*CalculatePriceResponse) UnmarshalJSON ¶ added in v1.1.0
func (c *CalculatePriceResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CalculatePriceResponse.
type CalculatePriceResponseProperties ¶
type CalculatePriceResponseProperties struct { // Currency and amount that customer will be charged in customer's local currency. Tax is not included. BillingCurrencyTotal *CalculatePriceResponsePropertiesBillingCurrencyTotal `json:"billingCurrencyTotal,omitempty"` // Total amount in pricing currency. GrandTotal *float64 `json:"grandTotal,omitempty"` // True if billing is managed by Microsoft Partner. Used only for CSP accounts. IsBillingPartnerManaged *bool `json:"isBillingPartnerManaged,omitempty"` // Whether or not tax is included in grand total IsTaxIncluded *bool `json:"isTaxIncluded,omitempty"` // Net total amount in pricing currency. NetTotal *float64 `json:"netTotal,omitempty"` PaymentSchedule []*PaymentDetail `json:"paymentSchedule,omitempty"` // Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included. PricingCurrencyTotal *CalculatePriceResponsePropertiesPricingCurrencyTotal `json:"pricingCurrencyTotal,omitempty"` // GUID that represents reservation order that can be placed after calculating price. ReservationOrderID *string `json:"reservationOrderId,omitempty"` // Description of SKU that is being purchased. SKUDescription *string `json:"skuDescription,omitempty"` // Title of SKU that is being purchased. SKUTitle *string `json:"skuTitle,omitempty"` // Tax amount in pricing currency. TaxTotal *float64 `json:"taxTotal,omitempty"` }
func (CalculatePriceResponseProperties) MarshalJSON ¶
func (c CalculatePriceResponseProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CalculatePriceResponseProperties.
func (*CalculatePriceResponseProperties) UnmarshalJSON ¶ added in v1.1.0
func (c *CalculatePriceResponseProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CalculatePriceResponseProperties.
type CalculatePriceResponsePropertiesBillingCurrencyTotal ¶
type CalculatePriceResponsePropertiesBillingCurrencyTotal struct { // Amount in pricing currency. Tax is not included. Amount *float64 `json:"amount,omitempty"` // The ISO 4217 3-letter currency code for the currency used by this purchase record. CurrencyCode *string `json:"currencyCode,omitempty"` }
CalculatePriceResponsePropertiesBillingCurrencyTotal - Currency and amount that customer will be charged in customer's local currency. Tax is not included.
func (CalculatePriceResponsePropertiesBillingCurrencyTotal) MarshalJSON ¶ added in v1.1.0
func (c CalculatePriceResponsePropertiesBillingCurrencyTotal) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CalculatePriceResponsePropertiesBillingCurrencyTotal.
func (*CalculatePriceResponsePropertiesBillingCurrencyTotal) UnmarshalJSON ¶ added in v1.1.0
func (c *CalculatePriceResponsePropertiesBillingCurrencyTotal) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CalculatePriceResponsePropertiesBillingCurrencyTotal.
type CalculatePriceResponsePropertiesPricingCurrencyTotal ¶
type CalculatePriceResponsePropertiesPricingCurrencyTotal struct { Amount *float32 `json:"amount,omitempty"` // The ISO 4217 3-letter currency code for the currency used by this purchase record. CurrencyCode *string `json:"currencyCode,omitempty"` }
CalculatePriceResponsePropertiesPricingCurrencyTotal - Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included.
func (CalculatePriceResponsePropertiesPricingCurrencyTotal) MarshalJSON ¶ added in v1.1.0
func (c CalculatePriceResponsePropertiesPricingCurrencyTotal) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CalculatePriceResponsePropertiesPricingCurrencyTotal.
func (*CalculatePriceResponsePropertiesPricingCurrencyTotal) UnmarshalJSON ¶ added in v1.1.0
func (c *CalculatePriceResponsePropertiesPricingCurrencyTotal) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CalculatePriceResponsePropertiesPricingCurrencyTotal.
type CalculateRefundClient ¶ added in v1.1.0
type CalculateRefundClient struct {
// contains filtered or unexported fields
}
CalculateRefundClient contains the methods for the CalculateRefund group. Don't use this type directly, use NewCalculateRefundClient() instead.
func NewCalculateRefundClient ¶ added in v1.1.0
func NewCalculateRefundClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*CalculateRefundClient, error)
NewCalculateRefundClient creates a new instance of CalculateRefundClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*CalculateRefundClient) Post ¶ added in v1.1.0
func (client *CalculateRefundClient) Post(ctx context.Context, reservationOrderID string, body CalculateRefundRequest, options *CalculateRefundClientPostOptions) (CalculateRefundClientPostResponse, error)
Post - Calculate price for returning Reservations if there are no policy errors. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-03-01 reservationOrderID - Order Id of the reservation body - Information needed for calculating refund of a reservation. options - CalculateRefundClientPostOptions contains the optional parameters for the CalculateRefundClient.Post method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/CalculateRefund.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewCalculateRefundClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Post(ctx, "276e7ae4-84d0-4da6-ab4b-d6b94f3557da", armreservations.CalculateRefundRequest{ ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/50000000-aaaa-bbbb-cccc-100000000004"), Properties: &armreservations.CalculateRefundRequestProperties{ ReservationToReturn: &armreservations.ReservationToReturn{ Quantity: to.Ptr[int32](1), ReservationID: to.Ptr("/providers/microsoft.capacity/reservationOrders/50000000-aaaa-bbbb-cccc-100000000004/reservations/40000000-aaaa-bbbb-cccc-100000000000"), }, Scope: to.Ptr("Reservation"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // TODO: use response item _ = res }
Output:
type CalculateRefundClientPostOptions ¶ added in v1.1.0
type CalculateRefundClientPostOptions struct { }
CalculateRefundClientPostOptions contains the optional parameters for the CalculateRefundClient.Post method.
type CalculateRefundClientPostResponse ¶ added in v1.1.0
type CalculateRefundClientPostResponse struct {
CalculateRefundResponse
}
CalculateRefundClientPostResponse contains the response from method CalculateRefundClient.Post.
type CalculateRefundRequest ¶ added in v1.1.0
type CalculateRefundRequest struct { // Fully qualified identifier of the reservation order being returned ID *string `json:"id,omitempty"` Properties *CalculateRefundRequestProperties `json:"properties,omitempty"` }
func (CalculateRefundRequest) MarshalJSON ¶ added in v1.1.0
func (c CalculateRefundRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CalculateRefundRequest.
func (*CalculateRefundRequest) UnmarshalJSON ¶ added in v1.1.0
func (c *CalculateRefundRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CalculateRefundRequest.
type CalculateRefundRequestProperties ¶ added in v1.1.0
type CalculateRefundRequestProperties struct { // Reservation to return ReservationToReturn *ReservationToReturn `json:"reservationToReturn,omitempty"` // The scope of the refund, e.g. Reservation Scope *string `json:"scope,omitempty"` }
func (CalculateRefundRequestProperties) MarshalJSON ¶ added in v1.1.0
func (c CalculateRefundRequestProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CalculateRefundRequestProperties.
func (*CalculateRefundRequestProperties) UnmarshalJSON ¶ added in v1.1.0
func (c *CalculateRefundRequestProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CalculateRefundRequestProperties.
type CalculateRefundResponse ¶ added in v1.1.0
type CalculateRefundResponse struct { // Fully qualified identifier of the reservation being returned ID *string `json:"id,omitempty"` Properties *RefundResponseProperties `json:"properties,omitempty"` }
func (CalculateRefundResponse) MarshalJSON ¶ added in v1.1.0
func (c CalculateRefundResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CalculateRefundResponse.
func (*CalculateRefundResponse) UnmarshalJSON ¶ added in v1.1.0
func (c *CalculateRefundResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CalculateRefundResponse.
type Catalog ¶
type Catalog struct { // The billing plan options available for this SKU. BillingPlans map[string][]*ReservationBillingPlan `json:"billingPlans,omitempty"` // READ-ONLY Capabilities []*SKUCapability `json:"capabilities,omitempty" azure:"ro"` // READ-ONLY Locations []*string `json:"locations,omitempty" azure:"ro"` // READ-ONLY; Pricing information about the SKU Msrp *CatalogMsrp `json:"msrp,omitempty" azure:"ro"` // READ-ONLY; The name of SKU Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; The type of resource the SKU applies to. ResourceType *string `json:"resourceType,omitempty" azure:"ro"` // READ-ONLY Restrictions []*SKURestriction `json:"restrictions,omitempty" azure:"ro"` // READ-ONLY SKUProperties []*SKUProperty `json:"skuProperties,omitempty" azure:"ro"` // READ-ONLY; The size of this SKU Size *string `json:"size,omitempty" azure:"ro"` // READ-ONLY; Available reservation terms for this resource Terms []*ReservationTerm `json:"terms,omitempty" azure:"ro"` // READ-ONLY; The tier of this SKU Tier *string `json:"tier,omitempty" azure:"ro"` }
func (Catalog) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Catalog.
func (*Catalog) UnmarshalJSON ¶ added in v1.1.0
UnmarshalJSON implements the json.Unmarshaller interface for type Catalog.
type CatalogMsrp ¶
type CatalogMsrp struct { // Amount in pricing currency. Tax not included. P1Y *Price `json:"p1Y,omitempty"` }
CatalogMsrp - Pricing information about the SKU
func (CatalogMsrp) MarshalJSON ¶ added in v1.1.0
func (c CatalogMsrp) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CatalogMsrp.
func (*CatalogMsrp) UnmarshalJSON ¶ added in v1.1.0
func (c *CatalogMsrp) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CatalogMsrp.
type ChangeDirectoryRequest ¶
type ChangeDirectoryRequest struct { // Tenant id GUID that reservation order is to be transferred to DestinationTenantID *string `json:"destinationTenantId,omitempty"` }
func (ChangeDirectoryRequest) MarshalJSON ¶ added in v1.1.0
func (c ChangeDirectoryRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ChangeDirectoryRequest.
func (*ChangeDirectoryRequest) UnmarshalJSON ¶ added in v1.1.0
func (c *ChangeDirectoryRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ChangeDirectoryRequest.
type ChangeDirectoryResponse ¶
type ChangeDirectoryResponse struct { // Change directory result for reservation order or reservation ReservationOrder *ChangeDirectoryResult `json:"reservationOrder,omitempty"` Reservations []*ChangeDirectoryResult `json:"reservations,omitempty"` }
ChangeDirectoryResponse - Change directory response
func (ChangeDirectoryResponse) MarshalJSON ¶
func (c ChangeDirectoryResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ChangeDirectoryResponse.
func (*ChangeDirectoryResponse) UnmarshalJSON ¶ added in v1.1.0
func (c *ChangeDirectoryResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ChangeDirectoryResponse.
type ChangeDirectoryResult ¶
type ChangeDirectoryResult struct { // Error reason if operation failed. Null otherwise Error *string `json:"error,omitempty"` // Identifier of the reservation order or reservation ID *string `json:"id,omitempty"` // True if change directory operation succeeded on this reservation order or reservation IsSucceeded *bool `json:"isSucceeded,omitempty"` // Name of the reservation order or reservation Name *string `json:"name,omitempty"` }
ChangeDirectoryResult - Change directory result for reservation order or reservation
func (ChangeDirectoryResult) MarshalJSON ¶ added in v1.1.0
func (c ChangeDirectoryResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ChangeDirectoryResult.
func (*ChangeDirectoryResult) UnmarshalJSON ¶ added in v1.1.0
func (c *ChangeDirectoryResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ChangeDirectoryResult.
type CreateGenericQuotaRequestParameters ¶
type CreateGenericQuotaRequestParameters struct { // Quota change requests. Value []*CurrentQuotaLimitBase `json:"value,omitempty"` }
CreateGenericQuotaRequestParameters - Quota change requests information.
func (CreateGenericQuotaRequestParameters) MarshalJSON ¶
func (c CreateGenericQuotaRequestParameters) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CreateGenericQuotaRequestParameters.
func (*CreateGenericQuotaRequestParameters) UnmarshalJSON ¶ added in v1.1.0
func (c *CreateGenericQuotaRequestParameters) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CreateGenericQuotaRequestParameters.
type CreatedByType ¶
type CreatedByType string
CreatedByType - The type of identity that created the resource.
const ( CreatedByTypeApplication CreatedByType = "Application" CreatedByTypeKey CreatedByType = "Key" CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" CreatedByTypeUser CreatedByType = "User" )
func PossibleCreatedByTypeValues ¶
func PossibleCreatedByTypeValues() []CreatedByType
PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.
type CurrentQuotaLimit ¶
type CurrentQuotaLimit struct { // Additional properties for the quota status for the resource. Properties *QuotaRequestStatusDetails `json:"properties,omitempty"` // Quota details. QuotaInformation *CurrentQuotaLimitBase `json:"quotaInformation,omitempty"` }
CurrentQuotaLimit - Current quota limits.
func (CurrentQuotaLimit) MarshalJSON ¶ added in v1.1.0
func (c CurrentQuotaLimit) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CurrentQuotaLimit.
func (*CurrentQuotaLimit) UnmarshalJSON ¶ added in v1.1.0
func (c *CurrentQuotaLimit) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CurrentQuotaLimit.
type CurrentQuotaLimitBase ¶
type CurrentQuotaLimitBase struct { // Quota properties for the resource. Properties *QuotaProperties `json:"properties,omitempty"` // READ-ONLY; The quota request ID. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The name of the quota request. Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; Type of resource. "Microsoft.Capacity/ServiceLimits" Type *string `json:"type,omitempty" azure:"ro"` }
CurrentQuotaLimitBase - Quota properties.
func (CurrentQuotaLimitBase) MarshalJSON ¶
func (c CurrentQuotaLimitBase) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CurrentQuotaLimitBase.
func (*CurrentQuotaLimitBase) UnmarshalJSON ¶ added in v1.1.0
func (c *CurrentQuotaLimitBase) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CurrentQuotaLimitBase.
type DisplayProvisioningState ¶
type DisplayProvisioningState string
DisplayProvisioningState - Represent the current display state of the Reservation.
const ( DisplayProvisioningStateCancelled DisplayProvisioningState = "Cancelled" DisplayProvisioningStateExpired DisplayProvisioningState = "Expired" DisplayProvisioningStateExpiring DisplayProvisioningState = "Expiring" DisplayProvisioningStateFailed DisplayProvisioningState = "Failed" DisplayProvisioningStatePending DisplayProvisioningState = "Pending" DisplayProvisioningStateProcessing DisplayProvisioningState = "Processing" DisplayProvisioningStateSucceeded DisplayProvisioningState = "Succeeded" )
func PossibleDisplayProvisioningStateValues ¶
func PossibleDisplayProvisioningStateValues() []DisplayProvisioningState
PossibleDisplayProvisioningStateValues returns the possible values for the DisplayProvisioningState const type.
type Error ¶
type Error struct {
Error *ExtendedErrorInfo `json:"error,omitempty"`
}
func (Error) MarshalJSON ¶ added in v1.1.0
MarshalJSON implements the json.Marshaller interface for type Error.
func (*Error) UnmarshalJSON ¶ added in v1.1.0
UnmarshalJSON implements the json.Unmarshaller interface for type Error.
type ErrorDetails ¶
type ErrorDetails struct { // READ-ONLY; Error code. Code *string `json:"code,omitempty" azure:"ro"` // READ-ONLY; Error message indicating why the operation failed. Message *string `json:"message,omitempty" azure:"ro"` // READ-ONLY; The target of the particular error. Target *string `json:"target,omitempty" azure:"ro"` }
ErrorDetails - The details of the error.
func (ErrorDetails) MarshalJSON ¶ added in v1.1.0
func (e ErrorDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorDetails.
func (*ErrorDetails) UnmarshalJSON ¶ added in v1.1.0
func (e *ErrorDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetails.
type ErrorResponse ¶
type ErrorResponse struct { // The details of the error. Error *ErrorDetails `json:"error,omitempty"` }
ErrorResponse - Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.
func (ErrorResponse) MarshalJSON ¶ added in v1.1.0
func (e ErrorResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorResponse.
func (*ErrorResponse) UnmarshalJSON ¶ added in v1.1.0
func (e *ErrorResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse.
type ErrorResponseCode ¶
type ErrorResponseCode string
const ( ErrorResponseCodeActivateQuoteFailed ErrorResponseCode = "ActivateQuoteFailed" ErrorResponseCodeAppliedScopesNotAssociatedWithCommerceAccount ErrorResponseCode = "AppliedScopesNotAssociatedWithCommerceAccount" ErrorResponseCodeAppliedScopesSameAsExisting ErrorResponseCode = "AppliedScopesSameAsExisting" ErrorResponseCodeAuthorizationFailed ErrorResponseCode = "AuthorizationFailed" ErrorResponseCodeBadRequest ErrorResponseCode = "BadRequest" ErrorResponseCodeBillingCustomerInputError ErrorResponseCode = "BillingCustomerInputError" ErrorResponseCodeBillingError ErrorResponseCode = "BillingError" ErrorResponseCodeBillingPaymentInstrumentHardError ErrorResponseCode = "BillingPaymentInstrumentHardError" ErrorResponseCodeBillingPaymentInstrumentSoftError ErrorResponseCode = "BillingPaymentInstrumentSoftError" ErrorResponseCodeBillingScopeIDCannotBeChanged ErrorResponseCode = "BillingScopeIdCannotBeChanged" ErrorResponseCodeBillingTransientError ErrorResponseCode = "BillingTransientError" ErrorResponseCodeCalculatePriceFailed ErrorResponseCode = "CalculatePriceFailed" ErrorResponseCodeCapacityUpdateScopesFailed ErrorResponseCode = "CapacityUpdateScopesFailed" ErrorResponseCodeClientCertificateThumbprintNotSet ErrorResponseCode = "ClientCertificateThumbprintNotSet" ErrorResponseCodeCreateQuoteFailed ErrorResponseCode = "CreateQuoteFailed" ErrorResponseCodeForbidden ErrorResponseCode = "Forbidden" ErrorResponseCodeFulfillmentConfigurationError ErrorResponseCode = "FulfillmentConfigurationError" ErrorResponseCodeFulfillmentError ErrorResponseCode = "FulfillmentError" ErrorResponseCodeFulfillmentOutOfStockError ErrorResponseCode = "FulfillmentOutOfStockError" ErrorResponseCodeFulfillmentTransientError ErrorResponseCode = "FulfillmentTransientError" ErrorResponseCodeHTTPMethodNotSupported ErrorResponseCode = "HttpMethodNotSupported" ErrorResponseCodeInternalServerError ErrorResponseCode = "InternalServerError" ErrorResponseCodeInvalidAccessToken ErrorResponseCode = "InvalidAccessToken" ErrorResponseCodeInvalidFulfillmentRequestParameters ErrorResponseCode = "InvalidFulfillmentRequestParameters" ErrorResponseCodeInvalidHealthCheckType ErrorResponseCode = "InvalidHealthCheckType" ErrorResponseCodeInvalidLocationID ErrorResponseCode = "InvalidLocationId" ErrorResponseCodeInvalidRefundQuantity ErrorResponseCode = "InvalidRefundQuantity" ErrorResponseCodeInvalidRequestContent ErrorResponseCode = "InvalidRequestContent" ErrorResponseCodeInvalidRequestURI ErrorResponseCode = "InvalidRequestUri" ErrorResponseCodeInvalidReservationID ErrorResponseCode = "InvalidReservationId" ErrorResponseCodeInvalidReservationOrderID ErrorResponseCode = "InvalidReservationOrderId" ErrorResponseCodeInvalidSingleAppliedScopesCount ErrorResponseCode = "InvalidSingleAppliedScopesCount" ErrorResponseCodeInvalidSubscriptionID ErrorResponseCode = "InvalidSubscriptionId" ErrorResponseCodeInvalidTenantID ErrorResponseCode = "InvalidTenantId" ErrorResponseCodeMissingAppliedScopesForSingle ErrorResponseCode = "MissingAppliedScopesForSingle" ErrorResponseCodeMissingTenantID ErrorResponseCode = "MissingTenantId" ErrorResponseCodeNoValidReservationsToReRate ErrorResponseCode = "NoValidReservationsToReRate" ErrorResponseCodeNonsupportedAccountID ErrorResponseCode = "NonsupportedAccountId" ErrorResponseCodeNotSpecified ErrorResponseCode = "NotSpecified" ErrorResponseCodeNotSupportedCountry ErrorResponseCode = "NotSupportedCountry" ErrorResponseCodeOperationCannotBePerformedInCurrentState ErrorResponseCode = "OperationCannotBePerformedInCurrentState" ErrorResponseCodeOperationFailed ErrorResponseCode = "OperationFailed" ErrorResponseCodePatchValuesSameAsExisting ErrorResponseCode = "PatchValuesSameAsExisting" ErrorResponseCodePaymentInstrumentNotFound ErrorResponseCode = "PaymentInstrumentNotFound" ErrorResponseCodePurchaseError ErrorResponseCode = "PurchaseError" ErrorResponseCodeReRateOnlyAllowedForEA ErrorResponseCode = "ReRateOnlyAllowedForEA" ErrorResponseCodeRefundLimitExceeded ErrorResponseCode = "RefundLimitExceeded" ErrorResponseCodeReservationIDNotInReservationOrder ErrorResponseCode = "ReservationIdNotInReservationOrder" ErrorResponseCodeReservationOrderCreationFailed ErrorResponseCode = "ReservationOrderCreationFailed" ErrorResponseCodeReservationOrderIDAlreadyExists ErrorResponseCode = "ReservationOrderIdAlreadyExists" ErrorResponseCodeReservationOrderNotEnabled ErrorResponseCode = "ReservationOrderNotEnabled" ErrorResponseCodeReservationOrderNotFound ErrorResponseCode = "ReservationOrderNotFound" ErrorResponseCodeRiskCheckFailed ErrorResponseCode = "RiskCheckFailed" ErrorResponseCodeRoleAssignmentCreationFailed ErrorResponseCode = "RoleAssignmentCreationFailed" ErrorResponseCodeSelfServiceRefundNotSupported ErrorResponseCode = "SelfServiceRefundNotSupported" ErrorResponseCodeServerTimeout ErrorResponseCode = "ServerTimeout" ErrorResponseCodeUnauthenticatedRequestsThrottled ErrorResponseCode = "UnauthenticatedRequestsThrottled" ErrorResponseCodeUnsupportedReservationTerm ErrorResponseCode = "UnsupportedReservationTerm" )
func PossibleErrorResponseCodeValues ¶
func PossibleErrorResponseCodeValues() []ErrorResponseCode
PossibleErrorResponseCodeValues returns the possible values for the ErrorResponseCode const type.
type ExceptionResponse ¶
type ExceptionResponse struct { // The API error details. Error *ServiceError `json:"error,omitempty"` }
ExceptionResponse - The API error.
func (ExceptionResponse) MarshalJSON ¶ added in v1.1.0
func (e ExceptionResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExceptionResponse.
func (*ExceptionResponse) UnmarshalJSON ¶ added in v1.1.0
func (e *ExceptionResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExceptionResponse.
type ExchangeClient ¶
type ExchangeClient struct {
// contains filtered or unexported fields
}
ExchangeClient contains the methods for the Exchange group. Don't use this type directly, use NewExchangeClient() instead.
func NewExchangeClient ¶
func NewExchangeClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ExchangeClient, error)
NewExchangeClient creates a new instance of ExchangeClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*ExchangeClient) BeginPost ¶
func (client *ExchangeClient) BeginPost(ctx context.Context, body ExchangeRequest, options *ExchangeClientBeginPostOptions) (*runtime.Poller[ExchangeClientPostResponse], error)
BeginPost - Returns one or more Reservations in exchange for one or more Reservation purchases. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-03-01 body - Request containing the refunds and purchases that need to be executed. options - ExchangeClientBeginPostOptions contains the optional parameters for the ExchangeClient.BeginPost method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/Exchange.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewExchangeClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := client.BeginPost(ctx, armreservations.ExchangeRequest{ Properties: &armreservations.ExchangeRequestProperties{ SessionID: to.Ptr("66e2ac8f-439e-4345-8235-6fef07608081"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // TODO: use response item _ = res }
Output:
type ExchangeClientBeginPostOptions ¶ added in v0.2.0
type ExchangeClientBeginPostOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ExchangeClientBeginPostOptions contains the optional parameters for the ExchangeClient.BeginPost method.
type ExchangeClientPostResponse ¶ added in v0.2.0
type ExchangeClientPostResponse struct {
ExchangeOperationResultResponse
}
ExchangeClientPostResponse contains the response from method ExchangeClient.Post.
type ExchangeOperationResultResponse ¶
type ExchangeOperationResultResponse struct { // Required if status == failed or status == canceled. Error *OperationResultError `json:"error,omitempty"` // It should match what is used to GET the operation result. ID *string `json:"id,omitempty"` // It must match the last segment of the id field, and will typically be a GUID / system generated value. Name *string `json:"name,omitempty"` // Exchange response properties Properties *ExchangeResponseProperties `json:"properties,omitempty"` // Status of the operation. Status *ExchangeOperationResultStatus `json:"status,omitempty"` }
ExchangeOperationResultResponse - Exchange operation result
func (ExchangeOperationResultResponse) MarshalJSON ¶ added in v1.1.0
func (e ExchangeOperationResultResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExchangeOperationResultResponse.
func (*ExchangeOperationResultResponse) UnmarshalJSON ¶ added in v1.1.0
func (e *ExchangeOperationResultResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExchangeOperationResultResponse.
type ExchangeOperationResultStatus ¶
type ExchangeOperationResultStatus string
ExchangeOperationResultStatus - Status of the operation.
const ( ExchangeOperationResultStatusCancelled ExchangeOperationResultStatus = "Cancelled" ExchangeOperationResultStatusFailed ExchangeOperationResultStatus = "Failed" ExchangeOperationResultStatusPendingPurchases ExchangeOperationResultStatus = "PendingPurchases" ExchangeOperationResultStatusPendingRefunds ExchangeOperationResultStatus = "PendingRefunds" ExchangeOperationResultStatusSucceeded ExchangeOperationResultStatus = "Succeeded" )
func PossibleExchangeOperationResultStatusValues ¶
func PossibleExchangeOperationResultStatusValues() []ExchangeOperationResultStatus
PossibleExchangeOperationResultStatusValues returns the possible values for the ExchangeOperationResultStatus const type.
type ExchangePolicyError ¶
type ExchangePolicyError struct { Code *string `json:"code,omitempty"` Message *string `json:"message,omitempty"` }
ExchangePolicyError - error details
func (ExchangePolicyError) MarshalJSON ¶ added in v1.1.0
func (e ExchangePolicyError) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExchangePolicyError.
func (*ExchangePolicyError) UnmarshalJSON ¶ added in v1.1.0
func (e *ExchangePolicyError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExchangePolicyError.
type ExchangePolicyErrors ¶
type ExchangePolicyErrors struct { // Exchange Policy errors PolicyErrors []*ExchangePolicyError `json:"policyErrors,omitempty"` }
ExchangePolicyErrors - Exchange policy errors
func (ExchangePolicyErrors) MarshalJSON ¶
func (e ExchangePolicyErrors) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExchangePolicyErrors.
func (*ExchangePolicyErrors) UnmarshalJSON ¶ added in v1.1.0
func (e *ExchangePolicyErrors) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExchangePolicyErrors.
type ExchangeRequest ¶
type ExchangeRequest struct { // Exchange request properties Properties *ExchangeRequestProperties `json:"properties,omitempty"` }
ExchangeRequest - Exchange request
func (ExchangeRequest) MarshalJSON ¶ added in v1.1.0
func (e ExchangeRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExchangeRequest.
func (*ExchangeRequest) UnmarshalJSON ¶ added in v1.1.0
func (e *ExchangeRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExchangeRequest.
type ExchangeRequestProperties ¶
type ExchangeRequestProperties struct { // SessionId that was returned by CalculateExchange API. SessionID *string `json:"sessionId,omitempty"` }
ExchangeRequestProperties - Exchange request properties
func (ExchangeRequestProperties) MarshalJSON ¶ added in v1.1.0
func (e ExchangeRequestProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExchangeRequestProperties.
func (*ExchangeRequestProperties) UnmarshalJSON ¶ added in v1.1.0
func (e *ExchangeRequestProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExchangeRequestProperties.
type ExchangeResponseProperties ¶
type ExchangeResponseProperties struct { NetPayable *Price `json:"netPayable,omitempty"` // Exchange policy errors PolicyResult *ExchangePolicyErrors `json:"policyResult,omitempty"` PurchasesTotal *Price `json:"purchasesTotal,omitempty"` RefundsTotal *Price `json:"refundsTotal,omitempty"` // Details of the reservations being returned ReservationsToExchange []*ReservationToReturnForExchange `json:"reservationsToExchange,omitempty"` // Details of the reservations being purchased ReservationsToPurchase []*ReservationToPurchaseExchange `json:"reservationsToPurchase,omitempty"` // Exchange session identifier SessionID *string `json:"sessionId,omitempty"` }
ExchangeResponseProperties - Exchange response properties
func (ExchangeResponseProperties) MarshalJSON ¶
func (e ExchangeResponseProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExchangeResponseProperties.
func (*ExchangeResponseProperties) UnmarshalJSON ¶ added in v1.1.0
func (e *ExchangeResponseProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExchangeResponseProperties.
type ExtendedErrorInfo ¶
type ExtendedErrorInfo struct { Code *ErrorResponseCode `json:"code,omitempty"` Message *string `json:"message,omitempty"` }
func (ExtendedErrorInfo) MarshalJSON ¶ added in v1.1.0
func (e ExtendedErrorInfo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExtendedErrorInfo.
func (*ExtendedErrorInfo) UnmarshalJSON ¶ added in v1.1.0
func (e *ExtendedErrorInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedErrorInfo.
type ExtendedStatusInfo ¶
type ExtendedStatusInfo struct { // The message giving detailed information about the status code. Message *string `json:"message,omitempty"` StatusCode *ReservationStatusCode `json:"statusCode,omitempty"` }
func (ExtendedStatusInfo) MarshalJSON ¶ added in v1.1.0
func (e ExtendedStatusInfo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExtendedStatusInfo.
func (*ExtendedStatusInfo) UnmarshalJSON ¶ added in v1.1.0
func (e *ExtendedStatusInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedStatusInfo.
type InstanceFlexibility ¶
type InstanceFlexibility string
InstanceFlexibility - Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type.
const ( InstanceFlexibilityOff InstanceFlexibility = "Off" InstanceFlexibilityOn InstanceFlexibility = "On" )
func PossibleInstanceFlexibilityValues ¶
func PossibleInstanceFlexibilityValues() []InstanceFlexibility
PossibleInstanceFlexibilityValues returns the possible values for the InstanceFlexibility const type.
type ListResult ¶ added in v0.2.0
type ListResult struct { // The roll out count summary of the reservations Summary *ReservationSummary `json:"summary,omitempty"` // READ-ONLY; The link (url) to the next page of results. NextLink *string `json:"nextLink,omitempty" azure:"ro"` // READ-ONLY; The list of reservations. Value []*ReservationResponse `json:"value,omitempty" azure:"ro"` }
ListResult - The list of reservations and summary of roll out count of reservations in each state.
func (ListResult) MarshalJSON ¶ added in v0.2.0
func (l ListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ListResult.
func (*ListResult) UnmarshalJSON ¶ added in v1.1.0
func (l *ListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ListResult.
type Location ¶
type Location string
Location - Location in which the Resources needs to be reserved. It cannot be changed after the resource has been created.
const ( LocationAustraliaeast Location = "australiaeast" LocationAustraliasoutheast Location = "australiasoutheast" LocationBrazilsouth Location = "brazilsouth" LocationCanadacentral Location = "canadacentral" LocationCanadaeast Location = "canadaeast" LocationCentralindia Location = "centralindia" LocationCentralus Location = "centralus" LocationEastasia Location = "eastasia" LocationEastus Location = "eastus" LocationEastus2 Location = "eastus2" LocationJapaneast Location = "japaneast" LocationJapanwest Location = "japanwest" LocationNorthcentralus Location = "northcentralus" LocationNortheurope Location = "northeurope" LocationSouthcentralus Location = "southcentralus" LocationSoutheastasia Location = "southeastasia" LocationSouthindia Location = "southindia" LocationUksouth Location = "uksouth" LocationUkwest Location = "ukwest" LocationWestcentralus Location = "westcentralus" LocationWesteurope Location = "westeurope" LocationWestindia Location = "westindia" LocationWestus Location = "westus" LocationWestus2 Location = "westus2" )
func PossibleLocationValues ¶
func PossibleLocationValues() []Location
PossibleLocationValues returns the possible values for the Location const type.
type MergeProperties ¶
type MergeProperties struct { // Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} Sources []*string `json:"sources,omitempty"` }
func (MergeProperties) MarshalJSON ¶
func (m MergeProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MergeProperties.
func (*MergeProperties) UnmarshalJSON ¶ added in v1.1.0
func (m *MergeProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MergeProperties.
type MergeRequest ¶
type MergeRequest struct {
Properties *MergeProperties `json:"properties,omitempty"`
}
func (MergeRequest) MarshalJSON ¶ added in v1.1.0
func (m MergeRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MergeRequest.
func (*MergeRequest) UnmarshalJSON ¶ added in v1.1.0
func (m *MergeRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MergeRequest.
type OperationClient ¶
type OperationClient struct {
// contains filtered or unexported fields
}
OperationClient contains the methods for the Operation group. Don't use this type directly, use NewOperationClient() instead.
func NewOperationClient ¶
func NewOperationClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationClient, error)
NewOperationClient creates a new instance of OperationClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*OperationClient) NewListPager ¶ added in v0.4.0
func (client *OperationClient) NewListPager(options *OperationClientListOptions) *runtime.Pager[OperationClientListResponse]
NewListPager - List all the operations. Generated from API version 2022-03-01 options - OperationClientListOptions contains the optional parameters for the OperationClient.List method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/GetOperations.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewOperationClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := client.NewListPager(nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range nextResult.Value { // TODO: use page item _ = v } } }
Output:
type OperationClientListOptions ¶ added in v0.2.0
type OperationClientListOptions struct { }
OperationClientListOptions contains the optional parameters for the OperationClient.List method.
type OperationClientListResponse ¶ added in v0.2.0
type OperationClientListResponse struct {
OperationList
}
OperationClientListResponse contains the response from method OperationClient.List.
type OperationDisplay ¶
type OperationDisplay struct { Description *string `json:"description,omitempty"` Operation *string `json:"operation,omitempty"` Provider *string `json:"provider,omitempty"` Resource *string `json:"resource,omitempty"` }
func (OperationDisplay) MarshalJSON ¶ added in v1.1.0
func (o OperationDisplay) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationDisplay.
func (*OperationDisplay) UnmarshalJSON ¶ added in v1.1.0
func (o *OperationDisplay) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.
type OperationList ¶
type OperationList struct { // Url to get the next page of items. NextLink *string `json:"nextLink,omitempty"` Value []*OperationResponse `json:"value,omitempty"` }
func (OperationList) MarshalJSON ¶
func (o OperationList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationList.
func (*OperationList) UnmarshalJSON ¶ added in v1.1.0
func (o *OperationList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationList.
type OperationResponse ¶
type OperationResponse struct { // Display of the operation Display *OperationDisplay `json:"display,omitempty"` // Indicates whether the operation is a data action IsDataAction *bool `json:"isDataAction,omitempty"` // Name of the operation Name *string `json:"name,omitempty"` // Origin of the operation Origin *string `json:"origin,omitempty"` // Properties of the operation Properties interface{} `json:"properties,omitempty"` }
func (OperationResponse) MarshalJSON ¶ added in v1.1.0
func (o OperationResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationResponse.
func (*OperationResponse) UnmarshalJSON ¶ added in v1.1.0
func (o *OperationResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationResponse.
type OperationResultError ¶
type OperationResultError struct { // Required if status == failed or status == cancelled. If status == failed, provide an invariant error code used for error // troubleshooting, aggregation, and analysis. Code *string `json:"code,omitempty"` // Required if status == failed. Localized. If status == failed, provide an actionable error message indicating what error // occurred, and what the user can do to address the issue. Message *string `json:"message,omitempty"` }
OperationResultError - Required if status == failed or status == canceled.
func (OperationResultError) MarshalJSON ¶ added in v1.1.0
func (o OperationResultError) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationResultError.
func (*OperationResultError) UnmarshalJSON ¶ added in v1.1.0
func (o *OperationResultError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationResultError.
type OperationStatus ¶
type OperationStatus string
OperationStatus - Status of the individual operation.
const ( OperationStatusCancelled OperationStatus = "Cancelled" OperationStatusFailed OperationStatus = "Failed" OperationStatusPending OperationStatus = "Pending" OperationStatusSucceeded OperationStatus = "Succeeded" )
func PossibleOperationStatusValues ¶
func PossibleOperationStatusValues() []OperationStatus
PossibleOperationStatusValues returns the possible values for the OperationStatus const type.
type Patch ¶
type Patch struct {
Properties *PatchProperties `json:"properties,omitempty"`
}
func (Patch) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Patch.
func (*Patch) UnmarshalJSON ¶ added in v1.1.0
UnmarshalJSON implements the json.Unmarshaller interface for type Patch.
type PatchProperties ¶
type PatchProperties struct { // Type of the Applied Scope. AppliedScopeType *AppliedScopeType `json:"appliedScopeType,omitempty"` // List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. AppliedScopes []*string `json:"appliedScopes,omitempty"` // Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines // reserved resource type. InstanceFlexibility *InstanceFlexibility `json:"instanceFlexibility,omitempty"` // Name of the Reservation Name *string `json:"name,omitempty"` // Setting this to true will automatically purchase a new reservation on the expiration date time. Renew *bool `json:"renew,omitempty"` RenewProperties *PatchPropertiesRenewProperties `json:"renewProperties,omitempty"` }
func (PatchProperties) MarshalJSON ¶
func (p PatchProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PatchProperties.
func (*PatchProperties) UnmarshalJSON ¶ added in v1.1.0
func (p *PatchProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PatchProperties.
type PatchPropertiesRenewProperties ¶
type PatchPropertiesRenewProperties struct {
PurchaseProperties *PurchaseRequest `json:"purchaseProperties,omitempty"`
}
func (PatchPropertiesRenewProperties) MarshalJSON ¶ added in v1.1.0
func (p PatchPropertiesRenewProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PatchPropertiesRenewProperties.
func (*PatchPropertiesRenewProperties) UnmarshalJSON ¶ added in v1.1.0
func (p *PatchPropertiesRenewProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PatchPropertiesRenewProperties.
type PaymentDetail ¶
type PaymentDetail struct { // Shows the Account that is charged for this payment. BillingAccount *string `json:"billingAccount,omitempty"` // Amount charged in Billing currency. Tax not included. Is null for future payments BillingCurrencyTotal *Price `json:"billingCurrencyTotal,omitempty"` // Date when the payment needs to be done. DueDate *time.Time `json:"dueDate,omitempty"` ExtendedStatusInfo *ExtendedStatusInfo `json:"extendedStatusInfo,omitempty"` // Date when the transaction is completed. Is null when it is scheduled. PaymentDate *time.Time `json:"paymentDate,omitempty"` // Amount in pricing currency. Tax not included. PricingCurrencyTotal *Price `json:"pricingCurrencyTotal,omitempty"` // Describes whether the payment is completed, failed, cancelled or scheduled in the future. Status *PaymentStatus `json:"status,omitempty"` }
PaymentDetail - Information about payment related to a reservation order.
func (PaymentDetail) MarshalJSON ¶
func (p PaymentDetail) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PaymentDetail.
func (*PaymentDetail) UnmarshalJSON ¶
func (p *PaymentDetail) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PaymentDetail.
type PaymentStatus ¶
type PaymentStatus string
PaymentStatus - Describes whether the payment is completed, failed, cancelled or scheduled in the future.
const ( PaymentStatusCancelled PaymentStatus = "Cancelled" PaymentStatusFailed PaymentStatus = "Failed" PaymentStatusScheduled PaymentStatus = "Scheduled" PaymentStatusSucceeded PaymentStatus = "Succeeded" )
func PossiblePaymentStatusValues ¶
func PossiblePaymentStatusValues() []PaymentStatus
PossiblePaymentStatusValues returns the possible values for the PaymentStatus const type.
type Price ¶
type Price struct { Amount *float64 `json:"amount,omitempty"` // The ISO 4217 3-letter currency code for the currency used by this purchase record. CurrencyCode *string `json:"currencyCode,omitempty"` }
func (Price) MarshalJSON ¶ added in v1.1.0
MarshalJSON implements the json.Marshaller interface for type Price.
func (*Price) UnmarshalJSON ¶ added in v1.1.0
UnmarshalJSON implements the json.Unmarshaller interface for type Price.
type Properties ¶ added in v0.2.0
type Properties struct { // The applied scope type AppliedScopeType *AppliedScopeType `json:"appliedScopeType,omitempty"` // The list of applied scopes AppliedScopes []*string `json:"appliedScopes,omitempty"` // Indicates if the reservation is archived Archived *bool `json:"archived,omitempty"` // This is the DateTime when the reservation benefit started. BenefitStartTime *time.Time `json:"benefitStartTime,omitempty"` // The billing plan options available for this SKU. BillingPlan *ReservationBillingPlan `json:"billingPlan,omitempty"` // Subscription that will be charged for purchasing Reservation BillingScopeID *string `json:"billingScopeId,omitempty"` // Capabilities of the reservation Capabilities *string `json:"capabilities,omitempty"` // Friendly name for user to easily identify the reservation DisplayName *string `json:"displayName,omitempty"` // DateTime of the Reservation starting when this version is effective from. EffectiveDateTime *time.Time `json:"effectiveDateTime,omitempty"` // This is the date when the Reservation will expire. ExpiryDate *time.Time `json:"expiryDate,omitempty"` // The message giving detailed information about the status code. ExtendedStatusInfo *ExtendedStatusInfo `json:"extendedStatusInfo,omitempty"` // Allows reservation discount to be applied across skus within the same Autofit group. Not all skus support instance size // flexibility. InstanceFlexibility *InstanceFlexibility `json:"instanceFlexibility,omitempty"` MergeProperties *ReservationMergeProperties `json:"mergeProperties,omitempty"` // Current state of the reservation. ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` // This is the date when the Reservation was purchased. PurchaseDate *time.Time `json:"purchaseDate,omitempty"` // Quantity of the SKUs that are part of the Reservation. Quantity *int32 `json:"quantity,omitempty"` // Setting this to true will automatically purchase a new reservation on the expiration date time. Renew *bool `json:"renew,omitempty"` // Reservation Id of the reservation which is purchased because of renew. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. RenewDestination *string `json:"renewDestination,omitempty"` RenewProperties *RenewPropertiesResponse `json:"renewProperties,omitempty"` // Reservation Id of the reservation from which this reservation is renewed. Format of the resource Id is // /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. RenewSource *string `json:"renewSource,omitempty"` // The type of the resource that is being reserved. ReservedResourceType *ReservedResourceType `json:"reservedResourceType,omitempty"` // Description of the SKU in english. SKUDescription *string `json:"skuDescription,omitempty"` SplitProperties *ReservationSplitProperties `json:"splitProperties,omitempty"` // Represent the term of Reservation. Term *ReservationTerm `json:"term,omitempty"` // READ-ONLY; The provisioning state of the reservation for display, e.g. Succeeded DisplayProvisioningState *string `json:"displayProvisioningState,omitempty" azure:"ro"` // READ-ONLY; DateTime of the last time the Reservation was updated. LastUpdatedDateTime *time.Time `json:"lastUpdatedDateTime,omitempty" azure:"ro"` // READ-ONLY; The provisioning state of the reservation, e.g. Succeeded ProvisioningSubState *string `json:"provisioningSubState,omitempty" azure:"ro"` // READ-ONLY; The applied scope type of the reservation for display, e.g. Shared UserFriendlyAppliedScopeType *string `json:"userFriendlyAppliedScopeType,omitempty" azure:"ro"` // READ-ONLY; The renew state of the reservation for display, e.g. On UserFriendlyRenewState *string `json:"userFriendlyRenewState,omitempty" azure:"ro"` // READ-ONLY; Reservation utilization Utilization *PropertiesUtilization `json:"utilization,omitempty" azure:"ro"` }
Properties - The properties of the reservations
func (Properties) MarshalJSON ¶ added in v0.2.0
func (p Properties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type Properties.
func (*Properties) UnmarshalJSON ¶ added in v0.2.0
func (p *Properties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type Properties.
type PropertiesUtilization ¶ added in v0.2.0
type PropertiesUtilization struct { // The array of aggregates of a reservation's utilization Aggregates []*ReservationUtilizationAggregates `json:"aggregates,omitempty"` // READ-ONLY; The number of days trend for a reservation Trend *string `json:"trend,omitempty" azure:"ro"` }
PropertiesUtilization - Reservation utilization
func (PropertiesUtilization) MarshalJSON ¶ added in v0.2.0
func (p PropertiesUtilization) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PropertiesUtilization.
func (*PropertiesUtilization) UnmarshalJSON ¶ added in v1.1.0
func (p *PropertiesUtilization) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PropertiesUtilization.
type ProvisioningState ¶
type ProvisioningState string
ProvisioningState - Represent the current state of the Reservation.
const ( ProvisioningStateBillingFailed ProvisioningState = "BillingFailed" ProvisioningStateCancelled ProvisioningState = "Cancelled" ProvisioningStateConfirmedBilling ProvisioningState = "ConfirmedBilling" ProvisioningStateConfirmedResourceHold ProvisioningState = "ConfirmedResourceHold" ProvisioningStateCreated ProvisioningState = "Created" ProvisioningStateCreating ProvisioningState = "Creating" ProvisioningStateExpired ProvisioningState = "Expired" ProvisioningStateFailed ProvisioningState = "Failed" ProvisioningStateMerged ProvisioningState = "Merged" ProvisioningStatePendingBilling ProvisioningState = "PendingBilling" ProvisioningStatePendingResourceHold ProvisioningState = "PendingResourceHold" ProvisioningStateSplit ProvisioningState = "Split" ProvisioningStateSucceeded ProvisioningState = "Succeeded" )
func PossibleProvisioningStateValues ¶
func PossibleProvisioningStateValues() []ProvisioningState
PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.
type PurchaseRequest ¶
type PurchaseRequest struct { // The Azure Region where the reserved resource lives. Location *string `json:"location,omitempty"` Properties *PurchaseRequestProperties `json:"properties,omitempty"` SKU *SKUName `json:"sku,omitempty"` }
func (PurchaseRequest) MarshalJSON ¶ added in v1.1.0
func (p PurchaseRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PurchaseRequest.
func (*PurchaseRequest) UnmarshalJSON ¶ added in v1.1.0
func (p *PurchaseRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PurchaseRequest.
type PurchaseRequestProperties ¶
type PurchaseRequestProperties struct { // Type of the Applied Scope. AppliedScopeType *AppliedScopeType `json:"appliedScopeType,omitempty"` // List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. AppliedScopes []*string `json:"appliedScopes,omitempty"` // Represent the billing plans. BillingPlan *ReservationBillingPlan `json:"billingPlan,omitempty"` // Subscription that will be charged for purchasing Reservation BillingScopeID *string `json:"billingScopeId,omitempty"` // Friendly name of the Reservation DisplayName *string `json:"displayName,omitempty"` // Quantity of the SKUs that are part of the Reservation. Quantity *int32 `json:"quantity,omitempty"` // Setting this to true will automatically purchase a new reservation on the expiration date time. Renew *bool `json:"renew,omitempty"` // Properties specific to each reserved resource type. Not required if not applicable. ReservedResourceProperties *PurchaseRequestPropertiesReservedResourceProperties `json:"reservedResourceProperties,omitempty"` // The type of the resource that is being reserved. ReservedResourceType *ReservedResourceType `json:"reservedResourceType,omitempty"` // Represent the term of Reservation. Term *ReservationTerm `json:"term,omitempty"` }
func (PurchaseRequestProperties) MarshalJSON ¶
func (p PurchaseRequestProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PurchaseRequestProperties.
func (*PurchaseRequestProperties) UnmarshalJSON ¶ added in v1.1.0
func (p *PurchaseRequestProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PurchaseRequestProperties.
type PurchaseRequestPropertiesReservedResourceProperties ¶
type PurchaseRequestPropertiesReservedResourceProperties struct { // Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines // reserved resource type. InstanceFlexibility *InstanceFlexibility `json:"instanceFlexibility,omitempty"` }
PurchaseRequestPropertiesReservedResourceProperties - Properties specific to each reserved resource type. Not required if not applicable.
func (PurchaseRequestPropertiesReservedResourceProperties) MarshalJSON ¶ added in v1.1.0
func (p PurchaseRequestPropertiesReservedResourceProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PurchaseRequestPropertiesReservedResourceProperties.
func (*PurchaseRequestPropertiesReservedResourceProperties) UnmarshalJSON ¶ added in v1.1.0
func (p *PurchaseRequestPropertiesReservedResourceProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PurchaseRequestPropertiesReservedResourceProperties.
type QuotaClient ¶
type QuotaClient struct {
// contains filtered or unexported fields
}
QuotaClient contains the methods for the Quota group. Don't use this type directly, use NewQuotaClient() instead.
func NewQuotaClient ¶
func NewQuotaClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*QuotaClient, error)
NewQuotaClient creates a new instance of QuotaClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*QuotaClient) BeginCreateOrUpdate ¶
func (client *QuotaClient) BeginCreateOrUpdate(ctx context.Context, subscriptionID string, providerID string, location string, resourceName string, createQuotaRequest CurrentQuotaLimitBase, options *QuotaClientBeginCreateOrUpdateOptions) (*runtime.Poller[QuotaClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - Create or update the quota (service limits) of a resource to the requested value. Steps: 1. Make the Get request to get the quota information for specific resource. 2. To increase the quota, update the limit field in the response from Get request to new value. 3. Submit the JSON to the quota request API to update the quota. The Create quota request may be constructed as follows. The PUT operation can be used to update the quota. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2020-10-25 subscriptionID - Azure subscription ID. providerID - Azure resource provider ID. location - Azure region. resourceName - The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or TotalLowPriorityCores for Microsoft.MachineLearningServices createQuotaRequest - Quota requests payload. options - QuotaClientBeginCreateOrUpdateOptions contains the optional parameters for the QuotaClient.BeginCreateOrUpdate method.
Example (QuotasRequestPutForCompute) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/putComputeOneSkuQuotaRequest.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewQuotaClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := client.BeginCreateOrUpdate(ctx, "D7EC67B3-7657-4966-BFFC-41EFD36BAAB3", "Microsoft.Compute", "eastus", "standardFSv2Family", armreservations.CurrentQuotaLimitBase{ Properties: &armreservations.QuotaProperties{ Name: &armreservations.ResourceName{ Value: to.Ptr("standardFSv2Family"), }, Limit: to.Ptr[int32](200), Unit: to.Ptr("Count"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // TODO: use response item _ = res }
Output:
Example (QuotasRequestPutForMachineLearningServicesDedicatedResource) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/putMachineLearningServicesQuotaRequestDedicated.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewQuotaClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := client.BeginCreateOrUpdate(ctx, "D7EC67B3-7657-4966-BFFC-41EFD36BAAB3", "Microsoft.MachineLearningServices", "eastus", "StandardDv2Family", armreservations.CurrentQuotaLimitBase{ Properties: &armreservations.QuotaProperties{ Name: &armreservations.ResourceName{ Value: to.Ptr("StandardDv2Family"), }, Limit: to.Ptr[int32](200), ResourceType: to.Ptr(armreservations.ResourceTypeDedicated), Unit: to.Ptr("Count"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // TODO: use response item _ = res }
Output:
Example (QuotasRequestPutForMachineLearningServicesLowPriorityResource) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/putMachineLearningServicesQuotaRequestLowPriority.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewQuotaClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := client.BeginCreateOrUpdate(ctx, "D7EC67B3-7657-4966-BFFC-41EFD36BAAB3", "Microsoft.MachineLearningServices", "eastus", "TotalLowPriorityCores", armreservations.CurrentQuotaLimitBase{ Properties: &armreservations.QuotaProperties{ Name: &armreservations.ResourceName{ Value: to.Ptr("TotalLowPriorityCores"), }, Limit: to.Ptr[int32](200), ResourceType: to.Ptr(armreservations.ResourceTypeLowPriority), Unit: to.Ptr("Count"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // TODO: use response item _ = res }
Output:
func (*QuotaClient) BeginUpdate ¶
func (client *QuotaClient) BeginUpdate(ctx context.Context, subscriptionID string, providerID string, location string, resourceName string, createQuotaRequest CurrentQuotaLimitBase, options *QuotaClientBeginUpdateOptions) (*runtime.Poller[QuotaClientUpdateResponse], error)
BeginUpdate - Update the quota (service limits) of this resource to the requested value. • To get the quota information for specific resource, send a GET request. • To increase the quota, update the limit field from the GET response to a new value. • To update the quota value, submit the JSON response to the quota request API to update the quota. • To update the quota. use the PATCH operation. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2020-10-25 subscriptionID - Azure subscription ID. providerID - Azure resource provider ID. location - Azure region. resourceName - The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or TotalLowPriorityCores for Microsoft.MachineLearningServices createQuotaRequest - Payload for the quota request. options - QuotaClientBeginUpdateOptions contains the optional parameters for the QuotaClient.BeginUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/patchComputeQuotaRequest.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewQuotaClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := client.BeginUpdate(ctx, "D7EC67B3-7657-4966-BFFC-41EFD36BAAB3", "Microsoft.Compute", "eastus", "standardFSv2Family", armreservations.CurrentQuotaLimitBase{ Properties: &armreservations.QuotaProperties{ Name: &armreservations.ResourceName{ Value: to.Ptr("standardFSv2Family"), }, Limit: to.Ptr[int32](200), Unit: to.Ptr("Count"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // TODO: use response item _ = res }
Output:
func (*QuotaClient) Get ¶
func (client *QuotaClient) Get(ctx context.Context, subscriptionID string, providerID string, location string, resourceName string, options *QuotaClientGetOptions) (QuotaClientGetResponse, error)
Get - Get the current quota (service limit) and usage of a resource. You can use the response from the GET operation to submit quota update request. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2020-10-25 subscriptionID - Azure subscription ID. providerID - Azure resource provider ID. location - Azure region. resourceName - The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or TotalLowPriorityCores for Microsoft.MachineLearningServices options - QuotaClientGetOptions contains the optional parameters for the QuotaClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/getComputeOneSkuUsages.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewQuotaClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Get(ctx, "00000000-0000-0000-0000-000000000000", "Microsoft.Compute", "eastus", "standardNDSFamily", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // TODO: use response item _ = res }
Output:
func (*QuotaClient) NewListPager ¶ added in v0.4.0
func (client *QuotaClient) NewListPager(subscriptionID string, providerID string, location string, options *QuotaClientListOptions) *runtime.Pager[QuotaClientListResponse]
NewListPager - Gets a list of current quotas (service limits) and usage for all resources. The response from the list quota operation can be leveraged to request quota updates. Generated from API version 2020-10-25 subscriptionID - Azure subscription ID. providerID - Azure resource provider ID. location - Azure region. options - QuotaClientListOptions contains the optional parameters for the QuotaClient.List method.
Example (QuotasListUsagesForCompute) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/getComputeUsages.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewQuotaClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := client.NewListPager("00000000-0000-0000-0000-000000000000", "Microsoft.Compute", "eastus", nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range nextResult.Value { // TODO: use page item _ = v } } }
Output:
Example (QuotasListUsagesMachineLearningServices) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/getMachineLearningServicesUsages.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewQuotaClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := client.NewListPager("00000000-0000-0000-0000-000000000000", "Microsoft.MachineLearningServices", "eastus", nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range nextResult.Value { // TODO: use page item _ = v } } }
Output:
type QuotaClientBeginCreateOrUpdateOptions ¶ added in v0.2.0
type QuotaClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
QuotaClientBeginCreateOrUpdateOptions contains the optional parameters for the QuotaClient.BeginCreateOrUpdate method.
type QuotaClientBeginUpdateOptions ¶ added in v0.2.0
type QuotaClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
QuotaClientBeginUpdateOptions contains the optional parameters for the QuotaClient.BeginUpdate method.
type QuotaClientCreateOrUpdateResponse ¶ added in v0.2.0
type QuotaClientCreateOrUpdateResponse struct {
CurrentQuotaLimitBase
}
QuotaClientCreateOrUpdateResponse contains the response from method QuotaClient.CreateOrUpdate.
type QuotaClientGetOptions ¶ added in v0.2.0
type QuotaClientGetOptions struct { }
QuotaClientGetOptions contains the optional parameters for the QuotaClient.Get method.
type QuotaClientGetResponse ¶ added in v0.2.0
type QuotaClientGetResponse struct { CurrentQuotaLimitBase // ETag contains the information returned from the ETag header response. ETag *string }
QuotaClientGetResponse contains the response from method QuotaClient.Get.
type QuotaClientListOptions ¶ added in v0.2.0
type QuotaClientListOptions struct { }
QuotaClientListOptions contains the optional parameters for the QuotaClient.List method.
type QuotaClientListResponse ¶ added in v0.2.0
type QuotaClientListResponse struct { QuotaLimits // ETag contains the information returned from the ETag header response. ETag *string }
QuotaClientListResponse contains the response from method QuotaClient.List.
type QuotaClientUpdateResponse ¶ added in v0.2.0
type QuotaClientUpdateResponse struct {
CurrentQuotaLimitBase
}
QuotaClientUpdateResponse contains the response from method QuotaClient.Update.
type QuotaLimits ¶
type QuotaLimits struct { // The URI for fetching the next page of quotas (service limits). When no more pages exist, the value is null. NextLink *string `json:"nextLink,omitempty"` // List of quotas (service limits). Value []*CurrentQuotaLimitBase `json:"value,omitempty"` }
QuotaLimits - Quota limits.
func (QuotaLimits) MarshalJSON ¶
func (q QuotaLimits) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type QuotaLimits.
func (*QuotaLimits) UnmarshalJSON ¶ added in v1.1.0
func (q *QuotaLimits) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type QuotaLimits.
type QuotaLimitsResponse ¶
type QuotaLimitsResponse struct { // The URI for fetching the next page of quota limits. When no more pages exist, the value is null. NextLink *string `json:"nextLink,omitempty"` // List of quotas with the quota request status. Value []*CurrentQuotaLimit `json:"value,omitempty"` }
QuotaLimitsResponse - Quotas (service limits) in the request response.
func (QuotaLimitsResponse) MarshalJSON ¶
func (q QuotaLimitsResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type QuotaLimitsResponse.
func (*QuotaLimitsResponse) UnmarshalJSON ¶ added in v1.1.0
func (q *QuotaLimitsResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type QuotaLimitsResponse.
type QuotaProperties ¶
type QuotaProperties struct { // Quota properties. Limit *int32 `json:"limit,omitempty"` // Name of the resource provide by the resource provider. Use this property for quotaRequests resource operations. Name *ResourceName `json:"name,omitempty"` // Additional properties for the specified resource provider. Properties interface{} `json:"properties,omitempty"` // The name of the resource type. ResourceType *ResourceType `json:"resourceType,omitempty"` // The limit units, such as count and bytes. Use the unit field provided in the response of the GET quota operation. Unit *string `json:"unit,omitempty"` // READ-ONLY; Current usage value for the resource. CurrentValue *int32 `json:"currentValue,omitempty" azure:"ro"` // READ-ONLY; The time period over which the quota usage values are summarized. For example, P1D (per one day), PT1M (per // one minute), and PT1S (per one second). This parameter is optional because, for some // resources such as compute, the time period is irrelevant. QuotaPeriod *string `json:"quotaPeriod,omitempty" azure:"ro"` }
QuotaProperties - Quota properties for the resource.
func (QuotaProperties) MarshalJSON ¶ added in v1.1.0
func (q QuotaProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type QuotaProperties.
func (*QuotaProperties) UnmarshalJSON ¶ added in v1.1.0
func (q *QuotaProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type QuotaProperties.
type QuotaRequestDetails ¶
type QuotaRequestDetails struct { // Quota request details. Properties *QuotaRequestProperties `json:"properties,omitempty"` // READ-ONLY; Quota request ID. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; Quota request name. Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; Resource type Type *string `json:"type,omitempty" azure:"ro"` }
QuotaRequestDetails - Quota request details.
func (QuotaRequestDetails) MarshalJSON ¶ added in v1.1.0
func (q QuotaRequestDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type QuotaRequestDetails.
func (*QuotaRequestDetails) UnmarshalJSON ¶ added in v1.1.0
func (q *QuotaRequestDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type QuotaRequestDetails.
type QuotaRequestDetailsList ¶
type QuotaRequestDetailsList struct { // The URI to fetch the next page of quota limits. When there are no more pages, this is null. NextLink *string `json:"nextLink,omitempty"` // The quota requests. Value []*QuotaRequestDetails `json:"value,omitempty"` }
QuotaRequestDetailsList - Quota request details.
func (QuotaRequestDetailsList) MarshalJSON ¶
func (q QuotaRequestDetailsList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type QuotaRequestDetailsList.
func (*QuotaRequestDetailsList) UnmarshalJSON ¶ added in v1.1.0
func (q *QuotaRequestDetailsList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type QuotaRequestDetailsList.
type QuotaRequestOneResourceProperties ¶
type QuotaRequestOneResourceProperties struct { // The quota request addition properties. Properties *CurrentQuotaLimitBase `json:"properties,omitempty"` // READ-ONLY; User friendly status message. Message *string `json:"message,omitempty" azure:"ro"` // READ-ONLY; The quota request status. ProvisioningState *QuotaRequestState `json:"provisioningState,omitempty" azure:"ro"` // READ-ONLY; The time when the quota request was submitted using format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 // standard. RequestSubmitTime *time.Time `json:"requestSubmitTime,omitempty" azure:"ro"` }
QuotaRequestOneResourceProperties - The details of quota request.
func (QuotaRequestOneResourceProperties) MarshalJSON ¶
func (q QuotaRequestOneResourceProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type QuotaRequestOneResourceProperties.
func (*QuotaRequestOneResourceProperties) UnmarshalJSON ¶
func (q *QuotaRequestOneResourceProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type QuotaRequestOneResourceProperties.
type QuotaRequestOneResourceSubmitResponse ¶
type QuotaRequestOneResourceSubmitResponse struct { // The details for quota request. Properties *QuotaRequestOneResourceProperties `json:"properties,omitempty"` // READ-ONLY; The quota request ID. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The name of the quota request. Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; Type of resource. "Microsoft.Capacity/ServiceLimits" Type *string `json:"type,omitempty" azure:"ro"` }
QuotaRequestOneResourceSubmitResponse - Response for the quota submission request.
func (QuotaRequestOneResourceSubmitResponse) MarshalJSON ¶ added in v1.1.0
func (q QuotaRequestOneResourceSubmitResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type QuotaRequestOneResourceSubmitResponse.
func (*QuotaRequestOneResourceSubmitResponse) UnmarshalJSON ¶ added in v1.1.0
func (q *QuotaRequestOneResourceSubmitResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type QuotaRequestOneResourceSubmitResponse.
type QuotaRequestProperties ¶
type QuotaRequestProperties struct { // The quota request status. ProvisioningState *QuotaRequestState `json:"provisioningState,omitempty"` // The quotaRequests. Value []*SubRequest `json:"value,omitempty"` // READ-ONLY; User friendly status message. Message *string `json:"message,omitempty" azure:"ro"` // READ-ONLY; The time when the quota request was submitted using format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 // standard. RequestSubmitTime *time.Time `json:"requestSubmitTime,omitempty" azure:"ro"` }
QuotaRequestProperties - The details of quota request.
func (QuotaRequestProperties) MarshalJSON ¶
func (q QuotaRequestProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type QuotaRequestProperties.
func (*QuotaRequestProperties) UnmarshalJSON ¶
func (q *QuotaRequestProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type QuotaRequestProperties.
type QuotaRequestState ¶
type QuotaRequestState string
QuotaRequestState - The quota request status.
const ( QuotaRequestStateAccepted QuotaRequestState = "Accepted" QuotaRequestStateFailed QuotaRequestState = "Failed" QuotaRequestStateInProgress QuotaRequestState = "InProgress" QuotaRequestStateInvalid QuotaRequestState = "Invalid" QuotaRequestStateSucceeded QuotaRequestState = "Succeeded" )
func PossibleQuotaRequestStateValues ¶
func PossibleQuotaRequestStateValues() []QuotaRequestState
PossibleQuotaRequestStateValues returns the possible values for the QuotaRequestState const type.
type QuotaRequestStatusClient ¶
type QuotaRequestStatusClient struct {
// contains filtered or unexported fields
}
QuotaRequestStatusClient contains the methods for the QuotaRequestStatus group. Don't use this type directly, use NewQuotaRequestStatusClient() instead.
func NewQuotaRequestStatusClient ¶
func NewQuotaRequestStatusClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*QuotaRequestStatusClient, error)
NewQuotaRequestStatusClient creates a new instance of QuotaRequestStatusClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*QuotaRequestStatusClient) Get ¶
func (client *QuotaRequestStatusClient) Get(ctx context.Context, subscriptionID string, providerID string, location string, id string, options *QuotaRequestStatusClientGetOptions) (QuotaRequestStatusClientGetResponse, error)
Get - For the specified Azure region (location), get the details and status of the quota request by the quota request ID for the resources of the resource provider. The PUT request for the quota (service limit) returns a response with the requestId parameter. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2020-10-25 subscriptionID - Azure subscription ID. providerID - Azure resource provider ID. location - Azure region. id - Quota Request ID. options - QuotaRequestStatusClientGetOptions contains the optional parameters for the QuotaRequestStatusClient.Get method.
Example (QuotaRequestFailed) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/getQuotaRequestStatusFailed.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewQuotaRequestStatusClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Get(ctx, "00000000-0000-0000-0000-000000000000", "Microsoft.Compute", "eastus", "2B5C8515-37D8-4B6A-879B-CD641A2CF605", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // TODO: use response item _ = res }
Output:
Example (QuotaRequestInProgress) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/getQuotaRequestStatusInProgress.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewQuotaRequestStatusClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Get(ctx, "00000000-0000-0000-0000-000000000000", "Microsoft.Compute", "eastus", "2B5C8515-37D8-4B6A-879B-CD641A2CF605", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // TODO: use response item _ = res }
Output:
Example (QuotaRequestStatus) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/getQuotaRequestStatusById.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewQuotaRequestStatusClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Get(ctx, "00000000-0000-0000-0000-000000000000", "Microsoft.Compute", "eastus", "2B5C8515-37D8-4B6A-879B-CD641A2CF605", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // TODO: use response item _ = res }
Output:
func (*QuotaRequestStatusClient) NewListPager ¶ added in v0.4.0
func (client *QuotaRequestStatusClient) NewListPager(subscriptionID string, providerID string, location string, options *QuotaRequestStatusClientListOptions) *runtime.Pager[QuotaRequestStatusClientListResponse]
NewListPager - For the specified Azure region (location), subscription, and resource provider, get the history of the quota requests for the past year. To select specific quota requests, use the oData filter. Generated from API version 2020-10-25 subscriptionID - Azure subscription ID. providerID - Azure resource provider ID. location - Azure region. options - QuotaRequestStatusClientListOptions contains the optional parameters for the QuotaRequestStatusClient.List method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/getQuotaRequestsHistory.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewQuotaRequestStatusClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := client.NewListPager("3f75fdf7-977e-44ad-990d-99f14f0f299f", "Microsoft.Compute", "eastus", &armreservations.QuotaRequestStatusClientListOptions{Filter: nil, Top: nil, Skiptoken: nil, }) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range nextResult.Value { // TODO: use page item _ = v } } }
Output:
type QuotaRequestStatusClientGetOptions ¶ added in v0.2.0
type QuotaRequestStatusClientGetOptions struct { }
QuotaRequestStatusClientGetOptions contains the optional parameters for the QuotaRequestStatusClient.Get method.
type QuotaRequestStatusClientGetResponse ¶ added in v0.2.0
type QuotaRequestStatusClientGetResponse struct {
QuotaRequestDetails
}
QuotaRequestStatusClientGetResponse contains the response from method QuotaRequestStatusClient.Get.
type QuotaRequestStatusClientListOptions ¶ added in v0.2.0
type QuotaRequestStatusClientListOptions struct { // FIELD SUPPORTED OPERATORS // requestSubmitTime ge, le, eq, gt, lt Filter *string // Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, // the value of the nextLink element includes a skiptoken parameter that // specifies a starting point to use for subsequent calls. Skiptoken *string // Number of records to return. Top *int32 }
QuotaRequestStatusClientListOptions contains the optional parameters for the QuotaRequestStatusClient.List method.
type QuotaRequestStatusClientListResponse ¶ added in v0.2.0
type QuotaRequestStatusClientListResponse struct {
QuotaRequestDetailsList
}
QuotaRequestStatusClientListResponse contains the response from method QuotaRequestStatusClient.List.
type QuotaRequestStatusDetails ¶
type QuotaRequestStatusDetails struct { // READ-ONLY; A user friendly message. Message *string `json:"message,omitempty" azure:"ro"` // READ-ONLY; The details of the quota request status. ProvisioningState *QuotaRequestState `json:"provisioningState,omitempty" azure:"ro"` }
QuotaRequestStatusDetails - Quota request status details.
func (QuotaRequestStatusDetails) MarshalJSON ¶ added in v1.1.0
func (q QuotaRequestStatusDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type QuotaRequestStatusDetails.
func (*QuotaRequestStatusDetails) UnmarshalJSON ¶ added in v1.1.0
func (q *QuotaRequestStatusDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type QuotaRequestStatusDetails.
type QuotaRequestSubmitResponse ¶
type QuotaRequestSubmitResponse struct { // The quota request details. Properties *QuotaRequestProperties `json:"properties,omitempty"` // READ-ONLY; The quota request ID. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The name of the quota request. Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; Type of resource. "Microsoft.Capacity/serviceLimits" Type *string `json:"type,omitempty" azure:"ro"` }
QuotaRequestSubmitResponse - Response for the quota submission request.
func (QuotaRequestSubmitResponse) MarshalJSON ¶ added in v1.1.0
func (q QuotaRequestSubmitResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type QuotaRequestSubmitResponse.
func (*QuotaRequestSubmitResponse) UnmarshalJSON ¶ added in v1.1.0
func (q *QuotaRequestSubmitResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type QuotaRequestSubmitResponse.
type QuotaRequestSubmitResponse201 ¶
type QuotaRequestSubmitResponse201 struct { // Quota request status. Properties *QuotaRequestStatusDetails `json:"properties,omitempty"` // READ-ONLY; The quota request ID. Use the requestId parameter to check the request status. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; Operation ID Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; Resource type Type *string `json:"type,omitempty" azure:"ro"` }
QuotaRequestSubmitResponse201 - Response with request ID that the quota request was accepted.
func (QuotaRequestSubmitResponse201) MarshalJSON ¶ added in v1.1.0
func (q QuotaRequestSubmitResponse201) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type QuotaRequestSubmitResponse201.
func (*QuotaRequestSubmitResponse201) UnmarshalJSON ¶ added in v1.1.0
func (q *QuotaRequestSubmitResponse201) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type QuotaRequestSubmitResponse201.
type RefundBillingInformation ¶ added in v1.1.0
type RefundBillingInformation struct { BillingCurrencyProratedAmount *Price `json:"billingCurrencyProratedAmount,omitempty"` BillingCurrencyRemainingCommitmentAmount *Price `json:"billingCurrencyRemainingCommitmentAmount,omitempty"` BillingCurrencyTotalPaidAmount *Price `json:"billingCurrencyTotalPaidAmount,omitempty"` // Represent the billing plans. BillingPlan *ReservationBillingPlan `json:"billingPlan,omitempty"` // The number of completed transactions in this reservation's payment CompletedTransactions *int32 `json:"completedTransactions,omitempty"` // The number of total transactions in this reservation's payment TotalTransactions *int32 `json:"totalTransactions,omitempty"` }
RefundBillingInformation - billing information
func (RefundBillingInformation) MarshalJSON ¶ added in v1.1.0
func (r RefundBillingInformation) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RefundBillingInformation.
func (*RefundBillingInformation) UnmarshalJSON ¶ added in v1.1.0
func (r *RefundBillingInformation) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RefundBillingInformation.
type RefundPolicyError ¶ added in v1.1.0
type RefundPolicyError struct { Code *ErrorResponseCode `json:"code,omitempty"` Message *string `json:"message,omitempty"` }
RefundPolicyError - error details
func (RefundPolicyError) MarshalJSON ¶ added in v1.1.0
func (r RefundPolicyError) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RefundPolicyError.
func (*RefundPolicyError) UnmarshalJSON ¶ added in v1.1.0
func (r *RefundPolicyError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RefundPolicyError.
type RefundPolicyResult ¶ added in v1.1.0
type RefundPolicyResult struct { // Refund policy result property Properties *RefundPolicyResultProperty `json:"properties,omitempty"` }
RefundPolicyResult - Refund policy result
func (RefundPolicyResult) MarshalJSON ¶ added in v1.1.0
func (r RefundPolicyResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RefundPolicyResult.
func (*RefundPolicyResult) UnmarshalJSON ¶ added in v1.1.0
func (r *RefundPolicyResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RefundPolicyResult.
type RefundPolicyResultProperty ¶ added in v1.1.0
type RefundPolicyResultProperty struct { ConsumedRefundsTotal *Price `json:"consumedRefundsTotal,omitempty"` MaxRefundLimit *Price `json:"maxRefundLimit,omitempty"` // Refund Policy errors PolicyErrors []*RefundPolicyError `json:"policyErrors,omitempty"` }
RefundPolicyResultProperty - Refund policy result property
func (RefundPolicyResultProperty) MarshalJSON ¶ added in v1.1.0
func (r RefundPolicyResultProperty) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RefundPolicyResultProperty.
func (*RefundPolicyResultProperty) UnmarshalJSON ¶ added in v1.1.0
func (r *RefundPolicyResultProperty) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RefundPolicyResultProperty.
type RefundRequest ¶ added in v1.1.0
type RefundRequest struct {
Properties *RefundRequestProperties `json:"properties,omitempty"`
}
func (RefundRequest) MarshalJSON ¶ added in v1.1.0
func (r RefundRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RefundRequest.
func (*RefundRequest) UnmarshalJSON ¶ added in v1.1.0
func (r *RefundRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RefundRequest.
type RefundRequestProperties ¶ added in v1.1.0
type RefundRequestProperties struct { // Reservation to return ReservationToReturn *ReservationToReturn `json:"reservationToReturn,omitempty"` // The reason of returning the reservation ReturnReason *string `json:"returnReason,omitempty"` // The scope of the refund, e.g. Reservation Scope *string `json:"scope,omitempty"` // SessionId that was returned by CalculateRefund API. SessionID *string `json:"sessionId,omitempty"` }
func (RefundRequestProperties) MarshalJSON ¶ added in v1.1.0
func (r RefundRequestProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RefundRequestProperties.
func (*RefundRequestProperties) UnmarshalJSON ¶ added in v1.1.0
func (r *RefundRequestProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RefundRequestProperties.
type RefundResponse ¶ added in v1.1.0
type RefundResponse struct { // Fully qualified identifier of the reservation being returned ID *string `json:"id,omitempty"` Properties *RefundResponseProperties `json:"properties,omitempty"` }
func (RefundResponse) MarshalJSON ¶ added in v1.1.0
func (r RefundResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RefundResponse.
func (*RefundResponse) UnmarshalJSON ¶ added in v1.1.0
func (r *RefundResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RefundResponse.
type RefundResponseProperties ¶ added in v1.1.0
type RefundResponseProperties struct { // billing information BillingInformation *RefundBillingInformation `json:"billingInformation,omitempty"` BillingRefundAmount *Price `json:"billingRefundAmount,omitempty"` // Refund policy result PolicyResult *RefundPolicyResult `json:"policyResult,omitempty"` PricingRefundAmount *Price `json:"pricingRefundAmount,omitempty"` // Quantity to be returned Quantity *int32 `json:"quantity,omitempty"` // Refund session identifier SessionID *string `json:"sessionId,omitempty"` }
func (RefundResponseProperties) MarshalJSON ¶ added in v1.1.0
func (r RefundResponseProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RefundResponseProperties.
func (*RefundResponseProperties) UnmarshalJSON ¶ added in v1.1.0
func (r *RefundResponseProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RefundResponseProperties.
type RenewPropertiesResponse ¶
type RenewPropertiesResponse struct { // Currency and amount that customer will be charged in customer's local currency for renewal purchase. Tax is not included. BillingCurrencyTotal *RenewPropertiesResponseBillingCurrencyTotal `json:"billingCurrencyTotal,omitempty"` // 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. PricingCurrencyTotal *RenewPropertiesResponsePricingCurrencyTotal `json:"pricingCurrencyTotal,omitempty"` PurchaseProperties *PurchaseRequest `json:"purchaseProperties,omitempty"` }
func (RenewPropertiesResponse) MarshalJSON ¶ added in v1.1.0
func (r RenewPropertiesResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RenewPropertiesResponse.
func (*RenewPropertiesResponse) UnmarshalJSON ¶ added in v1.1.0
func (r *RenewPropertiesResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RenewPropertiesResponse.
type RenewPropertiesResponseBillingCurrencyTotal ¶
type RenewPropertiesResponseBillingCurrencyTotal struct { Amount *float32 `json:"amount,omitempty"` // The ISO 4217 3-letter currency code for the currency used by this purchase record. CurrencyCode *string `json:"currencyCode,omitempty"` }
RenewPropertiesResponseBillingCurrencyTotal - Currency and amount that customer will be charged in customer's local currency for renewal purchase. Tax is not included.
func (RenewPropertiesResponseBillingCurrencyTotal) MarshalJSON ¶ added in v1.1.0
func (r RenewPropertiesResponseBillingCurrencyTotal) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RenewPropertiesResponseBillingCurrencyTotal.
func (*RenewPropertiesResponseBillingCurrencyTotal) UnmarshalJSON ¶ added in v1.1.0
func (r *RenewPropertiesResponseBillingCurrencyTotal) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RenewPropertiesResponseBillingCurrencyTotal.
type RenewPropertiesResponsePricingCurrencyTotal ¶
type RenewPropertiesResponsePricingCurrencyTotal struct { Amount *float32 `json:"amount,omitempty"` // The ISO 4217 3-letter currency code for the currency used by this purchase record. CurrencyCode *string `json:"currencyCode,omitempty"` }
RenewPropertiesResponsePricingCurrencyTotal - 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.
func (RenewPropertiesResponsePricingCurrencyTotal) MarshalJSON ¶ added in v1.1.0
func (r RenewPropertiesResponsePricingCurrencyTotal) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RenewPropertiesResponsePricingCurrencyTotal.
func (*RenewPropertiesResponsePricingCurrencyTotal) UnmarshalJSON ¶ added in v1.1.0
func (r *RenewPropertiesResponsePricingCurrencyTotal) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RenewPropertiesResponsePricingCurrencyTotal.
type ReservationBillingPlan ¶
type ReservationBillingPlan string
ReservationBillingPlan - Represent the billing plans.
const ( ReservationBillingPlanMonthly ReservationBillingPlan = "Monthly" ReservationBillingPlanUpfront ReservationBillingPlan = "Upfront" )
func PossibleReservationBillingPlanValues ¶
func PossibleReservationBillingPlanValues() []ReservationBillingPlan
PossibleReservationBillingPlanValues returns the possible values for the ReservationBillingPlan const type.
type ReservationClient ¶
type ReservationClient struct {
// contains filtered or unexported fields
}
ReservationClient contains the methods for the Reservation group. Don't use this type directly, use NewReservationClient() instead.
func NewReservationClient ¶
func NewReservationClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ReservationClient, error)
NewReservationClient creates a new instance of ReservationClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*ReservationClient) Archive ¶ added in v1.1.0
func (client *ReservationClient) Archive(ctx context.Context, reservationOrderID string, reservationID string, options *ReservationClientArchiveOptions) (ReservationClientArchiveResponse, error)
Archive - Archiving a Reservation moves it to Archived state. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-03-01 reservationOrderID - Order Id of the reservation reservationID - Id of the Reservation Item options - ReservationClientArchiveOptions contains the optional parameters for the ReservationClient.Archive method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/Archive.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewReservationClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = client.Archive(ctx, "276e7ae4-84d0-4da6-ab4b-d6b94f3557da", "356e7ae4-84d0-4da6-ab4b-d6b94f3557da", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*ReservationClient) BeginAvailableScopes ¶
func (client *ReservationClient) BeginAvailableScopes(ctx context.Context, reservationOrderID string, reservationID string, body AvailableScopeRequest, options *ReservationClientBeginAvailableScopesOptions) (*runtime.Poller[ReservationClientAvailableScopesResponse], error)
BeginAvailableScopes - Get Available Scopes for Reservation. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-03-01 reservationOrderID - Order Id of the reservation reservationID - Id of the Reservation Item options - ReservationClientBeginAvailableScopesOptions contains the optional parameters for the ReservationClient.BeginAvailableScopes method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/GetAvailableScope.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewReservationClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := client.BeginAvailableScopes(ctx, "276e7ae4-84d0-4da6-ab4b-d6b94f3557da", "356e7ae4-84d0-4da6-ab4b-d6b94f3557da", armreservations.AvailableScopeRequest{ Properties: &armreservations.AvailableScopeRequestProperties{ Scopes: []*string{ to.Ptr("/subscriptions/efc7c997-7700-4a74-b731-55aec16c15e9")}, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // TODO: use response item _ = res }
Output:
func (*ReservationClient) BeginMerge ¶
func (client *ReservationClient) BeginMerge(ctx context.Context, reservationOrderID string, body MergeRequest, options *ReservationClientBeginMergeOptions) (*runtime.Poller[ReservationClientMergeResponse], error)
BeginMerge - Merge the specified Reservations into a new Reservation. The two Reservations being merged must have same properties. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-03-01 reservationOrderID - Order Id of the reservation body - Information needed for commercial request for a reservation options - ReservationClientBeginMergeOptions contains the optional parameters for the ReservationClient.BeginMerge method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/MergeReservations.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewReservationClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := client.BeginMerge(ctx, "276e7ae4-84d0-4da6-ab4b-d6b94f3557da", armreservations.MergeRequest{ Properties: &armreservations.MergeProperties{ Sources: []*string{ to.Ptr("/providers/Microsoft.Capacity/reservationOrders/c0565a8a-4491-4e77-b07b-5e6d66718e1c/reservations/cea04232-932e-47db-acb5-e29a945ecc73"), to.Ptr("/providers/Microsoft.Capacity/reservationOrders/c0565a8a-4491-4e77-b07b-5e6d66718e1c/reservations/5bf54dc7-dacd-4f46-a16b-7b78f4a59799")}, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // TODO: use response item _ = res }
Output:
func (*ReservationClient) BeginSplit ¶
func (client *ReservationClient) BeginSplit(ctx context.Context, reservationOrderID string, body SplitRequest, options *ReservationClientBeginSplitOptions) (*runtime.Poller[ReservationClientSplitResponse], error)
BeginSplit - Split a Reservation into two Reservations with specified quantity distribution. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-03-01 reservationOrderID - Order Id of the reservation body - Information needed to Split a reservation item options - ReservationClientBeginSplitOptions contains the optional parameters for the ReservationClient.BeginSplit method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/SplitReservation.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewReservationClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := client.BeginSplit(ctx, "276e7ae4-84d0-4da6-ab4b-d6b94f3557da", armreservations.SplitRequest{ Properties: &armreservations.SplitProperties{ Quantities: []*int32{ to.Ptr[int32](1), to.Ptr[int32](2)}, ReservationID: to.Ptr("/providers/Microsoft.Capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/bcae77cd-3119-4766-919f-b50d36c75c7a"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // TODO: use response item _ = res }
Output:
func (*ReservationClient) BeginUpdate ¶
func (client *ReservationClient) BeginUpdate(ctx context.Context, reservationOrderID string, reservationID string, parameters Patch, options *ReservationClientBeginUpdateOptions) (*runtime.Poller[ReservationClientUpdateResponse], error)
BeginUpdate - Updates the applied scopes of the Reservation. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-03-01 reservationOrderID - Order Id of the reservation reservationID - Id of the Reservation Item parameters - Information needed to patch a reservation item options - ReservationClientBeginUpdateOptions contains the optional parameters for the ReservationClient.BeginUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/UpdateReservation.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewReservationClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := client.BeginUpdate(ctx, "276e7ae4-84d0-4da6-ab4b-d6b94f3557da", "6ef59113-3482-40da-8d79-787f823e34bc", armreservations.Patch{ Properties: &armreservations.PatchProperties{ AppliedScopeType: to.Ptr(armreservations.AppliedScopeTypeShared), InstanceFlexibility: to.Ptr(armreservations.InstanceFlexibilityOff), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // TODO: use response item _ = res }
Output:
func (*ReservationClient) Get ¶
func (client *ReservationClient) Get(ctx context.Context, reservationID string, reservationOrderID string, options *ReservationClientGetOptions) (ReservationClientGetResponse, error)
Get - Get specific Reservation details. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-03-01 reservationID - Id of the Reservation Item reservationOrderID - Order Id of the reservation options - ReservationClientGetOptions contains the optional parameters for the ReservationClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/GetReservationDetails.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewReservationClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Get(ctx, "6ef59113-3482-40da-8d79-787f823e34bc", "276e7ae4-84d0-4da6-ab4b-d6b94f3557da", &armreservations.ReservationClientGetOptions{Expand: to.Ptr("renewProperties")}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // TODO: use response item _ = res }
Output:
func (*ReservationClient) NewListAllPager ¶ added in v0.4.0
func (client *ReservationClient) NewListAllPager(options *ReservationClientListAllOptions) *runtime.Pager[ReservationClientListAllResponse]
NewListAllPager - List the reservations and the roll up counts of reservations group by provisioning states that the user has access to in the current tenant. Generated from API version 2022-03-01 options - ReservationClientListAllOptions contains the optional parameters for the ReservationClient.ListAll method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/GetReservations.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewReservationClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := client.NewListAllPager(&armreservations.ReservationClientListAllOptions{Filter: to.Ptr("(properties%2farchived+eq+false)"), Orderby: to.Ptr("properties/displayName asc"), RefreshSummary: nil, Skiptoken: to.Ptr[float32](50), SelectedState: nil, Take: to.Ptr[float32](1), }) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range nextResult.Value { // TODO: use page item _ = v } } }
Output:
func (*ReservationClient) NewListPager ¶ added in v0.4.0
func (client *ReservationClient) NewListPager(reservationOrderID string, options *ReservationClientListOptions) *runtime.Pager[ReservationClientListResponse]
NewListPager - List Reservations within a single ReservationOrder. Generated from API version 2022-03-01 reservationOrderID - Order Id of the reservation options - ReservationClientListOptions contains the optional parameters for the ReservationClient.List method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/GetReservationsFromOrder.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewReservationClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := client.NewListPager("276e7ae4-84d0-4da6-ab4b-d6b94f3557da", nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range nextResult.Value { // TODO: use page item _ = v } } }
Output:
func (*ReservationClient) NewListRevisionsPager ¶ added in v0.4.0
func (client *ReservationClient) NewListRevisionsPager(reservationID string, reservationOrderID string, options *ReservationClientListRevisionsOptions) *runtime.Pager[ReservationClientListRevisionsResponse]
NewListRevisionsPager - List of all the revisions for the Reservation. Generated from API version 2022-03-01 reservationID - Id of the Reservation Item reservationOrderID - Order Id of the reservation options - ReservationClientListRevisionsOptions contains the optional parameters for the ReservationClient.ListRevisions method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/GetReservationRevisions.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewReservationClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := client.NewListRevisionsPager("6ef59113-3482-40da-8d79-787f823e34bc", "276e7ae4-84d0-4da6-ab4b-d6b94f3557da", nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range nextResult.Value { // TODO: use page item _ = v } } }
Output:
func (*ReservationClient) Unarchive ¶ added in v1.1.0
func (client *ReservationClient) Unarchive(ctx context.Context, reservationOrderID string, reservationID string, options *ReservationClientUnarchiveOptions) (ReservationClientUnarchiveResponse, error)
Unarchive - Unarchiving a Reservation moves it to the state it was before archiving. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-03-01 reservationOrderID - Order Id of the reservation reservationID - Id of the Reservation Item options - ReservationClientUnarchiveOptions contains the optional parameters for the ReservationClient.Unarchive method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/Unarchive.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewReservationClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = client.Unarchive(ctx, "276e7ae4-84d0-4da6-ab4b-d6b94f3557da", "356e7ae4-84d0-4da6-ab4b-d6b94f3557da", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
type ReservationClientArchiveOptions ¶ added in v1.1.0
type ReservationClientArchiveOptions struct { }
ReservationClientArchiveOptions contains the optional parameters for the ReservationClient.Archive method.
type ReservationClientArchiveResponse ¶ added in v1.1.0
type ReservationClientArchiveResponse struct { }
ReservationClientArchiveResponse contains the response from method ReservationClient.Archive.
type ReservationClientAvailableScopesResponse ¶ added in v0.2.0
type ReservationClientAvailableScopesResponse struct {
AvailableScopeProperties
}
ReservationClientAvailableScopesResponse contains the response from method ReservationClient.AvailableScopes.
type ReservationClientBeginAvailableScopesOptions ¶ added in v0.2.0
type ReservationClientBeginAvailableScopesOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ReservationClientBeginAvailableScopesOptions contains the optional parameters for the ReservationClient.BeginAvailableScopes method.
type ReservationClientBeginMergeOptions ¶ added in v0.2.0
type ReservationClientBeginMergeOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ReservationClientBeginMergeOptions contains the optional parameters for the ReservationClient.BeginMerge method.
type ReservationClientBeginSplitOptions ¶ added in v0.2.0
type ReservationClientBeginSplitOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ReservationClientBeginSplitOptions contains the optional parameters for the ReservationClient.BeginSplit method.
type ReservationClientBeginUpdateOptions ¶ added in v0.2.0
type ReservationClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ReservationClientBeginUpdateOptions contains the optional parameters for the ReservationClient.BeginUpdate method.
type ReservationClientGetOptions ¶ added in v0.2.0
type ReservationClientGetOptions struct { // Supported value of this query is renewProperties Expand *string }
ReservationClientGetOptions contains the optional parameters for the ReservationClient.Get method.
type ReservationClientGetResponse ¶ added in v0.2.0
type ReservationClientGetResponse struct {
ReservationResponse
}
ReservationClientGetResponse contains the response from method ReservationClient.Get.
type ReservationClientListAllOptions ¶ added in v0.2.0
type ReservationClientListAllOptions struct { // May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does not currently support // 'ne', 'gt', 'le', 'ge', or 'not'. Reservation properties include sku/name, // properties/{appliedScopeType, archived, displayName, displayProvisioningState, effectiveDateTime, expiryDate, provisioningState, // quantity, renew, reservedResourceType, term, // userFriendlyAppliedScopeType, userFriendlyRenewState} Filter *string // May be used to sort order by reservation properties. Orderby *string // To indicate whether to refresh the roll up counts of the reservations group by provisioning states RefreshSummary *string // The selected provisioning state SelectedState *string // The number of reservations to skip from the list before returning results Skiptoken *float32 // To number of reservations to return Take *float32 }
ReservationClientListAllOptions contains the optional parameters for the ReservationClient.ListAll method.
type ReservationClientListAllResponse ¶ added in v0.2.0
type ReservationClientListAllResponse struct {
ListResult
}
ReservationClientListAllResponse contains the response from method ReservationClient.ListAll.
type ReservationClientListOptions ¶ added in v0.2.0
type ReservationClientListOptions struct { }
ReservationClientListOptions contains the optional parameters for the ReservationClient.List method.
type ReservationClientListResponse ¶ added in v0.2.0
type ReservationClientListResponse struct {
ReservationList
}
ReservationClientListResponse contains the response from method ReservationClient.List.
type ReservationClientListRevisionsOptions ¶ added in v0.2.0
type ReservationClientListRevisionsOptions struct { }
ReservationClientListRevisionsOptions contains the optional parameters for the ReservationClient.ListRevisions method.
type ReservationClientListRevisionsResponse ¶ added in v0.2.0
type ReservationClientListRevisionsResponse struct {
ReservationList
}
ReservationClientListRevisionsResponse contains the response from method ReservationClient.ListRevisions.
type ReservationClientMergeResponse ¶ added in v0.2.0
type ReservationClientMergeResponse struct { // Array of ReservationResponse ReservationResponseArray []*ReservationResponse }
ReservationClientMergeResponse contains the response from method ReservationClient.Merge.
func (*ReservationClientMergeResponse) UnmarshalJSON ¶ added in v0.3.0
func (r *ReservationClientMergeResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationClientMergeResponse.
type ReservationClientSplitResponse ¶ added in v0.2.0
type ReservationClientSplitResponse struct { // Array of ReservationResponse ReservationResponseArray []*ReservationResponse }
ReservationClientSplitResponse contains the response from method ReservationClient.Split.
func (*ReservationClientSplitResponse) UnmarshalJSON ¶ added in v0.3.0
func (r *ReservationClientSplitResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationClientSplitResponse.
type ReservationClientUnarchiveOptions ¶ added in v1.1.0
type ReservationClientUnarchiveOptions struct { }
ReservationClientUnarchiveOptions contains the optional parameters for the ReservationClient.Unarchive method.
type ReservationClientUnarchiveResponse ¶ added in v1.1.0
type ReservationClientUnarchiveResponse struct { }
ReservationClientUnarchiveResponse contains the response from method ReservationClient.Unarchive.
type ReservationClientUpdateResponse ¶ added in v0.2.0
type ReservationClientUpdateResponse struct {
ReservationResponse
}
ReservationClientUpdateResponse contains the response from method ReservationClient.Update.
type ReservationList ¶
type ReservationList struct { // Url to get the next page of reservations. NextLink *string `json:"nextLink,omitempty"` Value []*ReservationResponse `json:"value,omitempty"` }
func (ReservationList) MarshalJSON ¶
func (r ReservationList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationList.
func (*ReservationList) UnmarshalJSON ¶ added in v1.1.0
func (r *ReservationList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationList.
type ReservationMergeProperties ¶
type ReservationMergeProperties struct { // Reservation Resource Id Created due to the merge. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} MergeDestination *string `json:"mergeDestination,omitempty"` // 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} MergeSources []*string `json:"mergeSources,omitempty"` }
func (ReservationMergeProperties) MarshalJSON ¶
func (r ReservationMergeProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationMergeProperties.
func (*ReservationMergeProperties) UnmarshalJSON ¶ added in v1.1.0
func (r *ReservationMergeProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationMergeProperties.
type ReservationOrderBillingPlanInformation ¶
type ReservationOrderBillingPlanInformation struct { // For recurring billing plans, indicates the date when next payment will be processed. Null when total is paid off. NextPaymentDueDate *time.Time `json:"nextPaymentDueDate,omitempty"` // Amount of money to be paid for the Order. Tax is not included. PricingCurrencyTotal *Price `json:"pricingCurrencyTotal,omitempty"` // Date when the billing plan has started. StartDate *time.Time `json:"startDate,omitempty"` Transactions []*PaymentDetail `json:"transactions,omitempty"` }
ReservationOrderBillingPlanInformation - Information describing the type of billing plan for this reservation.
func (ReservationOrderBillingPlanInformation) MarshalJSON ¶
func (r ReservationOrderBillingPlanInformation) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationOrderBillingPlanInformation.
func (*ReservationOrderBillingPlanInformation) UnmarshalJSON ¶
func (r *ReservationOrderBillingPlanInformation) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationOrderBillingPlanInformation.
type ReservationOrderClient ¶
type ReservationOrderClient struct {
// contains filtered or unexported fields
}
ReservationOrderClient contains the methods for the ReservationOrder group. Don't use this type directly, use NewReservationOrderClient() instead.
func NewReservationOrderClient ¶
func NewReservationOrderClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ReservationOrderClient, error)
NewReservationOrderClient creates a new instance of ReservationOrderClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*ReservationOrderClient) BeginPurchase ¶
func (client *ReservationOrderClient) BeginPurchase(ctx context.Context, reservationOrderID string, body PurchaseRequest, options *ReservationOrderClientBeginPurchaseOptions) (*runtime.Poller[ReservationOrderClientPurchaseResponse], error)
BeginPurchase - Purchase ReservationOrder and create resource under the specified URI. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-03-01 reservationOrderID - Order Id of the reservation body - Information needed for calculate or purchase reservation options - ReservationOrderClientBeginPurchaseOptions contains the optional parameters for the ReservationOrderClient.BeginPurchase method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/PurchaseReservationOrder.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewReservationOrderClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := client.BeginPurchase(ctx, "a075419f-44cc-497f-b68a-14ee811d48b9", armreservations.PurchaseRequest{ Location: to.Ptr("westus"), Properties: &armreservations.PurchaseRequestProperties{ AppliedScopeType: to.Ptr(armreservations.AppliedScopeTypeShared), BillingPlan: to.Ptr(armreservations.ReservationBillingPlanMonthly), BillingScopeID: to.Ptr("/subscriptions/ed3a1871-612d-abcd-a849-c2542a68be83"), DisplayName: to.Ptr("TestReservationOrder"), Quantity: to.Ptr[int32](1), Renew: to.Ptr(false), ReservedResourceProperties: &armreservations.PurchaseRequestPropertiesReservedResourceProperties{ InstanceFlexibility: to.Ptr(armreservations.InstanceFlexibilityOn), }, ReservedResourceType: to.Ptr(armreservations.ReservedResourceTypeVirtualMachines), Term: to.Ptr(armreservations.ReservationTermP1Y), }, SKU: &armreservations.SKUName{ Name: to.Ptr("standard_D1"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // TODO: use response item _ = res }
Output:
func (*ReservationOrderClient) Calculate ¶
func (client *ReservationOrderClient) Calculate(ctx context.Context, body PurchaseRequest, options *ReservationOrderClientCalculateOptions) (ReservationOrderClientCalculateResponse, error)
Calculate - Calculate price for placing a ReservationOrder. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-03-01 body - Information needed for calculate or purchase reservation options - ReservationOrderClientCalculateOptions contains the optional parameters for the ReservationOrderClient.Calculate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/CalculateReservationOrder.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewReservationOrderClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Calculate(ctx, armreservations.PurchaseRequest{ Location: to.Ptr("westus"), Properties: &armreservations.PurchaseRequestProperties{ AppliedScopeType: to.Ptr(armreservations.AppliedScopeTypeShared), BillingPlan: to.Ptr(armreservations.ReservationBillingPlanMonthly), BillingScopeID: to.Ptr("/subscriptions/ed3a1871-612d-abcd-a849-c2542a68be83"), DisplayName: to.Ptr("TestReservationOrder"), Quantity: to.Ptr[int32](1), ReservedResourceProperties: &armreservations.PurchaseRequestPropertiesReservedResourceProperties{ InstanceFlexibility: to.Ptr(armreservations.InstanceFlexibilityOn), }, ReservedResourceType: to.Ptr(armreservations.ReservedResourceTypeVirtualMachines), Term: to.Ptr(armreservations.ReservationTermP1Y), }, SKU: &armreservations.SKUName{ Name: to.Ptr("standard_D1"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // TODO: use response item _ = res }
Output:
func (*ReservationOrderClient) ChangeDirectory ¶
func (client *ReservationOrderClient) ChangeDirectory(ctx context.Context, reservationOrderID string, body ChangeDirectoryRequest, options *ReservationOrderClientChangeDirectoryOptions) (ReservationOrderClientChangeDirectoryResponse, error)
ChangeDirectory - Change directory (tenant) of ReservationOrder and all Reservation under it to specified tenant id If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-03-01 reservationOrderID - Order Id of the reservation body - Information needed to change directory of reservation order options - ReservationOrderClientChangeDirectoryOptions contains the optional parameters for the ReservationOrderClient.ChangeDirectory method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/ChangeDirectoryReservationOrder.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewReservationOrderClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.ChangeDirectory(ctx, "a075419f-44cc-497f-b68a-14ee811d48b9", armreservations.ChangeDirectoryRequest{ DestinationTenantID: to.Ptr("906655ea-30be-4587-9d12-b50e077b0f32"), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // TODO: use response item _ = res }
Output:
func (*ReservationOrderClient) Get ¶
func (client *ReservationOrderClient) Get(ctx context.Context, reservationOrderID string, options *ReservationOrderClientGetOptions) (ReservationOrderClientGetResponse, error)
Get - Get the details of the ReservationOrder. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-03-01 reservationOrderID - Order Id of the reservation options - ReservationOrderClientGetOptions contains the optional parameters for the ReservationOrderClient.Get method.
Example (GetReservation) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/GetReservationOrderDetails.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewReservationOrderClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Get(ctx, "a075419f-44cc-497f-b68a-14ee811d48b9", &armreservations.ReservationOrderClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // TODO: use response item _ = res }
Output:
Example (GetReservationWithExpandPayments) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/GetReservationOrderDetailsWithExpandPlanInformation.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewReservationOrderClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Get(ctx, "a075419f-44cc-497f-b68a-14ee811d48b9", &armreservations.ReservationOrderClientGetOptions{Expand: to.Ptr("schedule")}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // TODO: use response item _ = res }
Output:
func (*ReservationOrderClient) NewListPager ¶ added in v0.4.0
func (client *ReservationOrderClient) NewListPager(options *ReservationOrderClientListOptions) *runtime.Pager[ReservationOrderClientListResponse]
NewListPager - List of all the ReservationOrders that the user has access to in the current tenant. Generated from API version 2022-03-01 options - ReservationOrderClientListOptions contains the optional parameters for the ReservationOrderClient.List method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/GetReservationOrders.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewReservationOrderClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := client.NewListPager(nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range nextResult.Value { // TODO: use page item _ = v } } }
Output:
type ReservationOrderClientBeginPurchaseOptions ¶ added in v0.2.0
type ReservationOrderClientBeginPurchaseOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ReservationOrderClientBeginPurchaseOptions contains the optional parameters for the ReservationOrderClient.BeginPurchase method.
type ReservationOrderClientCalculateOptions ¶ added in v0.2.0
type ReservationOrderClientCalculateOptions struct { }
ReservationOrderClientCalculateOptions contains the optional parameters for the ReservationOrderClient.Calculate method.
type ReservationOrderClientCalculateResponse ¶ added in v0.2.0
type ReservationOrderClientCalculateResponse struct {
CalculatePriceResponse
}
ReservationOrderClientCalculateResponse contains the response from method ReservationOrderClient.Calculate.
type ReservationOrderClientChangeDirectoryOptions ¶ added in v0.2.0
type ReservationOrderClientChangeDirectoryOptions struct { }
ReservationOrderClientChangeDirectoryOptions contains the optional parameters for the ReservationOrderClient.ChangeDirectory method.
type ReservationOrderClientChangeDirectoryResponse ¶ added in v0.2.0
type ReservationOrderClientChangeDirectoryResponse struct {
ChangeDirectoryResponse
}
ReservationOrderClientChangeDirectoryResponse contains the response from method ReservationOrderClient.ChangeDirectory.
type ReservationOrderClientGetOptions ¶ added in v0.2.0
type ReservationOrderClientGetOptions struct { // May be used to expand the planInformation. Expand *string }
ReservationOrderClientGetOptions contains the optional parameters for the ReservationOrderClient.Get method.
type ReservationOrderClientGetResponse ¶ added in v0.2.0
type ReservationOrderClientGetResponse struct {
ReservationOrderResponse
}
ReservationOrderClientGetResponse contains the response from method ReservationOrderClient.Get.
type ReservationOrderClientListOptions ¶ added in v0.2.0
type ReservationOrderClientListOptions struct { }
ReservationOrderClientListOptions contains the optional parameters for the ReservationOrderClient.List method.
type ReservationOrderClientListResponse ¶ added in v0.2.0
type ReservationOrderClientListResponse struct {
ReservationOrderList
}
ReservationOrderClientListResponse contains the response from method ReservationOrderClient.List.
type ReservationOrderClientPurchaseResponse ¶ added in v0.2.0
type ReservationOrderClientPurchaseResponse struct {
ReservationOrderResponse
}
ReservationOrderClientPurchaseResponse contains the response from method ReservationOrderClient.Purchase.
type ReservationOrderList ¶
type ReservationOrderList struct { // Url to get the next page of reservationOrders. NextLink *string `json:"nextLink,omitempty"` Value []*ReservationOrderResponse `json:"value,omitempty"` }
func (ReservationOrderList) MarshalJSON ¶
func (r ReservationOrderList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationOrderList.
func (*ReservationOrderList) UnmarshalJSON ¶ added in v1.1.0
func (r *ReservationOrderList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationOrderList.
type ReservationOrderProperties ¶
type ReservationOrderProperties struct { // This is the DateTime when the reservation benefit started. BenefitStartTime *time.Time `json:"benefitStartTime,omitempty"` // Represent the billing plans. BillingPlan *ReservationBillingPlan `json:"billingPlan,omitempty"` // This is the DateTime when the reservation was created. CreatedDateTime *time.Time `json:"createdDateTime,omitempty"` // Friendly name for user to easily identified the reservation. DisplayName *string `json:"displayName,omitempty"` // This is the date when the Reservation will expire. ExpiryDate *time.Time `json:"expiryDate,omitempty"` // Total Quantity of the SKUs purchased in the Reservation. OriginalQuantity *int32 `json:"originalQuantity,omitempty"` // Information describing the type of billing plan for this reservation. PlanInformation *ReservationOrderBillingPlanInformation `json:"planInformation,omitempty"` // Current state of the reservation. ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` // This is the DateTime when the reservation was initially requested for purchase. RequestDateTime *time.Time `json:"requestDateTime,omitempty"` Reservations []*ReservationResponse `json:"reservations,omitempty"` // Represent the term of Reservation. Term *ReservationTerm `json:"term,omitempty"` }
func (ReservationOrderProperties) MarshalJSON ¶
func (r ReservationOrderProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationOrderProperties.
func (*ReservationOrderProperties) UnmarshalJSON ¶
func (r *ReservationOrderProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationOrderProperties.
type ReservationOrderResponse ¶
type ReservationOrderResponse struct { Etag *int32 `json:"etag,omitempty"` Properties *ReservationOrderProperties `json:"properties,omitempty"` // READ-ONLY; Identifier of the reservation ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; Name of the reservation Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; Metadata pertaining to creation and last modification of the resource. SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; Type of resource. "Microsoft.Capacity/reservations" Type *string `json:"type,omitempty" azure:"ro"` }
func (ReservationOrderResponse) MarshalJSON ¶ added in v1.1.0
func (r ReservationOrderResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationOrderResponse.
func (*ReservationOrderResponse) UnmarshalJSON ¶ added in v1.1.0
func (r *ReservationOrderResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationOrderResponse.
type ReservationResponse ¶
type ReservationResponse struct { Etag *int32 `json:"etag,omitempty"` // Resource Provider type to be reserved. Kind *string `json:"kind,omitempty"` // The Azure Region where the reserved resource lives. Location *string `json:"location,omitempty"` // The properties associated to this reservation Properties *Properties `json:"properties,omitempty"` // The sku information associated to this reservation SKU *SKUName `json:"sku,omitempty"` // READ-ONLY; Identifier of the reservation ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; Name of the reservation Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; Metadata pertaining to creation and last modification of the resource. SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; Type of resource. "Microsoft.Capacity/reservationOrders/reservations" Type *string `json:"type,omitempty" azure:"ro"` }
ReservationResponse - The definition of the reservation.
func (ReservationResponse) MarshalJSON ¶ added in v1.1.0
func (r ReservationResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationResponse.
func (*ReservationResponse) UnmarshalJSON ¶ added in v1.1.0
func (r *ReservationResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationResponse.
type ReservationSplitProperties ¶
type ReservationSplitProperties struct { // List of destination Resource Id that are created due to split. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} SplitDestinations []*string `json:"splitDestinations,omitempty"` // Resource Id of the Reservation from which this is split. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} SplitSource *string `json:"splitSource,omitempty"` }
func (ReservationSplitProperties) MarshalJSON ¶
func (r ReservationSplitProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationSplitProperties.
func (*ReservationSplitProperties) UnmarshalJSON ¶ added in v1.1.0
func (r *ReservationSplitProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationSplitProperties.
type ReservationStatusCode ¶
type ReservationStatusCode string
const ( ReservationStatusCodeActive ReservationStatusCode = "Active" ReservationStatusCodeExpired ReservationStatusCode = "Expired" ReservationStatusCodeMerged ReservationStatusCode = "Merged" ReservationStatusCodeNone ReservationStatusCode = "None" ReservationStatusCodePaymentInstrumentError ReservationStatusCode = "PaymentInstrumentError" ReservationStatusCodePending ReservationStatusCode = "Pending" ReservationStatusCodeProcessing ReservationStatusCode = "Processing" ReservationStatusCodePurchaseError ReservationStatusCode = "PurchaseError" ReservationStatusCodeSplit ReservationStatusCode = "Split" ReservationStatusCodeSucceeded ReservationStatusCode = "Succeeded" )
func PossibleReservationStatusCodeValues ¶
func PossibleReservationStatusCodeValues() []ReservationStatusCode
PossibleReservationStatusCodeValues returns the possible values for the ReservationStatusCode const type.
type ReservationSummary ¶
type ReservationSummary struct { // READ-ONLY; The number of reservation in Cancelled state CancelledCount *float32 `json:"cancelledCount,omitempty" azure:"ro"` // READ-ONLY; The number of reservation in Expired state ExpiredCount *float32 `json:"expiredCount,omitempty" azure:"ro"` // READ-ONLY; The number of reservation in Expiring state ExpiringCount *float32 `json:"expiringCount,omitempty" azure:"ro"` // READ-ONLY; The number of reservation in Failed state FailedCount *float32 `json:"failedCount,omitempty" azure:"ro"` // READ-ONLY; The number of reservation in Pending state PendingCount *float32 `json:"pendingCount,omitempty" azure:"ro"` // READ-ONLY; The number of reservation in Processing state ProcessingCount *float32 `json:"processingCount,omitempty" azure:"ro"` // READ-ONLY; The number of reservation in Succeeded state SucceededCount *float32 `json:"succeededCount,omitempty" azure:"ro"` }
ReservationSummary - The roll up count summary of reservations in each state
func (ReservationSummary) MarshalJSON ¶ added in v1.1.0
func (r ReservationSummary) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationSummary.
func (*ReservationSummary) UnmarshalJSON ¶ added in v1.1.0
func (r *ReservationSummary) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationSummary.
type ReservationTerm ¶
type ReservationTerm string
ReservationTerm - Represent the term of Reservation.
const ( ReservationTermP1Y ReservationTerm = "P1Y" ReservationTermP3Y ReservationTerm = "P3Y" ReservationTermP5Y ReservationTerm = "P5Y" )
func PossibleReservationTermValues ¶
func PossibleReservationTermValues() []ReservationTerm
PossibleReservationTermValues returns the possible values for the ReservationTerm const type.
type ReservationToExchange ¶
type ReservationToExchange struct { // billing information BillingInformation *BillingInformation `json:"billingInformation,omitempty"` BillingRefundAmount *Price `json:"billingRefundAmount,omitempty"` // Quantity to be returned Quantity *int32 `json:"quantity,omitempty"` // Fully qualified id of the Reservation being returned. ReservationID *string `json:"reservationId,omitempty"` }
ReservationToExchange - Reservation refund details
func (ReservationToExchange) MarshalJSON ¶ added in v1.1.0
func (r ReservationToExchange) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationToExchange.
func (*ReservationToExchange) UnmarshalJSON ¶ added in v1.1.0
func (r *ReservationToExchange) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationToExchange.
type ReservationToPurchaseCalculateExchange ¶
type ReservationToPurchaseCalculateExchange struct { BillingCurrencyTotal *Price `json:"billingCurrencyTotal,omitempty"` Properties *PurchaseRequest `json:"properties,omitempty"` }
ReservationToPurchaseCalculateExchange - Reservation purchase details
func (ReservationToPurchaseCalculateExchange) MarshalJSON ¶ added in v1.1.0
func (r ReservationToPurchaseCalculateExchange) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationToPurchaseCalculateExchange.
func (*ReservationToPurchaseCalculateExchange) UnmarshalJSON ¶ added in v1.1.0
func (r *ReservationToPurchaseCalculateExchange) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationToPurchaseCalculateExchange.
type ReservationToPurchaseExchange ¶
type ReservationToPurchaseExchange struct { BillingCurrencyTotal *Price `json:"billingCurrencyTotal,omitempty"` Properties *PurchaseRequest `json:"properties,omitempty"` // Fully qualified id of the Reservation being purchased. This value is only guaranteed to be non-null if the purchase is // successful. ReservationID *string `json:"reservationId,omitempty"` // Fully qualified id of the ReservationOrder being purchased ReservationOrderID *string `json:"reservationOrderId,omitempty"` // Status of the individual operation. Status *OperationStatus `json:"status,omitempty"` }
ReservationToPurchaseExchange - Reservation purchase details
func (ReservationToPurchaseExchange) MarshalJSON ¶ added in v1.1.0
func (r ReservationToPurchaseExchange) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationToPurchaseExchange.
func (*ReservationToPurchaseExchange) UnmarshalJSON ¶ added in v1.1.0
func (r *ReservationToPurchaseExchange) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationToPurchaseExchange.
type ReservationToReturn ¶
type ReservationToReturn struct { // Quantity to be returned. Must be greater than zero. Quantity *int32 `json:"quantity,omitempty"` // Fully qualified identifier of the Reservation being returned ReservationID *string `json:"reservationId,omitempty"` }
ReservationToReturn - Reservation to return
func (ReservationToReturn) MarshalJSON ¶ added in v1.1.0
func (r ReservationToReturn) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationToReturn.
func (*ReservationToReturn) UnmarshalJSON ¶ added in v1.1.0
func (r *ReservationToReturn) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationToReturn.
type ReservationToReturnForExchange ¶
type ReservationToReturnForExchange struct { // billing information BillingInformation *BillingInformation `json:"billingInformation,omitempty"` BillingRefundAmount *Price `json:"billingRefundAmount,omitempty"` // Quantity to be returned Quantity *int32 `json:"quantity,omitempty"` // Fully qualified id of the Reservation being returned. ReservationID *string `json:"reservationId,omitempty"` // Status of the individual operation. Status *OperationStatus `json:"status,omitempty"` }
ReservationToReturnForExchange - Reservation refund details
func (ReservationToReturnForExchange) MarshalJSON ¶ added in v1.1.0
func (r ReservationToReturnForExchange) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationToReturnForExchange.
func (*ReservationToReturnForExchange) UnmarshalJSON ¶ added in v1.1.0
func (r *ReservationToReturnForExchange) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationToReturnForExchange.
type ReservationUtilizationAggregates ¶
type ReservationUtilizationAggregates struct { // READ-ONLY; The grain of the aggregate Grain *float32 `json:"grain,omitempty" azure:"ro"` // READ-ONLY; The grain unit of the aggregate GrainUnit *string `json:"grainUnit,omitempty" azure:"ro"` // READ-ONLY; The aggregate value Value *float32 `json:"value,omitempty" azure:"ro"` // READ-ONLY; The aggregate value unit ValueUnit *string `json:"valueUnit,omitempty" azure:"ro"` }
ReservationUtilizationAggregates - The aggregate values of reservation utilization
func (ReservationUtilizationAggregates) MarshalJSON ¶ added in v1.1.0
func (r ReservationUtilizationAggregates) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationUtilizationAggregates.
func (*ReservationUtilizationAggregates) UnmarshalJSON ¶ added in v1.1.0
func (r *ReservationUtilizationAggregates) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationUtilizationAggregates.
type ReservedResourceType ¶
type ReservedResourceType string
ReservedResourceType - The type of the resource that is being reserved.
const ( ReservedResourceTypeAVS ReservedResourceType = "AVS" ReservedResourceTypeAppService ReservedResourceType = "AppService" ReservedResourceTypeAzureDataExplorer ReservedResourceType = "AzureDataExplorer" ReservedResourceTypeAzureFiles ReservedResourceType = "AzureFiles" ReservedResourceTypeBlockBlob ReservedResourceType = "BlockBlob" ReservedResourceTypeCosmosDb ReservedResourceType = "CosmosDb" ReservedResourceTypeDataFactory ReservedResourceType = "DataFactory" ReservedResourceTypeDatabricks ReservedResourceType = "Databricks" ReservedResourceTypeDedicatedHost ReservedResourceType = "DedicatedHost" ReservedResourceTypeManagedDisk ReservedResourceType = "ManagedDisk" ReservedResourceTypeMariaDb ReservedResourceType = "MariaDb" ReservedResourceTypeMySQL ReservedResourceType = "MySql" ReservedResourceTypeNetAppStorage ReservedResourceType = "NetAppStorage" ReservedResourceTypePostgreSQL ReservedResourceType = "PostgreSql" ReservedResourceTypeRedHat ReservedResourceType = "RedHat" ReservedResourceTypeRedHatOsa ReservedResourceType = "RedHatOsa" ReservedResourceTypeRedisCache ReservedResourceType = "RedisCache" ReservedResourceTypeSQLAzureHybridBenefit ReservedResourceType = "SqlAzureHybridBenefit" ReservedResourceTypeSQLDataWarehouse ReservedResourceType = "SqlDataWarehouse" ReservedResourceTypeSQLDatabases ReservedResourceType = "SqlDatabases" ReservedResourceTypeSQLEdge ReservedResourceType = "SqlEdge" ReservedResourceTypeSapHana ReservedResourceType = "SapHana" ReservedResourceTypeSuseLinux ReservedResourceType = "SuseLinux" ReservedResourceTypeVMwareCloudSimple ReservedResourceType = "VMwareCloudSimple" ReservedResourceTypeVirtualMachineSoftware ReservedResourceType = "VirtualMachineSoftware" ReservedResourceTypeVirtualMachines ReservedResourceType = "VirtualMachines" )
func PossibleReservedResourceTypeValues ¶
func PossibleReservedResourceTypeValues() []ReservedResourceType
PossibleReservedResourceTypeValues returns the possible values for the ReservedResourceType const type.
type ResourceName ¶
type ResourceName struct { // Resource name. Value *string `json:"value,omitempty"` // READ-ONLY; Resource display localized name. LocalizedValue *string `json:"localizedValue,omitempty" azure:"ro"` }
ResourceName - Resource name provided by the resource provider. Use this property for quotaRequest parameter.
func (ResourceName) MarshalJSON ¶ added in v1.1.0
func (r ResourceName) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourceName.
func (*ResourceName) UnmarshalJSON ¶ added in v1.1.0
func (r *ResourceName) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResourceName.
type ResourceType ¶
type ResourceType string
ResourceType - The resource types.
const ( ResourceTypeDedicated ResourceType = "dedicated" ResourceTypeLowPriority ResourceType = "lowPriority" ResourceTypeServiceSpecific ResourceType = "serviceSpecific" ResourceTypeStandard ResourceType = "standard" )
func PossibleResourceTypeValues ¶
func PossibleResourceTypeValues() []ResourceType
PossibleResourceTypeValues returns the possible values for the ResourceType const type.
type ReturnClient ¶ added in v1.1.0
type ReturnClient struct {
// contains filtered or unexported fields
}
ReturnClient contains the methods for the Return group. Don't use this type directly, use NewReturnClient() instead.
func NewReturnClient ¶ added in v1.1.0
func NewReturnClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ReturnClient, error)
NewReturnClient creates a new instance of ReturnClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*ReturnClient) Post ¶ added in v1.1.0
func (client *ReturnClient) Post(ctx context.Context, reservationOrderID string, body RefundRequest, options *ReturnClientPostOptions) (ReturnClientPostResponse, error)
Post - Return a reservation. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-03-01 reservationOrderID - Order Id of the reservation body - Information needed for returning reservation. options - ReturnClientPostOptions contains the optional parameters for the ReturnClient.Post method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-03-01/examples/Return.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client, err := armreservations.NewReturnClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = client.Post(ctx, "276e7ae4-84d0-4da6-ab4b-d6b94f3557da", armreservations.RefundRequest{ Properties: &armreservations.RefundRequestProperties{ ReservationToReturn: &armreservations.ReservationToReturn{ Quantity: to.Ptr[int32](1), ReservationID: to.Ptr("/providers/microsoft.capacity/reservationOrders/50000000-aaaa-bbbb-cccc-100000000004/reservations/40000000-aaaa-bbbb-cccc-100000000000"), }, ReturnReason: to.Ptr("PurchasedWrongProduct"), Scope: to.Ptr("Reservation"), SessionID: to.Ptr("10000000-aaaa-bbbb-cccc-200000000000"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
type ReturnClientPostOptions ¶ added in v1.1.0
type ReturnClientPostOptions struct { }
ReturnClientPostOptions contains the optional parameters for the ReturnClient.Post method.
type ReturnClientPostResponse ¶ added in v1.1.0
type ReturnClientPostResponse struct { RefundResponse // Location contains the information returned from the Location header response. Location *string }
ReturnClientPostResponse contains the response from method ReturnClient.Post.
type SKUCapability ¶
type SKUCapability struct { // An invariant to describe the feature. Name *string `json:"name,omitempty"` // An invariant if the feature is measured by quantity. Value *string `json:"value,omitempty"` }
func (SKUCapability) MarshalJSON ¶ added in v1.1.0
func (s SKUCapability) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SKUCapability.
func (*SKUCapability) UnmarshalJSON ¶ added in v1.1.0
func (s *SKUCapability) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SKUCapability.
type SKUName ¶
type SKUName struct {
Name *string `json:"name,omitempty"`
}
func (SKUName) MarshalJSON ¶ added in v1.1.0
MarshalJSON implements the json.Marshaller interface for type SKUName.
func (*SKUName) UnmarshalJSON ¶ added in v1.1.0
UnmarshalJSON implements the json.Unmarshaller interface for type SKUName.
type SKUProperty ¶
type SKUProperty struct { // An invariant to describe the feature. Name *string `json:"name,omitempty"` // An invariant if the feature is measured by quantity. Value *string `json:"value,omitempty"` }
func (SKUProperty) MarshalJSON ¶ added in v1.1.0
func (s SKUProperty) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SKUProperty.
func (*SKUProperty) UnmarshalJSON ¶ added in v1.1.0
func (s *SKUProperty) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SKUProperty.
type SKURestriction ¶
type SKURestriction struct { // The reason for restriction. ReasonCode *string `json:"reasonCode,omitempty"` // The type of restrictions. Type *string `json:"type,omitempty"` // The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU // is restricted. Values []*string `json:"values,omitempty"` }
func (SKURestriction) MarshalJSON ¶
func (s SKURestriction) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SKURestriction.
func (*SKURestriction) UnmarshalJSON ¶ added in v1.1.0
func (s *SKURestriction) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SKURestriction.
type ScopeProperties ¶
type ScopeProperties struct { Scope *string `json:"scope,omitempty"` Valid *bool `json:"valid,omitempty"` }
func (ScopeProperties) MarshalJSON ¶ added in v1.1.0
func (s ScopeProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ScopeProperties.
func (*ScopeProperties) UnmarshalJSON ¶ added in v1.1.0
func (s *ScopeProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ScopeProperties.
type ServiceError ¶
type ServiceError struct { // The error code. Code *string `json:"code,omitempty"` // The error message text. Message *string `json:"message,omitempty"` // READ-ONLY; The list of error details. Details []*ServiceErrorDetail `json:"details,omitempty" azure:"ro"` }
ServiceError - The API error details.
func (ServiceError) MarshalJSON ¶
func (s ServiceError) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServiceError.
func (*ServiceError) UnmarshalJSON ¶ added in v1.1.0
func (s *ServiceError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServiceError.
type ServiceErrorDetail ¶
type ServiceErrorDetail struct { // READ-ONLY; The error code. Code *string `json:"code,omitempty" azure:"ro"` // READ-ONLY; The error message. Message *string `json:"message,omitempty" azure:"ro"` }
ServiceErrorDetail - The error details.
func (ServiceErrorDetail) MarshalJSON ¶ added in v1.1.0
func (s ServiceErrorDetail) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServiceErrorDetail.
func (*ServiceErrorDetail) UnmarshalJSON ¶ added in v1.1.0
func (s *ServiceErrorDetail) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServiceErrorDetail.
type SplitProperties ¶
type SplitProperties struct { // List of the quantities in the new reservations to create. Quantities []*int32 `json:"quantities,omitempty"` // Resource id of the reservation to be split. Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} ReservationID *string `json:"reservationId,omitempty"` }
func (SplitProperties) MarshalJSON ¶
func (s SplitProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SplitProperties.
func (*SplitProperties) UnmarshalJSON ¶ added in v1.1.0
func (s *SplitProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SplitProperties.
type SplitRequest ¶
type SplitRequest struct {
Properties *SplitProperties `json:"properties,omitempty"`
}
func (SplitRequest) MarshalJSON ¶ added in v1.1.0
func (s SplitRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SplitRequest.
func (*SplitRequest) UnmarshalJSON ¶ added in v1.1.0
func (s *SplitRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SplitRequest.
type SubRequest ¶
type SubRequest struct { // The resource name. Name *ResourceName `json:"name,omitempty"` // The quota request status. ProvisioningState *QuotaRequestState `json:"provisioningState,omitempty"` // The limit units, such as count and bytes. Use the unit field provided in the response of the GET quota operation. Unit *string `json:"unit,omitempty"` // READ-ONLY; Quota (resource limit). Limit *int32 `json:"limit,omitempty" azure:"ro"` // READ-ONLY; User-friendly status message. Message *string `json:"message,omitempty" azure:"ro"` // READ-ONLY; Resource type for which the quota check was made. ResourceType *string `json:"resourceType,omitempty" azure:"ro"` // READ-ONLY; Sub request ID for individual request. SubRequestID *string `json:"subRequestId,omitempty" azure:"ro"` }
SubRequest - The sub-request submitted with the quota request.
func (SubRequest) MarshalJSON ¶ added in v1.1.0
func (s SubRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SubRequest.
func (*SubRequest) UnmarshalJSON ¶ added in v1.1.0
func (s *SubRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SubRequest.
type SubscriptionScopeProperties ¶
type SubscriptionScopeProperties struct {
Scopes []*ScopeProperties `json:"scopes,omitempty"`
}
func (SubscriptionScopeProperties) MarshalJSON ¶
func (s SubscriptionScopeProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SubscriptionScopeProperties.
func (*SubscriptionScopeProperties) UnmarshalJSON ¶ added in v1.1.0
func (s *SubscriptionScopeProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionScopeProperties.
type SystemData ¶
type SystemData struct { // The timestamp of resource creation (UTC). CreatedAt *time.Time `json:"createdAt,omitempty"` // The identity that created the resource. CreatedBy *string `json:"createdBy,omitempty"` // The type of identity that created the resource. CreatedByType *CreatedByType `json:"createdByType,omitempty"` // The timestamp of resource last modification (UTC) LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"` // The identity that last modified the resource. LastModifiedBy *string `json:"lastModifiedBy,omitempty"` // The type of identity that last modified the resource. LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` }
SystemData - Metadata pertaining to creation and last modification of the resource.
func (SystemData) MarshalJSON ¶
func (s SystemData) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SystemData.
func (*SystemData) UnmarshalJSON ¶
func (s *SystemData) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.
type UserFriendlyAppliedScopeType ¶
type UserFriendlyAppliedScopeType string
UserFriendlyAppliedScopeType - The applied scope type
const ( UserFriendlyAppliedScopeTypeManagementGroup UserFriendlyAppliedScopeType = "ManagementGroup" UserFriendlyAppliedScopeTypeNone UserFriendlyAppliedScopeType = "None" UserFriendlyAppliedScopeTypeResourceGroup UserFriendlyAppliedScopeType = "ResourceGroup" UserFriendlyAppliedScopeTypeSingle UserFriendlyAppliedScopeType = "Single" )
func PossibleUserFriendlyAppliedScopeTypeValues ¶
func PossibleUserFriendlyAppliedScopeTypeValues() []UserFriendlyAppliedScopeType
PossibleUserFriendlyAppliedScopeTypeValues returns the possible values for the UserFriendlyAppliedScopeType const type.
type UserFriendlyRenewState ¶
type UserFriendlyRenewState string
UserFriendlyRenewState - The renew state of the reservation
const ( UserFriendlyRenewStateNotApplicable UserFriendlyRenewState = "NotApplicable" UserFriendlyRenewStateNotRenewed UserFriendlyRenewState = "NotRenewed" UserFriendlyRenewStateOff UserFriendlyRenewState = "Off" UserFriendlyRenewStateOn UserFriendlyRenewState = "On" UserFriendlyRenewStateRenewed UserFriendlyRenewState = "Renewed" )
func PossibleUserFriendlyRenewStateValues ¶
func PossibleUserFriendlyRenewStateValues() []UserFriendlyRenewState
PossibleUserFriendlyRenewStateValues returns the possible values for the UserFriendlyRenewState const type.
Source Files ¶
- azurereservationapi_client.go
- build.go
- calculateexchange_client.go
- calculaterefund_client.go
- constants.go
- date_type.go
- exchange_client.go
- models.go
- models_serde.go
- operation_client.go
- quota_client.go
- quotarequeststatus_client.go
- reservation_client.go
- reservationorder_client.go
- response_types.go
- return_client.go
- time_rfc3339.go