armaddons

package module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 12 Imported by: 1

README

Azure Addons Module for Go

PkgGoDev

The armaddons module provides operations for working with Azure Addons.

Source code

Getting started

Prerequisites

  • an Azure subscription
  • Go 1.18 or above (You could download and install the latest version of Go from here. It will replace the existing Go on your machine. If you want to install multiple Go versions on the same machine, you could refer this doc.)

Install the package

This project uses Go modules for versioning and dependency management.

Install the Azure Addons module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/addons/armaddons

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Addons. The azidentity module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.

cred, err := azidentity.NewDefaultAzureCredential(nil)

For more information on authentication, please see the documentation for azidentity at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity.

Client Factory

Azure Addons module consists of one or more clients. We provide a client factory which could be used to create any client in this module.

clientFactory, err := armaddons.NewClientFactory(<subscription ID>, cred, nil)

You can use ClientOptions in package github.com/Azure/azure-sdk-for-go/sdk/azcore/arm to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for azcore at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore.

options := arm.ClientOptions {
    ClientOptions: azcore.ClientOptions {
        Cloud: cloud.AzureChina,
    },
}
clientFactory, err := armaddons.NewClientFactory(<subscription ID>, cred, &options)

Clients

A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory.

client := clientFactory.NewSupportPlanTypesClient()

Fakes

The fake package contains types used for constructing in-memory fake servers used in unit tests. This allows writing tests to cover various success/error conditions without the need for connecting to a live service.

Please see https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/samples/fakes for details and examples on how to use fakes.

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the Addons label.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CanonicalSupportPlanInfoDefinition

type CanonicalSupportPlanInfoDefinition struct {
	// Flag to indicate if this support plan type is currently enabled for the subscription.
	Enabled *bool

	// The one time charge status for the subscription.
	OneTimeCharge *OneTimeCharge

	// Support plan type.
	SupportPlanType *SupportPlanType
}

CanonicalSupportPlanInfoDefinition - Definition object with the properties of a canonical plan

func (CanonicalSupportPlanInfoDefinition) MarshalJSON added in v0.2.0

func (c CanonicalSupportPlanInfoDefinition) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CanonicalSupportPlanInfoDefinition.

func (*CanonicalSupportPlanInfoDefinition) UnmarshalJSON added in v0.2.0

func (c *CanonicalSupportPlanInfoDefinition) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CanonicalSupportPlanInfoDefinition.

type CanonicalSupportPlanProperties

type CanonicalSupportPlanProperties struct {
	// The provisioning state of the resource.
	ProvisioningState *ProvisioningState
}

CanonicalSupportPlanProperties - The properties of the Canonical support plan.

func (CanonicalSupportPlanProperties) MarshalJSON added in v0.2.0

func (c CanonicalSupportPlanProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CanonicalSupportPlanProperties.

func (*CanonicalSupportPlanProperties) UnmarshalJSON added in v0.2.0

func (c *CanonicalSupportPlanProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CanonicalSupportPlanProperties.

type CanonicalSupportPlanResponseEnvelope

type CanonicalSupportPlanResponseEnvelope struct {
	// REQUIRED; Describes Canonical support plan type and status.
	Properties *CanonicalSupportPlanProperties

	// READ-ONLY; The id of the ARM resource, e.g. "/subscriptions/{id}/providers/Microsoft.Addons/supportProvider/{supportProviderName}/supportPlanTypes/{planTypeName}".
	ID *string

	// READ-ONLY; The name of the Canonical support plan, i.e. "essential", "standard" or "advanced".
	Name *string

	// READ-ONLY; Microsoft.Addons/supportProvider
	Type *string
}

CanonicalSupportPlanResponseEnvelope - The status of the Canonical support plan.

func (CanonicalSupportPlanResponseEnvelope) MarshalJSON added in v0.2.0

func (c CanonicalSupportPlanResponseEnvelope) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CanonicalSupportPlanResponseEnvelope.

func (*CanonicalSupportPlanResponseEnvelope) UnmarshalJSON added in v0.2.0

func (c *CanonicalSupportPlanResponseEnvelope) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CanonicalSupportPlanResponseEnvelope.

type ClientFactory added in v0.2.0

type ClientFactory struct {
	// contains filtered or unexported fields
}

ClientFactory is a client factory used to create any client in this module. Don't use this type directly, use NewClientFactory instead.

func NewClientFactory added in v0.2.0

func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error)

NewClientFactory creates a new instance of ClientFactory with the specified values. The parameter values will be propagated to any client created from this factory.

  • subscriptionID - Subscription credentials that uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ClientFactory) NewOperationsClient added in v0.2.0

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

