armedgezones

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: MIT Imports: 14 Imported by: 0

README

Azure Edgezones Module for Go

PkgGoDev

The armedgezones module provides operations for working with Azure Edgezones.

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 Edgezones module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/edgezones/armedgezones

Authorization

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

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 Edgezones 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 ActionType

type ActionType string

ActionType - Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.

const (
	// ActionTypeInternal - Actions are for internal-only APIs.
	ActionTypeInternal ActionType = "Internal"
)

func PossibleActionTypeValues

func PossibleActionTypeValues() []ActionType

PossibleActionTypeValues returns the possible values for the ActionType const type.

type ClientFactory

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

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. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ClientFactory) NewExtendedZonesClient

func (c *ClientFactory) NewExtendedZonesClient() *ExtendedZonesClient

NewExtendedZonesClient creates a new instance of ExtendedZonesClient.

func (*ClientFactory) NewOperationsClient

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

type CreatedByType

type CreatedByType string

CreatedByType - The kind of entity that created the resource.

const (
	// CreatedByTypeApplication - The entity was created by an application.
	CreatedByTypeApplication CreatedByType = "Application"
	// CreatedByTypeKey - The entity was created by a key.
	CreatedByTypeKey CreatedByType = "Key"
	// CreatedByTypeManagedIdentity - The entity was created by a managed identity.
	CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity"
	// CreatedByTypeUser - The entity was created by a user.
	CreatedByTypeUser CreatedByType = "User"
)

func PossibleCreatedByTypeValues

func PossibleCreatedByTypeValues() []CreatedByType

PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.

type ExtendedZone

