armcustomproviders

package module
v0.7.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 Custom Providers Module for Go

PkgGoDev

The armcustomproviders module provides operations for working with Azure Custom Providers.

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 Custom Providers module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/customproviders/armcustomproviders

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Custom Providers. 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 Custom Providers 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 := armcustomproviders.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 := armcustomproviders.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.NewCustomResourceProviderClient()

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 Custom Providers 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 ActionRouting

type ActionRouting string

ActionRouting - The routing types that are supported for action requests.

const (
	ActionRoutingProxy ActionRouting = "Proxy"
)

func PossibleActionRoutingValues

func PossibleActionRoutingValues() []ActionRouting

PossibleActionRoutingValues returns the possible values for the ActionRouting const type.

type Association

type Association struct {
	// The properties of the association.
	Properties *AssociationProperties

	// READ-ONLY; The association id.
	ID *string

	// READ-ONLY; The association name.
	Name *string

	// READ-ONLY; The association type.
	Type *string
}

Association - The resource definition of this association.

func (Association) MarshalJSON added in v0.6.0

func (a Association) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Association.

func (*Association) UnmarshalJSON added in v0.6.0

func (a *Association) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Association.

type AssociationProperties

type AssociationProperties struct {
	// The REST resource instance of the target resource for this association.
	TargetResourceID *string

	// READ-ONLY; The provisioning state of the association.
	ProvisioningState *ProvisioningState
}

AssociationProperties - The properties of the association.

func (AssociationProperties) MarshalJSON added in v0.6.0

func (a AssociationProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AssociationProperties.

func (*AssociationProperties) UnmarshalJSON added in v0.6.0

func (a *AssociationProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AssociationProperties.

type AssociationsClient

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

AssociationsClient contains the methods for the Associations group. Don't use this type directly, use NewAssociationsClient() instead.

func NewAssociationsClient

func NewAssociationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*AssociationsClient, error)

NewAssociationsClient creates a new instance of AssociationsClient with the specified values.

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

func (*AssociationsClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Create or update an association. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-01-preview

  • scope - The scope of the association. The scope can be any valid REST resource instance. For example, use '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.Compute/virtualMachines/{vm-name}' for a virtual machine resource.
  • associationName - The name of the association.
  • association - The parameters required to create or update an association.
  • options - AssociationsClientBeginCreateOrUpdateOptions contains the optional parameters for the AssociationsClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/createOrUpdateAssociation.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/customproviders/armcustomproviders"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcustomproviders.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAssociationsClient().BeginCreateOrUpdate(ctx, "scope", "associationName", armcustomproviders.Association{
		Properties: &armcustomproviders.AssociationProperties{
			TargetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/appRG/providers/Microsoft.Solutions/applications/applicationName"),
		},
	}, 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.Association = armcustomproviders.Association{
	// 	Name: to.Ptr("associationName"),
	// 	Type: to.Ptr("Microsoft.CustomProviders/associations"),
	// 	ID: to.Ptr("/scope/providers/Microsoft.CustomProviders/associations/associationName"),
	// 	Properties: &armcustomproviders.AssociationProperties{
	// 		ProvisioningState: to.Ptr(armcustomproviders.ProvisioningStateSucceeded),
	// 		TargetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/appRG/providers/Microsoft.Solutions/applications/applicationName"),
	// 	},
	// }
}
Output:

func (*AssociationsClient) BeginDelete

BeginDelete - Delete an association. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-01-preview

  • scope - The scope of the association.
  • associationName - The name of the association.
  • options - AssociationsClientBeginDeleteOptions contains the optional parameters for the AssociationsClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/deleteAssociation.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/customproviders/armcustomproviders"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcustomproviders.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAssociationsClient().BeginDelete(ctx, "scope", "associationName", 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 (*AssociationsClient) Get

Get - Get an association. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-01-preview

  • scope - The scope of the association.
  • associationName - The name of the association.
  • options - AssociationsClientGetOptions contains the optional parameters for the AssociationsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAssociation.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/customproviders/armcustomproviders"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcustomproviders.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAssociationsClient().Get(ctx, "scope", "associationName", 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.Association = armcustomproviders.Association{
	// 	Name: to.Ptr("associationName"),
	// 	Type: to.Ptr("Microsoft.CustomProviders/associations"),
	// 	ID: to.Ptr("scope/providers/Microsoft.CustomProviders/associations/associationName"),
	// 	Properties: &armcustomproviders.AssociationProperties{
	// 		ProvisioningState: to.Ptr(armcustomproviders.ProvisioningStateSucceeded),
	// 		TargetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/appRG/providers/Microsoft.Solutions/applications/applicationName"),
	// 	},
	// }
}
Output:

func (*AssociationsClient) NewListAllPager added in v0.4.0

NewListAllPager - Gets all association for the given scope.

Generated from API version 2018-09-01-preview

  • scope - The scope of the association.
  • options - AssociationsClientListAllOptions contains the optional parameters for the AssociationsClient.NewListAllPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAllAssociations.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/customproviders/armcustomproviders"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcustomproviders.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAssociationsClient().NewListAllPager("scope", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.AssociationsList = armcustomproviders.AssociationsList{
		// 	Value: []*armcustomproviders.Association{
		// 		{
		// 			Name: to.Ptr("associationName"),
		// 			Type: to.Ptr("Microsoft.CustomProviders/associations"),
		// 			ID: to.Ptr("scope/providers/Microsoft.CustomProviders/associations/associationName"),
		// 			Properties: &armcustomproviders.AssociationProperties{
		// 				ProvisioningState: to.Ptr(armcustomproviders.ProvisioningStateSucceeded),
		// 				TargetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/appRG/providers/Microsoft.Solutions/applications/applicationName"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type AssociationsClientBeginCreateOrUpdateOptions added in v0.2.0

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

AssociationsClientBeginCreateOrUpdateOptions contains the optional parameters for the AssociationsClient.BeginCreateOrUpdate method.

type AssociationsClientBeginDeleteOptions added in v0.2.0

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

AssociationsClientBeginDeleteOptions contains the optional parameters for the AssociationsClient.BeginDelete method.

type AssociationsClientCreateOrUpdateResponse added in v0.2.0

type AssociationsClientCreateOrUpdateResponse struct {
	// The resource definition of this association.
	Association
}

AssociationsClientCreateOrUpdateResponse contains the response from method AssociationsClient.BeginCreateOrUpdate.

type AssociationsClientDeleteResponse added in v0.2.0

type AssociationsClientDeleteResponse struct {
}

AssociationsClientDeleteResponse contains the response from method AssociationsClient.BeginDelete.

type AssociationsClientGetOptions added in v0.2.0

type AssociationsClientGetOptions struct {
}

AssociationsClientGetOptions contains the optional parameters for the AssociationsClient.Get method.

type AssociationsClientGetResponse added in v0.2.0

type AssociationsClientGetResponse struct {
	// The resource definition of this association.
	Association
}

AssociationsClientGetResponse contains the response from method AssociationsClient.Get.

type AssociationsClientListAllOptions added in v0.2.0

type AssociationsClientListAllOptions struct {
}

AssociationsClientListAllOptions contains the optional parameters for the AssociationsClient.NewListAllPager method.

type AssociationsClientListAllResponse added in v0.2.0

type AssociationsClientListAllResponse struct {
	// List of associations.
	AssociationsList
}

AssociationsClientListAllResponse contains the response from method AssociationsClient.NewListAllPager.

type AssociationsList

type AssociationsList struct {
	// The URL to use for getting the next set of results.
	NextLink *string

	// The array of associations.
	Value []*Association
}

AssociationsList - List of associations.

func (AssociationsList) MarshalJSON

func (a AssociationsList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AssociationsList.

func (*AssociationsList) UnmarshalJSON added in v0.6.0

func (a *AssociationsList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AssociationsList.

type ClientFactory added in v0.6.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.6.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 - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ClientFactory) NewAssociationsClient added in v0.6.0

func (c *ClientFactory) NewAssociationsClient() *AssociationsClient

NewAssociationsClient creates a new instance of AssociationsClient.

func (*ClientFactory) NewCustomResourceProviderClient added in v0.6.0

func (c *ClientFactory) NewCustomResourceProviderClient() *CustomResourceProviderClient

NewCustomResourceProviderClient creates a new instance of CustomResourceProviderClient.

func (*ClientFactory) NewOperationsClient added in v0.6.0

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

type CustomRPActionRouteDefinition

type CustomRPActionRouteDefinition struct {
	// REQUIRED; The route definition endpoint URI that the custom resource provider will proxy requests to. This can be in the
	// form of a flat URI (e.g. 'https://testendpoint/') or can specify to route via a path
	// (e.g. 'https://testendpoint/{requestPath}')
	Endpoint *string

	// REQUIRED; The name of the route definition. This becomes the name for the ARM extension (e.g.
	// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/{name}')
	Name *string

	// The routing types that are supported for action requests.
	RoutingType *ActionRouting
}

CustomRPActionRouteDefinition - The route definition for an action implemented by the custom resource provider.

func (CustomRPActionRouteDefinition) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type CustomRPActionRouteDefinition.

func (*CustomRPActionRouteDefinition) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type CustomRPActionRouteDefinition.

type CustomRPManifest

type CustomRPManifest struct {
	// REQUIRED; Resource location
	Location *string

	// The manifest for the custom resource provider
	Properties *CustomRPManifestProperties

	// Resource tags
	Tags map[string]*string

	// READ-ONLY; Resource Id
	ID *string

	// READ-ONLY; Resource name
	Name *string

	// READ-ONLY; Resource type
	Type *string
}

CustomRPManifest - A manifest file that defines the custom resource provider resources.

func (CustomRPManifest) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CustomRPManifest.

func (*CustomRPManifest) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type CustomRPManifest.

type CustomRPManifestProperties

type CustomRPManifestProperties struct {
	// A list of actions that the custom resource provider implements.
	Actions []*CustomRPActionRouteDefinition

	// A list of resource types that the custom resource provider implements.
	ResourceTypes []*CustomRPResourceTypeRouteDefinition

	// A list of validations to run on the custom resource provider's requests.
	Validations []*CustomRPValidations

	// READ-ONLY; The provisioning state of the resource provider.
	ProvisioningState *ProvisioningState
}

CustomRPManifestProperties - The manifest for the custom resource provider

func (CustomRPManifestProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CustomRPManifestProperties.

func (*CustomRPManifestProperties) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type CustomRPManifestProperties.

type CustomRPResourceTypeRouteDefinition

type CustomRPResourceTypeRouteDefinition struct {
	// REQUIRED; The route definition endpoint URI that the custom resource provider will proxy requests to. This can be in the
	// form of a flat URI (e.g. 'https://testendpoint/') or can specify to route via a path
	// (e.g. 'https://testendpoint/{requestPath}')
	Endpoint *string

	// REQUIRED; The name of the route definition. This becomes the name for the ARM extension (e.g.
	// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/{name}')
	Name *string

	// The routing types that are supported for resource requests.
	RoutingType *ResourceTypeRouting
}

CustomRPResourceTypeRouteDefinition - The route definition for a resource implemented by the custom resource provider.

func (CustomRPResourceTypeRouteDefinition) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type CustomRPResourceTypeRouteDefinition.

func (*CustomRPResourceTypeRouteDefinition) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type CustomRPResourceTypeRouteDefinition.

type CustomRPRouteDefinition

type CustomRPRouteDefinition struct {
	// REQUIRED; The route definition endpoint URI that the custom resource provider will proxy requests to. This can be in the
	// form of a flat URI (e.g. 'https://testendpoint/') or can specify to route via a path
	// (e.g. 'https://testendpoint/{requestPath}')
	Endpoint *string

	// REQUIRED; The name of the route definition. This becomes the name for the ARM extension (e.g.
	// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/{name}')
	Name *string
}

CustomRPRouteDefinition - A route definition that defines an action or resource that can be interacted with through the custom resource provider.

func (CustomRPRouteDefinition) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type CustomRPRouteDefinition.

func (*CustomRPRouteDefinition) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type CustomRPRouteDefinition.

type CustomRPValidations

type CustomRPValidations struct {
	// REQUIRED; A link to the validation specification. The specification must be hosted on raw.githubusercontent.com.
	Specification *string

	// The type of validation to run against a matching request.
	ValidationType *ValidationType
}

CustomRPValidations - A validation to apply on custom resource provider requests.

func (CustomRPValidations) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type CustomRPValidations.

func (*CustomRPValidations) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type CustomRPValidations.

type CustomResourceProviderClient

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

CustomResourceProviderClient contains the methods for the CustomResourceProvider group. Don't use this type directly, use NewCustomResourceProviderClient() instead.

func NewCustomResourceProviderClient

func NewCustomResourceProviderClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CustomResourceProviderClient, error)

NewCustomResourceProviderClient creates a new instance of CustomResourceProviderClient with the specified values.

  • subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*CustomResourceProviderClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Creates or updates the custom resource provider. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-01-preview

  • resourceGroupName - The name of the resource group.
  • resourceProviderName - The name of the resource provider.
  • resourceProvider - The parameters required to create or update a custom resource provider definition.
  • options - CustomResourceProviderClientBeginCreateOrUpdateOptions contains the optional parameters for the CustomResourceProviderClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/createOrUpdateCustomRP.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/customproviders/armcustomproviders"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcustomproviders.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewCustomResourceProviderClient().BeginCreateOrUpdate(ctx, "testRG", "newrp", armcustomproviders.CustomRPManifest{
		Location: to.Ptr("eastus"),
		Properties: &armcustomproviders.CustomRPManifestProperties{
			Actions: []*armcustomproviders.CustomRPActionRouteDefinition{
				{
					Name:        to.Ptr("TestAction"),
					Endpoint:    to.Ptr("https://mytestendpoint/"),
					RoutingType: to.Ptr(armcustomproviders.ActionRoutingProxy),
				}},
			ResourceTypes: []*armcustomproviders.CustomRPResourceTypeRouteDefinition{
				{
					Name:        to.Ptr("TestResource"),
					Endpoint:    to.Ptr("https://mytestendpoint2/"),
					RoutingType: to.Ptr(armcustomproviders.ResourceTypeRoutingProxyCache),
				}},
		},
	}, 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.CustomRPManifest = armcustomproviders.CustomRPManifest{
	// 	Name: to.Ptr("newrp"),
	// 	Type: to.Ptr("Microsoft.CustomProviders/resourceProviders"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.CustomProviders/resourceProviders/newrp"),
	// 	Location: to.Ptr("East US"),
	// 	Properties: &armcustomproviders.CustomRPManifestProperties{
	// 		Actions: []*armcustomproviders.CustomRPActionRouteDefinition{
	// 			{
	// 				Name: to.Ptr("TestAction"),
	// 				Endpoint: to.Ptr("https://mytestendpoint/"),
	// 				RoutingType: to.Ptr(armcustomproviders.ActionRoutingProxy),
	// 		}},
	// 		ProvisioningState: to.Ptr(armcustomproviders.ProvisioningStateSucceeded),
	// 		ResourceTypes: []*armcustomproviders.CustomRPResourceTypeRouteDefinition{
	// 			{
	// 				Name: to.Ptr("TestResource"),
	// 				Endpoint: to.Ptr("https://mytestendpoint2/"),
	// 				RoutingType: to.Ptr(armcustomproviders.ResourceTypeRoutingProxyCache),
	// 		}},
	// 	},
	// }
}
Output:

func (*CustomResourceProviderClient) BeginDelete

BeginDelete - Deletes the custom resource provider. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-01-preview

  • resourceGroupName - The name of the resource group.
  • resourceProviderName - The name of the resource provider.
  • options - CustomResourceProviderClientBeginDeleteOptions contains the optional parameters for the CustomResourceProviderClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/deleteCustomRP.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/customproviders/armcustomproviders"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcustomproviders.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewCustomResourceProviderClient().BeginDelete(ctx, "testRG", "newrp", 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 (*CustomResourceProviderClient) Get

Get - Gets the custom resource provider manifest. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-01-preview

  • resourceGroupName - The name of the resource group.
  • resourceProviderName - The name of the resource provider.
  • options - CustomResourceProviderClientGetOptions contains the optional parameters for the CustomResourceProviderClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getCustomRP.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/customproviders/armcustomproviders"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcustomproviders.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewCustomResourceProviderClient().Get(ctx, "testRG", "newrp", 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.CustomRPManifest = armcustomproviders.CustomRPManifest{
	// 	Name: to.Ptr("newrp"),
	// 	Type: to.Ptr("Microsoft.CustomProviders/resourceProviders"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.CustomProviders/resourceProviders/newrp"),
	// 	Location: to.Ptr("East US"),
	// 	Properties: &armcustomproviders.CustomRPManifestProperties{
	// 		Actions: []*armcustomproviders.CustomRPActionRouteDefinition{
	// 			{
	// 				Name: to.Ptr("TestAction"),
	// 				Endpoint: to.Ptr("https://mytestendpoint/"),
	// 				RoutingType: to.Ptr(armcustomproviders.ActionRoutingProxy),
	// 		}},
	// 		ProvisioningState: to.Ptr(armcustomproviders.ProvisioningStateSucceeded),
	// 		ResourceTypes: []*armcustomproviders.CustomRPResourceTypeRouteDefinition{
	// 			{
	// 				Name: to.Ptr("TestResource"),
	// 				Endpoint: to.Ptr("https://mytestendpoint2/"),
	// 				RoutingType: to.Ptr(armcustomproviders.ResourceTypeRoutingProxyCache),
	// 		}},
	// 	},
	// }
}
Output:

func (*CustomResourceProviderClient) NewListByResourceGroupPager added in v0.4.0

NewListByResourceGroupPager - Gets all the custom resource providers within a resource group.

Generated from API version 2018-09-01-preview

  • resourceGroupName - The name of the resource group.
  • options - CustomResourceProviderClientListByResourceGroupOptions contains the optional parameters for the CustomResourceProviderClient.NewListByResourceGroupPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/listCustomRPsByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/customproviders/armcustomproviders"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcustomproviders.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewCustomResourceProviderClient().NewListByResourceGroupPager("testRG", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.ListByCustomRPManifest = armcustomproviders.ListByCustomRPManifest{
		// 	Value: []*armcustomproviders.CustomRPManifest{
		// 		{
		// 			Name: to.Ptr("newrp1"),
		// 			Type: to.Ptr("Microsoft.CustomProviders/resourceProviders"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.CustomProviders/resourceProviders/newrp1"),
		// 			Location: to.Ptr("East US"),
		// 			Properties: &armcustomproviders.CustomRPManifestProperties{
		// 				Actions: []*armcustomproviders.CustomRPActionRouteDefinition{
		// 					{
		// 						Name: to.Ptr("TestAction"),
		// 						Endpoint: to.Ptr("https://mytestendpoint/"),
		// 						RoutingType: to.Ptr(armcustomproviders.ActionRoutingProxy),
		// 				}},
		// 				ProvisioningState: to.Ptr(armcustomproviders.ProvisioningStateSucceeded),
		// 				ResourceTypes: []*armcustomproviders.CustomRPResourceTypeRouteDefinition{
		// 					{
		// 						Name: to.Ptr("TestResource"),
		// 						Endpoint: to.Ptr("https://mytestendpoint2/"),
		// 						RoutingType: to.Ptr(armcustomproviders.ResourceTypeRoutingProxyCache),
		// 				}},
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("newrp2"),
		// 			Type: to.Ptr("Microsoft.CustomProviders/resourceProviders"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.CustomProviders/resourceProviders/newrp2"),
		// 			Location: to.Ptr("East US"),
		// 			Properties: &armcustomproviders.CustomRPManifestProperties{
		// 				Actions: []*armcustomproviders.CustomRPActionRouteDefinition{
		// 					{
		// 						Name: to.Ptr("TestAction"),
		// 						Endpoint: to.Ptr("https://mytestendpoint/"),
		// 						RoutingType: to.Ptr(armcustomproviders.ActionRoutingProxy),
		// 				}},
		// 				ProvisioningState: to.Ptr(armcustomproviders.ProvisioningStateSucceeded),
		// 				ResourceTypes: []*armcustomproviders.CustomRPResourceTypeRouteDefinition{
		// 					{
		// 						Name: to.Ptr("TestResource"),
		// 						Endpoint: to.Ptr("https://mytestendpoint2/"),
		// 						RoutingType: to.Ptr(armcustomproviders.ResourceTypeRoutingProxyCache),
		// 				}},
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*CustomResourceProviderClient) NewListBySubscriptionPager added in v0.4.0

NewListBySubscriptionPager - Gets all the custom resource providers within a subscription.

Generated from API version 2018-09-01-preview

  • options - CustomResourceProviderClientListBySubscriptionOptions contains the optional parameters for the CustomResourceProviderClient.NewListBySubscriptionPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/listCustomRPsBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/customproviders/armcustomproviders"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcustomproviders.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewCustomResourceProviderClient().NewListBySubscriptionPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.ListByCustomRPManifest = armcustomproviders.ListByCustomRPManifest{
		// 	Value: []*armcustomproviders.CustomRPManifest{
		// 		{
		// 			Name: to.Ptr("newrp1"),
		// 			Type: to.Ptr("Microsoft.CustomProviders/resourceProviders"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.CustomProviders/resourceProviders/newrp1"),
		// 			Location: to.Ptr("East US"),
		// 			Properties: &armcustomproviders.CustomRPManifestProperties{
		// 				Actions: []*armcustomproviders.CustomRPActionRouteDefinition{
		// 					{
		// 						Name: to.Ptr("TestAction"),
		// 						Endpoint: to.Ptr("https://mytestendpoint/"),
		// 						RoutingType: to.Ptr(armcustomproviders.ActionRoutingProxy),
		// 				}},
		// 				ProvisioningState: to.Ptr(armcustomproviders.ProvisioningStateSucceeded),
		// 				ResourceTypes: []*armcustomproviders.CustomRPResourceTypeRouteDefinition{
		// 					{
		// 						Name: to.Ptr("TestResource"),
		// 						Endpoint: to.Ptr("https://mytestendpoint2/"),
		// 						RoutingType: to.Ptr(armcustomproviders.ResourceTypeRoutingProxyCache),
		// 				}},
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("newrp2"),
		// 			Type: to.Ptr("Microsoft.CustomProviders/resourceProviders"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG2/providers/Microsoft.CustomProviders/resourceProviders/newrp2"),
		// 			Location: to.Ptr("East US"),
		// 			Properties: &armcustomproviders.CustomRPManifestProperties{
		// 				Actions: []*armcustomproviders.CustomRPActionRouteDefinition{
		// 					{
		// 						Name: to.Ptr("TestAction"),
		// 						Endpoint: to.Ptr("https://mytestendpoint/"),
		// 						RoutingType: to.Ptr(armcustomproviders.ActionRoutingProxy),
		// 				}},
		// 				ProvisioningState: to.Ptr(armcustomproviders.ProvisioningStateSucceeded),
		// 				ResourceTypes: []*armcustomproviders.CustomRPResourceTypeRouteDefinition{
		// 					{
		// 						Name: to.Ptr("TestResource"),
		// 						Endpoint: to.Ptr("https://mytestendpoint2/"),
		// 						RoutingType: to.Ptr(armcustomproviders.ResourceTypeRoutingProxyCache),
		// 				}},
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*CustomResourceProviderClient) Update

func (client *CustomResourceProviderClient) Update(ctx context.Context, resourceGroupName string, resourceProviderName string, patchableResource ResourceProvidersUpdate, options *CustomResourceProviderClientUpdateOptions) (CustomResourceProviderClientUpdateResponse, error)

Update - Updates an existing custom resource provider. The only value that can be updated via PATCH currently is the tags. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-01-preview

  • resourceGroupName - The name of the resource group.
  • resourceProviderName - The name of the resource provider.
  • patchableResource - The updatable fields of a custom resource provider.
  • options - CustomResourceProviderClientUpdateOptions contains the optional parameters for the CustomResourceProviderClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/updateCustomRP.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/customproviders/armcustomproviders"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcustomproviders.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewCustomResourceProviderClient().Update(ctx, "testRG", "newrp", armcustomproviders.ResourceProvidersUpdate{
		Tags: map[string]*string{},
	}, 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.CustomRPManifest = armcustomproviders.CustomRPManifest{
	// 	Name: to.Ptr("newrp"),
	// 	Type: to.Ptr("Microsoft.CustomProviders/resourceProviders"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.CustomProviders/resourceProviders/newrp"),
	// 	Location: to.Ptr("East US"),
	// 	Properties: &armcustomproviders.CustomRPManifestProperties{
	// 		Actions: []*armcustomproviders.CustomRPActionRouteDefinition{
	// 			{
	// 				Name: to.Ptr("TestAction"),
	// 				Endpoint: to.Ptr("https://mytestendpoint/"),
	// 				RoutingType: to.Ptr(armcustomproviders.ActionRoutingProxy),
	// 		}},
	// 		ProvisioningState: to.Ptr(armcustomproviders.ProvisioningStateSucceeded),
	// 		ResourceTypes: []*armcustomproviders.CustomRPResourceTypeRouteDefinition{
	// 			{
	// 				Name: to.Ptr("TestResource"),
	// 				Endpoint: to.Ptr("https://mytestendpoint2/"),
	// 				RoutingType: to.Ptr(armcustomproviders.ResourceTypeRoutingProxyCache),
	// 		}},
	// 	},
	// }
}
Output:

type CustomResourceProviderClientBeginCreateOrUpdateOptions added in v0.2.0

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

CustomResourceProviderClientBeginCreateOrUpdateOptions contains the optional parameters for the CustomResourceProviderClient.BeginCreateOrUpdate method.

type CustomResourceProviderClientBeginDeleteOptions added in v0.2.0

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

CustomResourceProviderClientBeginDeleteOptions contains the optional parameters for the CustomResourceProviderClient.BeginDelete method.

type CustomResourceProviderClientCreateOrUpdateResponse added in v0.2.0

type CustomResourceProviderClientCreateOrUpdateResponse struct {
	// A manifest file that defines the custom resource provider resources.
	CustomRPManifest
}

CustomResourceProviderClientCreateOrUpdateResponse contains the response from method CustomResourceProviderClient.BeginCreateOrUpdate.

type CustomResourceProviderClientDeleteResponse added in v0.2.0

type CustomResourceProviderClientDeleteResponse struct {
}

CustomResourceProviderClientDeleteResponse contains the response from method CustomResourceProviderClient.BeginDelete.

type CustomResourceProviderClientGetOptions added in v0.2.0

type CustomResourceProviderClientGetOptions struct {
}

CustomResourceProviderClientGetOptions contains the optional parameters for the CustomResourceProviderClient.Get method.

type CustomResourceProviderClientGetResponse added in v0.2.0

type CustomResourceProviderClientGetResponse struct {
	// A manifest file that defines the custom resource provider resources.
	CustomRPManifest
}

CustomResourceProviderClientGetResponse contains the response from method CustomResourceProviderClient.Get.

type CustomResourceProviderClientListByResourceGroupOptions added in v0.2.0

type CustomResourceProviderClientListByResourceGroupOptions struct {
}

CustomResourceProviderClientListByResourceGroupOptions contains the optional parameters for the CustomResourceProviderClient.NewListByResourceGroupPager method.

type CustomResourceProviderClientListByResourceGroupResponse added in v0.2.0

type CustomResourceProviderClientListByResourceGroupResponse struct {
	// List of custom resource providers.
	ListByCustomRPManifest
}

CustomResourceProviderClientListByResourceGroupResponse contains the response from method CustomResourceProviderClient.NewListByResourceGroupPager.

type CustomResourceProviderClientListBySubscriptionOptions added in v0.2.0

type CustomResourceProviderClientListBySubscriptionOptions struct {
}

CustomResourceProviderClientListBySubscriptionOptions contains the optional parameters for the CustomResourceProviderClient.NewListBySubscriptionPager method.

type CustomResourceProviderClientListBySubscriptionResponse added in v0.2.0

type CustomResourceProviderClientListBySubscriptionResponse struct {
	// List of custom resource providers.
	ListByCustomRPManifest
}

CustomResourceProviderClientListBySubscriptionResponse contains the response from method CustomResourceProviderClient.NewListBySubscriptionPager.

type CustomResourceProviderClientUpdateOptions added in v0.2.0

type CustomResourceProviderClientUpdateOptions struct {
}

CustomResourceProviderClientUpdateOptions contains the optional parameters for the CustomResourceProviderClient.Update method.

type CustomResourceProviderClientUpdateResponse added in v0.2.0

type CustomResourceProviderClientUpdateResponse struct {
	// A manifest file that defines the custom resource provider resources.
	CustomRPManifest
}

CustomResourceProviderClientUpdateResponse contains the response from method CustomResourceProviderClient.Update.

type ErrorDefinition

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

	// READ-ONLY; Internal error details.
	Details []*ErrorDefinition

	// READ-ONLY; Description of the error.
	Message *string
}

ErrorDefinition - Error definition.

func (ErrorDefinition) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ErrorDefinition.

func (*ErrorDefinition) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDefinition.

type ErrorResponse

type ErrorResponse struct {
	// The error details.
	Error *ErrorDefinition
}

ErrorResponse - Error response.

func (ErrorResponse) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type ErrorResponse.

func (*ErrorResponse) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse.

type ListByCustomRPManifest

type ListByCustomRPManifest struct {
	// The URL to use for getting the next set of results.
	NextLink *string

	// The array of custom resource provider manifests.
	Value []*CustomRPManifest
}

ListByCustomRPManifest - List of custom resource providers.

func (ListByCustomRPManifest) MarshalJSON

func (l ListByCustomRPManifest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ListByCustomRPManifest.

func (*ListByCustomRPManifest) UnmarshalJSON added in v0.6.0

func (l *ListByCustomRPManifest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ListByCustomRPManifest.

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) NewListPager added in v0.4.0

NewListPager - The list of operations provided by Microsoft CustomProviders.

Generated from API version 2018-09-01-preview

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

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/operationsList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/customproviders/armcustomproviders"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcustomproviders.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewOperationsClient().NewListPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.ResourceProviderOperationList = armcustomproviders.ResourceProviderOperationList{
		// 	Value: []*armcustomproviders.ResourceProviderOperation{
		// 		{
		// 			Name: to.Ptr("Microsoft.CustomProviders/resourceProviders/read"),
		// 			Display: &armcustomproviders.ResourceProviderOperationDisplay{
		// 				Description: to.Ptr("List or get the Custom Providers"),
		// 				Operation: to.Ptr("List Custom Providers"),
		// 				Provider: to.Ptr("Azure Custom Providers"),
		// 				Resource: to.Ptr("resourceProviders"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.CustomProviders/resourceProviders/delete"),
		// 			Display: &armcustomproviders.ResourceProviderOperationDisplay{
		// 				Description: to.Ptr("List or get the Custom Providers"),
		// 				Operation: to.Ptr("List Custom Providers"),
		// 				Provider: to.Ptr("Azure Custom Providers"),
		// 				Resource: to.Ptr("resourceProviders"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.CustomProviders/resourceProviders/wrte"),
		// 			Display: &armcustomproviders.ResourceProviderOperationDisplay{
		// 				Description: to.Ptr("List or get the Custom Providers"),
		// 				Operation: to.Ptr("List Custom Providers"),
		// 				Provider: to.Ptr("Azure Custom Providers"),
		// 				Resource: to.Ptr("resourceProviders"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type OperationsClientListOptions added in v0.2.0

type OperationsClientListOptions struct {
}

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

type OperationsClientListResponse added in v0.2.0

type OperationsClientListResponse struct {
	// Results of the request to list operations.
	ResourceProviderOperationList
}

OperationsClientListResponse contains the response from method OperationsClient.NewListPager.

type ProvisioningState

type ProvisioningState string

ProvisioningState - The provisioning state of the resource provider.

const (
	ProvisioningStateAccepted  ProvisioningState = "Accepted"
	ProvisioningStateDeleting  ProvisioningState = "Deleting"
	ProvisioningStateFailed    ProvisioningState = "Failed"
	ProvisioningStateRunning   ProvisioningState = "Running"
	ProvisioningStateSucceeded ProvisioningState = "Succeeded"
)

func PossibleProvisioningStateValues

func PossibleProvisioningStateValues() []ProvisioningState

PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.

type Resource

type Resource struct {
	// REQUIRED; Resource location
	Location *string

	// Resource tags
	Tags map[string]*string

	// READ-ONLY; Resource Id
	ID *string

	// READ-ONLY; Resource name
	Name *string

	// READ-ONLY; Resource type
	Type *string
}

Resource - The resource definition.

func (Resource) MarshalJSON

func (r Resource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Resource.

func (*Resource) UnmarshalJSON added in v0.6.0

func (r *Resource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Resource.

type ResourceProviderOperation

type ResourceProviderOperation struct {
	// Display metadata associated with the operation.
	Display *ResourceProviderOperationDisplay

	// Operation name, in format of {provider}/{resource}/{operation}
	Name *string
}

ResourceProviderOperation - Supported operations of this resource provider.

func (ResourceProviderOperation) MarshalJSON added in v0.6.0

func (r ResourceProviderOperation) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ResourceProviderOperation.

func (*ResourceProviderOperation) UnmarshalJSON added in v0.6.0

func (r *ResourceProviderOperation) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderOperation.

type ResourceProviderOperationDisplay

type ResourceProviderOperationDisplay struct {
	// Description of this operation.
	Description *string

	// Type of operation: get, read, delete, etc.
	Operation *string

	// Resource provider: Microsoft Custom Providers.
	Provider *string

	// Resource on which the operation is performed.
	Resource *string
}

ResourceProviderOperationDisplay - Display metadata associated with the operation.

func (ResourceProviderOperationDisplay) MarshalJSON added in v0.6.0

func (r ResourceProviderOperationDisplay) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ResourceProviderOperationDisplay.

func (*ResourceProviderOperationDisplay) UnmarshalJSON added in v0.6.0

func (r *ResourceProviderOperationDisplay) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderOperationDisplay.

type ResourceProviderOperationList

type ResourceProviderOperationList struct {
	// The URL to use for getting the next set of results.
	NextLink *string

	// List of operations supported by this resource provider.
	Value []*ResourceProviderOperation
}

ResourceProviderOperationList - Results of the request to list operations.

func (ResourceProviderOperationList) MarshalJSON

func (r ResourceProviderOperationList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ResourceProviderOperationList.

func (*ResourceProviderOperationList) UnmarshalJSON added in v0.6.0

func (r *ResourceProviderOperationList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderOperationList.

type ResourceProvidersUpdate

type ResourceProvidersUpdate struct {
	// Resource tags
	Tags map[string]*string
}

ResourceProvidersUpdate - custom resource provider update information.

func (ResourceProvidersUpdate) MarshalJSON

func (r ResourceProvidersUpdate) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ResourceProvidersUpdate.

func (*ResourceProvidersUpdate) UnmarshalJSON added in v0.6.0

func (r *ResourceProvidersUpdate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProvidersUpdate.

type ResourceTypeRouting

type ResourceTypeRouting string

ResourceTypeRouting - The routing types that are supported for resource requests.

const (
	ResourceTypeRoutingProxy      ResourceTypeRouting = "Proxy"
	ResourceTypeRoutingProxyCache ResourceTypeRouting = "Proxy,Cache"
)

func PossibleResourceTypeRoutingValues

func PossibleResourceTypeRoutingValues() []ResourceTypeRouting

PossibleResourceTypeRoutingValues returns the possible values for the ResourceTypeRouting const type.

type ValidationType

type ValidationType string

ValidationType - The type of validation to run against a matching request.

const (
	ValidationTypeSwagger ValidationType = "Swagger"
)

func PossibleValidationTypeValues

func PossibleValidationTypeValues() []ValidationType

PossibleValidationTypeValues returns the possible values for the ValidationType const type.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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