func (*ClientFactory) NewSupportPlanTypesClient added in v0.2.0

func (c *ClientFactory) NewSupportPlanTypesClient() *SupportPlanTypesClient

NewSupportPlanTypesClient creates a new instance of SupportPlanTypesClient.

type ErrorDefinition

type ErrorDefinition struct {
	// REQUIRED; Service specific error code which serves as the substatus for the HTTP error code.
	Code *string

	// REQUIRED; Description of the error.
	Message *string
}

ErrorDefinition - Error description and code explaining why an operation failed.

func (ErrorDefinition) MarshalJSON added in v0.2.0

func (e ErrorDefinition) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ErrorDefinition.

func (*ErrorDefinition) UnmarshalJSON added in v0.2.0

func (e *ErrorDefinition) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDefinition.

type OneTimeCharge

type OneTimeCharge string

OneTimeCharge - The one time charge status for the subscription.

const (
	OneTimeChargeNo          OneTimeCharge = "no"
	OneTimeChargeOnEnabled   OneTimeCharge = "onEnabled"
	OneTimeChargeOnReenabled OneTimeCharge = "onReenabled"
)

func PossibleOneTimeChargeValues

func PossibleOneTimeChargeValues() []OneTimeCharge

PossibleOneTimeChargeValues returns the possible values for the OneTimeCharge const type.

type OperationListValue

type OperationListValue struct {
	// List of supported operations.
	Value []*OperationsDefinition
}

OperationListValue - List of supported operations.

func (OperationListValue) MarshalJSON added in v0.2.0

func (o OperationListValue) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationListValue.

func (*OperationListValue) UnmarshalJSON added in v0.2.0

func (o *OperationListValue) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationListValue.

type OperationsClient

type OperationsClient struct {
	// contains filtered or unexported fields
}

OperationsClient contains the methods for the Operations group. Don't use this type directly, use NewOperationsClient() instead.

func NewOperationsClient

func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error)

NewOperationsClient creates a new instance of OperationsClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*OperationsClient) List

List - Lists all of the available Addons RP operations. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-03-01

  • options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/addons/resource-manager/Microsoft.Addons/preview/2018-03-01/examples/Operations_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/addons/armaddons"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armaddons.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewOperationsClient().List(ctx, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.OperationListValue = armaddons.OperationListValue{
	// 	Value: []*armaddons.OperationsDefinition{
	// 		{
	// 			Name: to.Ptr("Microsoft.Addons/supportProviders/supportPlanTypes/read"),
	// 			Display: &armaddons.OperationsDisplayDefinition{
	// 				Description: to.Ptr("Get the specified Canonical support plan state."),
	// 				Operation: to.Ptr("Get Canonical support plan state"),
	// 				Provider: to.Ptr("Microsoft Addons"),
	// 				Resource: to.Ptr("supportPlanTypes"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.Addons/supportProviders/supportPlanTypes/write"),
	// 			Display: &armaddons.OperationsDisplayDefinition{
	// 				Description: to.Ptr("Adds the Canonical support plan type specified."),
	// 				Operation: to.Ptr("Adds a Canonical support plan."),
	// 				Provider: to.Ptr("Microsoft Addons"),
	// 				Resource: to.Ptr("supportPlanTypes"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.Addons/supportProviders/supportPlanTypes/delete"),
	// 			Display: &armaddons.OperationsDisplayDefinition{
	// 				Description: to.Ptr("Removes the specified Canonical support plan"),
	// 				Operation: to.Ptr("Removes the Canonical support plan"),
	// 				Provider: to.Ptr("Microsoft Addons"),
	// 				Resource: to.Ptr("supportPlanTypes"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.Addons/supportProviders/canonical/supportPlanTypes/get"),
	// 			Display: &armaddons.OperationsDisplayDefinition{
	// 				Description: to.Ptr("Gets the available Canonical support plan types as well as some extra metadata on their enabled status."),
	// 				Operation: to.Ptr("Gets available Canonical support plan types."),
	// 				Provider: to.Ptr("Microsoft Addons"),
	// 				Resource: to.Ptr("supportProviders"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.Addons/register/action"),
	// 			Display: &armaddons.OperationsDisplayDefinition{
	// 				Description: to.Ptr("Register the specified subscription with Microsoft.Addons"),
	// 				Operation: to.Ptr("Register for Microsoft.Addons"),
	// 				Provider: to.Ptr("Microsoft Addons"),
	// 				Resource: to.Ptr("register"),
	// 			},
	// 	}},
	// }
}
Output:

type OperationsClientListOptions

type OperationsClientListOptions struct {
}

OperationsClientListOptions contains the optional parameters for the OperationsClient.List method.

type OperationsClientListResponse

type OperationsClientListResponse struct {
	// List of supported operations.
	OperationListValue
}

OperationsClientListResponse contains the response from method OperationsClient.List.

type OperationsDefinition

type OperationsDefinition struct {
	// Display object with properties of the operation.
	Display *OperationsDisplayDefinition

	// Name of the operation.
	Name *string
}

OperationsDefinition - Definition object with the name and properties of an operation.

func (OperationsDefinition) MarshalJSON added in v0.2.0

func (o OperationsDefinition) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationsDefinition.

func (*OperationsDefinition) UnmarshalJSON added in v0.2.0

func (o *OperationsDefinition) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationsDefinition.

type OperationsDisplayDefinition

type OperationsDisplayDefinition struct {
	// Description of the operation.
	Description *string

	// Short description of the operation.
	Operation *string

	// Resource provider of the operation.
	Provider *string

	// Resource for the operation.
	Resource *string
}

OperationsDisplayDefinition - Display object with properties of the operation.

func (OperationsDisplayDefinition) MarshalJSON added in v0.2.0

func (o OperationsDisplayDefinition) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationsDisplayDefinition.

func (*OperationsDisplayDefinition) UnmarshalJSON added in v0.2.0

func (o *OperationsDisplayDefinition) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationsDisplayDefinition.

type PlanTypeName

type PlanTypeName string
const (
	PlanTypeNameAdvanced  PlanTypeName = "Advanced"
	PlanTypeNameEssential PlanTypeName = "Essential"
	PlanTypeNameStandard  PlanTypeName = "Standard"
)

func PossiblePlanTypeNameValues

func PossiblePlanTypeNameValues() []PlanTypeName

PossiblePlanTypeNameValues returns the possible values for the PlanTypeName const type.

type ProvisioningState

type ProvisioningState string

ProvisioningState - The provisioning state of the resource.

const (
	ProvisioningStateCancelled   ProvisioningState = "Cancelled"
	ProvisioningStateCancelling  ProvisioningState = "Cancelling"
	ProvisioningStateDowngrading ProvisioningState = "Downgrading"
	ProvisioningStateFailed      ProvisioningState = "Failed"
	ProvisioningStatePurchasing  ProvisioningState = "Purchasing"
	ProvisioningStateSucceeded   ProvisioningState = "Succeeded"
	ProvisioningStateUpgrading   ProvisioningState = "Upgrading"
)

func PossibleProvisioningStateValues

func PossibleProvisioningStateValues() []ProvisioningState

PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.

type SupportPlanType

type SupportPlanType string

SupportPlanType - Support plan type.