type ExtendedZone struct {
	// The resource-specific properties for this resource.
	Properties *ExtendedZoneProperties

	// READ-ONLY; The name of the ExtendedZone
	Name *string

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

ExtendedZone - Resource that represents an Azure Extended Zone available to a subscription for registering and unregistering.

func (ExtendedZone) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ExtendedZone.

func (*ExtendedZone) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedZone.

type ExtendedZoneListResult

type ExtendedZoneListResult struct {
	// REQUIRED; The ExtendedZone items on this page
	Value []*ExtendedZone

	// The link to the next page of items
	NextLink *string
}

ExtendedZoneListResult - The response of a ExtendedZone list operation.

func (ExtendedZoneListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ExtendedZoneListResult.

func (*ExtendedZoneListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedZoneListResult.

type ExtendedZoneProperties

type ExtendedZoneProperties struct {
	// READ-ONLY; Display name of the Azure Extended Zone.
	DisplayName *string

	// READ-ONLY; Geography of the Azure Extended Zone.
	Geography *string

	// READ-ONLY; The Geography Group of the Azure Extended Zone.
	GeographyGroup *string

	// READ-ONLY; The Home Location of the Azure Extended Zone.
	HomeLocation *string

	// READ-ONLY; The Latitude of the Azure Extended Zone.
	Latitude *string

	// READ-ONLY; The Longitude of the Azure Extended Zone.
	Longitude *string

	// READ-ONLY; Category of region for the Azure Extended Zone.
	RegionCategory *string

	// READ-ONLY; Type of region for the Azure Extended Zone.
	RegionType *string

	// READ-ONLY; Regional display name of the Azure Extended Zone.
	RegionalDisplayName *string

	// READ-ONLY; Status of the last operation performed by the subscription on the Edge Zone resource
	ProvisioningState *ProvisioningState

	// READ-ONLY; Indicates the Azure Extended Zone registration’s approval status.
	RegistrationState *RegistrationState
}

ExtendedZoneProperties - The properties of an Extended Zone resource.

func (ExtendedZoneProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ExtendedZoneProperties.

func (*ExtendedZoneProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedZoneProperties.

type ExtendedZonesClient

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

ExtendedZonesClient - ExtendedZone operations Don't use this type directly, use NewExtendedZonesClient() instead.

func NewExtendedZonesClient

func NewExtendedZonesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExtendedZonesClient, error)

NewExtendedZonesClient creates a new instance of ExtendedZonesClient with the specified values.

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

func (*ExtendedZonesClient) Get

Get - Gets an Azure Extended Zone for a subscription If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-04-01-preview

  • extendedZoneName - The name of the ExtendedZone
  • options - ExtendedZonesClientGetOptions contains the optional parameters for the ExtendedZonesClient.Get method.

func (*ExtendedZonesClient) NewListBySubscriptionPager

NewListBySubscriptionPager - Lists the Azure Extended Zones available to a subscription

Generated from API version 2024-04-01-preview

  • options - ExtendedZonesClientListBySubscriptionOptions contains the optional parameters for the ExtendedZonesClient.NewListBySubscriptionPager method.

func (*ExtendedZonesClient) Register

Register - Registers a subscription for an Extended Zone If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-04-01-preview

  • extendedZoneName - The name of the ExtendedZone
  • options - ExtendedZonesClientRegisterOptions contains the optional parameters for the ExtendedZonesClient.Register method.

func (*ExtendedZonesClient) Unregister

Unregister - Unregisters a subscription for an Extended Zone If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-04-01-preview

  • extendedZoneName - The name of the ExtendedZone
  • options - ExtendedZonesClientUnregisterOptions contains the optional parameters for the ExtendedZonesClient.Unregister method.

type ExtendedZonesClientGetOptions

type ExtendedZonesClientGetOptions struct {
}

ExtendedZonesClientGetOptions contains the optional parameters for the ExtendedZonesClient.Get method.

type ExtendedZonesClientGetResponse

type ExtendedZonesClientGetResponse struct {
	// Resource that represents an Azure Extended Zone available to a subscription for registering and unregistering.
	ExtendedZone
}

ExtendedZonesClientGetResponse contains the response from method ExtendedZonesClient.Get.

type ExtendedZonesClientListBySubscriptionOptions

type ExtendedZonesClientListBySubscriptionOptions struct {
}

ExtendedZonesClientListBySubscriptionOptions contains the optional parameters for the ExtendedZonesClient.NewListBySubscriptionPager method.

type ExtendedZonesClientListBySubscriptionResponse

type ExtendedZonesClientListBySubscriptionResponse struct {
	// The response of a ExtendedZone list operation.
	ExtendedZoneListResult
}

ExtendedZonesClientListBySubscriptionResponse contains the response from method ExtendedZonesClient.NewListBySubscriptionPager.

type ExtendedZonesClientRegisterOptions

type ExtendedZonesClientRegisterOptions struct {
}

ExtendedZonesClientRegisterOptions contains the optional parameters for the ExtendedZonesClient.Register method.

type ExtendedZonesClientRegisterResponse

type ExtendedZonesClientRegisterResponse struct {
	// Resource that represents an Azure Extended Zone available to a subscription for registering and unregistering.
	ExtendedZone
}

ExtendedZonesClientRegisterResponse contains the response from method ExtendedZonesClient.Register.

type ExtendedZonesClientUnregisterOptions

type ExtendedZonesClientUnregisterOptions struct {
}

ExtendedZonesClientUnregisterOptions contains the optional parameters for the ExtendedZonesClient.Unregister method.

type ExtendedZonesClientUnregisterResponse

type ExtendedZonesClientUnregisterResponse struct {
	// Resource that represents an Azure Extended Zone available to a subscription for registering and unregistering.
	ExtendedZone
}

ExtendedZonesClientUnregisterResponse contains the response from method ExtendedZonesClient.Unregister.

type Operation

type Operation struct {
	// Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
	ActionType *ActionType

	// Localized display information for this particular operation.
	Display *OperationDisplay

	// READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure
	// Resource Manager/control-plane operations.
	IsDataAction *bool

	// READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write",
	// "Microsoft.Compute/virtualMachines/capture/action"
	Name *string

	// READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default
	// value is "user,system"
	Origin *Origin
}

Operation - Details of a REST API operation, returned from the Resource Provider Operations API

func (Operation) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Operation.

func (*Operation) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type Operation.

type OperationDisplay

type OperationDisplay struct {
	// The short, localized friendly description of the operation; suitable for tool tips and detailed views.
	Description *string

	// The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine",
	// "Restart Virtual Machine".
	Operation *string

	// The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute".
	Provider *string

	// The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections".
	Resource *string
}

OperationDisplay - Localized display information for and operation.

func (OperationDisplay) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationDisplay.

func (*OperationDisplay) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.

type OperationListResult

type OperationListResult struct {
	// REQUIRED; The Operation items on this page
	Value []*Operation

	// The link to the next page of items
	NextLink *string
}

OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an 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

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

NewListPager - List the operations for the provider

Generated from API version 2024-04-01-preview

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

type OperationsClientListOptions

type OperationsClientListOptions struct {
}

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

type OperationsClientListResponse

type OperationsClientListResponse struct {
	// A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.
	OperationListResult
}

OperationsClientListResponse contains the response from method OperationsClient.NewListPager.

type Origin

type Origin string

Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system"

const (
	// OriginSystem - Indicates the operation is initiated by a system.
	OriginSystem Origin = "system"
	// OriginUser - Indicates the operation is initiated by a user.
	OriginUser Origin = "user"
	// OriginUserSystem - Indicates the operation is initiated by a user or system.
	OriginUserSystem Origin = "user,system"
)

func PossibleOriginValues

func PossibleOriginValues() []Origin

PossibleOriginValues returns the possible values for the Origin const type.

type ProvisioningState

type ProvisioningState string

ProvisioningState - The status of the current operation.

const (
	// ProvisioningStateAccepted - Accepted State
	ProvisioningStateAccepted ProvisioningState = "Accepted"
	// ProvisioningStateCanceled - Resource creation was canceled.
	ProvisioningStateCanceled ProvisioningState = "Canceled"
	// ProvisioningStateDeleting - Deleting State
	ProvisioningStateDeleting ProvisioningState = "Deleting"
	// ProvisioningStateFailed - Resource creation failed.
	ProvisioningStateFailed ProvisioningState = "Failed"
	// ProvisioningStateProvisioning - Provisioning State
	ProvisioningStateProvisioning ProvisioningState = "Provisioning"
	// ProvisioningStateSucceeded - Resource has been created.
	ProvisioningStateSucceeded ProvisioningState = "Succeeded"
	// ProvisioningStateUpdating - Updating State
	ProvisioningStateUpdating ProvisioningState = "Updating"
)

func PossibleProvisioningStateValues

func PossibleProvisioningStateValues() []ProvisioningState

PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.

type RegistrationState

type RegistrationState string

RegistrationState - The Azure Extended Zone registration status for a subscription

const (
	// RegistrationStateNotRegistered - Subscription not registered for the Azure Extended Zone
	RegistrationStateNotRegistered RegistrationState = "NotRegistered"
	// RegistrationStatePendingRegister - Subscription pending registration for the Azure Extended Zone
	RegistrationStatePendingRegister RegistrationState = "PendingRegister"
	// RegistrationStatePendingUnregister - Subscription is pending unregistering for the Azure Extended Zone
	RegistrationStatePendingUnregister RegistrationState = "PendingUnregister"
	// RegistrationStateRegistered - Subscription is registered for the Azure Extended Zone
	RegistrationStateRegistered RegistrationState = "Registered"
)

func PossibleRegistrationStateValues

func PossibleRegistrationStateValues() []RegistrationState

PossibleRegistrationStateValues returns the possible values for the RegistrationState const type.

type SystemData

type SystemData struct {
	// The timestamp of resource creation (UTC).
	CreatedAt *time.Time

	// The identity that created the resource.
	CreatedBy *string

	// The type of identity that created the resource.
	CreatedByType *CreatedByType

	// The timestamp of resource last modification (UTC)
	LastModifiedAt *time.Time

	// The identity that last modified the resource.
	LastModifiedBy *string

	// The type of identity that last modified the resource.
	LastModifiedByType *CreatedByType
}

SystemData - Metadata pertaining to creation and last modification of the resource.

func (SystemData) MarshalJSON

func (s SystemData) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SystemData.

func (*SystemData) UnmarshalJSON

func (s *SystemData) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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