armaddons

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2022 License: MIT Imports: 11 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

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.

Clients

Azure Addons modules consist of one or more clients. A client groups a set of related APIs, providing access to its functionality within the specified subscription. Create one or more clients to access the APIs you require using your credential.

client, err := armaddons.NewSupportPlanTypesClient(<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,
    },
}
client, err := armaddons.NewSupportPlanTypesClient(<subscription ID>, cred, &options)

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 `json:"enabled,omitempty"`

	// The one time charge status for the subscription.
	OneTimeCharge *OneTimeCharge `json:"oneTimeCharge,omitempty"`

	// Support plan type.
	SupportPlanType *SupportPlanType `json:"supportPlanType,omitempty"`
}

CanonicalSupportPlanInfoDefinition - Definition object with the properties of a canonical plan

type CanonicalSupportPlanProperties

type CanonicalSupportPlanProperties struct {
	// The provisioning state of the resource.
	ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"`
}

CanonicalSupportPlanProperties - The properties of the Canonical support plan.

type CanonicalSupportPlanResponseEnvelope

type CanonicalSupportPlanResponseEnvelope struct {
	// REQUIRED; Describes Canonical support plan type and status.
	Properties *CanonicalSupportPlanProperties `json:"properties,omitempty"`

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

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

	// READ-ONLY; Microsoft.Addons/supportProvider
	Type *string `json:"type,omitempty" azure:"ro"`
}

CanonicalSupportPlanResponseEnvelope - The status of the Canonical support plan.

type ErrorDefinition

type ErrorDefinition struct {
	// REQUIRED; Service specific error code which serves as the substatus for the HTTP error code.
	Code *string `json:"code,omitempty"`

	// REQUIRED; Description of the error.
	Message *string `json:"message,omitempty"`
}

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

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 `json:"value,omitempty"`
}

OperationListValue - List of supported operations.

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/tree/main/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()
	client, err := armaddons.NewOperationsClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.List(ctx,
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

type OperationsClientListOptions

type OperationsClientListOptions struct {
}

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

type OperationsClientListResponse

type OperationsClientListResponse struct {
	OperationListValue
}

OperationsClientListResponse contains the response from method OperationsClient.List.

type OperationsDefinition

type OperationsDefinition struct {
	// Display object with properties of the operation.
	Display *OperationsDisplayDefinition `json:"display,omitempty"`

	// Name of the operation.
	Name *string `json:"name,omitempty"`
}

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

type OperationsDisplayDefinition

type OperationsDisplayDefinition struct {
	// Description of the operation.
	Description *string `json:"description,omitempty"`

	// Short description of the operation.
	Operation *string `json:"operation,omitempty"`

	// Resource provider of the operation.
	Provider *string `json:"provider,omitempty"`

	// Resource for the operation.
	Resource *string `json:"resource,omitempty"`
}

OperationsDisplayDefinition - Display object with properties of the operation.

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/tree/main/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()
	client, err := armaddons.NewSupportPlanTypesClient("d18d258f-bdba-4de1-8b51-e79d6c181d5e", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.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)
	}
	// TODO: use response item
	_ = res
}
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/tree/main/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()
	client, err := armaddons.NewSupportPlanTypesClient("d18d258f-bdba-4de1-8b51-e79d6c181d5e", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.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/tree/main/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()
	client, err := armaddons.NewSupportPlanTypesClient("d18d258f-bdba-4de1-8b51-e79d6c181d5e", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Get(ctx,
		"Canonical",
		armaddons.PlanTypeNameStandard,
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
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/tree/main/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()
	client, err := armaddons.NewSupportPlanTypesClient("d18d258f-bdba-4de1-8b51-e79d6c181d5e", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.ListInfo(ctx,
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
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 {
	CanonicalSupportPlanResponseEnvelope
}

SupportPlanTypesClientCreateOrUpdateResponse contains the response from method SupportPlanTypesClient.CreateOrUpdate.

type SupportPlanTypesClientDeleteResponse

type SupportPlanTypesClientDeleteResponse struct {
	CanonicalSupportPlanResponseEnvelope
}

SupportPlanTypesClientDeleteResponse contains the response from method SupportPlanTypesClient.Delete.

type SupportPlanTypesClientGetOptions

type SupportPlanTypesClientGetOptions struct {
}

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

type SupportPlanTypesClientGetResponse

type SupportPlanTypesClientGetResponse struct {
	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.

Jump to

Keyboard shortcuts

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