const (
	SupportPlanTypeAdvanced  SupportPlanType = "advanced"
	SupportPlanTypeEssential SupportPlanType = "essential"
	SupportPlanTypeStandard  SupportPlanType = "standard"
)

func PossibleSupportPlanTypeValues

func PossibleSupportPlanTypeValues() []SupportPlanType

PossibleSupportPlanTypeValues returns the possible values for the SupportPlanType const type.

type SupportPlanTypesClient

type SupportPlanTypesClient struct {
	// contains filtered or unexported fields
}

SupportPlanTypesClient contains the methods for the SupportPlanTypes group. Don't use this type directly, use NewSupportPlanTypesClient() instead.

func NewSupportPlanTypesClient

func NewSupportPlanTypesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SupportPlanTypesClient, error)

NewSupportPlanTypesClient creates a new instance of SupportPlanTypesClient with the specified values.

  • subscriptionID - Subscription credentials that uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*SupportPlanTypesClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Creates or updates the Canonical support plan of type {type} for the subscription. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-03-01

  • providerName - The support plan type. For now the only valid type is "canonical".
  • planTypeName - The Canonical support plan type.
  • options - SupportPlanTypesClientBeginCreateOrUpdateOptions contains the optional parameters for the SupportPlanTypesClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/addons/resource-manager/Microsoft.Addons/preview/2018-03-01/examples/SupportPlanTypes_CreateOrUpdate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/addons/armaddons"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armaddons.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewSupportPlanTypesClient().BeginCreateOrUpdate(ctx, "Canonical", armaddons.PlanTypeNameStandard, 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)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.CanonicalSupportPlanResponseEnvelope = armaddons.CanonicalSupportPlanResponseEnvelope{
	// 	Name: to.Ptr("Standard"),
	// 	Type: to.Ptr("Microsoft.Addons/supportProvider"),
	// 	ID: to.Ptr("subscriptions/d18d258f-bdba-4de1-8b51-e79d6c181d5e/providers/Microsoft.Addons/supportProviders/canonical/supportPlanTypes/Standard"),
	// 	Properties: &armaddons.CanonicalSupportPlanProperties{
	// 		ProvisioningState: to.Ptr(armaddons.ProvisioningStateSucceeded),
	// 	},
	// }
}
Output:

func (*SupportPlanTypesClient) BeginDelete

BeginDelete - Cancels the Canonical support plan of type {type} for the subscription. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-03-01

  • providerName - The support plan type. For now the only valid type is "canonical".
  • planTypeName - The Canonical support plan type.
  • options - SupportPlanTypesClientBeginDeleteOptions contains the optional parameters for the SupportPlanTypesClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/addons/resource-manager/Microsoft.Addons/preview/2018-03-01/examples/SupportPlanTypes_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/addons/armaddons"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armaddons.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewSupportPlanTypesClient().BeginDelete(ctx, "Canonical", armaddons.PlanTypeNameStandard, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*SupportPlanTypesClient) Get

Get - Returns whether or not the canonical support plan of type {type} is enabled for the subscription. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-03-01

  • providerName - The support plan type. For now the only valid type is "canonical".
  • planTypeName - The Canonical support plan type.
  • options - SupportPlanTypesClientGetOptions contains the optional parameters for the SupportPlanTypesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/addons/resource-manager/Microsoft.Addons/preview/2018-03-01/examples/SupportPlanTypes_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/addons/armaddons"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armaddons.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSupportPlanTypesClient().Get(ctx, "Canonical", armaddons.PlanTypeNameStandard, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.CanonicalSupportPlanResponseEnvelope = armaddons.CanonicalSupportPlanResponseEnvelope{
	// 	Name: to.Ptr("Standard"),
	// 	Type: to.Ptr("Microsoft.Addons/supportProvider"),
	// 	ID: to.Ptr("subscriptions/d18d258f-bdba-4de1-8b51-e79d6c181d5e/providers/Microsoft.Addons/supportProviders/canonical/supportPlanTypes/Standard"),
	// 	Properties: &armaddons.CanonicalSupportPlanProperties{
	// 		ProvisioningState: to.Ptr(armaddons.ProvisioningStateSucceeded),
	// 	},
	// }
}
Output:

func (*SupportPlanTypesClient) ListInfo

ListInfo - Returns the canonical support plan information for all types for the subscription. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-03-01

  • options - SupportPlanTypesClientListInfoOptions contains the optional parameters for the SupportPlanTypesClient.ListInfo method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/163e27c0ca7570bc39e00a46f255740d9b3ba3cb/specification/addons/resource-manager/Microsoft.Addons/preview/2018-03-01/examples/CanonicalListSupportPlanInfo_Post.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/addons/armaddons"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armaddons.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSupportPlanTypesClient().ListInfo(ctx, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.CanonicalSupportPlanInfoDefinitionArray = []*armaddons.CanonicalSupportPlanInfoDefinition{
	// 	{
	// 		Enabled: to.Ptr(false),
	// 		OneTimeCharge: to.Ptr(armaddons.OneTimeChargeOnReenabled),
	// 		SupportPlanType: to.Ptr(armaddons.SupportPlanTypeStandard),
	// 	},
	// 	{
	// 		Enabled: to.Ptr(false),
	// 		OneTimeCharge: to.Ptr(armaddons.OneTimeChargeOnReenabled),
	// 		SupportPlanType: to.Ptr(armaddons.SupportPlanTypeAdvanced),
	// 	},
	// 	{
	// 		Enabled: to.Ptr(true),
	// 		OneTimeCharge: to.Ptr(armaddons.OneTimeChargeNo),
	// 		SupportPlanType: to.Ptr(armaddons.SupportPlanTypeEssential),
	// }}
}
Output:

type SupportPlanTypesClientBeginCreateOrUpdateOptions

type SupportPlanTypesClientBeginCreateOrUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SupportPlanTypesClientBeginCreateOrUpdateOptions contains the optional parameters for the SupportPlanTypesClient.BeginCreateOrUpdate method.

type SupportPlanTypesClientBeginDeleteOptions

type SupportPlanTypesClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SupportPlanTypesClientBeginDeleteOptions contains the optional parameters for the SupportPlanTypesClient.BeginDelete method.

type SupportPlanTypesClientCreateOrUpdateResponse

type SupportPlanTypesClientCreateOrUpdateResponse struct {
	// The status of the Canonical support plan.
	CanonicalSupportPlanResponseEnvelope
}

SupportPlanTypesClientCreateOrUpdateResponse contains the response from method SupportPlanTypesClient.BeginCreateOrUpdate.

type SupportPlanTypesClientDeleteResponse

type SupportPlanTypesClientDeleteResponse struct {
	// The status of the Canonical support plan.
	CanonicalSupportPlanResponseEnvelope
}

SupportPlanTypesClientDeleteResponse contains the response from method SupportPlanTypesClient.BeginDelete.

type SupportPlanTypesClientGetOptions

type SupportPlanTypesClientGetOptions struct {
}

SupportPlanTypesClientGetOptions contains the optional parameters for the SupportPlanTypesClient.Get method.

type SupportPlanTypesClientGetResponse

type SupportPlanTypesClientGetResponse struct {
	// The status of the Canonical support plan.
	CanonicalSupportPlanResponseEnvelope
}

SupportPlanTypesClientGetResponse contains the response from method SupportPlanTypesClient.Get.

type SupportPlanTypesClientListInfoOptions

type SupportPlanTypesClientListInfoOptions struct {
}

SupportPlanTypesClientListInfoOptions contains the optional parameters for the SupportPlanTypesClient.ListInfo method.

type SupportPlanTypesClientListInfoResponse

type SupportPlanTypesClientListInfoResponse struct {
	// The status of all Canonical support plans for a subscription.
	CanonicalSupportPlanInfoDefinitionArray []*CanonicalSupportPlanInfoDefinition
}

SupportPlanTypesClientListInfoResponse contains the response from method SupportPlanTypesClient.ListInfo.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL