armlinks

package module
v1.2.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

PkgGoDev

The armlinks module provides operations for working with Azure Resource Links.

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 Resource Links module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armlinks

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Resource Links. 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 Resource Links 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 := armlinks.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 := armlinks.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.NewResourceLinksClient()

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 Resource Links 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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientFactory added in v1.1.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 v1.1.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 ID of the target subscription.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ClientFactory) NewOperationsClient added in v1.1.0

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

func (*ClientFactory) NewResourceLinksClient added in v1.1.0

func (c *ClientFactory) NewResourceLinksClient() *ResourceLinksClient

NewResourceLinksClient creates a new instance of ResourceLinksClient.

type Operation

type Operation struct {
	// The object that represents the operation.
	Display *OperationDisplay

	// Operation name: {provider}/{resource}/{operation}
	Name *string
}

Operation - Microsoft.Resources operation

func (Operation) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type Operation.

func (*Operation) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Operation.

type OperationDisplay

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

	// Operation type: Read, write, delete, etc.
	Operation *string

	// Service provider: Microsoft.Resources
	Provider *string

	// Resource on which the operation is performed: Profile, endpoint, etc.
	Resource *string
}

OperationDisplay - The object that represents the operation.

func (OperationDisplay) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type OperationDisplay.

func (*OperationDisplay) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.

type OperationListResult

type OperationListResult struct {
	// URL to get the next set of operation list results if there are any.
	NextLink *string

	// List of Microsoft.Resources operations.
	Value []*Operation
}

OperationListResult - Result of the request to list Microsoft.Resources operations. It contains a list of operations and a URL link to get the next set of results.

func (OperationListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationListResult.

func (*OperationListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.

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 - Lists all of the available Microsoft.Resources REST API operations.

Generated from API version 2016-09-01

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

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 {
	// Result of the request to list Microsoft.Resources operations. It contains a list of operations and a URL link to get the
	// next set of results.
	OperationListResult
}

OperationsClientListResponse contains the response from method OperationsClient.NewListPager.

type ResourceLink struct {
	// Properties for resource link.
	Properties *ResourceLinkProperties

	// READ-ONLY; The fully qualified ID of the resource link.
	ID *string

	// READ-ONLY; The name of the resource link.
	Name *string

	// READ-ONLY; The resource link object.
	Type any
}

ResourceLink - The resource link.

func (ResourceLink) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ResourceLink.

func (*ResourceLink) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceLink.

type ResourceLinkFilter

type ResourceLinkFilter struct {
	// REQUIRED; The ID of the target resource.
	TargetID *string
}

ResourceLinkFilter - Resource link filter.

func (ResourceLinkFilter) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ResourceLinkFilter.

func (*ResourceLinkFilter) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceLinkFilter.

type ResourceLinkProperties

type ResourceLinkProperties struct {
	// REQUIRED; The fully qualified ID of the target resource in the link.
	TargetID *string

	// Notes about the resource link.
	Notes *string

	// READ-ONLY; The fully qualified ID of the source resource in the link.
	SourceID *string
}

ResourceLinkProperties - The resource link properties.

func (ResourceLinkProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ResourceLinkProperties.

func (*ResourceLinkProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceLinkProperties.

type ResourceLinkResult

type ResourceLinkResult struct {
	// REQUIRED; An array of resource links.
	Value []*ResourceLink

	// READ-ONLY; The URL to use for getting the next set of results.
	NextLink *string
}

ResourceLinkResult - List of resource links.

func (ResourceLinkResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ResourceLinkResult.

func (*ResourceLinkResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceLinkResult.

type ResourceLinksClient

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

ResourceLinksClient contains the methods for the ResourceLinks group. Don't use this type directly, use NewResourceLinksClient() instead.

func NewResourceLinksClient

func NewResourceLinksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ResourceLinksClient, error)

NewResourceLinksClient creates a new instance of ResourceLinksClient with the specified values.

  • subscriptionID - The ID of the target subscription.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ResourceLinksClient) CreateOrUpdate

CreateOrUpdate - Creates or updates a resource link between the specified resources. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2016-09-01

  • linkID - The fully qualified ID of the resource link. Use the format, /subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/{provider-namespace}/{resource-type}/{resource-name}/Microsoft.Resources/links/{link-name}. For example, /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup/Microsoft.Web/sites/mySite/Microsoft.Resources/links/myLink
  • parameters - Parameters for creating or updating a resource link.
  • options - ResourceLinksClientCreateOrUpdateOptions contains the optional parameters for the ResourceLinksClient.CreateOrUpdate method.

func (*ResourceLinksClient) Delete

Delete - Deletes a resource link with the specified ID. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2016-09-01

  • linkID - The fully qualified ID of the resource link. Use the format, /subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/{provider-namespace}/{resource-type}/{resource-name}/Microsoft.Resources/links/{link-name}. For example, /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup/Microsoft.Web/sites/mySite/Microsoft.Resources/links/myLink
  • options - ResourceLinksClientDeleteOptions contains the optional parameters for the ResourceLinksClient.Delete method.

func (*ResourceLinksClient) Get

Get - Gets a resource link with the specified ID. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2016-09-01

  • linkID - The fully qualified Id of the resource link. For example, /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup/Microsoft.Web/sites/mySite/Microsoft.Resources/links/myLink
  • options - ResourceLinksClientGetOptions contains the optional parameters for the ResourceLinksClient.Get method.

func (*ResourceLinksClient) NewListAtSourceScopePager added in v0.4.0

NewListAtSourceScopePager - Gets a list of resource links at and below the specified source scope.

Generated from API version 2016-09-01

  • scope - The fully qualified ID of the scope for getting the resource links. For example, to list resource links at and under a resource group, set the scope to /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup.
  • options - ResourceLinksClientListAtSourceScopeOptions contains the optional parameters for the ResourceLinksClient.NewListAtSourceScopePager method.

func (*ResourceLinksClient) NewListAtSubscriptionPager added in v0.4.0

NewListAtSubscriptionPager - Gets all the linked resources for the subscription.

Generated from API version 2016-09-01

  • options - ResourceLinksClientListAtSubscriptionOptions contains the optional parameters for the ResourceLinksClient.NewListAtSubscriptionPager method.

type ResourceLinksClientCreateOrUpdateOptions added in v0.2.0

type ResourceLinksClientCreateOrUpdateOptions struct {
}

ResourceLinksClientCreateOrUpdateOptions contains the optional parameters for the ResourceLinksClient.CreateOrUpdate method.

type ResourceLinksClientCreateOrUpdateResponse added in v0.2.0

type ResourceLinksClientCreateOrUpdateResponse struct {
	// The resource link.
	ResourceLink
}

ResourceLinksClientCreateOrUpdateResponse contains the response from method ResourceLinksClient.CreateOrUpdate.

type ResourceLinksClientDeleteOptions added in v0.2.0

type ResourceLinksClientDeleteOptions struct {
}

ResourceLinksClientDeleteOptions contains the optional parameters for the ResourceLinksClient.Delete method.

type ResourceLinksClientDeleteResponse added in v0.2.0

type ResourceLinksClientDeleteResponse struct {
}

ResourceLinksClientDeleteResponse contains the response from method ResourceLinksClient.Delete.

type ResourceLinksClientGetOptions added in v0.2.0

type ResourceLinksClientGetOptions struct {
}

ResourceLinksClientGetOptions contains the optional parameters for the ResourceLinksClient.Get method.

type ResourceLinksClientGetResponse added in v0.2.0

type ResourceLinksClientGetResponse struct {
	// The resource link.
	ResourceLink
}

ResourceLinksClientGetResponse contains the response from method ResourceLinksClient.Get.

type ResourceLinksClientListAtSourceScopeOptions added in v0.2.0

type ResourceLinksClientListAtSourceScopeOptions struct {
	// The filter to apply when getting resource links. To get links only at the specified scope (not below the scope), use Filter.atScope()..
	// Specifying any value will set the value to atScope().
	Filter *string
}

ResourceLinksClientListAtSourceScopeOptions contains the optional parameters for the ResourceLinksClient.NewListAtSourceScopePager method.

type ResourceLinksClientListAtSourceScopeResponse added in v0.2.0

type ResourceLinksClientListAtSourceScopeResponse struct {
	// List of resource links.
	ResourceLinkResult
}

ResourceLinksClientListAtSourceScopeResponse contains the response from method ResourceLinksClient.NewListAtSourceScopePager.

type ResourceLinksClientListAtSubscriptionOptions added in v0.2.0

type ResourceLinksClientListAtSubscriptionOptions struct {
	// The filter to apply on the list resource links operation. The supported filter for list resource links is targetId. For
	// example, $filter=targetId eq {value}
	Filter *string
}

ResourceLinksClientListAtSubscriptionOptions contains the optional parameters for the ResourceLinksClient.NewListAtSubscriptionPager method.

type ResourceLinksClientListAtSubscriptionResponse added in v0.2.0

type ResourceLinksClientListAtSubscriptionResponse struct {
	// List of resource links.
	ResourceLinkResult
}

ResourceLinksClientListAtSubscriptionResponse contains the response from method ResourceLinksClient.NewListAtSubscriptionPager.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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