armkeyvault

package module
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 16 Imported by: 23

README

Azure Key Vault Module for Go

PkgGoDev

The armkeyvault module provides operations for working with Azure Key Vault.

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 Key Vault module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault

Authorization

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

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.

More sample code

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the Key Vault 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 AccessPolicyEntry

type AccessPolicyEntry struct {
	// REQUIRED; The object ID of a user, service principal or security group in the Azure Active Directory tenant for the vault.
	// The object ID must be unique for the list of access policies.
	ObjectID *string

	// REQUIRED; Permissions the identity has for keys, secrets and certificates.
	Permissions *Permissions

	// REQUIRED; The Azure Active Directory tenant ID that should be used for authenticating requests to the key vault.
	TenantID *string

	// Application ID of the client making request on behalf of a principal
	ApplicationID *string
}

AccessPolicyEntry - An identity that have access to the key vault. All identities in the array must use the same tenant ID as the key vault's tenant ID.

func (AccessPolicyEntry) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type AccessPolicyEntry.

func (*AccessPolicyEntry) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type AccessPolicyEntry.

type AccessPolicyUpdateKind

type AccessPolicyUpdateKind string
const (
	AccessPolicyUpdateKindAdd     AccessPolicyUpdateKind = "add"
	AccessPolicyUpdateKindRemove  AccessPolicyUpdateKind = "remove"
	AccessPolicyUpdateKindReplace AccessPolicyUpdateKind = "replace"
)

func PossibleAccessPolicyUpdateKindValues

func PossibleAccessPolicyUpdateKindValues() []AccessPolicyUpdateKind

PossibleAccessPolicyUpdateKindValues returns the possible values for the AccessPolicyUpdateKind const type.

type Action

type Action struct {
	// The type of action.
	Type *KeyRotationPolicyActionType
}

func (Action) MarshalJSON added in v1.2.0

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

MarshalJSON implements the json.Marshaller interface for type Action.

func (*Action) UnmarshalJSON added in v1.2.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Action.

type ActionsRequired

type ActionsRequired string

ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer.

const (
	ActionsRequiredNone ActionsRequired = "None"
)

func PossibleActionsRequiredValues

func PossibleActionsRequiredValues() []ActionsRequired

PossibleActionsRequiredValues returns the possible values for the ActionsRequired const type.

type ActivationStatus added in v1.2.0

type ActivationStatus string

ActivationStatus - Activation Status

const (
	// ActivationStatusActive - The managed HSM Pool is active.
	ActivationStatusActive ActivationStatus = "Active"
	// ActivationStatusFailed - Failed to activate managed hsm.
	ActivationStatusFailed ActivationStatus = "Failed"
	// ActivationStatusNotActivated - The managed HSM Pool is not yet activated.
	ActivationStatusNotActivated ActivationStatus = "NotActivated"
	// ActivationStatusUnknown - An unknown error occurred while activating managed hsm.
	ActivationStatusUnknown ActivationStatus = "Unknown"
)

func PossibleActivationStatusValues added in v1.2.0

func PossibleActivationStatusValues() []ActivationStatus

PossibleActivationStatusValues returns the possible values for the ActivationStatus const type.

type CertificatePermissions

type CertificatePermissions string
const (
	CertificatePermissionsAll            CertificatePermissions = "all"
	CertificatePermissionsBackup         CertificatePermissions = "backup"
	CertificatePermissionsCreate         CertificatePermissions = "create"
	CertificatePermissionsDelete         CertificatePermissions = "delete"
	CertificatePermissionsDeleteissuers  CertificatePermissions = "deleteissuers"
	CertificatePermissionsGet            CertificatePermissions = "get"
	CertificatePermissionsGetissuers     CertificatePermissions = "getissuers"
	CertificatePermissionsImport         CertificatePermissions = "import"
	CertificatePermissionsList           CertificatePermissions = "list"
	CertificatePermissionsListissuers    CertificatePermissions = "listissuers"
	CertificatePermissionsManagecontacts CertificatePermissions = "managecontacts"
	CertificatePermissionsManageissuers  CertificatePermissions = "manageissuers"
	CertificatePermissionsPurge          CertificatePermissions = "purge"
	CertificatePermissionsRecover        CertificatePermissions = "recover"
	CertificatePermissionsRestore        CertificatePermissions = "restore"
	CertificatePermissionsSetissuers     CertificatePermissions = "setissuers"
	CertificatePermissionsUpdate         CertificatePermissions = "update"
)

func PossibleCertificatePermissionsValues

func PossibleCertificatePermissionsValues() []CertificatePermissions

PossibleCertificatePermissionsValues returns the possible values for the CertificatePermissions const type.

type CheckMhsmNameAvailabilityParameters added in v1.2.0

type CheckMhsmNameAvailabilityParameters struct {
	// REQUIRED; The managed hsm name.
	Name *string
}

CheckMhsmNameAvailabilityParameters - The parameters used to check the availability of the managed hsm name.

func (CheckMhsmNameAvailabilityParameters) MarshalJSON added in v1.2.0

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

MarshalJSON implements the json.Marshaller interface for type CheckMhsmNameAvailabilityParameters.

func (*CheckMhsmNameAvailabilityParameters) UnmarshalJSON added in v1.2.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type CheckMhsmNameAvailabilityParameters.

type CheckMhsmNameAvailabilityResult added in v1.2.0

type CheckMhsmNameAvailabilityResult struct {
	// READ-ONLY; An error message explaining the Reason value in more detail.
	Message *string

	// READ-ONLY; A boolean value that indicates whether the name is available for you to use. If true, the name is available.
	// If false, the name has already been taken or is invalid and cannot be used.
	NameAvailable *bool

	// READ-ONLY; The reason that a managed hsm name could not be used. The reason element is only returned if NameAvailable is
	// false.
	Reason *Reason
}

CheckMhsmNameAvailabilityResult - The CheckMhsmNameAvailability operation response.

func (CheckMhsmNameAvailabilityResult) MarshalJSON added in v1.2.0

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

MarshalJSON implements the json.Marshaller interface for type CheckMhsmNameAvailabilityResult.

func (*CheckMhsmNameAvailabilityResult) UnmarshalJSON added in v1.2.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type CheckMhsmNameAvailabilityResult.

type CheckNameAvailabilityResult

type CheckNameAvailabilityResult struct {
	// READ-ONLY; An error message explaining the Reason value in more detail.
	Message *string

	// READ-ONLY; A boolean value that indicates whether the name is available for you to use. If true, the name is available.
	// If false, the name has already been taken or is invalid and cannot be used.
	NameAvailable *bool

	// READ-ONLY; The reason that a vault name could not be used. The Reason element is only returned if NameAvailable is false.
	Reason *Reason
}

CheckNameAvailabilityResult - The CheckNameAvailability operation response.

func (CheckNameAvailabilityResult) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityResult.

func (*CheckNameAvailabilityResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityResult.

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 - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ClientFactory) NewKeysClient added in v1.1.0

func (c *ClientFactory) NewKeysClient() *KeysClient

NewKeysClient creates a new instance of KeysClient.

func (*ClientFactory) NewMHSMPrivateEndpointConnectionsClient added in v1.1.0

func (c *ClientFactory) NewMHSMPrivateEndpointConnectionsClient() *MHSMPrivateEndpointConnectionsClient

NewMHSMPrivateEndpointConnectionsClient creates a new instance of MHSMPrivateEndpointConnectionsClient.

func (*ClientFactory) NewMHSMPrivateLinkResourcesClient added in v1.1.0

func (c *ClientFactory) NewMHSMPrivateLinkResourcesClient() *MHSMPrivateLinkResourcesClient

NewMHSMPrivateLinkResourcesClient creates a new instance of MHSMPrivateLinkResourcesClient.

func (*ClientFactory) NewMHSMRegionsClient added in v1.2.0

func (c *ClientFactory) NewMHSMRegionsClient() *MHSMRegionsClient

NewMHSMRegionsClient creates a new instance of MHSMRegionsClient.

func (*ClientFactory) NewManagedHsmKeysClient added in v1.2.0

func (c *ClientFactory) NewManagedHsmKeysClient() *ManagedHsmKeysClient

NewManagedHsmKeysClient creates a new instance of ManagedHsmKeysClient.

func (*ClientFactory) NewManagedHsmsClient added in v1.1.0

func (c *ClientFactory) NewManagedHsmsClient() *ManagedHsmsClient

NewManagedHsmsClient creates a new instance of ManagedHsmsClient.

func (*ClientFactory) NewOperationsClient added in v1.1.0

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

func (*ClientFactory) NewPrivateEndpointConnectionsClient added in v1.1.0

func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient

NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient.

func (*ClientFactory) NewPrivateLinkResourcesClient added in v1.1.0

func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient

NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient.

func (*ClientFactory) NewSecretsClient added in v1.1.0

func (c *ClientFactory) NewSecretsClient() *SecretsClient

NewSecretsClient creates a new instance of SecretsClient.

func (*ClientFactory) NewVaultsClient added in v1.1.0

func (c *ClientFactory) NewVaultsClient() *VaultsClient

NewVaultsClient creates a new instance of VaultsClient.

type CreateMode

type CreateMode string

CreateMode - The vault's create mode to indicate whether the vault need to be recovered or not.

const (
	CreateModeDefault CreateMode = "default"
	CreateModeRecover CreateMode = "recover"
)

func PossibleCreateModeValues

func PossibleCreateModeValues() []CreateMode

PossibleCreateModeValues returns the possible values for the CreateMode const type.

type DeletedManagedHsm

type DeletedManagedHsm struct {
	// Properties of the deleted managed HSM
	Properties *DeletedManagedHsmProperties

	// READ-ONLY; The Azure Resource Manager resource ID for the deleted managed HSM Pool.
	ID *string

	// READ-ONLY; The name of the managed HSM Pool.
	Name *string

	// READ-ONLY; The resource type of the managed HSM Pool.
	Type *string
}

func (DeletedManagedHsm) MarshalJSON added in v1.1.0

func (d DeletedManagedHsm) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DeletedManagedHsm.

func (*DeletedManagedHsm) UnmarshalJSON added in v1.1.0

func (d *DeletedManagedHsm) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DeletedManagedHsm.

type DeletedManagedHsmListResult

type DeletedManagedHsmListResult struct {
	// The URL to get the next set of deleted managed HSM Pools.
	NextLink *string

	// The list of deleted managed HSM Pools.
	Value []*DeletedManagedHsm
}

DeletedManagedHsmListResult - List of deleted managed HSM Pools

func (DeletedManagedHsmListResult) MarshalJSON

func (d DeletedManagedHsmListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DeletedManagedHsmListResult.

func (*DeletedManagedHsmListResult) UnmarshalJSON added in v1.1.0

func (d *DeletedManagedHsmListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DeletedManagedHsmListResult.

type DeletedManagedHsmProperties

type DeletedManagedHsmProperties struct {
	// READ-ONLY; The deleted date.
	DeletionDate *time.Time

	// READ-ONLY; The location of the original managed HSM.
	Location *string

	// READ-ONLY; The resource id of the original managed HSM.
	MhsmID *string

	// READ-ONLY; Purge protection status of the original managed HSM.
	PurgeProtectionEnabled *bool

	// READ-ONLY; The scheduled purged date.
	ScheduledPurgeDate *time.Time

	// READ-ONLY; Tags of the original managed HSM.
	Tags map[string]*string
}

DeletedManagedHsmProperties - Properties of the deleted managed HSM.

func (DeletedManagedHsmProperties) MarshalJSON

func (d DeletedManagedHsmProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DeletedManagedHsmProperties.

func (*DeletedManagedHsmProperties) UnmarshalJSON

func (d *DeletedManagedHsmProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DeletedManagedHsmProperties.

type DeletedVault

type DeletedVault struct {
	// Properties of the vault
	Properties *DeletedVaultProperties

	// READ-ONLY; The resource ID for the deleted key vault.
	ID *string

	// READ-ONLY; The name of the key vault.
	Name *string

	// READ-ONLY; The resource type of the key vault.
	Type *string
}

DeletedVault - Deleted vault information with extended details.

func (DeletedVault) MarshalJSON added in v1.1.0

func (d DeletedVault) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DeletedVault.

func (*DeletedVault) UnmarshalJSON added in v1.1.0

func (d *DeletedVault) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DeletedVault.

type DeletedVaultListResult

type DeletedVaultListResult struct {
	// The URL to get the next set of deleted vaults.
	NextLink *string

	// The list of deleted vaults.
	Value []*DeletedVault
}

DeletedVaultListResult - List of vaults

func (DeletedVaultListResult) MarshalJSON

func (d DeletedVaultListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DeletedVaultListResult.

func (*DeletedVaultListResult) UnmarshalJSON added in v1.1.0

func (d *DeletedVaultListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DeletedVaultListResult.

type DeletedVaultProperties

type DeletedVaultProperties struct {
	// READ-ONLY; The deleted date.
	DeletionDate *time.Time

	// READ-ONLY; The location of the original vault.
	Location *string

	// READ-ONLY; Purge protection status of the original vault.
	PurgeProtectionEnabled *bool

	// READ-ONLY; The scheduled purged date.
	ScheduledPurgeDate *time.Time

	// READ-ONLY; Tags of the original vault.
	Tags map[string]*string

	// READ-ONLY; The resource id of the original vault.
	VaultID *string
}

DeletedVaultProperties - Properties of the deleted vault.

func (DeletedVaultProperties) MarshalJSON

func (d DeletedVaultProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DeletedVaultProperties.

func (*DeletedVaultProperties) UnmarshalJSON

func (d *DeletedVaultProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DeletedVaultProperties.

type DeletionRecoveryLevel

type DeletionRecoveryLevel string

DeletionRecoveryLevel - The deletion recovery level currently in effect for the object. If it contains 'Purgeable', then the object can be permanently deleted by a privileged user; otherwise, only the system can purge the object at the end of the retention interval.

const (
	DeletionRecoveryLevelPurgeable                        DeletionRecoveryLevel = "Purgeable"
	DeletionRecoveryLevelRecoverable                      DeletionRecoveryLevel = "Recoverable"
	DeletionRecoveryLevelRecoverableProtectedSubscription DeletionRecoveryLevel = "Recoverable+ProtectedSubscription"
	DeletionRecoveryLevelRecoverablePurgeable             DeletionRecoveryLevel = "Recoverable+Purgeable"
)

func PossibleDeletionRecoveryLevelValues

func PossibleDeletionRecoveryLevelValues() []DeletionRecoveryLevel

PossibleDeletionRecoveryLevelValues returns the possible values for the DeletionRecoveryLevel const type.

type DimensionProperties

type DimensionProperties struct {
	// Display name of dimension.
	DisplayName *string

	// Name of dimension.
	Name *string

	// Property to specify whether the dimension should be exported for Shoebox.
	ToBeExportedForShoebox *bool
}

DimensionProperties - Type of operation: get, read, delete, etc.

func (DimensionProperties) MarshalJSON added in v1.1.0

func (d DimensionProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DimensionProperties.

func (*DimensionProperties) UnmarshalJSON added in v1.1.0

func (d *DimensionProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DimensionProperties.

type GeoReplicationRegionProvisioningState added in v1.2.0

type GeoReplicationRegionProvisioningState string

GeoReplicationRegionProvisioningState - The current provisioning state.

const (
	GeoReplicationRegionProvisioningStateCleanup         GeoReplicationRegionProvisioningState = "Cleanup"
	GeoReplicationRegionProvisioningStateDeleting        GeoReplicationRegionProvisioningState = "Deleting"
	GeoReplicationRegionProvisioningStateFailed          GeoReplicationRegionProvisioningState = "Failed"
	GeoReplicationRegionProvisioningStatePreprovisioning GeoReplicationRegionProvisioningState = "Preprovisioning"
	GeoReplicationRegionProvisioningStateProvisioning    GeoReplicationRegionProvisioningState = "Provisioning"
	GeoReplicationRegionProvisioningStateSucceeded       GeoReplicationRegionProvisioningState = "Succeeded"
)

func PossibleGeoReplicationRegionProvisioningStateValues added in v1.2.0

func PossibleGeoReplicationRegionProvisioningStateValues() []GeoReplicationRegionProvisioningState

PossibleGeoReplicationRegionProvisioningStateValues returns the possible values for the GeoReplicationRegionProvisioningState const type.

type IPRule

type IPRule struct {
	// REQUIRED; An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) or '124.56.78.0/24' (all addresses
	// that start with 124.56.78).
	Value *string
}

IPRule - A rule governing the accessibility of a vault from a specific ip address or ip range.

func (IPRule) MarshalJSON added in v1.1.0

func (i IPRule) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type IPRule.

func (*IPRule) UnmarshalJSON added in v1.1.0

func (i *IPRule) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IPRule.

type IdentityType

type IdentityType string

IdentityType - The type of identity.

const (
	IdentityTypeApplication     IdentityType = "Application"
	IdentityTypeKey             IdentityType = "Key"
	IdentityTypeManagedIdentity IdentityType = "ManagedIdentity"
	IdentityTypeUser            IdentityType = "User"
)

func PossibleIdentityTypeValues

func PossibleIdentityTypeValues() []IdentityType

PossibleIdentityTypeValues returns the possible values for the IdentityType const type.

type JSONWebKeyCurveName

type JSONWebKeyCurveName string

JSONWebKeyCurveName - The elliptic curve name. For valid values, see JsonWebKeyCurveName.

const (
	JSONWebKeyCurveNameP256  JSONWebKeyCurveName = "P-256"
	JSONWebKeyCurveNameP256K JSONWebKeyCurveName = "P-256K"
	JSONWebKeyCurveNameP384  JSONWebKeyCurveName = "P-384"
	JSONWebKeyCurveNameP521  JSONWebKeyCurveName = "P-521"
)

func PossibleJSONWebKeyCurveNameValues

func PossibleJSONWebKeyCurveNameValues() []JSONWebKeyCurveName

PossibleJSONWebKeyCurveNameValues returns the possible values for the JSONWebKeyCurveName const type.

type JSONWebKeyOperation

type JSONWebKeyOperation string

JSONWebKeyOperation - The permitted JSON web key operations of the key. For more information, see JsonWebKeyOperation.

const (
	JSONWebKeyOperationDecrypt   JSONWebKeyOperation = "decrypt"
	JSONWebKeyOperationEncrypt   JSONWebKeyOperation = "encrypt"
	JSONWebKeyOperationImport    JSONWebKeyOperation = "import"
	JSONWebKeyOperationRelease   JSONWebKeyOperation = "release"
	JSONWebKeyOperationSign      JSONWebKeyOperation = "sign"
	JSONWebKeyOperationUnwrapKey JSONWebKeyOperation = "unwrapKey"
	JSONWebKeyOperationVerify    JSONWebKeyOperation = "verify"
	JSONWebKeyOperationWrapKey   JSONWebKeyOperation = "wrapKey"
)

func PossibleJSONWebKeyOperationValues

func PossibleJSONWebKeyOperationValues() []JSONWebKeyOperation

PossibleJSONWebKeyOperationValues returns the possible values for the JSONWebKeyOperation const type.

type JSONWebKeyType

type JSONWebKeyType string

JSONWebKeyType - The type of the key. For valid values, see JsonWebKeyType.

const (
	JSONWebKeyTypeEC     JSONWebKeyType = "EC"
	JSONWebKeyTypeECHSM  JSONWebKeyType = "EC-HSM"
	JSONWebKeyTypeRSA    JSONWebKeyType = "RSA"
	JSONWebKeyTypeRSAHSM JSONWebKeyType = "RSA-HSM"
)

func PossibleJSONWebKeyTypeValues

func PossibleJSONWebKeyTypeValues() []JSONWebKeyType

PossibleJSONWebKeyTypeValues returns the possible values for the JSONWebKeyType const type.

type Key

type Key struct {
	// REQUIRED; The properties of the key.
	Properties *KeyProperties

	// READ-ONLY; Fully qualified identifier of the key vault resource.
	ID *string

	// READ-ONLY; Azure location of the key vault resource.
	Location *string

	// READ-ONLY; Name of the key vault resource.
	Name *string

	// READ-ONLY; Tags assigned to the key vault resource.
	Tags map[string]*string

	// READ-ONLY; Resource type of the key vault resource.
	Type *string
}

Key - The key resource.

func (Key) MarshalJSON

func (k Key) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Key.

func (*Key) UnmarshalJSON added in v1.1.0

func (k *Key) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Key.

type KeyAttributes

type KeyAttributes struct {
	// Determines whether or not the object is enabled.
	Enabled *bool

	// Expiry date in seconds since 1970-01-01T00:00:00Z.
	Expires *int64

	// Indicates if the private key can be exported.
	Exportable *bool

	// Not before date in seconds since 1970-01-01T00:00:00Z.
	NotBefore *int64

	// READ-ONLY; Creation time in seconds since 1970-01-01T00:00:00Z.
	Created *int64

	// READ-ONLY; The deletion recovery level currently in effect for the object. If it contains 'Purgeable', then the object
	// can be permanently deleted by a privileged user; otherwise, only the system can purge the
	// object at the end of the retention interval.
	RecoveryLevel *DeletionRecoveryLevel

	// READ-ONLY; Last updated time in seconds since 1970-01-01T00:00:00Z.
	Updated *int64
}

KeyAttributes - The object attributes managed by the Azure Key Vault service.

func (KeyAttributes) MarshalJSON added in v1.1.0

func (k KeyAttributes) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type KeyAttributes.

func (*KeyAttributes) UnmarshalJSON added in v1.1.0

func (k *KeyAttributes) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type KeyAttributes.

type KeyCreateParameters

type KeyCreateParameters struct {
	// REQUIRED; The properties of the key to be created.
	Properties *KeyProperties

	// The tags that will be assigned to the key.
	Tags map[string]*string
}

KeyCreateParameters - The parameters used to create a key.

func (KeyCreateParameters) MarshalJSON

func (k KeyCreateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type KeyCreateParameters.

func (*KeyCreateParameters) UnmarshalJSON added in v1.1.0

func (k *KeyCreateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type KeyCreateParameters.

type KeyListResult

type KeyListResult struct {
	// The URL to get the next page of keys.
	NextLink *string

	// The key resources.
	Value []*Key
}

KeyListResult - The page of keys.

func (KeyListResult) MarshalJSON

func (k KeyListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type KeyListResult.

func (*KeyListResult) UnmarshalJSON added in v1.1.0

func (k *KeyListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type KeyListResult.

type KeyPermissions

type KeyPermissions string
const (
	KeyPermissionsAll               KeyPermissions = "all"
	KeyPermissionsBackup            KeyPermissions = "backup"
	KeyPermissionsCreate            KeyPermissions = "create"
	KeyPermissionsDecrypt           KeyPermissions = "decrypt"
	KeyPermissionsDelete            KeyPermissions = "delete"
	KeyPermissionsEncrypt           KeyPermissions = "encrypt"
	KeyPermissionsGet               KeyPermissions = "get"
	KeyPermissionsGetrotationpolicy KeyPermissions = "getrotationpolicy"
	KeyPermissionsImport            KeyPermissions = "import"
	KeyPermissionsList              KeyPermissions = "list"
	KeyPermissionsPurge             KeyPermissions = "purge"
	KeyPermissionsRecover           KeyPermissions = "recover"
	KeyPermissionsRelease           KeyPermissions = "release"
	KeyPermissionsRestore           KeyPermissions = "restore"
	KeyPermissionsRotate            KeyPermissions = "rotate"
	KeyPermissionsSetrotationpolicy KeyPermissions = "setrotationpolicy"
	KeyPermissionsSign              KeyPermissions = "sign"
	KeyPermissionsUnwrapKey         KeyPermissions = "unwrapKey"
	KeyPermissionsUpdate            KeyPermissions = "update"
	KeyPermissionsVerify            KeyPermissions = "verify"
	KeyPermissionsWrapKey           KeyPermissions = "wrapKey"
)

func PossibleKeyPermissionsValues

func PossibleKeyPermissionsValues() []KeyPermissions

PossibleKeyPermissionsValues returns the possible values for the KeyPermissions const type.

type KeyProperties

type KeyProperties struct {
	// The attributes of the key.
	Attributes *KeyAttributes

	// The elliptic curve name. For valid values, see JsonWebKeyCurveName.
	CurveName *JSONWebKeyCurveName
	KeyOps    []*JSONWebKeyOperation

	// The key size in bits. For example: 2048, 3072, or 4096 for RSA.
	KeySize *int32

	// The type of the key. For valid values, see JsonWebKeyType.
	Kty *JSONWebKeyType

	// Key release policy in response. It will be used for both output and input. Omitted if empty
	ReleasePolicy *KeyReleasePolicy

	// Key rotation policy in response. It will be used for both output and input. Omitted if empty
	RotationPolicy *RotationPolicy

	// READ-ONLY; The URI to retrieve the current version of the key.
	KeyURI *string

	// READ-ONLY; The URI to retrieve the specific version of the key.
	KeyURIWithVersion *string
}

KeyProperties - The properties of the key.

func (KeyProperties) MarshalJSON

func (k KeyProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type KeyProperties.

func (*KeyProperties) UnmarshalJSON added in v1.1.0

func (k *KeyProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type KeyProperties.

type KeyReleasePolicy

type KeyReleasePolicy struct {
	// Content type and version of key release policy
	ContentType *string

	// Blob encoding the policy rules under which the key can be released.
	Data []byte
}

func (KeyReleasePolicy) MarshalJSON

func (k KeyReleasePolicy) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type KeyReleasePolicy.

func (*KeyReleasePolicy) UnmarshalJSON

func (k *KeyReleasePolicy) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type KeyReleasePolicy.

type KeyRotationPolicyActionType

type KeyRotationPolicyActionType string

KeyRotationPolicyActionType - The type of action.

const (
	KeyRotationPolicyActionTypeNotify KeyRotationPolicyActionType = "notify"
	KeyRotationPolicyActionTypeRotate KeyRotationPolicyActionType = "rotate"
)

func PossibleKeyRotationPolicyActionTypeValues

func PossibleKeyRotationPolicyActionTypeValues() []KeyRotationPolicyActionType

PossibleKeyRotationPolicyActionTypeValues returns the possible values for the KeyRotationPolicyActionType const type.

type KeyRotationPolicyAttributes

type KeyRotationPolicyAttributes struct {
	// The expiration time for the new key version. It should be in ISO8601 format. Eg: 'P90D', 'P1Y'.
	ExpiryTime *string

	// READ-ONLY; Creation time in seconds since 1970-01-01T00:00:00Z.
	Created *int64

	// READ-ONLY; Last updated time in seconds since 1970-01-01T00:00:00Z.
	Updated *int64
}

func (KeyRotationPolicyAttributes) MarshalJSON added in v1.2.0

func (k KeyRotationPolicyAttributes) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type KeyRotationPolicyAttributes.

func (*KeyRotationPolicyAttributes) UnmarshalJSON added in v1.2.0

func (k *KeyRotationPolicyAttributes) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type KeyRotationPolicyAttributes.

type KeysClient

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

KeysClient contains the methods for the Keys group. Don't use this type directly, use NewKeysClient() instead.

func NewKeysClient

func NewKeysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*KeysClient, error)

NewKeysClient creates a new instance of KeysClient with the specified values.

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

func (*KeysClient) CreateIfNotExist

func (client *KeysClient) CreateIfNotExist(ctx context.Context, resourceGroupName string, vaultName string, keyName string, parameters KeyCreateParameters, options *KeysClientCreateIfNotExistOptions) (KeysClientCreateIfNotExistResponse, error)

CreateIfNotExist - Creates the first version of a new key if it does not exist. If it already exists, then the existing key is returned without any write operations being performed. This API does not create subsequent versions, and does not update existing keys. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group which contains the specified key vault.
  • vaultName - The name of the key vault which contains the key to be created.
  • keyName - The name of the key to be created. The value you provide may be copied globally for the purpose of running the service. The value provided should not include personally identifiable or sensitive information.
  • parameters - The parameters used to create the specified key.
  • options - KeysClientCreateIfNotExistOptions contains the optional parameters for the KeysClient.CreateIfNotExist method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/createKey.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/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewKeysClient().CreateIfNotExist(ctx, "sample-group", "sample-vault-name", "sample-key-name", armkeyvault.KeyCreateParameters{
		Properties: &armkeyvault.KeyProperties{
			Kty: to.Ptr(armkeyvault.JSONWebKeyTypeRSA),
		},
	}, 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.Key = armkeyvault.Key{
	// 	Name: to.Ptr("sample-key-name"),
	// 	Type: to.Ptr("Microsoft.KeyVault/vaults/keys"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault-name/keys/sample-key-name"),
	// 	Location: to.Ptr("westus"),
	// 	Properties: &armkeyvault.KeyProperties{
	// 		Attributes: &armkeyvault.KeyAttributes{
	// 			Created: to.Ptr[int64](1598533051),
	// 			Enabled: to.Ptr(true),
	// 			RecoveryLevel: to.Ptr(armkeyvault.DeletionRecoveryLevelPurgeable),
	// 			Updated: to.Ptr[int64](1598533051),
	// 		},
	// 		KeyOps: []*armkeyvault.JSONWebKeyOperation{
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationEncrypt),
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationDecrypt),
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationSign),
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationVerify),
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationWrapKey),
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationUnwrapKey)},
	// 			KeySize: to.Ptr[int32](2048),
	// 			KeyURI: to.Ptr("https://sample-vault-name.vault.azure.net:443/keys/sample-key-name"),
	// 			KeyURIWithVersion: to.Ptr("https://sample-vault-name.vault.azure.net:443/keys/sample-key-name/fd618d9519b74f9aae94ade66b876acc"),
	// 			Kty: to.Ptr(armkeyvault.JSONWebKeyTypeRSA),
	// 		},
	// 	}
}
Output:

func (*KeysClient) Get

func (client *KeysClient) Get(ctx context.Context, resourceGroupName string, vaultName string, keyName string, options *KeysClientGetOptions) (KeysClientGetResponse, error)

Get - Gets the current version of the specified key from the specified key vault. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group which contains the specified key vault.
  • vaultName - The name of the vault which contains the key to be retrieved.
  • keyName - The name of the key to be retrieved.
  • options - KeysClientGetOptions contains the optional parameters for the KeysClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/getKey.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewKeysClient().Get(ctx, "sample-group", "sample-vault-name", "sample-key-name", 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.Key = armkeyvault.Key{
	// 	Name: to.Ptr("sample-key-name"),
	// 	Type: to.Ptr("Microsoft.KeyVault/vaults/keys"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault-name/keys/sample-key-name"),
	// 	Location: to.Ptr("westus"),
	// 	Properties: &armkeyvault.KeyProperties{
	// 		Attributes: &armkeyvault.KeyAttributes{
	// 			Created: to.Ptr[int64](1598533051),
	// 			Enabled: to.Ptr(true),
	// 			RecoveryLevel: to.Ptr(armkeyvault.DeletionRecoveryLevelPurgeable),
	// 			Updated: to.Ptr[int64](1598533051),
	// 		},
	// 		KeyOps: []*armkeyvault.JSONWebKeyOperation{
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationEncrypt),
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationDecrypt),
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationSign),
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationVerify),
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationWrapKey),
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationUnwrapKey)},
	// 			KeySize: to.Ptr[int32](2048),
	// 			KeyURI: to.Ptr("https://sample-vault-name.vault.azure.net:443/keys/sample-key-name"),
	// 			KeyURIWithVersion: to.Ptr("https://sample-vault-name.vault.azure.net:443/keys/sample-key-name/fd618d9519b74f9aae94ade66b876acc"),
	// 			Kty: to.Ptr(armkeyvault.JSONWebKeyTypeRSA),
	// 		},
	// 	}
}
Output:

func (*KeysClient) GetVersion

func (client *KeysClient) GetVersion(ctx context.Context, resourceGroupName string, vaultName string, keyName string, keyVersion string, options *KeysClientGetVersionOptions) (KeysClientGetVersionResponse, error)

GetVersion - Gets the specified version of the specified key in the specified key vault. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group which contains the specified key vault.
  • vaultName - The name of the vault which contains the key version to be retrieved.
  • keyName - The name of the key version to be retrieved.
  • keyVersion - The version of the key to be retrieved.
  • options - KeysClientGetVersionOptions contains the optional parameters for the KeysClient.GetVersion method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/getKeyVersion.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewKeysClient().GetVersion(ctx, "sample-group", "sample-vault-name", "sample-key-name", "fd618d9519b74f9aae94ade66b876acc", 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.Key = armkeyvault.Key{
	// 	Name: to.Ptr("fd618d9519b74f9aae94ade66b876acc"),
	// 	Type: to.Ptr("Microsoft.KeyVault/vaults/keys/versions"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault-name/keys/sample-key-name/versions/fd618d9519b74f9aae94ade66b876acc"),
	// 	Location: to.Ptr("westus"),
	// 	Properties: &armkeyvault.KeyProperties{
	// 		Attributes: &armkeyvault.KeyAttributes{
	// 			Created: to.Ptr[int64](1598533051),
	// 			Enabled: to.Ptr(true),
	// 			RecoveryLevel: to.Ptr(armkeyvault.DeletionRecoveryLevelPurgeable),
	// 			Updated: to.Ptr[int64](1598533051),
	// 		},
	// 		KeyOps: []*armkeyvault.JSONWebKeyOperation{
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationEncrypt),
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationDecrypt),
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationSign),
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationVerify),
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationWrapKey),
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationUnwrapKey)},
	// 			KeySize: to.Ptr[int32](2048),
	// 			KeyURI: to.Ptr("https://sample-vault-name.vault.azure.net:443/keys/sample-key-name"),
	// 			KeyURIWithVersion: to.Ptr("https://sample-vault-name.vault.azure.net:443/keys/sample-key-name/fd618d9519b74f9aae94ade66b876acc"),
	// 			Kty: to.Ptr(armkeyvault.JSONWebKeyTypeRSA),
	// 		},
	// 	}
}
Output:

func (*KeysClient) NewListPager added in v0.5.0

func (client *KeysClient) NewListPager(resourceGroupName string, vaultName string, options *KeysClientListOptions) *runtime.Pager[KeysClientListResponse]

NewListPager - Lists the keys in the specified key vault.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group which contains the specified key vault.
  • vaultName - The name of the vault which contains the keys to be retrieved.
  • options - KeysClientListOptions contains the optional parameters for the KeysClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/listKeys.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewKeysClient().NewListPager("sample-group", "sample-vault-name", 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.KeyListResult = armkeyvault.KeyListResult{
		// 	Value: []*armkeyvault.Key{
		// 		{
		// 			Name: to.Ptr("sample-key-name-1"),
		// 			Type: to.Ptr("Microsoft.KeyVault/vaults/keys"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault-name/keys/sample-key-name-1"),
		// 			Location: to.Ptr("westus"),
		// 			Properties: &armkeyvault.KeyProperties{
		// 				Attributes: &armkeyvault.KeyAttributes{
		// 					Created: to.Ptr[int64](1596493796),
		// 					Enabled: to.Ptr(true),
		// 					RecoveryLevel: to.Ptr(armkeyvault.DeletionRecoveryLevelPurgeable),
		// 					Updated: to.Ptr[int64](1596493796),
		// 				},
		// 				KeyURI: to.Ptr("https://sample-vault-name.vault.azure.net:443/keys/sample-key-name-1"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("sample-key-name-2"),
		// 			Type: to.Ptr("Microsoft.KeyVault/vaults/keys"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault-name/keys/sample-key-name-2"),
		// 			Location: to.Ptr("westus"),
		// 			Properties: &armkeyvault.KeyProperties{
		// 				Attributes: &armkeyvault.KeyAttributes{
		// 					Created: to.Ptr[int64](1596493797),
		// 					Enabled: to.Ptr(true),
		// 					RecoveryLevel: to.Ptr(armkeyvault.DeletionRecoveryLevelPurgeable),
		// 					Updated: to.Ptr[int64](1596493797),
		// 				},
		// 				KeyURI: to.Ptr("https://sample-vault-name.vault.azure.net:443/keys/sample-key-name-2"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*KeysClient) NewListVersionsPager added in v0.5.0

func (client *KeysClient) NewListVersionsPager(resourceGroupName string, vaultName string, keyName string, options *KeysClientListVersionsOptions) *runtime.Pager[KeysClientListVersionsResponse]

NewListVersionsPager - Lists the versions of the specified key in the specified key vault.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group which contains the specified key vault.
  • vaultName - The name of the vault which contains the key versions to be retrieved.
  • keyName - The name of the key versions to be retrieved.
  • options - KeysClientListVersionsOptions contains the optional parameters for the KeysClient.NewListVersionsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/listKeyVersions.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewKeysClient().NewListVersionsPager("sample-group", "sample-vault-name", "sample-key-name", 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.KeyListResult = armkeyvault.KeyListResult{
		// 	Value: []*armkeyvault.Key{
		// 		{
		// 			Name: to.Ptr("c2296aa24acf4daf86942bff5aca73dd"),
		// 			Type: to.Ptr("Microsoft.KeyVault/vaults/keys/versions"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault-name/keys/sample-key-name/versions/c2296aa24acf4daf86942bff5aca73dd"),
		// 			Location: to.Ptr("westus"),
		// 			Properties: &armkeyvault.KeyProperties{
		// 				Attributes: &armkeyvault.KeyAttributes{
		// 					Created: to.Ptr[int64](1598641074),
		// 					Enabled: to.Ptr(true),
		// 					RecoveryLevel: to.Ptr(armkeyvault.DeletionRecoveryLevelPurgeable),
		// 					Updated: to.Ptr[int64](1598641074),
		// 				},
		// 				KeyURI: to.Ptr("https://sample-vault-name.vault.azure.net:443/keys/sample-key-name"),
		// 				KeyURIWithVersion: to.Ptr("https://sample-vault-name.vault.azure.net:443/keys/sample-key-name/c2296aa24acf4daf86942bff5aca73dd"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("d5a04667b6f44b0ca62825f5eae93da6"),
		// 			Type: to.Ptr("Microsoft.KeyVault/vaults/keys/versions"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault-name/keys/sample-key-name/versions/d5a04667b6f44b0ca62825f5eae93da6"),
		// 			Location: to.Ptr("westus"),
		// 			Properties: &armkeyvault.KeyProperties{
		// 				Attributes: &armkeyvault.KeyAttributes{
		// 					Created: to.Ptr[int64](1598641295),
		// 					Enabled: to.Ptr(true),
		// 					RecoveryLevel: to.Ptr(armkeyvault.DeletionRecoveryLevelPurgeable),
		// 					Updated: to.Ptr[int64](1598641295),
		// 				},
		// 				KeyURI: to.Ptr("https://sample-vault-name.vault.azure.net:443/keys/sample-key-name"),
		// 				KeyURIWithVersion: to.Ptr("https://sample-vault-name.vault.azure.net:443/keys/sample-key-name/d5a04667b6f44b0ca62825f5eae93da6"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type KeysClientCreateIfNotExistOptions added in v0.3.0

type KeysClientCreateIfNotExistOptions struct {
}

KeysClientCreateIfNotExistOptions contains the optional parameters for the KeysClient.CreateIfNotExist method.

type KeysClientCreateIfNotExistResponse added in v0.3.0

type KeysClientCreateIfNotExistResponse struct {
	// The key resource.
	Key
}

KeysClientCreateIfNotExistResponse contains the response from method KeysClient.CreateIfNotExist.

type KeysClientGetOptions added in v0.3.0

type KeysClientGetOptions struct {
}

KeysClientGetOptions contains the optional parameters for the KeysClient.Get method.

type KeysClientGetResponse added in v0.3.0

type KeysClientGetResponse struct {
	// The key resource.
	Key
}

KeysClientGetResponse contains the response from method KeysClient.Get.

type KeysClientGetVersionOptions added in v0.3.0

type KeysClientGetVersionOptions struct {
}

KeysClientGetVersionOptions contains the optional parameters for the KeysClient.GetVersion method.

type KeysClientGetVersionResponse added in v0.3.0

type KeysClientGetVersionResponse struct {
	// The key resource.
	Key
}

KeysClientGetVersionResponse contains the response from method KeysClient.GetVersion.

type KeysClientListOptions added in v0.3.0

type KeysClientListOptions struct {
}

KeysClientListOptions contains the optional parameters for the KeysClient.NewListPager method.

type KeysClientListResponse added in v0.3.0

type KeysClientListResponse struct {
	// The page of keys.
	KeyListResult
}

KeysClientListResponse contains the response from method KeysClient.NewListPager.

type KeysClientListVersionsOptions added in v0.3.0

type KeysClientListVersionsOptions struct {
}

KeysClientListVersionsOptions contains the optional parameters for the KeysClient.NewListVersionsPager method.

type KeysClientListVersionsResponse added in v0.3.0

type KeysClientListVersionsResponse struct {
	// The page of keys.
	KeyListResult
}

KeysClientListVersionsResponse contains the response from method KeysClient.NewListVersionsPager.

type LifetimeAction

type LifetimeAction struct {
	// The action of key rotation policy lifetimeAction.
	Action *Action

	// The trigger of key rotation policy lifetimeAction.
	Trigger *Trigger
}

func (LifetimeAction) MarshalJSON added in v1.2.0

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

MarshalJSON implements the json.Marshaller interface for type LifetimeAction.

func (*LifetimeAction) UnmarshalJSON added in v1.2.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type LifetimeAction.

type LogSpecification

type LogSpecification struct {
	// Blob duration of specification.
	BlobDuration *string

	// Display name of log specification.
	DisplayName *string

	// Name of log specification.
	Name *string
}

LogSpecification - Log specification of operation.

func (LogSpecification) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type LogSpecification.

func (*LogSpecification) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type LogSpecification.

type MHSMGeoReplicatedRegion added in v1.2.0

type MHSMGeoReplicatedRegion struct {
	// A boolean value that indicates whether the region is the primary region or a secondary region.
	IsPrimary *bool

	// Name of the geo replicated region.
	Name *string

	// READ-ONLY; Provisioning state of the geo replicated region.
	ProvisioningState *GeoReplicationRegionProvisioningState
}

MHSMGeoReplicatedRegion - A region that this managed HSM Pool has been extended to.

func (MHSMGeoReplicatedRegion) MarshalJSON added in v1.2.0

func (m MHSMGeoReplicatedRegion) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type MHSMGeoReplicatedRegion.

func (*MHSMGeoReplicatedRegion) UnmarshalJSON added in v1.2.0

func (m *MHSMGeoReplicatedRegion) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type MHSMGeoReplicatedRegion.

type MHSMIPRule

type MHSMIPRule struct {
	// REQUIRED; An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) or '124.56.78.0/24' (all addresses
	// that start with 124.56.78).
	Value *string
}

MHSMIPRule - A rule governing the accessibility of a managed HSM pool from a specific IP address or IP range.

func (MHSMIPRule) MarshalJSON added in v1.1.0

func (m MHSMIPRule) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type MHSMIPRule.

func (*MHSMIPRule) UnmarshalJSON added in v1.1.0

func (m *MHSMIPRule) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type MHSMIPRule.

type MHSMNetworkRuleSet

type MHSMNetworkRuleSet struct {
	// Tells what traffic can bypass network rules. This can be 'AzureServices' or 'None'. If not specified the default is 'AzureServices'.
	Bypass *NetworkRuleBypassOptions

	// The default action when no rule from ipRules and from virtualNetworkRules match. This is only used after the bypass property
	// has been evaluated.
	DefaultAction *NetworkRuleAction

	// The list of IP address rules.
	IPRules []*MHSMIPRule

	// The list of virtual network rules.
	VirtualNetworkRules []*MHSMVirtualNetworkRule
}

MHSMNetworkRuleSet - A set of rules governing the network accessibility of a managed hsm pool.

func (MHSMNetworkRuleSet) MarshalJSON

func (m MHSMNetworkRuleSet) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type MHSMNetworkRuleSet.

func (*MHSMNetworkRuleSet) UnmarshalJSON added in v1.1.0

func (m *MHSMNetworkRuleSet) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type MHSMNetworkRuleSet.

type MHSMPrivateEndpoint

type MHSMPrivateEndpoint struct {
	// READ-ONLY; Full identifier of the private endpoint resource.
	ID *string
}

MHSMPrivateEndpoint - Private endpoint object properties.

func (MHSMPrivateEndpoint) MarshalJSON added in v1.1.0

func (m MHSMPrivateEndpoint) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type MHSMPrivateEndpoint.

func (*MHSMPrivateEndpoint) UnmarshalJSON added in v1.1.0

func (m *MHSMPrivateEndpoint) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type MHSMPrivateEndpoint.

type MHSMPrivateEndpointConnection

type MHSMPrivateEndpointConnection struct {
	// Modified whenever there is a change in the state of private endpoint connection.
	Etag *string

	// Managed service identity (system assigned and/or user assigned identities)
	Identity *ManagedServiceIdentity

	// The supported Azure location where the managed HSM Pool should be created.
	Location *string

	// Resource properties.
	Properties *MHSMPrivateEndpointConnectionProperties

	// SKU details
	SKU *ManagedHsmSKU

	// Resource tags
	Tags map[string]*string

	// READ-ONLY; The Azure Resource Manager resource ID for the managed HSM Pool.
	ID *string

	// READ-ONLY; The name of the managed HSM Pool.
	Name *string

	// READ-ONLY; Metadata pertaining to creation and last modification of the key vault resource.
	SystemData *SystemData

	// READ-ONLY; The resource type of the managed HSM Pool.
	Type *string
}

MHSMPrivateEndpointConnection - Private endpoint connection resource.

func (MHSMPrivateEndpointConnection) MarshalJSON

func (m MHSMPrivateEndpointConnection) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type MHSMPrivateEndpointConnection.

func (*MHSMPrivateEndpointConnection) UnmarshalJSON added in v1.1.0

func (m *MHSMPrivateEndpointConnection) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type MHSMPrivateEndpointConnection.

type MHSMPrivateEndpointConnectionItem

type MHSMPrivateEndpointConnectionItem struct {
	// Modified whenever there is a change in the state of private endpoint connection.
	Etag *string

	// Id of private endpoint connection.
	ID *string

	// Private endpoint connection properties.
	Properties *MHSMPrivateEndpointConnectionProperties
}

MHSMPrivateEndpointConnectionItem - Private endpoint connection item.

func (MHSMPrivateEndpointConnectionItem) MarshalJSON added in v1.1.0

func (m MHSMPrivateEndpointConnectionItem) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type MHSMPrivateEndpointConnectionItem.

func (*MHSMPrivateEndpointConnectionItem) UnmarshalJSON added in v1.1.0

func (m *MHSMPrivateEndpointConnectionItem) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type MHSMPrivateEndpointConnectionItem.

type MHSMPrivateEndpointConnectionProperties

type MHSMPrivateEndpointConnectionProperties struct {
	// Properties of the private endpoint object.
	PrivateEndpoint *MHSMPrivateEndpoint

	// Approval state of the private link connection.
	PrivateLinkServiceConnectionState *MHSMPrivateLinkServiceConnectionState

	// Provisioning state of the private endpoint connection.
	ProvisioningState *PrivateEndpointConnectionProvisioningState
}

MHSMPrivateEndpointConnectionProperties - Properties of the private endpoint connection resource.

func (MHSMPrivateEndpointConnectionProperties) MarshalJSON added in v1.1.0

func (m MHSMPrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type MHSMPrivateEndpointConnectionProperties.

func (*MHSMPrivateEndpointConnectionProperties) UnmarshalJSON added in v1.1.0

func (m *MHSMPrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type MHSMPrivateEndpointConnectionProperties.

type MHSMPrivateEndpointConnectionsClient

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

MHSMPrivateEndpointConnectionsClient contains the methods for the MHSMPrivateEndpointConnections group. Don't use this type directly, use NewMHSMPrivateEndpointConnectionsClient() instead.

func NewMHSMPrivateEndpointConnectionsClient

func NewMHSMPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MHSMPrivateEndpointConnectionsClient, error)

NewMHSMPrivateEndpointConnectionsClient creates a new instance of MHSMPrivateEndpointConnectionsClient with the specified values.

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

func (*MHSMPrivateEndpointConnectionsClient) BeginDelete

BeginDelete - Deletes the specified private endpoint connection associated with the managed hsm pool. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - Name of the resource group that contains the managed HSM pool.
  • name - Name of the managed HSM Pool
  • privateEndpointConnectionName - Name of the private endpoint connection associated with the managed hsm pool.
  • options - MHSMPrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the MHSMPrivateEndpointConnectionsClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_deletePrivateEndpointConnection.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewMHSMPrivateEndpointConnectionsClient().BeginDelete(ctx, "sample-group", "sample-mhsm", "sample-pec", 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.MHSMPrivateEndpointConnection = armkeyvault.MHSMPrivateEndpointConnection{
	// 	Name: to.Ptr("sample-pec"),
	// 	Type: to.Ptr("Microsoft.KeyVault/managedhsms/privateEndpointConnections"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/managedhsms/sample-vault/privateEndpointConnections/sample-pec"),
	// 	Properties: &armkeyvault.MHSMPrivateEndpointConnectionProperties{
	// 		ProvisioningState: to.Ptr(armkeyvault.PrivateEndpointConnectionProvisioningStateSucceeded),
	// 	},
	// }
}
Output:

func (*MHSMPrivateEndpointConnectionsClient) Get

Get - Gets the specified private endpoint connection associated with the managed HSM Pool. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - Name of the resource group that contains the managed HSM pool.
  • name - Name of the managed HSM Pool
  • privateEndpointConnectionName - Name of the private endpoint connection associated with the managed hsm pool.
  • options - MHSMPrivateEndpointConnectionsClientGetOptions contains the optional parameters for the MHSMPrivateEndpointConnectionsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_getPrivateEndpointConnection.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewMHSMPrivateEndpointConnectionsClient().Get(ctx, "sample-group", "sample-mhsm", "sample-pec", 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.MHSMPrivateEndpointConnection = armkeyvault.MHSMPrivateEndpointConnection{
	// 	Name: to.Ptr("sample-pec"),
	// 	Type: to.Ptr("Microsoft.KeyVault/managedhsms/privateEndpointConnections"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/managedhsms/sample-mhsm/privateEndpointConnections/sample-pec"),
	// 	Etag: to.Ptr(""),
	// 	Properties: &armkeyvault.MHSMPrivateEndpointConnectionProperties{
	// 		PrivateEndpoint: &armkeyvault.MHSMPrivateEndpoint{
	// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-1234-000000000000/resourceGroups/sample-group/providers/Microsoft.Network/privateEndpoints/sample-pe"),
	// 		},
	// 		PrivateLinkServiceConnectionState: &armkeyvault.MHSMPrivateLinkServiceConnectionState{
	// 			Description: to.Ptr("This was automatically approved by user1234@contoso.com"),
	// 			ActionsRequired: to.Ptr(armkeyvault.ActionsRequiredNone),
	// 			Status: to.Ptr(armkeyvault.PrivateEndpointServiceConnectionStatusApproved),
	// 		},
	// 		ProvisioningState: to.Ptr(armkeyvault.PrivateEndpointConnectionProvisioningStateSucceeded),
	// 	},
	// }
}
Output:

func (*MHSMPrivateEndpointConnectionsClient) NewListByResourcePager added in v0.5.0

NewListByResourcePager - The List operation gets information about the private endpoint connections associated with the managed HSM Pool.

Generated from API version 2023-07-01

  • resourceGroupName - Name of the resource group that contains the managed HSM pool.
  • name - Name of the managed HSM Pool
  • options - MHSMPrivateEndpointConnectionsClientListByResourceOptions contains the optional parameters for the MHSMPrivateEndpointConnectionsClient.NewListByResourcePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_ListPrivateEndpointConnectionsByResource.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewMHSMPrivateEndpointConnectionsClient().NewListByResourcePager("sample-group", "sample-mhsm", 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.MHSMPrivateEndpointConnectionsListResult = armkeyvault.MHSMPrivateEndpointConnectionsListResult{
		// 	Value: []*armkeyvault.MHSMPrivateEndpointConnection{
		// 		{
		// 			Name: to.Ptr("sample-pec1"),
		// 			Type: to.Ptr("Microsoft.KeyVault/managedhsms/privateEndpointConnections"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/managedhsms/sample-mhsm/privateEndpointConnections/sample-pec1"),
		// 			Etag: to.Ptr(""),
		// 			Properties: &armkeyvault.MHSMPrivateEndpointConnectionProperties{
		// 				PrivateEndpoint: &armkeyvault.MHSMPrivateEndpoint{
		// 					ID: to.Ptr("/subscriptions/00000000-0000-0000-1234-000000000000/resourceGroups/sample-group/providers/Microsoft.Network/privateEndpoints/sample-pe1"),
		// 				},
		// 				PrivateLinkServiceConnectionState: &armkeyvault.MHSMPrivateLinkServiceConnectionState{
		// 					Description: to.Ptr("This was automatically approved by user1234@contoso.com"),
		// 					ActionsRequired: to.Ptr(armkeyvault.ActionsRequiredNone),
		// 					Status: to.Ptr(armkeyvault.PrivateEndpointServiceConnectionStatusApproved),
		// 				},
		// 				ProvisioningState: to.Ptr(armkeyvault.PrivateEndpointConnectionProvisioningStateSucceeded),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("sample-pec2"),
		// 			Type: to.Ptr("Microsoft.KeyVault/managedhsms/privateEndpointConnections"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/managedhsms/sample-mhsm/privateEndpointConnections/sample-pec2"),
		// 			Etag: to.Ptr(""),
		// 			Properties: &armkeyvault.MHSMPrivateEndpointConnectionProperties{
		// 				PrivateEndpoint: &armkeyvault.MHSMPrivateEndpoint{
		// 					ID: to.Ptr("/subscriptions/00000000-0000-0000-1234-000000000000/resourceGroups/sample-group/providers/Microsoft.Network/privateEndpoints/sample-pe2"),
		// 				},
		// 				PrivateLinkServiceConnectionState: &armkeyvault.MHSMPrivateLinkServiceConnectionState{
		// 					Description: to.Ptr("This was automatically approved by user1234@contoso.com"),
		// 					ActionsRequired: to.Ptr(armkeyvault.ActionsRequiredNone),
		// 					Status: to.Ptr(armkeyvault.PrivateEndpointServiceConnectionStatusApproved),
		// 				},
		// 				ProvisioningState: to.Ptr(armkeyvault.PrivateEndpointConnectionProvisioningStateSucceeded),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*MHSMPrivateEndpointConnectionsClient) Put

Put - Updates the specified private endpoint connection associated with the managed hsm pool. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - Name of the resource group that contains the managed HSM pool.
  • name - Name of the managed HSM Pool
  • privateEndpointConnectionName - Name of the private endpoint connection associated with the managed hsm pool.
  • properties - The intended state of private endpoint connection.
  • options - MHSMPrivateEndpointConnectionsClientPutOptions contains the optional parameters for the MHSMPrivateEndpointConnectionsClient.Put method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_putPrivateEndpointConnection.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/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewMHSMPrivateEndpointConnectionsClient().Put(ctx, "sample-group", "sample-mhsm", "sample-pec", armkeyvault.MHSMPrivateEndpointConnection{
		Properties: &armkeyvault.MHSMPrivateEndpointConnectionProperties{
			PrivateLinkServiceConnectionState: &armkeyvault.MHSMPrivateLinkServiceConnectionState{
				Description: to.Ptr("My name is Joe and I'm approving this."),
				Status:      to.Ptr(armkeyvault.PrivateEndpointServiceConnectionStatusApproved),
			},
		},
	}, 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.MHSMPrivateEndpointConnection = armkeyvault.MHSMPrivateEndpointConnection{
	// 	Name: to.Ptr("sample-pec"),
	// 	Type: to.Ptr("Microsoft.KeyVault/managedhsms/privateEndpointConnections"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/managedhsms/sample-mhsm/privateEndpointConnections/sample-pec"),
	// 	Properties: &armkeyvault.MHSMPrivateEndpointConnectionProperties{
	// 		PrivateEndpoint: &armkeyvault.MHSMPrivateEndpoint{
	// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-1234-000000000000/resourceGroups/sample-group/providers/Microsoft.Network/privateEndpoints/sample-pe"),
	// 		},
	// 		PrivateLinkServiceConnectionState: &armkeyvault.MHSMPrivateLinkServiceConnectionState{
	// 			Description: to.Ptr("My name is Joe and I'm approving this."),
	// 			ActionsRequired: to.Ptr(armkeyvault.ActionsRequiredNone),
	// 			Status: to.Ptr(armkeyvault.PrivateEndpointServiceConnectionStatusApproved),
	// 		},
	// 		ProvisioningState: to.Ptr(armkeyvault.PrivateEndpointConnectionProvisioningStateSucceeded),
	// 	},
	// }
}
Output:

type MHSMPrivateEndpointConnectionsClientBeginDeleteOptions added in v0.3.0

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

MHSMPrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the MHSMPrivateEndpointConnectionsClient.BeginDelete method.

type MHSMPrivateEndpointConnectionsClientDeleteResponse added in v0.3.0

type MHSMPrivateEndpointConnectionsClientDeleteResponse struct {
	// Private endpoint connection resource.
	MHSMPrivateEndpointConnection
}

MHSMPrivateEndpointConnectionsClientDeleteResponse contains the response from method MHSMPrivateEndpointConnectionsClient.BeginDelete.

type MHSMPrivateEndpointConnectionsClientGetOptions added in v0.3.0

type MHSMPrivateEndpointConnectionsClientGetOptions struct {
}

MHSMPrivateEndpointConnectionsClientGetOptions contains the optional parameters for the MHSMPrivateEndpointConnectionsClient.Get method.

type MHSMPrivateEndpointConnectionsClientGetResponse added in v0.3.0

type MHSMPrivateEndpointConnectionsClientGetResponse struct {
	// Private endpoint connection resource.
	MHSMPrivateEndpointConnection
}

MHSMPrivateEndpointConnectionsClientGetResponse contains the response from method MHSMPrivateEndpointConnectionsClient.Get.

type MHSMPrivateEndpointConnectionsClientListByResourceOptions added in v0.3.0

type MHSMPrivateEndpointConnectionsClientListByResourceOptions struct {
}

MHSMPrivateEndpointConnectionsClientListByResourceOptions contains the optional parameters for the MHSMPrivateEndpointConnectionsClient.NewListByResourcePager method.

type MHSMPrivateEndpointConnectionsClientListByResourceResponse added in v0.3.0

type MHSMPrivateEndpointConnectionsClientListByResourceResponse struct {
	// List of private endpoint connections associated with a managed HSM Pools
	MHSMPrivateEndpointConnectionsListResult
}

MHSMPrivateEndpointConnectionsClientListByResourceResponse contains the response from method MHSMPrivateEndpointConnectionsClient.NewListByResourcePager.

type MHSMPrivateEndpointConnectionsClientPutOptions added in v0.3.0

type MHSMPrivateEndpointConnectionsClientPutOptions struct {
}

MHSMPrivateEndpointConnectionsClientPutOptions contains the optional parameters for the MHSMPrivateEndpointConnectionsClient.Put method.

type MHSMPrivateEndpointConnectionsClientPutResponse added in v0.3.0

type MHSMPrivateEndpointConnectionsClientPutResponse struct {
	// Private endpoint connection resource.
	MHSMPrivateEndpointConnection

	// AzureAsyncOperation contains the information returned from the Azure-AsyncOperation header response.
	AzureAsyncOperation *string

	// RetryAfter contains the information returned from the Retry-After header response.
	RetryAfter *int32
}

MHSMPrivateEndpointConnectionsClientPutResponse contains the response from method MHSMPrivateEndpointConnectionsClient.Put.

type MHSMPrivateEndpointConnectionsListResult

type MHSMPrivateEndpointConnectionsListResult struct {
	// The URL to get the next set of managed HSM Pools.
	NextLink *string

	// The private endpoint connection associated with a managed HSM Pools.
	Value []*MHSMPrivateEndpointConnection
}

MHSMPrivateEndpointConnectionsListResult - List of private endpoint connections associated with a managed HSM Pools

func (MHSMPrivateEndpointConnectionsListResult) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type MHSMPrivateEndpointConnectionsListResult.

func (*MHSMPrivateEndpointConnectionsListResult) UnmarshalJSON added in v1.1.0

func (m *MHSMPrivateEndpointConnectionsListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type MHSMPrivateEndpointConnectionsListResult.

type MHSMPrivateLinkResource

type MHSMPrivateLinkResource struct {
	// Managed service identity (system assigned and/or user assigned identities)
	Identity *ManagedServiceIdentity

	// The supported Azure location where the managed HSM Pool should be created.
	Location *string

	// Resource properties.
	Properties *MHSMPrivateLinkResourceProperties

	// SKU details
	SKU *ManagedHsmSKU

	// Resource tags
	Tags map[string]*string

	// READ-ONLY; The Azure Resource Manager resource ID for the managed HSM Pool.
	ID *string

	// READ-ONLY; The name of the managed HSM Pool.
	Name *string

	// READ-ONLY; Metadata pertaining to creation and last modification of the key vault resource.
	SystemData *SystemData

	// READ-ONLY; The resource type of the managed HSM Pool.
	Type *string
}

MHSMPrivateLinkResource - A private link resource

func (MHSMPrivateLinkResource) MarshalJSON

func (m MHSMPrivateLinkResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type MHSMPrivateLinkResource.

func (*MHSMPrivateLinkResource) UnmarshalJSON added in v1.1.0

func (m *MHSMPrivateLinkResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type MHSMPrivateLinkResource.

type MHSMPrivateLinkResourceListResult

type MHSMPrivateLinkResourceListResult struct {
	// Array of private link resources
	Value []*MHSMPrivateLinkResource
}

MHSMPrivateLinkResourceListResult - A list of private link resources

func (MHSMPrivateLinkResourceListResult) MarshalJSON

func (m MHSMPrivateLinkResourceListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type MHSMPrivateLinkResourceListResult.

func (*MHSMPrivateLinkResourceListResult) UnmarshalJSON added in v1.1.0

func (m *MHSMPrivateLinkResourceListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type MHSMPrivateLinkResourceListResult.

type MHSMPrivateLinkResourceProperties

type MHSMPrivateLinkResourceProperties struct {
	// Required DNS zone names of the the private link resource.
	RequiredZoneNames []*string

	// READ-ONLY; Group identifier of private link resource.
	GroupID *string

	// READ-ONLY; Required member names of private link resource.
	RequiredMembers []*string
}

MHSMPrivateLinkResourceProperties - Properties of a private link resource.

func (MHSMPrivateLinkResourceProperties) MarshalJSON

func (m MHSMPrivateLinkResourceProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type MHSMPrivateLinkResourceProperties.

func (*MHSMPrivateLinkResourceProperties) UnmarshalJSON added in v1.1.0

func (m *MHSMPrivateLinkResourceProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type MHSMPrivateLinkResourceProperties.

type MHSMPrivateLinkResourcesClient

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

MHSMPrivateLinkResourcesClient contains the methods for the MHSMPrivateLinkResources group. Don't use this type directly, use NewMHSMPrivateLinkResourcesClient() instead.

func NewMHSMPrivateLinkResourcesClient

func NewMHSMPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MHSMPrivateLinkResourcesClient, error)

NewMHSMPrivateLinkResourcesClient creates a new instance of MHSMPrivateLinkResourcesClient with the specified values.

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

func (*MHSMPrivateLinkResourcesClient) ListByMHSMResource

ListByMHSMResource - Gets the private link resources supported for the managed hsm pool. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - Name of the resource group that contains the managed HSM pool.
  • name - Name of the managed HSM Pool
  • options - MHSMPrivateLinkResourcesClientListByMHSMResourceOptions contains the optional parameters for the MHSMPrivateLinkResourcesClient.ListByMHSMResource method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_listPrivateLinkResources.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewMHSMPrivateLinkResourcesClient().ListByMHSMResource(ctx, "sample-group", "sample-mhsm", 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.MHSMPrivateLinkResourceListResult = armkeyvault.MHSMPrivateLinkResourceListResult{
	// 	Value: []*armkeyvault.MHSMPrivateLinkResource{
	// 		{
	// 			Name: to.Ptr("managedhsm"),
	// 			Type: to.Ptr("Microsoft.KeyVault/managedhsms/privateLinkResources"),
	// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.KeyVault/managedhsms/sample-mhsm/privateLinkResources/managedhsm"),
	// 			Properties: &armkeyvault.MHSMPrivateLinkResourceProperties{
	// 				GroupID: to.Ptr("managedhsms"),
	// 				RequiredMembers: []*string{
	// 					to.Ptr("default")},
	// 					RequiredZoneNames: []*string{
	// 						to.Ptr("privatelink.managedhsm.azure.net")},
	// 					},
	// 			}},
	// 		}
}
Output:

type MHSMPrivateLinkResourcesClientListByMHSMResourceOptions added in v0.3.0

type MHSMPrivateLinkResourcesClientListByMHSMResourceOptions struct {
}

MHSMPrivateLinkResourcesClientListByMHSMResourceOptions contains the optional parameters for the MHSMPrivateLinkResourcesClient.ListByMHSMResource method.

type MHSMPrivateLinkResourcesClientListByMHSMResourceResponse added in v0.3.0

type MHSMPrivateLinkResourcesClientListByMHSMResourceResponse struct {
	// A list of private link resources
	MHSMPrivateLinkResourceListResult
}

MHSMPrivateLinkResourcesClientListByMHSMResourceResponse contains the response from method MHSMPrivateLinkResourcesClient.ListByMHSMResource.

type MHSMPrivateLinkServiceConnectionState

type MHSMPrivateLinkServiceConnectionState struct {
	// A message indicating if changes on the service provider require any updates on the consumer.
	ActionsRequired *ActionsRequired

	// The reason for approval or rejection.
	Description *string

	// Indicates whether the connection has been approved, rejected or removed by the key vault owner.
	Status *PrivateEndpointServiceConnectionStatus
}

MHSMPrivateLinkServiceConnectionState - An object that represents the approval state of the private link connection.

func (MHSMPrivateLinkServiceConnectionState) MarshalJSON added in v1.1.0

func (m MHSMPrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type MHSMPrivateLinkServiceConnectionState.

func (*MHSMPrivateLinkServiceConnectionState) UnmarshalJSON added in v1.1.0

func (m *MHSMPrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type MHSMPrivateLinkServiceConnectionState.

type MHSMRegionsClient added in v1.2.0

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

MHSMRegionsClient contains the methods for the MHSMRegions group. Don't use this type directly, use NewMHSMRegionsClient() instead.

func NewMHSMRegionsClient added in v1.2.0

func NewMHSMRegionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MHSMRegionsClient, error)

NewMHSMRegionsClient creates a new instance of MHSMRegionsClient with the specified values.

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

func (*MHSMRegionsClient) NewListByResourcePager added in v1.2.0

func (client *MHSMRegionsClient) NewListByResourcePager(resourceGroupName string, name string, options *MHSMRegionsClientListByResourceOptions) *runtime.Pager[MHSMRegionsClientListByResourceResponse]

NewListByResourcePager - The List operation gets information about the regions associated with the managed HSM Pool.

Generated from API version 2023-07-01

  • resourceGroupName - Name of the resource group that contains the managed HSM pool.
  • name - Name of the managed HSM Pool
  • options - MHSMRegionsClientListByResourceOptions contains the optional parameters for the MHSMRegionsClient.NewListByResourcePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_ListRegionsByResource.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewMHSMRegionsClient().NewListByResourcePager("sample-group", "sample-mhsm", 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.MHSMRegionsListResult = armkeyvault.MHSMRegionsListResult{
		// 	Value: []*armkeyvault.MHSMGeoReplicatedRegion{
		// 		{
		// 			Name: to.Ptr("sample-region1"),
		// 			IsPrimary: to.Ptr(true),
		// 			ProvisioningState: to.Ptr(armkeyvault.GeoReplicationRegionProvisioningStateSucceeded),
		// 		},
		// 		{
		// 			Name: to.Ptr("sample-region2"),
		// 			IsPrimary: to.Ptr(false),
		// 			ProvisioningState: to.Ptr(armkeyvault.GeoReplicationRegionProvisioningStateSucceeded),
		// 	}},
		// }
	}
}
Output:

type MHSMRegionsClientListByResourceOptions added in v1.2.0

type MHSMRegionsClientListByResourceOptions struct {
}

MHSMRegionsClientListByResourceOptions contains the optional parameters for the MHSMRegionsClient.NewListByResourcePager method.

type MHSMRegionsClientListByResourceResponse added in v1.2.0

type MHSMRegionsClientListByResourceResponse struct {
	// List of regions associated with a managed HSM Pools
	MHSMRegionsListResult
}

MHSMRegionsClientListByResourceResponse contains the response from method MHSMRegionsClient.NewListByResourcePager.

type MHSMRegionsListResult added in v1.2.0

type MHSMRegionsListResult struct {
	// The URL to get the next set of managed HSM Pools.
	NextLink *string

	// The region associated with a managed HSM Pools.
	Value []*MHSMGeoReplicatedRegion
}

MHSMRegionsListResult - List of regions associated with a managed HSM Pools

func (MHSMRegionsListResult) MarshalJSON added in v1.2.0

func (m MHSMRegionsListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type MHSMRegionsListResult.

func (*MHSMRegionsListResult) UnmarshalJSON added in v1.2.0

func (m *MHSMRegionsListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type MHSMRegionsListResult.

type MHSMVirtualNetworkRule

type MHSMVirtualNetworkRule struct {
	// REQUIRED; Full resource id of a vnet subnet, such as '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'.
	ID *string
}

MHSMVirtualNetworkRule - A rule governing the accessibility of a managed hsm pool from a specific virtual network.

func (MHSMVirtualNetworkRule) MarshalJSON added in v1.1.0

func (m MHSMVirtualNetworkRule) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type MHSMVirtualNetworkRule.

func (*MHSMVirtualNetworkRule) UnmarshalJSON added in v1.1.0

func (m *MHSMVirtualNetworkRule) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type MHSMVirtualNetworkRule.

type ManagedHSMSecurityDomainProperties added in v1.2.0

type ManagedHSMSecurityDomainProperties struct {
	// READ-ONLY; Activation Status
	ActivationStatus *ActivationStatus

	// READ-ONLY; Activation Status Message.
	ActivationStatusMessage *string
}

ManagedHSMSecurityDomainProperties - The security domain properties of the managed hsm.

func (ManagedHSMSecurityDomainProperties) MarshalJSON added in v1.2.0

func (m ManagedHSMSecurityDomainProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ManagedHSMSecurityDomainProperties.

func (*ManagedHSMSecurityDomainProperties) UnmarshalJSON added in v1.2.0

func (m *ManagedHSMSecurityDomainProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ManagedHSMSecurityDomainProperties.

type ManagedHsm

type ManagedHsm struct {
	// Managed service identity (system assigned and/or user assigned identities)
	Identity *ManagedServiceIdentity

	// The supported Azure location where the managed HSM Pool should be created.
	Location *string

	// Properties of the managed HSM
	Properties *ManagedHsmProperties

	// SKU details
	SKU *ManagedHsmSKU

	// Resource tags
	Tags map[string]*string

	// READ-ONLY; The Azure Resource Manager resource ID for the managed HSM Pool.
	ID *string

	// READ-ONLY; The name of the managed HSM Pool.
	Name *string

	// READ-ONLY; Metadata pertaining to creation and last modification of the key vault resource.
	SystemData *SystemData

	// READ-ONLY; The resource type of the managed HSM Pool.
	Type *string
}

ManagedHsm - Resource information with extended details.

func (ManagedHsm) MarshalJSON

func (m ManagedHsm) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ManagedHsm.

func (*ManagedHsm) UnmarshalJSON added in v1.1.0

func (m *ManagedHsm) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ManagedHsm.

type ManagedHsmAction added in v1.2.0

type ManagedHsmAction struct {
	// The type of action.
	Type *KeyRotationPolicyActionType
}

func (ManagedHsmAction) MarshalJSON added in v1.2.0

func (m ManagedHsmAction) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ManagedHsmAction.

func (*ManagedHsmAction) UnmarshalJSON added in v1.2.0

func (m *ManagedHsmAction) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ManagedHsmAction.

type ManagedHsmKey added in v1.2.0

type ManagedHsmKey struct {
	// REQUIRED; The properties of the key.
	Properties *ManagedHsmKeyProperties

	// Resource tags.
	Tags map[string]*string

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

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

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

ManagedHsmKey - The key resource.

func (ManagedHsmKey) MarshalJSON added in v1.2.0

func (m ManagedHsmKey) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ManagedHsmKey.

func (*ManagedHsmKey) UnmarshalJSON added in v1.2.0

func (m *ManagedHsmKey) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ManagedHsmKey.

type ManagedHsmKeyAttributes added in v1.2.0

type ManagedHsmKeyAttributes struct {
	// Determines whether or not the object is enabled.
	Enabled *bool

	// Expiry date in seconds since 1970-01-01T00:00:00Z.
	Expires *int64

	// Indicates if the private key can be exported.
	Exportable *bool

	// Not before date in seconds since 1970-01-01T00:00:00Z.
	NotBefore *int64

	// READ-ONLY; Creation time in seconds since 1970-01-01T00:00:00Z.
	Created *int64

	// READ-ONLY; The deletion recovery level currently in effect for the object. If it contains 'Purgeable', then the object
	// can be permanently deleted by a privileged user; otherwise, only the system can purge the
	// object at the end of the retention interval.
	RecoveryLevel *DeletionRecoveryLevel

	// READ-ONLY; Last updated time in seconds since 1970-01-01T00:00:00Z.
	Updated *int64
}

ManagedHsmKeyAttributes - The object attributes managed by the Azure Key Vault service.

func (ManagedHsmKeyAttributes) MarshalJSON added in v1.2.0

func (m ManagedHsmKeyAttributes) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ManagedHsmKeyAttributes.

func (*ManagedHsmKeyAttributes) UnmarshalJSON added in v1.2.0

func (m *ManagedHsmKeyAttributes) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ManagedHsmKeyAttributes.

type ManagedHsmKeyCreateParameters added in v1.2.0

type ManagedHsmKeyCreateParameters struct {
	// REQUIRED; The properties of the key to be created.
	Properties *ManagedHsmKeyProperties

	// The tags that will be assigned to the key.
	Tags map[string]*string
}

ManagedHsmKeyCreateParameters - The parameters used to create a key.

func (ManagedHsmKeyCreateParameters) MarshalJSON added in v1.2.0

func (m ManagedHsmKeyCreateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ManagedHsmKeyCreateParameters.

func (*ManagedHsmKeyCreateParameters) UnmarshalJSON added in v1.2.0

func (m *ManagedHsmKeyCreateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ManagedHsmKeyCreateParameters.

type ManagedHsmKeyListResult added in v1.2.0

type ManagedHsmKeyListResult struct {
	// The URL to get the next page of keys.
	NextLink *string

	// The key resources.
	Value []*ManagedHsmKey
}

ManagedHsmKeyListResult - The page of keys.

func (ManagedHsmKeyListResult) MarshalJSON added in v1.2.0

func (m ManagedHsmKeyListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ManagedHsmKeyListResult.

func (*ManagedHsmKeyListResult) UnmarshalJSON added in v1.2.0

func (m *ManagedHsmKeyListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ManagedHsmKeyListResult.

type ManagedHsmKeyProperties added in v1.2.0

type ManagedHsmKeyProperties struct {
	// The attributes of the key.
	Attributes *ManagedHsmKeyAttributes

	// The elliptic curve name. For valid values, see JsonWebKeyCurveName.
	CurveName *JSONWebKeyCurveName
	KeyOps    []*JSONWebKeyOperation

	// The key size in bits. For example: 2048, 3072, or 4096 for RSA.
	KeySize *int32

	// The type of the key. For valid values, see JsonWebKeyType.
	Kty *JSONWebKeyType

	// Key release policy in response. It will be used for both output and input. Omitted if empty
	ReleasePolicy *ManagedHsmKeyReleasePolicy

	// Key rotation policy in response. It will be used for both output and input. Omitted if empty
	RotationPolicy *ManagedHsmRotationPolicy

	// READ-ONLY; The URI to retrieve the current version of the key.
	KeyURI *string

	// READ-ONLY; The URI to retrieve the specific version of the key.
	KeyURIWithVersion *string
}

ManagedHsmKeyProperties - The properties of the key.

func (ManagedHsmKeyProperties) MarshalJSON added in v1.2.0

func (m ManagedHsmKeyProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ManagedHsmKeyProperties.

func (*ManagedHsmKeyProperties) UnmarshalJSON added in v1.2.0

func (m *ManagedHsmKeyProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ManagedHsmKeyProperties.

type ManagedHsmKeyReleasePolicy added in v1.2.0

type ManagedHsmKeyReleasePolicy struct {
	// Content type and version of key release policy
	ContentType *string

	// Blob encoding the policy rules under which the key can be released.
	Data []byte
}

func (ManagedHsmKeyReleasePolicy) MarshalJSON added in v1.2.0

func (m ManagedHsmKeyReleasePolicy) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ManagedHsmKeyReleasePolicy.

func (*ManagedHsmKeyReleasePolicy) UnmarshalJSON added in v1.2.0

func (m *ManagedHsmKeyReleasePolicy) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ManagedHsmKeyReleasePolicy.

type ManagedHsmKeyRotationPolicyAttributes added in v1.2.0

type ManagedHsmKeyRotationPolicyAttributes struct {
	// The expiration time for the new key version. It should be in ISO8601 format. Eg: 'P90D', 'P1Y'.
	ExpiryTime *string

	// READ-ONLY; Creation time in seconds since 1970-01-01T00:00:00Z.
	Created *int64

	// READ-ONLY; Last updated time in seconds since 1970-01-01T00:00:00Z.
	Updated *int64
}

func (ManagedHsmKeyRotationPolicyAttributes) MarshalJSON added in v1.2.0

func (m ManagedHsmKeyRotationPolicyAttributes) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ManagedHsmKeyRotationPolicyAttributes.

func (*ManagedHsmKeyRotationPolicyAttributes) UnmarshalJSON added in v1.2.0

func (m *ManagedHsmKeyRotationPolicyAttributes) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ManagedHsmKeyRotationPolicyAttributes.

type ManagedHsmKeysClient added in v1.2.0

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

ManagedHsmKeysClient contains the methods for the ManagedHsmKeys group. Don't use this type directly, use NewManagedHsmKeysClient() instead.

func NewManagedHsmKeysClient added in v1.2.0

func NewManagedHsmKeysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedHsmKeysClient, error)

NewManagedHsmKeysClient creates a new instance of ManagedHsmKeysClient with the specified values.

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

func (*ManagedHsmKeysClient) CreateIfNotExist added in v1.2.0

CreateIfNotExist - Creates the first version of a new key if it does not exist. If it already exists, then the existing key is returned without any write operations being performed. This API does not create subsequent versions, and does not update existing keys. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • name - The name of the Managed HSM Pool within the specified resource group.
  • keyName - The name of the key to be created. The value you provide may be copied globally for the purpose of running the service. The value provided should not include personally identifiable or sensitive information.
  • parameters - The parameters used to create the specified key.
  • options - ManagedHsmKeysClientCreateIfNotExistOptions contains the optional parameters for the ManagedHsmKeysClient.CreateIfNotExist method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/managedHsmCreateKey.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/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewManagedHsmKeysClient().CreateIfNotExist(ctx, "sample-group", "sample-managedhsm-name", "sample-key-name", armkeyvault.ManagedHsmKeyCreateParameters{
		Properties: &armkeyvault.ManagedHsmKeyProperties{
			Kty: to.Ptr(armkeyvault.JSONWebKeyTypeRSA),
		},
	}, 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.ManagedHsmKey = armkeyvault.ManagedHsmKey{
	// 	Name: to.Ptr("sample-key-name"),
	// 	Type: to.Ptr("Microsoft.KeyVault/managedHSMs/keys"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/managedHSMs/sample-managedhsm-name/keys/sample-key-name"),
	// 	Properties: &armkeyvault.ManagedHsmKeyProperties{
	// 		Attributes: &armkeyvault.ManagedHsmKeyAttributes{
	// 			Created: to.Ptr[int64](1598533051),
	// 			Enabled: to.Ptr(true),
	// 			RecoveryLevel: to.Ptr(armkeyvault.DeletionRecoveryLevelPurgeable),
	// 			Updated: to.Ptr[int64](1598533051),
	// 		},
	// 		KeyOps: []*armkeyvault.JSONWebKeyOperation{
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationEncrypt),
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationDecrypt),
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationSign),
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationVerify),
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationWrapKey),
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationUnwrapKey)},
	// 			KeySize: to.Ptr[int32](2048),
	// 			KeyURI: to.Ptr("https://sample-managedhsm-name.managedhsm.azure.net:443/keys/sample-key-name"),
	// 			KeyURIWithVersion: to.Ptr("https://sample-managedhsm-name.managedhsm.azure.net:443/keys/sample-key-name/fd618d9519b74f9aae94ade66b876acc"),
	// 			Kty: to.Ptr(armkeyvault.JSONWebKeyTypeRSA),
	// 		},
	// 	}
}
Output:

func (*ManagedHsmKeysClient) Get added in v1.2.0

func (client *ManagedHsmKeysClient) Get(ctx context.Context, resourceGroupName string, name string, keyName string, options *ManagedHsmKeysClientGetOptions) (ManagedHsmKeysClientGetResponse, error)

Get - Gets the current version of the specified key from the specified managed HSM. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • name - The name of the Managed HSM Pool within the specified resource group.
  • keyName - The name of the key to be created. The value you provide may be copied globally for the purpose of running the service. The value provided should not include personally identifiable or sensitive information.
  • options - ManagedHsmKeysClientGetOptions contains the optional parameters for the ManagedHsmKeysClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/managedHsmGetKey.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewManagedHsmKeysClient().Get(ctx, "sample-group", "sample-managedhsm-name", "sample-key-name", 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.ManagedHsmKey = armkeyvault.ManagedHsmKey{
	// 	Name: to.Ptr("sample-key-name"),
	// 	Type: to.Ptr("Microsoft.KeyVault/managedHSMs/keys"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/managedHSMs/sample-managedhsm-name/keys/sample-key-name"),
	// 	Properties: &armkeyvault.ManagedHsmKeyProperties{
	// 		Attributes: &armkeyvault.ManagedHsmKeyAttributes{
	// 			Created: to.Ptr[int64](1598533051),
	// 			Enabled: to.Ptr(true),
	// 			RecoveryLevel: to.Ptr(armkeyvault.DeletionRecoveryLevelPurgeable),
	// 			Updated: to.Ptr[int64](1598533051),
	// 		},
	// 		KeyOps: []*armkeyvault.JSONWebKeyOperation{
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationEncrypt),
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationDecrypt),
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationSign),
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationVerify),
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationWrapKey),
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationUnwrapKey)},
	// 			KeySize: to.Ptr[int32](2048),
	// 			KeyURI: to.Ptr("https://sample-managedhsm-name.managedhsm.azure.net:443/keys/sample-key-name"),
	// 			KeyURIWithVersion: to.Ptr("https://sample-managedhsm-name.managedhsm.azure.net:443/keys/sample-key-name/fd618d9519b74f9aae94ade66b876acc"),
	// 			Kty: to.Ptr(armkeyvault.JSONWebKeyTypeRSA),
	// 		},
	// 	}
}
Output:

func (*ManagedHsmKeysClient) GetVersion added in v1.2.0

func (client *ManagedHsmKeysClient) GetVersion(ctx context.Context, resourceGroupName string, name string, keyName string, keyVersion string, options *ManagedHsmKeysClientGetVersionOptions) (ManagedHsmKeysClientGetVersionResponse, error)

GetVersion - Gets the specified version of the specified key in the specified managed HSM. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • name - The name of the Managed HSM Pool within the specified resource group.
  • keyName - The name of the key to be created. The value you provide may be copied globally for the purpose of running the service. The value provided should not include personally identifiable or sensitive information.
  • keyVersion - The version of the key to be retrieved.
  • options - ManagedHsmKeysClientGetVersionOptions contains the optional parameters for the ManagedHsmKeysClient.GetVersion method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/managedHsmGetKeyVersion.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewManagedHsmKeysClient().GetVersion(ctx, "sample-group", "sample-managedhsm-name", "sample-key-name", "fd618d9519b74f9aae94ade66b876acc", 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.ManagedHsmKey = armkeyvault.ManagedHsmKey{
	// 	Name: to.Ptr("fd618d9519b74f9aae94ade66b876acc"),
	// 	Type: to.Ptr("Microsoft.KeyVault/managedHSMs/keys/versions"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/managedHSMs/sample-managedhsm-name/keys/sample-key-name/versions/fd618d9519b74f9aae94ade66b876acc"),
	// 	Properties: &armkeyvault.ManagedHsmKeyProperties{
	// 		Attributes: &armkeyvault.ManagedHsmKeyAttributes{
	// 			Created: to.Ptr[int64](1598533051),
	// 			Enabled: to.Ptr(true),
	// 			RecoveryLevel: to.Ptr(armkeyvault.DeletionRecoveryLevelPurgeable),
	// 			Updated: to.Ptr[int64](1598533051),
	// 		},
	// 		KeyOps: []*armkeyvault.JSONWebKeyOperation{
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationEncrypt),
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationDecrypt),
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationSign),
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationVerify),
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationWrapKey),
	// 			to.Ptr(armkeyvault.JSONWebKeyOperationUnwrapKey)},
	// 			KeySize: to.Ptr[int32](2048),
	// 			KeyURI: to.Ptr("https://sample-managedhsm-name.managedhsm.azure.net:443/keys/sample-key-name"),
	// 			KeyURIWithVersion: to.Ptr("https://sample-managedhsm-name.managedhsm.azure.net:443/keys/sample-key-name/fd618d9519b74f9aae94ade66b876acc"),
	// 			Kty: to.Ptr(armkeyvault.JSONWebKeyTypeRSA),
	// 		},
	// 	}
}
Output:

func (*ManagedHsmKeysClient) NewListPager added in v1.2.0

func (client *ManagedHsmKeysClient) NewListPager(resourceGroupName string, name string, options *ManagedHsmKeysClientListOptions) *runtime.Pager[ManagedHsmKeysClientListResponse]

NewListPager - Lists the keys in the specified managed HSM.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • name - The name of the Managed HSM Pool within the specified resource group.
  • options - ManagedHsmKeysClientListOptions contains the optional parameters for the ManagedHsmKeysClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/managedHsmListKeys.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewManagedHsmKeysClient().NewListPager("sample-group", "sample-managedhsm-name", 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.ManagedHsmKeyListResult = armkeyvault.ManagedHsmKeyListResult{
		// 	Value: []*armkeyvault.ManagedHsmKey{
		// 		{
		// 			Name: to.Ptr("sample-key-name-1"),
		// 			Type: to.Ptr("Microsoft.KeyVault/managedHSMs/keys"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/managedHSMs/sample-managedhsm-name/keys/sample-key-name-1"),
		// 			Properties: &armkeyvault.ManagedHsmKeyProperties{
		// 				Attributes: &armkeyvault.ManagedHsmKeyAttributes{
		// 					Created: to.Ptr[int64](1596493796),
		// 					Enabled: to.Ptr(true),
		// 					RecoveryLevel: to.Ptr(armkeyvault.DeletionRecoveryLevelPurgeable),
		// 					Updated: to.Ptr[int64](1596493796),
		// 				},
		// 				KeyURI: to.Ptr("https://sample-managedhsm-name.managedhsm.azure.net:443/keys/sample-key-name-1"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("sample-key-name-2"),
		// 			Type: to.Ptr("Microsoft.KeyVault/managedHSMs/keys"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/managedHSMs/sample-managedhsm-name/keys/sample-key-name-2"),
		// 			Properties: &armkeyvault.ManagedHsmKeyProperties{
		// 				Attributes: &armkeyvault.ManagedHsmKeyAttributes{
		// 					Created: to.Ptr[int64](1596493797),
		// 					Enabled: to.Ptr(true),
		// 					RecoveryLevel: to.Ptr(armkeyvault.DeletionRecoveryLevelPurgeable),
		// 					Updated: to.Ptr[int64](1596493797),
		// 				},
		// 				KeyURI: to.Ptr("https://sample-managedhsm-name.managedhsm.azure.net:443/keys/sample-key-name-2"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*ManagedHsmKeysClient) NewListVersionsPager added in v1.2.0

func (client *ManagedHsmKeysClient) NewListVersionsPager(resourceGroupName string, name string, keyName string, options *ManagedHsmKeysClientListVersionsOptions) *runtime.Pager[ManagedHsmKeysClientListVersionsResponse]

NewListVersionsPager - Lists the versions of the specified key in the specified managed HSM.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • name - The name of the Managed HSM Pool within the specified resource group.
  • keyName - The name of the key to be created. The value you provide may be copied globally for the purpose of running the service. The value provided should not include personally identifiable or sensitive information.
  • options - ManagedHsmKeysClientListVersionsOptions contains the optional parameters for the ManagedHsmKeysClient.NewListVersionsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/managedHsmListKeyVersions.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewManagedHsmKeysClient().NewListVersionsPager("sample-group", "sample-managedhsm-name", "sample-key-name", 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.ManagedHsmKeyListResult = armkeyvault.ManagedHsmKeyListResult{
		// 	Value: []*armkeyvault.ManagedHsmKey{
		// 		{
		// 			Name: to.Ptr("c2296aa24acf4daf86942bff5aca73dd"),
		// 			Type: to.Ptr("Microsoft.KeyVault/managedHSMs/keys/versions"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/managedHSMs/sample-managedhsm-name/keys/sample-key-name/versions/c2296aa24acf4daf86942bff5aca73dd"),
		// 			Properties: &armkeyvault.ManagedHsmKeyProperties{
		// 				Attributes: &armkeyvault.ManagedHsmKeyAttributes{
		// 					Created: to.Ptr[int64](1598641074),
		// 					Enabled: to.Ptr(true),
		// 					RecoveryLevel: to.Ptr(armkeyvault.DeletionRecoveryLevelPurgeable),
		// 					Updated: to.Ptr[int64](1598641074),
		// 				},
		// 				KeyURI: to.Ptr("https://sample-managedhsm-name.managedhsm.azure.net:443/keys/sample-key-name"),
		// 				KeyURIWithVersion: to.Ptr("https://sample-managedhsm-name.managedhsm.azure.net:443/keys/sample-key-name/c2296aa24acf4daf86942bff5aca73dd"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("d5a04667b6f44b0ca62825f5eae93da6"),
		// 			Type: to.Ptr("Microsoft.KeyVault/managedHSMs/keys/versions"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/managedHSMs/sample-managedhsm-name/keys/sample-key-name/versions/d5a04667b6f44b0ca62825f5eae93da6"),
		// 			Properties: &armkeyvault.ManagedHsmKeyProperties{
		// 				Attributes: &armkeyvault.ManagedHsmKeyAttributes{
		// 					Created: to.Ptr[int64](1598641295),
		// 					Enabled: to.Ptr(true),
		// 					RecoveryLevel: to.Ptr(armkeyvault.DeletionRecoveryLevelPurgeable),
		// 					Updated: to.Ptr[int64](1598641295),
		// 				},
		// 				KeyURI: to.Ptr("https://sample-managedhsm-name.managedhsm.azure.net:443/keys/sample-key-name"),
		// 				KeyURIWithVersion: to.Ptr("https://sample-managedhsm-name.managedhsm.azure.net:443/keys/sample-key-name/d5a04667b6f44b0ca62825f5eae93da6"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type ManagedHsmKeysClientCreateIfNotExistOptions added in v1.2.0

type ManagedHsmKeysClientCreateIfNotExistOptions struct {
}

ManagedHsmKeysClientCreateIfNotExistOptions contains the optional parameters for the ManagedHsmKeysClient.CreateIfNotExist method.

type ManagedHsmKeysClientCreateIfNotExistResponse added in v1.2.0

type ManagedHsmKeysClientCreateIfNotExistResponse struct {
	// The key resource.
	ManagedHsmKey
}

ManagedHsmKeysClientCreateIfNotExistResponse contains the response from method ManagedHsmKeysClient.CreateIfNotExist.

type ManagedHsmKeysClientGetOptions added in v1.2.0

type ManagedHsmKeysClientGetOptions struct {
}

ManagedHsmKeysClientGetOptions contains the optional parameters for the ManagedHsmKeysClient.Get method.

type ManagedHsmKeysClientGetResponse added in v1.2.0

type ManagedHsmKeysClientGetResponse struct {
	// The key resource.
	ManagedHsmKey
}

ManagedHsmKeysClientGetResponse contains the response from method ManagedHsmKeysClient.Get.

type ManagedHsmKeysClientGetVersionOptions added in v1.2.0

type ManagedHsmKeysClientGetVersionOptions struct {
}

ManagedHsmKeysClientGetVersionOptions contains the optional parameters for the ManagedHsmKeysClient.GetVersion method.

type ManagedHsmKeysClientGetVersionResponse added in v1.2.0

type ManagedHsmKeysClientGetVersionResponse struct {
	// The key resource.
	ManagedHsmKey
}

ManagedHsmKeysClientGetVersionResponse contains the response from method ManagedHsmKeysClient.GetVersion.

type ManagedHsmKeysClientListOptions added in v1.2.0

type ManagedHsmKeysClientListOptions struct {
}

ManagedHsmKeysClientListOptions contains the optional parameters for the ManagedHsmKeysClient.NewListPager method.

type ManagedHsmKeysClientListResponse added in v1.2.0

type ManagedHsmKeysClientListResponse struct {
	// The page of keys.
	ManagedHsmKeyListResult
}

ManagedHsmKeysClientListResponse contains the response from method ManagedHsmKeysClient.NewListPager.

type ManagedHsmKeysClientListVersionsOptions added in v1.2.0

type ManagedHsmKeysClientListVersionsOptions struct {
}

ManagedHsmKeysClientListVersionsOptions contains the optional parameters for the ManagedHsmKeysClient.NewListVersionsPager method.

type ManagedHsmKeysClientListVersionsResponse added in v1.2.0

type ManagedHsmKeysClientListVersionsResponse struct {
	// The page of keys.
	ManagedHsmKeyListResult
}

ManagedHsmKeysClientListVersionsResponse contains the response from method ManagedHsmKeysClient.NewListVersionsPager.

type ManagedHsmLifetimeAction added in v1.2.0

type ManagedHsmLifetimeAction struct {
	// The action of key rotation policy lifetimeAction.
	Action *ManagedHsmAction

	// The trigger of key rotation policy lifetimeAction.
	Trigger *ManagedHsmTrigger
}

func (ManagedHsmLifetimeAction) MarshalJSON added in v1.2.0

func (m ManagedHsmLifetimeAction) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ManagedHsmLifetimeAction.

func (*ManagedHsmLifetimeAction) UnmarshalJSON added in v1.2.0

func (m *ManagedHsmLifetimeAction) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ManagedHsmLifetimeAction.

type ManagedHsmListResult

type ManagedHsmListResult struct {
	// The URL to get the next set of managed HSM Pools.
	NextLink *string

	// The list of managed HSM Pools.
	Value []*ManagedHsm
}

ManagedHsmListResult - List of managed HSM Pools

func (ManagedHsmListResult) MarshalJSON

func (m ManagedHsmListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ManagedHsmListResult.

func (*ManagedHsmListResult) UnmarshalJSON added in v1.1.0

func (m *ManagedHsmListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ManagedHsmListResult.

type ManagedHsmProperties

type ManagedHsmProperties struct {
	// The create mode to indicate whether the resource is being created or is being recovered from a deleted resource.
	CreateMode *CreateMode

	// Property specifying whether protection against purge is enabled for this managed HSM pool. Setting this property to true
	// activates protection against purge for this managed HSM pool and its content -
	// only the Managed HSM service may initiate a hard, irrecoverable deletion. Enabling this functionality is irreversible.
	EnablePurgeProtection *bool

	// Property to specify whether the 'soft delete' functionality is enabled for this managed HSM pool. Soft delete is enabled
	// by default for all managed HSMs and is immutable.
	EnableSoftDelete *bool

	// Array of initial administrators object ids for this managed hsm pool.
	InitialAdminObjectIDs []*string

	// Rules governing the accessibility of the key vault from specific network locations.
	NetworkACLs *MHSMNetworkRuleSet

	// Control permission to the managed HSM from public networks.
	PublicNetworkAccess *PublicNetworkAccess

	// List of all regions associated with the managed hsm pool.
	Regions []*MHSMGeoReplicatedRegion

	// Soft deleted data retention days. When you delete an HSM or a key, it will remain recoverable for the configured retention
	// period or for a default period of 90 days. It accepts values between 7 and
	// 90.
	SoftDeleteRetentionInDays *int32

	// The Azure Active Directory tenant ID that should be used for authenticating requests to the managed HSM pool.
	TenantID *string

	// READ-ONLY; The URI of the managed hsm pool for performing operations on keys.
	HsmURI *string

	// READ-ONLY; List of private endpoint connections associated with the managed hsm pool.
	PrivateEndpointConnections []*MHSMPrivateEndpointConnectionItem

	// READ-ONLY; Provisioning state.
	ProvisioningState *ProvisioningState

	// READ-ONLY; The scheduled purge date in UTC.
	ScheduledPurgeDate *time.Time

	// READ-ONLY; Managed HSM security domain properties.
	SecurityDomainProperties *ManagedHSMSecurityDomainProperties

	// READ-ONLY; Resource Status Message.
	StatusMessage *string
}

ManagedHsmProperties - Properties of the managed HSM Pool

func (ManagedHsmProperties) MarshalJSON

func (m ManagedHsmProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ManagedHsmProperties.

func (*ManagedHsmProperties) UnmarshalJSON

func (m *ManagedHsmProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ManagedHsmProperties.

type ManagedHsmRotationPolicy added in v1.2.0

type ManagedHsmRotationPolicy struct {
	// The attributes of key rotation policy.
	Attributes *ManagedHsmKeyRotationPolicyAttributes

	// The lifetimeActions for key rotation action.
	LifetimeActions []*ManagedHsmLifetimeAction
}

func (ManagedHsmRotationPolicy) MarshalJSON added in v1.2.0

func (m ManagedHsmRotationPolicy) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ManagedHsmRotationPolicy.

func (*ManagedHsmRotationPolicy) UnmarshalJSON added in v1.2.0

func (m *ManagedHsmRotationPolicy) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ManagedHsmRotationPolicy.

type ManagedHsmSKU

type ManagedHsmSKU struct {
	// REQUIRED; SKU Family of the managed HSM Pool
	Family *ManagedHsmSKUFamily

	// REQUIRED; SKU of the managed HSM Pool
	Name *ManagedHsmSKUName
}

ManagedHsmSKU - SKU details

func (ManagedHsmSKU) MarshalJSON added in v1.1.0

func (m ManagedHsmSKU) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ManagedHsmSKU.

func (*ManagedHsmSKU) UnmarshalJSON added in v1.1.0

func (m *ManagedHsmSKU) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ManagedHsmSKU.

type ManagedHsmSKUFamily

type ManagedHsmSKUFamily string

ManagedHsmSKUFamily - SKU Family of the managed HSM Pool

const (
	ManagedHsmSKUFamilyB ManagedHsmSKUFamily = "B"
)

func PossibleManagedHsmSKUFamilyValues

func PossibleManagedHsmSKUFamilyValues() []ManagedHsmSKUFamily

PossibleManagedHsmSKUFamilyValues returns the possible values for the ManagedHsmSKUFamily const type.

type ManagedHsmSKUName

type ManagedHsmSKUName string

ManagedHsmSKUName - SKU of the managed HSM Pool

const (
	ManagedHsmSKUNameCustomB32  ManagedHsmSKUName = "Custom_B32"
	ManagedHsmSKUNameCustomB6   ManagedHsmSKUName = "Custom_B6"
	ManagedHsmSKUNameStandardB1 ManagedHsmSKUName = "Standard_B1"
)

func PossibleManagedHsmSKUNameValues

func PossibleManagedHsmSKUNameValues() []ManagedHsmSKUName

PossibleManagedHsmSKUNameValues returns the possible values for the ManagedHsmSKUName const type.

type ManagedHsmTrigger added in v1.2.0

type ManagedHsmTrigger struct {
	// The time duration after key creation to rotate the key. It only applies to rotate. It will be in ISO 8601 duration format.
	// Eg: 'P90D', 'P1Y'.
	TimeAfterCreate *string

	// The time duration before key expiring to rotate or notify. It will be in ISO 8601 duration format. Eg: 'P90D', 'P1Y'.
	TimeBeforeExpiry *string
}

func (ManagedHsmTrigger) MarshalJSON added in v1.2.0

func (m ManagedHsmTrigger) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ManagedHsmTrigger.

func (*ManagedHsmTrigger) UnmarshalJSON added in v1.2.0

func (m *ManagedHsmTrigger) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ManagedHsmTrigger.

type ManagedHsmsClient

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

ManagedHsmsClient contains the methods for the ManagedHsms group. Don't use this type directly, use NewManagedHsmsClient() instead.

func NewManagedHsmsClient

func NewManagedHsmsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedHsmsClient, error)

NewManagedHsmsClient creates a new instance of ManagedHsmsClient with the specified values.

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

func (*ManagedHsmsClient) BeginCreateOrUpdate

func (client *ManagedHsmsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, name string, parameters ManagedHsm, options *ManagedHsmsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedHsmsClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Create or update a managed HSM Pool in the specified subscription. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - Name of the resource group that contains the managed HSM pool.
  • name - Name of the managed HSM Pool
  • parameters - Parameters to create or update the managed HSM Pool
  • options - ManagedHsmsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedHsmsClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_CreateOrUpdate.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/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewManagedHsmsClient().BeginCreateOrUpdate(ctx, "hsm-group", "hsm1", armkeyvault.ManagedHsm{
		Location: to.Ptr("westus"),
		SKU: &armkeyvault.ManagedHsmSKU{
			Name:   to.Ptr(armkeyvault.ManagedHsmSKUNameStandardB1),
			Family: to.Ptr(armkeyvault.ManagedHsmSKUFamilyB),
		},
		Tags: map[string]*string{
			"Dept":        to.Ptr("hsm"),
			"Environment": to.Ptr("dogfood"),
		},
		Properties: &armkeyvault.ManagedHsmProperties{
			EnablePurgeProtection: to.Ptr(false),
			EnableSoftDelete:      to.Ptr(true),
			InitialAdminObjectIDs: []*string{
				to.Ptr("00000000-0000-0000-0000-000000000000")},
			SoftDeleteRetentionInDays: to.Ptr[int32](90),
			TenantID:                  to.Ptr("00000000-0000-0000-0000-000000000000"),
		},
	}, 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.ManagedHsm = armkeyvault.ManagedHsm{
	// 	Name: to.Ptr("hsm1"),
	// 	Type: to.Ptr("Microsoft.KeyVault/managedHSMs"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.KeyVault/managedHSMs/hsm1"),
	// 	Location: to.Ptr("westus"),
	// 	SKU: &armkeyvault.ManagedHsmSKU{
	// 		Name: to.Ptr(armkeyvault.ManagedHsmSKUNameStandardB1),
	// 		Family: to.Ptr(armkeyvault.ManagedHsmSKUFamilyB),
	// 	},
	// 	Tags: map[string]*string{
	// 		"Dept": to.Ptr("hsm"),
	// 		"Environment": to.Ptr("dogfood"),
	// 	},
	// 	Properties: &armkeyvault.ManagedHsmProperties{
	// 		EnablePurgeProtection: to.Ptr(false),
	// 		EnableSoftDelete: to.Ptr(true),
	// 		HsmURI: to.Ptr("https://westus.hsm1.managedhsm.azure.net"),
	// 		InitialAdminObjectIDs: []*string{
	// 			to.Ptr("00000000-0000-0000-0000-000000000000")},
	// 			ProvisioningState: to.Ptr(armkeyvault.ProvisioningStateSucceeded),
	// 			SoftDeleteRetentionInDays: to.Ptr[int32](90),
	// 			StatusMessage: to.Ptr("ManagedHsm is functional."),
	// 			TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 		},
	// 	}
}
Output:

func (*ManagedHsmsClient) BeginDelete

BeginDelete - Deletes the specified managed HSM Pool. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - Name of the resource group that contains the managed HSM pool.
  • name - The name of the managed HSM Pool to delete
  • options - ManagedHsmsClientBeginDeleteOptions contains the optional parameters for the ManagedHsmsClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewManagedHsmsClient().BeginDelete(ctx, "hsm-group", "hsm1", 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 (*ManagedHsmsClient) BeginPurgeDeleted

BeginPurgeDeleted - Permanently deletes the specified managed HSM. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • name - The name of the soft-deleted managed HSM.
  • location - The location of the soft-deleted managed HSM.
  • options - ManagedHsmsClientBeginPurgeDeletedOptions contains the optional parameters for the ManagedHsmsClient.BeginPurgeDeleted method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/DeletedManagedHsm_Purge.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewManagedHsmsClient().BeginPurgeDeleted(ctx, "hsm1", "westus", 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 (*ManagedHsmsClient) BeginUpdate

func (client *ManagedHsmsClient) BeginUpdate(ctx context.Context, resourceGroupName string, name string, parameters ManagedHsm, options *ManagedHsmsClientBeginUpdateOptions) (*runtime.Poller[ManagedHsmsClientUpdateResponse], error)

BeginUpdate - Update a managed HSM Pool in the specified subscription. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - Name of the resource group that contains the managed HSM pool.
  • name - Name of the managed HSM Pool
  • parameters - Parameters to patch the managed HSM Pool
  • options - ManagedHsmsClientBeginUpdateOptions contains the optional parameters for the ManagedHsmsClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_Update.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/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewManagedHsmsClient().BeginUpdate(ctx, "hsm-group", "hsm1", armkeyvault.ManagedHsm{
		Tags: map[string]*string{
			"Dept":        to.Ptr("hsm"),
			"Environment": to.Ptr("dogfood"),
			"Slice":       to.Ptr("A"),
		},
	}, 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.ManagedHsm = armkeyvault.ManagedHsm{
	// 	Name: to.Ptr("hsm1"),
	// 	Type: to.Ptr("Microsoft.KeyVault/managedHSMs"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.KeyVault/managedHSMs/hsm1"),
	// 	Location: to.Ptr("westus"),
	// 	SKU: &armkeyvault.ManagedHsmSKU{
	// 		Name: to.Ptr(armkeyvault.ManagedHsmSKUNameStandardB1),
	// 		Family: to.Ptr(armkeyvault.ManagedHsmSKUFamilyB),
	// 	},
	// 	Tags: map[string]*string{
	// 		"Dept": to.Ptr("hsm"),
	// 		"Environment": to.Ptr("dogfood"),
	// 		"Slice": to.Ptr("A"),
	// 	},
	// 	Properties: &armkeyvault.ManagedHsmProperties{
	// 		EnablePurgeProtection: to.Ptr(false),
	// 		EnableSoftDelete: to.Ptr(true),
	// 		HsmURI: to.Ptr("https://westus.hsm1.managedhsm.azure.net"),
	// 		InitialAdminObjectIDs: []*string{
	// 			to.Ptr("00000000-0000-0000-0000-000000000000")},
	// 			ProvisioningState: to.Ptr(armkeyvault.ProvisioningStateSucceeded),
	// 			SoftDeleteRetentionInDays: to.Ptr[int32](90),
	// 			StatusMessage: to.Ptr("ManagedHsm is functional."),
	// 			TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 		},
	// 	}
}
Output:

func (*ManagedHsmsClient) CheckMhsmNameAvailability added in v1.2.0

CheckMhsmNameAvailability - Checks that the managed hsm name is valid and is not already in use. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • mhsmName - The name of the managed hsm.
  • options - ManagedHsmsClientCheckMhsmNameAvailabilityOptions contains the optional parameters for the ManagedHsmsClient.CheckMhsmNameAvailability method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_checkMhsmNameAvailability.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/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewManagedHsmsClient().CheckMhsmNameAvailability(ctx, armkeyvault.CheckMhsmNameAvailabilityParameters{
		Name: to.Ptr("sample-mhsm"),
	}, 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.CheckMhsmNameAvailabilityResult = armkeyvault.CheckMhsmNameAvailabilityResult{
	// 	NameAvailable: to.Ptr(true),
	// }
}
Output:

func (*ManagedHsmsClient) Get

func (client *ManagedHsmsClient) Get(ctx context.Context, resourceGroupName string, name string, options *ManagedHsmsClientGetOptions) (ManagedHsmsClientGetResponse, error)

Get - Gets the specified managed HSM Pool. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - Name of the resource group that contains the managed HSM pool.
  • name - The name of the managed HSM Pool.
  • options - ManagedHsmsClientGetOptions contains the optional parameters for the ManagedHsmsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewManagedHsmsClient().Get(ctx, "hsm-group", "hsm1", 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.ManagedHsm = armkeyvault.ManagedHsm{
	// 	Name: to.Ptr("hsm1"),
	// 	Type: to.Ptr("Microsoft.KeyVault/managedHSMs"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.KeyVault/managedHSMs/hsm1"),
	// 	Location: to.Ptr("westus"),
	// 	SKU: &armkeyvault.ManagedHsmSKU{
	// 		Name: to.Ptr(armkeyvault.ManagedHsmSKUNameStandardB1),
	// 		Family: to.Ptr(armkeyvault.ManagedHsmSKUFamilyB),
	// 	},
	// 	Tags: map[string]*string{
	// 		"Dept": to.Ptr("hsm"),
	// 		"Environment": to.Ptr("dogfood"),
	// 	},
	// 	Properties: &armkeyvault.ManagedHsmProperties{
	// 		EnablePurgeProtection: to.Ptr(false),
	// 		EnableSoftDelete: to.Ptr(true),
	// 		HsmURI: to.Ptr("https://westus.hsm1.managedhsm.azure.net"),
	// 		InitialAdminObjectIDs: []*string{
	// 			to.Ptr("00000000-0000-0000-0000-000000000000")},
	// 			ProvisioningState: to.Ptr(armkeyvault.ProvisioningStateSucceeded),
	// 			SoftDeleteRetentionInDays: to.Ptr[int32](90),
	// 			StatusMessage: to.Ptr("ManagedHsm is functional."),
	// 			TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 		},
	// 	}
}
Output:

func (*ManagedHsmsClient) GetDeleted

GetDeleted - Gets the specified deleted managed HSM. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • name - The name of the deleted managed HSM.
  • location - The location of the deleted managed HSM.
  • options - ManagedHsmsClientGetDeletedOptions contains the optional parameters for the ManagedHsmsClient.GetDeleted method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/DeletedManagedHsm_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewManagedHsmsClient().GetDeleted(ctx, "hsm1", "westus", 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.DeletedManagedHsm = armkeyvault.DeletedManagedHsm{
	// 	Name: to.Ptr("vault-agile-drawer-6404"),
	// 	Type: to.Ptr("Microsoft.KeyVault/deletedManagedHSMs"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/westus/deletedManagedHSMs/hsm1"),
	// 	Properties: &armkeyvault.DeletedManagedHsmProperties{
	// 		DeletionDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T00:00:59.000Z"); return t}()),
	// 		Location: to.Ptr("westus"),
	// 		MhsmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.KeyVault/managedHSMs/hsm1"),
	// 		PurgeProtectionEnabled: to.Ptr(true),
	// 		ScheduledPurgeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T00:00:59.000Z"); return t}()),
	// 		Tags: map[string]*string{
	// 			"Dept": to.Ptr("hsm"),
	// 			"Environment": to.Ptr("production"),
	// 		},
	// 	},
	// }
}
Output:

func (*ManagedHsmsClient) NewListByResourceGroupPager added in v0.5.0

NewListByResourceGroupPager - The List operation gets information about the managed HSM Pools associated with the subscription and within the specified resource group.

Generated from API version 2023-07-01

  • resourceGroupName - Name of the resource group that contains the managed HSM pool.
  • options - ManagedHsmsClientListByResourceGroupOptions contains the optional parameters for the ManagedHsmsClient.NewListByResourceGroupPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_ListByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewManagedHsmsClient().NewListByResourceGroupPager("hsm-group", &armkeyvault.ManagedHsmsClientListByResourceGroupOptions{Top: 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.ManagedHsmListResult = armkeyvault.ManagedHsmListResult{
		// 	Value: []*armkeyvault.ManagedHsm{
		// 		{
		// 			Name: to.Ptr("hsm1"),
		// 			Type: to.Ptr("Microsoft.KeyVault/managedHSMs"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.KeyVault/managedHSMs/hsm1"),
		// 			Location: to.Ptr("westus"),
		// 			SKU: &armkeyvault.ManagedHsmSKU{
		// 				Name: to.Ptr(armkeyvault.ManagedHsmSKUNameStandardB1),
		// 				Family: to.Ptr(armkeyvault.ManagedHsmSKUFamilyB),
		// 			},
		// 			Tags: map[string]*string{
		// 				"Dept": to.Ptr("hsm"),
		// 				"Environment": to.Ptr("dogfood"),
		// 			},
		// 			Properties: &armkeyvault.ManagedHsmProperties{
		// 				EnablePurgeProtection: to.Ptr(false),
		// 				EnableSoftDelete: to.Ptr(true),
		// 				HsmURI: to.Ptr("https://westus.hsm1.managedhsm.azure.net"),
		// 				InitialAdminObjectIDs: []*string{
		// 					to.Ptr("00000000-0000-0000-0000-000000000000")},
		// 					ProvisioningState: to.Ptr(armkeyvault.ProvisioningStateSucceeded),
		// 					SoftDeleteRetentionInDays: to.Ptr[int32](90),
		// 					StatusMessage: to.Ptr("ManagedHsm is functional."),
		// 					TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("hsm2"),
		// 				Type: to.Ptr("Microsoft.KeyVault/managedHSMs"),
		// 				ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.KeyVault/managedHSMs/hsm2"),
		// 				Location: to.Ptr("westus"),
		// 				SKU: &armkeyvault.ManagedHsmSKU{
		// 					Name: to.Ptr(armkeyvault.ManagedHsmSKUNameStandardB1),
		// 					Family: to.Ptr(armkeyvault.ManagedHsmSKUFamilyB),
		// 				},
		// 				Tags: map[string]*string{
		// 					"Dept": to.Ptr("hsm"),
		// 					"Environment": to.Ptr("production"),
		// 				},
		// 				Properties: &armkeyvault.ManagedHsmProperties{
		// 					EnablePurgeProtection: to.Ptr(false),
		// 					EnableSoftDelete: to.Ptr(true),
		// 					HsmURI: to.Ptr("https://westus.hsm2.managedhsm.azure.net"),
		// 					InitialAdminObjectIDs: []*string{
		// 						to.Ptr("00000000-0000-0000-0000-000000000000")},
		// 						ProvisioningState: to.Ptr(armkeyvault.ProvisioningStateSucceeded),
		// 						SoftDeleteRetentionInDays: to.Ptr[int32](90),
		// 						StatusMessage: to.Ptr("ManagedHsm is functional."),
		// 						TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 					},
		// 			}},
		// 		}
	}
}
Output:

func (*ManagedHsmsClient) NewListBySubscriptionPager added in v0.5.0

NewListBySubscriptionPager - The List operation gets information about the managed HSM Pools associated with the subscription.

Generated from API version 2023-07-01

  • options - ManagedHsmsClientListBySubscriptionOptions contains the optional parameters for the ManagedHsmsClient.NewListBySubscriptionPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_ListBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewManagedHsmsClient().NewListBySubscriptionPager(&armkeyvault.ManagedHsmsClientListBySubscriptionOptions{Top: 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.ManagedHsmListResult = armkeyvault.ManagedHsmListResult{
		// 	Value: []*armkeyvault.ManagedHsm{
		// 		{
		// 			Name: to.Ptr("hsm1"),
		// 			Type: to.Ptr("Microsoft.KeyVault/managedHSMs"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.KeyVault/managedHSMs/hsm1"),
		// 			Location: to.Ptr("westus"),
		// 			SKU: &armkeyvault.ManagedHsmSKU{
		// 				Name: to.Ptr(armkeyvault.ManagedHsmSKUNameStandardB1),
		// 				Family: to.Ptr(armkeyvault.ManagedHsmSKUFamilyB),
		// 			},
		// 			Tags: map[string]*string{
		// 				"Dept": to.Ptr("hsm"),
		// 				"Environment": to.Ptr("dogfood"),
		// 			},
		// 			Properties: &armkeyvault.ManagedHsmProperties{
		// 				EnablePurgeProtection: to.Ptr(false),
		// 				EnableSoftDelete: to.Ptr(true),
		// 				HsmURI: to.Ptr("https://westus.hsm1.managedhsm.azure.net"),
		// 				InitialAdminObjectIDs: []*string{
		// 					to.Ptr("00000000-0000-0000-0000-000000000000")},
		// 					ProvisioningState: to.Ptr(armkeyvault.ProvisioningStateSucceeded),
		// 					SoftDeleteRetentionInDays: to.Ptr[int32](90),
		// 					StatusMessage: to.Ptr("ManagedHsm is functional."),
		// 					TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("hsm2"),
		// 				Type: to.Ptr("Microsoft.KeyVault/managedHSMs"),
		// 				ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.KeyVault/managedHSMs/hsm2"),
		// 				Location: to.Ptr("westus"),
		// 				SKU: &armkeyvault.ManagedHsmSKU{
		// 					Name: to.Ptr(armkeyvault.ManagedHsmSKUNameStandardB1),
		// 					Family: to.Ptr(armkeyvault.ManagedHsmSKUFamilyB),
		// 				},
		// 				Tags: map[string]*string{
		// 					"Dept": to.Ptr("hsm"),
		// 					"Environment": to.Ptr("production"),
		// 				},
		// 				Properties: &armkeyvault.ManagedHsmProperties{
		// 					EnablePurgeProtection: to.Ptr(false),
		// 					EnableSoftDelete: to.Ptr(true),
		// 					HsmURI: to.Ptr("https://westus.hsm2.managedhsm.azure.net"),
		// 					InitialAdminObjectIDs: []*string{
		// 						to.Ptr("00000000-0000-0000-0000-000000000000")},
		// 						ProvisioningState: to.Ptr(armkeyvault.ProvisioningStateSucceeded),
		// 						SoftDeleteRetentionInDays: to.Ptr[int32](90),
		// 						StatusMessage: to.Ptr("ManagedHsm is functional."),
		// 						TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 					},
		// 			}},
		// 		}
	}
}
Output:

func (*ManagedHsmsClient) NewListDeletedPager added in v0.5.0

NewListDeletedPager - The List operation gets information about the deleted managed HSMs associated with the subscription.

Generated from API version 2023-07-01

  • options - ManagedHsmsClientListDeletedOptions contains the optional parameters for the ManagedHsmsClient.NewListDeletedPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/DeletedManagedHsm_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewManagedHsmsClient().NewListDeletedPager(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.DeletedManagedHsmListResult = armkeyvault.DeletedManagedHsmListResult{
		// 	Value: []*armkeyvault.DeletedManagedHsm{
		// 		{
		// 			Name: to.Ptr("vault-agile-drawer-6404"),
		// 			Type: to.Ptr("Microsoft.KeyVault/deletedManagedHSMs"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/westus/deletedManagedHSMs/hsm1"),
		// 			Properties: &armkeyvault.DeletedManagedHsmProperties{
		// 				DeletionDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T00:00:59.000Z"); return t}()),
		// 				Location: to.Ptr("westus"),
		// 				MhsmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.KeyVault/managedHSMs/hsm1"),
		// 				PurgeProtectionEnabled: to.Ptr(true),
		// 				ScheduledPurgeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T00:00:59.000Z"); return t}()),
		// 				Tags: map[string]*string{
		// 					"Dept": to.Ptr("hsm"),
		// 					"Environment": to.Ptr("production"),
		// 				},
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("vault-agile-drawer-6404"),
		// 			Type: to.Ptr("Microsoft.KeyVault/deletedManagedHSMs"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/westus/deletedManagedHSMs/hsm2"),
		// 			Properties: &armkeyvault.DeletedManagedHsmProperties{
		// 				DeletionDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T00:00:59.000Z"); return t}()),
		// 				Location: to.Ptr("westus"),
		// 				MhsmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.KeyVault/managedHSMs/hsm2"),
		// 				PurgeProtectionEnabled: to.Ptr(true),
		// 				ScheduledPurgeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T00:00:59.000Z"); return t}()),
		// 				Tags: map[string]*string{
		// 					"Dept": to.Ptr("hsm"),
		// 					"Environment": to.Ptr("production"),
		// 				},
		// 			},
		// 	}},
		// }
	}
}
Output:

type ManagedHsmsClientBeginCreateOrUpdateOptions added in v0.3.0

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

ManagedHsmsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedHsmsClient.BeginCreateOrUpdate method.

type ManagedHsmsClientBeginDeleteOptions added in v0.3.0

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

ManagedHsmsClientBeginDeleteOptions contains the optional parameters for the ManagedHsmsClient.BeginDelete method.

type ManagedHsmsClientBeginPurgeDeletedOptions added in v0.3.0

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

ManagedHsmsClientBeginPurgeDeletedOptions contains the optional parameters for the ManagedHsmsClient.BeginPurgeDeleted method.

type ManagedHsmsClientBeginUpdateOptions added in v0.3.0

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

ManagedHsmsClientBeginUpdateOptions contains the optional parameters for the ManagedHsmsClient.BeginUpdate method.

type ManagedHsmsClientCheckMhsmNameAvailabilityOptions added in v1.2.0

type ManagedHsmsClientCheckMhsmNameAvailabilityOptions struct {
}

ManagedHsmsClientCheckMhsmNameAvailabilityOptions contains the optional parameters for the ManagedHsmsClient.CheckMhsmNameAvailability method.

type ManagedHsmsClientCheckMhsmNameAvailabilityResponse added in v1.2.0

type ManagedHsmsClientCheckMhsmNameAvailabilityResponse struct {
	// The CheckMhsmNameAvailability operation response.
	CheckMhsmNameAvailabilityResult
}

ManagedHsmsClientCheckMhsmNameAvailabilityResponse contains the response from method ManagedHsmsClient.CheckMhsmNameAvailability.

type ManagedHsmsClientCreateOrUpdateResponse added in v0.3.0

type ManagedHsmsClientCreateOrUpdateResponse struct {
	// Resource information with extended details.
	ManagedHsm
}

ManagedHsmsClientCreateOrUpdateResponse contains the response from method ManagedHsmsClient.BeginCreateOrUpdate.

type ManagedHsmsClientDeleteResponse added in v0.3.0

type ManagedHsmsClientDeleteResponse struct {
}

ManagedHsmsClientDeleteResponse contains the response from method ManagedHsmsClient.BeginDelete.

type ManagedHsmsClientGetDeletedOptions added in v0.3.0

type ManagedHsmsClientGetDeletedOptions struct {
}

ManagedHsmsClientGetDeletedOptions contains the optional parameters for the ManagedHsmsClient.GetDeleted method.

type ManagedHsmsClientGetDeletedResponse added in v0.3.0

type ManagedHsmsClientGetDeletedResponse struct {
	DeletedManagedHsm
}

ManagedHsmsClientGetDeletedResponse contains the response from method ManagedHsmsClient.GetDeleted.

type ManagedHsmsClientGetOptions added in v0.3.0

type ManagedHsmsClientGetOptions struct {
}

ManagedHsmsClientGetOptions contains the optional parameters for the ManagedHsmsClient.Get method.

type ManagedHsmsClientGetResponse added in v0.3.0

type ManagedHsmsClientGetResponse struct {
	// Resource information with extended details.
	ManagedHsm
}

ManagedHsmsClientGetResponse contains the response from method ManagedHsmsClient.Get.

type ManagedHsmsClientListByResourceGroupOptions added in v0.3.0

type ManagedHsmsClientListByResourceGroupOptions struct {
	// Maximum number of results to return.
	Top *int32
}

ManagedHsmsClientListByResourceGroupOptions contains the optional parameters for the ManagedHsmsClient.NewListByResourceGroupPager method.

type ManagedHsmsClientListByResourceGroupResponse added in v0.3.0

type ManagedHsmsClientListByResourceGroupResponse struct {
	// List of managed HSM Pools
	ManagedHsmListResult
}

ManagedHsmsClientListByResourceGroupResponse contains the response from method ManagedHsmsClient.NewListByResourceGroupPager.

type ManagedHsmsClientListBySubscriptionOptions added in v0.3.0

type ManagedHsmsClientListBySubscriptionOptions struct {
	// Maximum number of results to return.
	Top *int32
}

ManagedHsmsClientListBySubscriptionOptions contains the optional parameters for the ManagedHsmsClient.NewListBySubscriptionPager method.

type ManagedHsmsClientListBySubscriptionResponse added in v0.3.0

type ManagedHsmsClientListBySubscriptionResponse struct {
	// List of managed HSM Pools
	ManagedHsmListResult
}

ManagedHsmsClientListBySubscriptionResponse contains the response from method ManagedHsmsClient.NewListBySubscriptionPager.

type ManagedHsmsClientListDeletedOptions added in v0.3.0

type ManagedHsmsClientListDeletedOptions struct {
}

ManagedHsmsClientListDeletedOptions contains the optional parameters for the ManagedHsmsClient.NewListDeletedPager method.

type ManagedHsmsClientListDeletedResponse added in v0.3.0

type ManagedHsmsClientListDeletedResponse struct {
	// List of deleted managed HSM Pools
	DeletedManagedHsmListResult
}

ManagedHsmsClientListDeletedResponse contains the response from method ManagedHsmsClient.NewListDeletedPager.

type ManagedHsmsClientPurgeDeletedResponse added in v0.3.0

type ManagedHsmsClientPurgeDeletedResponse struct {
}

ManagedHsmsClientPurgeDeletedResponse contains the response from method ManagedHsmsClient.BeginPurgeDeleted.

type ManagedHsmsClientUpdateResponse added in v0.3.0

type ManagedHsmsClientUpdateResponse struct {
	// Resource information with extended details.
	ManagedHsm
}

ManagedHsmsClientUpdateResponse contains the response from method ManagedHsmsClient.BeginUpdate.

type ManagedServiceIdentity added in v1.3.0

type ManagedServiceIdentity struct {
	// REQUIRED; Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
	Type *ManagedServiceIdentityType

	// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM
	// resource ids in the form:
	// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.
	// The dictionary values can be empty objects ({}) in
	// requests.
	UserAssignedIdentities map[string]*UserAssignedIdentity

	// READ-ONLY; The service principal ID of the system assigned identity. This property will only be provided for a system assigned
	// identity.
	PrincipalID *string

	// READ-ONLY; The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity.
	TenantID *string
}

ManagedServiceIdentity - Managed service identity (system assigned and/or user assigned identities)

func (ManagedServiceIdentity) MarshalJSON added in v1.3.0

func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity.

func (*ManagedServiceIdentity) UnmarshalJSON added in v1.3.0

func (m *ManagedServiceIdentity) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServiceIdentity.

type ManagedServiceIdentityType added in v1.3.0

type ManagedServiceIdentityType string

ManagedServiceIdentityType - Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).

const (
	ManagedServiceIdentityTypeNone                       ManagedServiceIdentityType = "None"
	ManagedServiceIdentityTypeSystemAssigned             ManagedServiceIdentityType = "SystemAssigned"
	ManagedServiceIdentityTypeSystemAssignedUserAssigned ManagedServiceIdentityType = "SystemAssigned,UserAssigned"
	ManagedServiceIdentityTypeUserAssigned               ManagedServiceIdentityType = "UserAssigned"
)

func PossibleManagedServiceIdentityTypeValues added in v1.3.0

func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType

PossibleManagedServiceIdentityTypeValues returns the possible values for the ManagedServiceIdentityType const type.

type MetricSpecification

type MetricSpecification struct {
	// The metric aggregation type. Possible values include: 'Average', 'Count', 'Total'.
	AggregationType *string

	// The dimensions of metric
	Dimensions []*DimensionProperties

	// Display description of metric specification.
	DisplayDescription *string

	// Display name of metric specification.
	DisplayName *string

	// Property to specify whether to fill gap with zero.
	FillGapWithZero *bool

	// The internal metric name.
	InternalMetricName *string

	// The metric lock aggregation type.
	LockAggregationType *string

	// Name of metric specification.
	Name *string

	// The supported aggregation types for the metrics.
	SupportedAggregationTypes []*string

	// The supported time grain types for the metrics.
	SupportedTimeGrainTypes []*string

	// The metric unit. Possible values include: 'Bytes', 'Count', 'Milliseconds'.
	Unit *string
}

MetricSpecification - Metric specification of operation.

func (MetricSpecification) MarshalJSON

func (m MetricSpecification) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type MetricSpecification.

func (*MetricSpecification) UnmarshalJSON added in v1.1.0

func (m *MetricSpecification) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type MetricSpecification.

type NetworkRuleAction

type NetworkRuleAction string

NetworkRuleAction - The default action when no rule from ipRules and from virtualNetworkRules match. This is only used after the bypass property has been evaluated.

const (
	NetworkRuleActionAllow NetworkRuleAction = "Allow"
	NetworkRuleActionDeny  NetworkRuleAction = "Deny"
)

func PossibleNetworkRuleActionValues

func PossibleNetworkRuleActionValues() []NetworkRuleAction

PossibleNetworkRuleActionValues returns the possible values for the NetworkRuleAction const type.

type NetworkRuleBypassOptions

type NetworkRuleBypassOptions string

NetworkRuleBypassOptions - Tells what traffic can bypass network rules. This can be 'AzureServices' or 'None'. If not specified the default is 'AzureServices'.

const (
	NetworkRuleBypassOptionsAzureServices NetworkRuleBypassOptions = "AzureServices"
	NetworkRuleBypassOptionsNone          NetworkRuleBypassOptions = "None"
)

func PossibleNetworkRuleBypassOptionsValues

func PossibleNetworkRuleBypassOptionsValues() []NetworkRuleBypassOptions

PossibleNetworkRuleBypassOptionsValues returns the possible values for the NetworkRuleBypassOptions const type.

type NetworkRuleSet

type NetworkRuleSet struct {
	// Tells what traffic can bypass network rules. This can be 'AzureServices' or 'None'. If not specified the default is 'AzureServices'.
	Bypass *NetworkRuleBypassOptions

	// The default action when no rule from ipRules and from virtualNetworkRules match. This is only used after the bypass property
	// has been evaluated.
	DefaultAction *NetworkRuleAction

	// The list of IP address rules.
	IPRules []*IPRule

	// The list of virtual network rules.
	VirtualNetworkRules []*VirtualNetworkRule
}

NetworkRuleSet - A set of rules governing the network accessibility of a vault.

func (NetworkRuleSet) MarshalJSON

func (n NetworkRuleSet) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NetworkRuleSet.

func (*NetworkRuleSet) UnmarshalJSON added in v1.1.0

func (n *NetworkRuleSet) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRuleSet.

type Operation

type Operation struct {
	// Display metadata associated with the operation.
	Display *OperationDisplay

	// Property to specify whether the action is a data action.
	IsDataAction *bool

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

	// Properties of operation, include metric specifications.
	OperationProperties *OperationProperties

	// The origin of operations.
	Origin *string
}

Operation - Key Vault REST API operation definition.

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 operation.
	Description *string

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

	// Service provider: Microsoft Key Vault.
	Provider *string

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

OperationDisplay - Display metadata associated with 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 {
	// The URL to get the next set of operations.
	NextLink *string

	// List of Storage operations supported by the Storage resource provider.
	Value []*Operation
}

OperationListResult - Result of the request to list Storage 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 OperationProperties

type OperationProperties struct {
	// One property of operation, include metric specifications.
	ServiceSpecification *ServiceSpecification
}

OperationProperties - Properties of operation, include metric specifications.

func (OperationProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type OperationProperties.

func (*OperationProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationProperties.

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.5.0

NewListPager - Lists all of the available Key Vault Rest API operations.

Generated from API version 2023-07-01

  • 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/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/listOperations.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.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.OperationListResult = armkeyvault.OperationListResult{
		// 	Value: []*armkeyvault.Operation{
		// 		{
		// 			Name: to.Ptr("Microsoft.KeyVault/vaults/read"),
		// 			Display: &armkeyvault.OperationDisplay{
		// 				Description: to.Ptr("View the properties of a key vault"),
		// 				Operation: to.Ptr("View Key Vault"),
		// 				Provider: to.Ptr("Microsoft Key Vault"),
		// 				Resource: to.Ptr("Key Vault"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.KeyVault/vaults/write"),
		// 			Display: &armkeyvault.OperationDisplay{
		// 				Description: to.Ptr("Create a new key vault or update the properties of an existing key vault"),
		// 				Operation: to.Ptr("Update Key Vault"),
		// 				Provider: to.Ptr("Microsoft Key Vault"),
		// 				Resource: to.Ptr("Key Vault"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.KeyVault/vaults/delete"),
		// 			Display: &armkeyvault.OperationDisplay{
		// 				Description: to.Ptr("Delete a key vault"),
		// 				Operation: to.Ptr("Delete Key Vault"),
		// 				Provider: to.Ptr("Microsoft Key Vault"),
		// 				Resource: to.Ptr("Key Vault"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.KeyVault/vaults/deploy/action"),
		// 			Display: &armkeyvault.OperationDisplay{
		// 				Description: to.Ptr("Enables access to secrets in a key vault when deploying Azure resources"),
		// 				Operation: to.Ptr("Use Vault for Azure Deployments"),
		// 				Provider: to.Ptr("Microsoft Key Vault"),
		// 				Resource: to.Ptr("Key Vault"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.KeyVault/vaults/secrets/read"),
		// 			Display: &armkeyvault.OperationDisplay{
		// 				Description: to.Ptr("View the properties of a secret, but not its value"),
		// 				Operation: to.Ptr("View Secret Properties"),
		// 				Provider: to.Ptr("Microsoft Key Vault"),
		// 				Resource: to.Ptr("Secret"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.KeyVault/vaults/secrets/write"),
		// 			Display: &armkeyvault.OperationDisplay{
		// 				Description: to.Ptr("Create a new secret or update the value of an existing secret"),
		// 				Operation: to.Ptr("Update Secret"),
		// 				Provider: to.Ptr("Microsoft Key Vault"),
		// 				Resource: to.Ptr("Secret"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.KeyVault/vaults/accessPolicies/write"),
		// 			Display: &armkeyvault.OperationDisplay{
		// 				Description: to.Ptr("Update an existing access policy by merging or replacing, or add a new access policy to a vault."),
		// 				Operation: to.Ptr("Update Access Policy"),
		// 				Provider: to.Ptr("Microsoft Key Vault"),
		// 				Resource: to.Ptr("Access Policy"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.KeyVault/vaults/providers/Microsoft.Insights/logDefinitions/read"),
		// 			Display: &armkeyvault.OperationDisplay{
		// 				Description: to.Ptr("Gets the available logs for a key vault"),
		// 				Operation: to.Ptr("Read log definition"),
		// 				Provider: to.Ptr("Microsoft Key Vault"),
		// 				Resource: to.Ptr("Key Vault Log Definition"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 			Origin: to.Ptr("system"),
		// 			OperationProperties: &armkeyvault.OperationProperties{
		// 				ServiceSpecification: &armkeyvault.ServiceSpecification{
		// 					LogSpecifications: []*armkeyvault.LogSpecification{
		// 						{
		// 							Name: to.Ptr("AuditEvent"),
		// 							BlobDuration: to.Ptr("PT1H"),
		// 							DisplayName: to.Ptr("Audit Logs"),
		// 					}},
		// 					MetricSpecifications: []*armkeyvault.MetricSpecification{
		// 						{
		// 							Name: to.Ptr("ServiceApiHit"),
		// 							AggregationType: to.Ptr(""),
		// 							Dimensions: []*armkeyvault.DimensionProperties{
		// 								{
		// 									Name: to.Ptr("ActivityType"),
		// 									DisplayName: to.Ptr(""),
		// 									ToBeExportedForShoebox: to.Ptr(true),
		// 								},
		// 								{
		// 									Name: to.Ptr("ActivityName"),
		// 									DisplayName: to.Ptr(""),
		// 									ToBeExportedForShoebox: to.Ptr(true),
		// 							}},
		// 							DisplayDescription: to.Ptr(""),
		// 							DisplayName: to.Ptr(""),
		// 							FillGapWithZero: to.Ptr(false),
		// 							InternalMetricName: to.Ptr("AuditEvent"),
		// 							LockAggregationType: to.Ptr(""),
		// 							SupportedAggregationTypes: []*string{
		// 								to.Ptr("")},
		// 								SupportedTimeGrainTypes: []*string{
		// 									to.Ptr("")},
		// 									Unit: to.Ptr(""),
		// 							}},
		// 						},
		// 					},
		// 				},
		// 				{
		// 					Name: to.Ptr("Microsoft.KeyVault/vaults/providers/Microsoft.Insights/diagnosticSettings/Read"),
		// 					Display: &armkeyvault.OperationDisplay{
		// 						Description: to.Ptr("Gets the diagnostic setting for the resource"),
		// 						Operation: to.Ptr("Read diagnostic setting"),
		// 						Provider: to.Ptr("Microsoft Key Vault"),
		// 						Resource: to.Ptr("Key Vault Diagnostic Settings"),
		// 					},
		// 					IsDataAction: to.Ptr(false),
		// 					Origin: to.Ptr("system"),
		// 				},
		// 				{
		// 					Name: to.Ptr("Microsoft.KeyVault/vaults/providers/Microsoft.Insights/diagnosticSettings/Write"),
		// 					Display: &armkeyvault.OperationDisplay{
		// 						Description: to.Ptr("Creates or updates the diagnostic setting for the resource"),
		// 						Operation: to.Ptr("Write diagnostic setting"),
		// 						Provider: to.Ptr("Microsoft Key Vault"),
		// 						Resource: to.Ptr("Key Vault Diagnostic Settings"),
		// 					},
		// 					IsDataAction: to.Ptr(false),
		// 					Origin: to.Ptr("system"),
		// 				},
		// 				{
		// 					Name: to.Ptr("Microsoft.KeyVault/register/action"),
		// 					Display: &armkeyvault.OperationDisplay{
		// 						Description: to.Ptr("Registers a subscription"),
		// 						Operation: to.Ptr("Register Subscription"),
		// 						Provider: to.Ptr("Microsoft Key Vault"),
		// 						Resource: to.Ptr("Subscription"),
		// 					},
		// 					IsDataAction: to.Ptr(false),
		// 				},
		// 				{
		// 					Name: to.Ptr("Microsoft.KeyVault/unregister/action"),
		// 					Display: &armkeyvault.OperationDisplay{
		// 						Description: to.Ptr("Unregisters a subscription"),
		// 						Operation: to.Ptr("Unregister Subscription"),
		// 						Provider: to.Ptr("Microsoft Key Vault"),
		// 						Resource: to.Ptr("Subscription"),
		// 					},
		// 					IsDataAction: to.Ptr(false),
		// 				},
		// 				{
		// 					Name: to.Ptr("Microsoft.KeyVault/operations/read"),
		// 					Display: &armkeyvault.OperationDisplay{
		// 						Description: to.Ptr("Lists operations available on Microsoft.KeyVault resource provider"),
		// 						Operation: to.Ptr("Available Key Vault Operations"),
		// 						Provider: to.Ptr("Microsoft Key Vault"),
		// 						Resource: to.Ptr("Operations"),
		// 					},
		// 					IsDataAction: to.Ptr(false),
		// 				},
		// 				{
		// 					Name: to.Ptr("Microsoft.KeyVault/checkNameAvailability/read"),
		// 					Display: &armkeyvault.OperationDisplay{
		// 						Description: to.Ptr("Checks that a key vault name is valid and is not in use"),
		// 						Operation: to.Ptr("Check Name Availability"),
		// 						Provider: to.Ptr("Microsoft Key Vault"),
		// 						Resource: to.Ptr("Name Availability"),
		// 					},
		// 					IsDataAction: to.Ptr(false),
		// 				},
		// 				{
		// 					Name: to.Ptr("Microsoft.KeyVault/deletedVaults/read"),
		// 					Display: &armkeyvault.OperationDisplay{
		// 						Description: to.Ptr("View the properties of soft deleted key vaults"),
		// 						Operation: to.Ptr("View Soft Deleted Vaults"),
		// 						Provider: to.Ptr("Microsoft Key Vault"),
		// 						Resource: to.Ptr("Soft Deleted Key Vault"),
		// 					},
		// 					IsDataAction: to.Ptr(false),
		// 				},
		// 				{
		// 					Name: to.Ptr("Microsoft.KeyVault/locations/deletedVaults/read"),
		// 					Display: &armkeyvault.OperationDisplay{
		// 						Description: to.Ptr("View the properties of a soft deleted key vault"),
		// 						Operation: to.Ptr("View Soft Deleted Key Vault"),
		// 						Provider: to.Ptr("Microsoft Key Vault"),
		// 						Resource: to.Ptr("Soft Deleted Key Vault"),
		// 					},
		// 					IsDataAction: to.Ptr(false),
		// 				},
		// 				{
		// 					Name: to.Ptr("Microsoft.KeyVault/locations/deletedVaults/purge/action"),
		// 					Display: &armkeyvault.OperationDisplay{
		// 						Description: to.Ptr("Purge a soft deleted key vault"),
		// 						Operation: to.Ptr("Purge Soft Deleted Key Vault"),
		// 						Provider: to.Ptr("Microsoft Key Vault"),
		// 						Resource: to.Ptr("Soft Deleted Key Vault"),
		// 					},
		// 					IsDataAction: to.Ptr(false),
		// 				},
		// 				{
		// 					Name: to.Ptr("Microsoft.KeyVault/locations/operationResults/read"),
		// 					Display: &armkeyvault.OperationDisplay{
		// 						Description: to.Ptr("Check the result of a long run operation"),
		// 						Operation: to.Ptr("Check Operation Result"),
		// 						Provider: to.Ptr("Microsoft Key Vault"),
		// 						Resource: to.Ptr("Long Run Operation Result"),
		// 					},
		// 					IsDataAction: to.Ptr(false),
		// 				},
		// 				{
		// 					Name: to.Ptr("Microsoft.KeyVault/hsmPools/read"),
		// 					Display: &armkeyvault.OperationDisplay{
		// 						Description: to.Ptr("View the properties of an HSM pool"),
		// 						Operation: to.Ptr("View HSM pool"),
		// 						Provider: to.Ptr("Microsoft Key Vault"),
		// 						Resource: to.Ptr("HSM pool"),
		// 					},
		// 					IsDataAction: to.Ptr(false),
		// 				},
		// 				{
		// 					Name: to.Ptr("Microsoft.KeyVault/hsmPools/write"),
		// 					Display: &armkeyvault.OperationDisplay{
		// 						Description: to.Ptr("Create a new HSM pool of update the properties of an existing HSM pool"),
		// 						Operation: to.Ptr("Create or Update HSM pool"),
		// 						Provider: to.Ptr("Microsoft Key Vault"),
		// 						Resource: to.Ptr("HSM pool"),
		// 					},
		// 					IsDataAction: to.Ptr(false),
		// 				},
		// 				{
		// 					Name: to.Ptr("Microsoft.KeyVault/hsmPools/delete"),
		// 					Display: &armkeyvault.OperationDisplay{
		// 						Description: to.Ptr("Delete an HSM pool"),
		// 						Operation: to.Ptr("Delete HSM pool"),
		// 						Provider: to.Ptr("Microsoft Key Vault"),
		// 						Resource: to.Ptr("HSM pool"),
		// 					},
		// 					IsDataAction: to.Ptr(false),
		// 				},
		// 				{
		// 					Name: to.Ptr("Microsoft.KeyVault/hsmPools/joinVault/action"),
		// 					Display: &armkeyvault.OperationDisplay{
		// 						Description: to.Ptr("Join a key vault to an HSM pool"),
		// 						Operation: to.Ptr("Join KeyVault to HSM pool"),
		// 						Provider: to.Ptr("Microsoft Key Vault"),
		// 						Resource: to.Ptr("HSM pool"),
		// 					},
		// 					IsDataAction: to.Ptr(false),
		// 				},
		// 				{
		// 					Name: to.Ptr("Microsoft.KeyVault/managedHSMs/read"),
		// 					Display: &armkeyvault.OperationDisplay{
		// 						Description: to.Ptr("View the properties of a Managed HSM"),
		// 						Operation: to.Ptr("View Managed HSM"),
		// 						Provider: to.Ptr("Microsoft Key Vault"),
		// 						Resource: to.Ptr("Managed HSM"),
		// 					},
		// 					IsDataAction: to.Ptr(false),
		// 				},
		// 				{
		// 					Name: to.Ptr("Microsoft.KeyVault/managedHSMs/write"),
		// 					Display: &armkeyvault.OperationDisplay{
		// 						Description: to.Ptr("Create a new Managed HSM of update the properties of an existing Managed HSM"),
		// 						Operation: to.Ptr("Create or Update Managed HSM"),
		// 						Provider: to.Ptr("Microsoft Key Vault"),
		// 						Resource: to.Ptr("Managed HSM"),
		// 					},
		// 					IsDataAction: to.Ptr(false),
		// 				},
		// 				{
		// 					Name: to.Ptr("Microsoft.KeyVault/managedHSMs/delete"),
		// 					Display: &armkeyvault.OperationDisplay{
		// 						Description: to.Ptr("Delete a Managed HSM"),
		// 						Operation: to.Ptr("Delete Managed HSM"),
		// 						Provider: to.Ptr("Microsoft Key Vault"),
		// 						Resource: to.Ptr("Managed HSM"),
		// 					},
		// 					IsDataAction: to.Ptr(false),
		// 				},
		// 				{
		// 					Name: to.Ptr("Microsoft.KeyVault/vaults/providers/Microsoft.Insights/metricDefinitions/read"),
		// 					Display: &armkeyvault.OperationDisplay{
		// 						Description: to.Ptr("Gets the available metrics for a key vault"),
		// 						Operation: to.Ptr("Read metric definition"),
		// 						Provider: to.Ptr("Microsoft Key Vault"),
		// 						Resource: to.Ptr("Key Vault Metric Definition"),
		// 					},
		// 					IsDataAction: to.Ptr(false),
		// 					Origin: to.Ptr("system"),
		// 					OperationProperties: &armkeyvault.OperationProperties{
		// 						ServiceSpecification: &armkeyvault.ServiceSpecification{
		// 						},
		// 					},
		// 				},
		// 				{
		// 					Name: to.Ptr("Microsoft.KeyVault/locations/deleteVirtualNetworkOrSubnets/action"),
		// 					Display: &armkeyvault.OperationDisplay{
		// 						Description: to.Ptr("Notifies Microsoft.KeyVault that a virtual network or subnet is being deleted"),
		// 						Operation: to.Ptr("Modify Network ACLs containing the deleted Vitual Network or Subnet "),
		// 						Provider: to.Ptr("Microsoft Key Vault"),
		// 						Resource: to.Ptr("Location"),
		// 					},
		// 					IsDataAction: to.Ptr(false),
		// 					Origin: to.Ptr("system"),
		// 			}},
		// 		}
	}
}
Output:

type OperationsClientListOptions added in v0.3.0

type OperationsClientListOptions struct {
}

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

type OperationsClientListResponse added in v0.3.0

type OperationsClientListResponse struct {
	// Result of the request to list Storage 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 Permissions

type Permissions struct {
	// Permissions to certificates
	Certificates []*CertificatePermissions

	// Permissions to keys
	Keys []*KeyPermissions

	// Permissions to secrets
	Secrets []*SecretPermissions

	// Permissions to storage accounts
	Storage []*StoragePermissions
}

Permissions the identity has for keys, secrets, certificates and storage.

func (Permissions) MarshalJSON

func (p Permissions) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Permissions.

func (*Permissions) UnmarshalJSON added in v1.1.0

func (p *Permissions) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Permissions.

type PrivateEndpoint

type PrivateEndpoint struct {
	// READ-ONLY; Full identifier of the private endpoint resource.
	ID *string
}

PrivateEndpoint - Private endpoint object properties.

func (PrivateEndpoint) MarshalJSON added in v1.1.0

func (p PrivateEndpoint) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint.

func (*PrivateEndpoint) UnmarshalJSON added in v1.1.0

func (p *PrivateEndpoint) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpoint.

type PrivateEndpointConnection

type PrivateEndpointConnection struct {
	// Modified whenever there is a change in the state of private endpoint connection.
	Etag *string

	// Resource properties.
	Properties *PrivateEndpointConnectionProperties

	// READ-ONLY; Fully qualified identifier of the key vault resource.
	ID *string

	// READ-ONLY; Azure location of the key vault resource.
	Location *string

	// READ-ONLY; Name of the key vault resource.
	Name *string

	// READ-ONLY; Tags assigned to the key vault resource.
	Tags map[string]*string

	// READ-ONLY; Resource type of the key vault resource.
	Type *string
}

PrivateEndpointConnection - Private endpoint connection resource.

func (PrivateEndpointConnection) MarshalJSON

func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection.

func (*PrivateEndpointConnection) UnmarshalJSON added in v1.1.0

func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection.

type PrivateEndpointConnectionItem

type PrivateEndpointConnectionItem struct {
	// Modified whenever there is a change in the state of private endpoint connection.
	Etag *string

	// Id of private endpoint connection.
	ID *string

	// Private endpoint connection properties.
	Properties *PrivateEndpointConnectionProperties
}

PrivateEndpointConnectionItem - Private endpoint connection item.

func (PrivateEndpointConnectionItem) MarshalJSON added in v1.1.0

func (p PrivateEndpointConnectionItem) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionItem.

func (*PrivateEndpointConnectionItem) UnmarshalJSON added in v1.1.0

func (p *PrivateEndpointConnectionItem) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionItem.

type PrivateEndpointConnectionListResult

type PrivateEndpointConnectionListResult struct {
	// The URL to get the next set of private endpoint connections.
	NextLink *string

	// The list of private endpoint connections.
	Value []*PrivateEndpointConnection
}

PrivateEndpointConnectionListResult - List of private endpoint connections.

func (PrivateEndpointConnectionListResult) MarshalJSON

func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult.

func (*PrivateEndpointConnectionListResult) UnmarshalJSON added in v1.1.0

func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult.

type PrivateEndpointConnectionProperties

type PrivateEndpointConnectionProperties struct {
	// Properties of the private endpoint object.
	PrivateEndpoint *PrivateEndpoint

	// Approval state of the private link connection.
	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState

	// Provisioning state of the private endpoint connection.
	ProvisioningState *PrivateEndpointConnectionProvisioningState
}

PrivateEndpointConnectionProperties - Properties of the private endpoint connection resource.

func (PrivateEndpointConnectionProperties) MarshalJSON added in v1.1.0

func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties.

func (*PrivateEndpointConnectionProperties) UnmarshalJSON added in v1.1.0

func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties.

type PrivateEndpointConnectionProvisioningState

type PrivateEndpointConnectionProvisioningState string

PrivateEndpointConnectionProvisioningState - The current provisioning state.

const (
	PrivateEndpointConnectionProvisioningStateCreating     PrivateEndpointConnectionProvisioningState = "Creating"
	PrivateEndpointConnectionProvisioningStateDeleting     PrivateEndpointConnectionProvisioningState = "Deleting"
	PrivateEndpointConnectionProvisioningStateDisconnected PrivateEndpointConnectionProvisioningState = "Disconnected"
	PrivateEndpointConnectionProvisioningStateFailed       PrivateEndpointConnectionProvisioningState = "Failed"
	PrivateEndpointConnectionProvisioningStateSucceeded    PrivateEndpointConnectionProvisioningState = "Succeeded"
	PrivateEndpointConnectionProvisioningStateUpdating     PrivateEndpointConnectionProvisioningState = "Updating"
)

func PossiblePrivateEndpointConnectionProvisioningStateValues

func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState

PossiblePrivateEndpointConnectionProvisioningStateValues returns the possible values for the PrivateEndpointConnectionProvisioningState const type.

type PrivateEndpointConnectionsClient

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

PrivateEndpointConnectionsClient contains the methods for the PrivateEndpointConnections group. Don't use this type directly, use NewPrivateEndpointConnectionsClient() instead.

func NewPrivateEndpointConnectionsClient

func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error)

NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values.

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

func (*PrivateEndpointConnectionsClient) BeginDelete

func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, vaultName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*runtime.Poller[PrivateEndpointConnectionsClientDeleteResponse], error)

BeginDelete - Deletes the specified private endpoint connection associated with the key vault. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - Name of the resource group that contains the key vault.
  • vaultName - The name of the key vault.
  • privateEndpointConnectionName - Name of the private endpoint connection associated with the key vault.
  • options - PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/deletePrivateEndpointConnection.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "sample-group", "sample-vault", "sample-pec", 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.PrivateEndpointConnection = armkeyvault.PrivateEndpointConnection{
	// 	Name: to.Ptr("sample-pec"),
	// 	Type: to.Ptr("Microsoft.KeyVault/vaults/privateEndpointConnections"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault/privateEndpointConnections/sample-pec"),
	// 	Properties: &armkeyvault.PrivateEndpointConnectionProperties{
	// 		ProvisioningState: to.Ptr(armkeyvault.PrivateEndpointConnectionProvisioningStateSucceeded),
	// 	},
	// }
}
Output:

func (*PrivateEndpointConnectionsClient) Get

func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, vaultName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error)

Get - Gets the specified private endpoint connection associated with the key vault. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - Name of the resource group that contains the key vault.
  • vaultName - The name of the key vault.
  • privateEndpointConnectionName - Name of the private endpoint connection associated with the key vault.
  • options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/getPrivateEndpointConnection.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "sample-group", "sample-vault", "sample-pec", 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.PrivateEndpointConnection = armkeyvault.PrivateEndpointConnection{
	// 	Name: to.Ptr("sample-pec"),
	// 	Type: to.Ptr("Microsoft.KeyVault/vaults/privateEndpointConnections"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault/privateEndpointConnections/sample-pec"),
	// 	Etag: to.Ptr(""),
	// 	Properties: &armkeyvault.PrivateEndpointConnectionProperties{
	// 		PrivateEndpoint: &armkeyvault.PrivateEndpoint{
	// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-1234-000000000000/resourceGroups/sample-group/providers/Microsoft.Network/privateEndpoints/sample-pe"),
	// 		},
	// 		PrivateLinkServiceConnectionState: &armkeyvault.PrivateLinkServiceConnectionState{
	// 			Description: to.Ptr("This was automatically approved by user1234@contoso.com"),
	// 			ActionsRequired: to.Ptr(armkeyvault.ActionsRequiredNone),
	// 			Status: to.Ptr(armkeyvault.PrivateEndpointServiceConnectionStatusApproved),
	// 		},
	// 		ProvisioningState: to.Ptr(armkeyvault.PrivateEndpointConnectionProvisioningStateSucceeded),
	// 	},
	// }
}
Output:

func (*PrivateEndpointConnectionsClient) NewListByResourcePager added in v0.5.0

NewListByResourcePager - The List operation gets information about the private endpoint connections associated with the vault.

Generated from API version 2023-07-01

  • resourceGroupName - Name of the resource group that contains the key vault.
  • vaultName - The name of the key vault.
  • options - PrivateEndpointConnectionsClientListByResourceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByResourcePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/listPrivateEndpointConnection.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListByResourcePager("sample-group", "sample-vault", 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.PrivateEndpointConnectionListResult = armkeyvault.PrivateEndpointConnectionListResult{
		// 	Value: []*armkeyvault.PrivateEndpointConnection{
		// 		{
		// 			Name: to.Ptr("sample-pec"),
		// 			Type: to.Ptr("Microsoft.KeyVault/vaults/privateEndpointConnections"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault/privateEndpointConnections/sample-pec"),
		// 			Etag: to.Ptr(""),
		// 			Properties: &armkeyvault.PrivateEndpointConnectionProperties{
		// 				PrivateEndpoint: &armkeyvault.PrivateEndpoint{
		// 					ID: to.Ptr("/subscriptions/00000000-0000-0000-1234-000000000000/resourceGroups/sample-group/providers/Microsoft.Network/privateEndpoints/sample-pe"),
		// 				},
		// 				PrivateLinkServiceConnectionState: &armkeyvault.PrivateLinkServiceConnectionState{
		// 					Description: to.Ptr("This was automatically approved by user1234@contoso.com"),
		// 					ActionsRequired: to.Ptr(armkeyvault.ActionsRequiredNone),
		// 					Status: to.Ptr(armkeyvault.PrivateEndpointServiceConnectionStatusApproved),
		// 				},
		// 				ProvisioningState: to.Ptr(armkeyvault.PrivateEndpointConnectionProvisioningStateSucceeded),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("sample-pec"),
		// 			Type: to.Ptr("Microsoft.KeyVault/vaults/privateEndpointConnections"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault/privateEndpointConnections/sample-pec"),
		// 			Etag: to.Ptr(""),
		// 			Properties: &armkeyvault.PrivateEndpointConnectionProperties{
		// 				PrivateEndpoint: &armkeyvault.PrivateEndpoint{
		// 					ID: to.Ptr("/subscriptions/00000000-0000-0000-1234-000000000000/resourceGroups/sample-group/providers/Microsoft.Network/privateEndpoints/sample-pe"),
		// 				},
		// 				PrivateLinkServiceConnectionState: &armkeyvault.PrivateLinkServiceConnectionState{
		// 					Description: to.Ptr("This was automatically approved by user1234@contoso.com"),
		// 					ActionsRequired: to.Ptr(armkeyvault.ActionsRequiredNone),
		// 					Status: to.Ptr(armkeyvault.PrivateEndpointServiceConnectionStatusApproved),
		// 				},
		// 				ProvisioningState: to.Ptr(armkeyvault.PrivateEndpointConnectionProvisioningStateSucceeded),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*PrivateEndpointConnectionsClient) Put

func (client *PrivateEndpointConnectionsClient) Put(ctx context.Context, resourceGroupName string, vaultName string, privateEndpointConnectionName string, properties PrivateEndpointConnection, options *PrivateEndpointConnectionsClientPutOptions) (PrivateEndpointConnectionsClientPutResponse, error)

Put - Updates the specified private endpoint connection associated with the key vault. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - Name of the resource group that contains the key vault.
  • vaultName - The name of the key vault.
  • privateEndpointConnectionName - Name of the private endpoint connection associated with the key vault.
  • properties - The intended state of private endpoint connection.
  • options - PrivateEndpointConnectionsClientPutOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Put method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/putPrivateEndpointConnection.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/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPrivateEndpointConnectionsClient().Put(ctx, "sample-group", "sample-vault", "sample-pec", armkeyvault.PrivateEndpointConnection{
		Etag: to.Ptr(""),
		Properties: &armkeyvault.PrivateEndpointConnectionProperties{
			PrivateLinkServiceConnectionState: &armkeyvault.PrivateLinkServiceConnectionState{
				Description: to.Ptr("My name is Joe and I'm approving this."),
				Status:      to.Ptr(armkeyvault.PrivateEndpointServiceConnectionStatusApproved),
			},
		},
	}, 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.PrivateEndpointConnection = armkeyvault.PrivateEndpointConnection{
	// 	Name: to.Ptr("sample-pec"),
	// 	Type: to.Ptr("Microsoft.KeyVault/vaults/privateEndpointConnections"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault/privateEndpointConnections/sample-pec"),
	// 	Etag: to.Ptr(""),
	// 	Properties: &armkeyvault.PrivateEndpointConnectionProperties{
	// 		PrivateEndpoint: &armkeyvault.PrivateEndpoint{
	// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-1234-000000000000/resourceGroups/sample-group/providers/Microsoft.Network/privateEndpoints/sample-pe"),
	// 		},
	// 		PrivateLinkServiceConnectionState: &armkeyvault.PrivateLinkServiceConnectionState{
	// 			Description: to.Ptr("My name is Joe and I'm approving this."),
	// 			ActionsRequired: to.Ptr(armkeyvault.ActionsRequiredNone),
	// 			Status: to.Ptr(armkeyvault.PrivateEndpointServiceConnectionStatusApproved),
	// 		},
	// 		ProvisioningState: to.Ptr(armkeyvault.PrivateEndpointConnectionProvisioningStateSucceeded),
	// 	},
	// }
}
Output:

type PrivateEndpointConnectionsClientBeginDeleteOptions added in v0.3.0

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

PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete method.

type PrivateEndpointConnectionsClientDeleteResponse added in v0.3.0

type PrivateEndpointConnectionsClientDeleteResponse struct {
	// Private endpoint connection resource.
	PrivateEndpointConnection
}

PrivateEndpointConnectionsClientDeleteResponse contains the response from method PrivateEndpointConnectionsClient.BeginDelete.

type PrivateEndpointConnectionsClientGetOptions added in v0.3.0

type PrivateEndpointConnectionsClientGetOptions struct {
}

PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get method.

type PrivateEndpointConnectionsClientGetResponse added in v0.3.0

type PrivateEndpointConnectionsClientGetResponse struct {
	// Private endpoint connection resource.
	PrivateEndpointConnection
}

PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get.

type PrivateEndpointConnectionsClientListByResourceOptions added in v0.3.0

type PrivateEndpointConnectionsClientListByResourceOptions struct {
}

PrivateEndpointConnectionsClientListByResourceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByResourcePager method.

type PrivateEndpointConnectionsClientListByResourceResponse added in v0.3.0

type PrivateEndpointConnectionsClientListByResourceResponse struct {
	// List of private endpoint connections.
	PrivateEndpointConnectionListResult
}

PrivateEndpointConnectionsClientListByResourceResponse contains the response from method PrivateEndpointConnectionsClient.NewListByResourcePager.

type PrivateEndpointConnectionsClientPutOptions added in v0.3.0

type PrivateEndpointConnectionsClientPutOptions struct {
}

PrivateEndpointConnectionsClientPutOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Put method.

type PrivateEndpointConnectionsClientPutResponse added in v0.3.0

type PrivateEndpointConnectionsClientPutResponse struct {
	// Private endpoint connection resource.
	PrivateEndpointConnection

	// AzureAsyncOperation contains the information returned from the Azure-AsyncOperation header response.
	AzureAsyncOperation *string

	// RetryAfter contains the information returned from the Retry-After header response.
	RetryAfter *int32
}

PrivateEndpointConnectionsClientPutResponse contains the response from method PrivateEndpointConnectionsClient.Put.

type PrivateEndpointServiceConnectionStatus

type PrivateEndpointServiceConnectionStatus string

PrivateEndpointServiceConnectionStatus - The private endpoint connection status.

const (
	PrivateEndpointServiceConnectionStatusApproved     PrivateEndpointServiceConnectionStatus = "Approved"
	PrivateEndpointServiceConnectionStatusDisconnected PrivateEndpointServiceConnectionStatus = "Disconnected"
	PrivateEndpointServiceConnectionStatusPending      PrivateEndpointServiceConnectionStatus = "Pending"
	PrivateEndpointServiceConnectionStatusRejected     PrivateEndpointServiceConnectionStatus = "Rejected"
)

func PossiblePrivateEndpointServiceConnectionStatusValues

func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus

PossiblePrivateEndpointServiceConnectionStatusValues returns the possible values for the PrivateEndpointServiceConnectionStatus const type.

type PrivateLinkResource

type PrivateLinkResource struct {
	// Resource properties.
	Properties *PrivateLinkResourceProperties

	// READ-ONLY; Fully qualified identifier of the key vault resource.
	ID *string

	// READ-ONLY; Azure location of the key vault resource.
	Location *string

	// READ-ONLY; Name of the key vault resource.
	Name *string

	// READ-ONLY; Tags assigned to the key vault resource.
	Tags map[string]*string

	// READ-ONLY; Resource type of the key vault resource.
	Type *string
}

PrivateLinkResource - A private link resource

func (PrivateLinkResource) MarshalJSON

func (p PrivateLinkResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource.

func (*PrivateLinkResource) UnmarshalJSON added in v1.1.0

func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource.

type PrivateLinkResourceListResult

type PrivateLinkResourceListResult struct {
	// Array of private link resources
	Value []*PrivateLinkResource
}

PrivateLinkResourceListResult - A list of private link resources

func (PrivateLinkResourceListResult) MarshalJSON

func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult.

func (*PrivateLinkResourceListResult) UnmarshalJSON added in v1.1.0

func (p *PrivateLinkResourceListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult.

type PrivateLinkResourceProperties

type PrivateLinkResourceProperties struct {
	// Required DNS zone names of the the private link resource.
	RequiredZoneNames []*string

	// READ-ONLY; Group identifier of private link resource.
	GroupID *string

	// READ-ONLY; Required member names of private link resource.
	RequiredMembers []*string
}

PrivateLinkResourceProperties - Properties of a private link resource.

func (PrivateLinkResourceProperties) MarshalJSON

func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties.

func (*PrivateLinkResourceProperties) UnmarshalJSON added in v1.1.0

func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties.

type PrivateLinkResourcesClient

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

PrivateLinkResourcesClient contains the methods for the PrivateLinkResources group. Don't use this type directly, use NewPrivateLinkResourcesClient() instead.

func NewPrivateLinkResourcesClient

func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkResourcesClient, error)

NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values.

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

func (*PrivateLinkResourcesClient) ListByVault

ListByVault - Gets the private link resources supported for the key vault. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - Name of the resource group that contains the key vault.
  • vaultName - The name of the key vault.
  • options - PrivateLinkResourcesClientListByVaultOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByVault method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/listPrivateLinkResources.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPrivateLinkResourcesClient().ListByVault(ctx, "sample-group", "sample-vault", 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.PrivateLinkResourceListResult = armkeyvault.PrivateLinkResourceListResult{
	// 	Value: []*armkeyvault.PrivateLinkResource{
	// 		{
	// 			Name: to.Ptr("vault"),
	// 			Type: to.Ptr("Microsoft.KeyVault/vaults/privateLinkResources"),
	// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.KeyVault/vaults/sample-vault/privateLinkResources/vault"),
	// 			Properties: &armkeyvault.PrivateLinkResourceProperties{
	// 				GroupID: to.Ptr("vault"),
	// 				RequiredMembers: []*string{
	// 					to.Ptr("default")},
	// 					RequiredZoneNames: []*string{
	// 						to.Ptr("privatelink.vaultcore.azure.net")},
	// 					},
	// 			}},
	// 		}
}
Output:

type PrivateLinkResourcesClientListByVaultOptions added in v0.3.0

type PrivateLinkResourcesClientListByVaultOptions struct {
}

PrivateLinkResourcesClientListByVaultOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByVault method.

type PrivateLinkResourcesClientListByVaultResponse added in v0.3.0

type PrivateLinkResourcesClientListByVaultResponse struct {
	// A list of private link resources
	PrivateLinkResourceListResult
}

PrivateLinkResourcesClientListByVaultResponse contains the response from method PrivateLinkResourcesClient.ListByVault.

type PrivateLinkServiceConnectionState

type PrivateLinkServiceConnectionState struct {
	// A message indicating if changes on the service provider require any updates on the consumer.
	ActionsRequired *ActionsRequired

	// The reason for approval or rejection.
	Description *string

	// Indicates whether the connection has been approved, rejected or removed by the key vault owner.
	Status *PrivateEndpointServiceConnectionStatus
}

PrivateLinkServiceConnectionState - An object that represents the approval state of the private link connection.

func (PrivateLinkServiceConnectionState) MarshalJSON added in v1.1.0

func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState.

func (*PrivateLinkServiceConnectionState) UnmarshalJSON added in v1.1.0

func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionState.

type ProvisioningState

type ProvisioningState string

ProvisioningState - Provisioning state.

const (
	// ProvisioningStateActivated - The managed HSM pool is ready for normal use.
	ProvisioningStateActivated ProvisioningState = "Activated"
	// ProvisioningStateDeleting - The managed HSM Pool is currently being deleted.
	ProvisioningStateDeleting ProvisioningState = "Deleting"
	// ProvisioningStateFailed - Provisioning of the managed HSM Pool has failed.
	ProvisioningStateFailed ProvisioningState = "Failed"
	// ProvisioningStateProvisioning - The managed HSM Pool is currently being provisioned.
	ProvisioningStateProvisioning ProvisioningState = "Provisioning"
	// ProvisioningStateRestoring - The managed HSM pool is being restored from full HSM backup.
	ProvisioningStateRestoring ProvisioningState = "Restoring"
	// ProvisioningStateSecurityDomainRestore - The managed HSM pool is waiting for a security domain restore action.
	ProvisioningStateSecurityDomainRestore ProvisioningState = "SecurityDomainRestore"
	// ProvisioningStateSucceeded - The managed HSM Pool has been full provisioned.
	ProvisioningStateSucceeded ProvisioningState = "Succeeded"
	// ProvisioningStateUpdating - The managed HSM Pool is currently being updated.
	ProvisioningStateUpdating ProvisioningState = "Updating"
)

func PossibleProvisioningStateValues

func PossibleProvisioningStateValues() []ProvisioningState

PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.

type PublicNetworkAccess

type PublicNetworkAccess string

PublicNetworkAccess - Control permission to the managed HSM from public networks.

const (
	PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled"
	PublicNetworkAccessEnabled  PublicNetworkAccess = "Enabled"
)

func PossiblePublicNetworkAccessValues

func PossiblePublicNetworkAccessValues() []PublicNetworkAccess

PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type.

type Reason

type Reason string

Reason - The reason that a vault name could not be used. The Reason element is only returned if NameAvailable is false.

const (
	ReasonAccountNameInvalid Reason = "AccountNameInvalid"
	ReasonAlreadyExists      Reason = "AlreadyExists"
)

func PossibleReasonValues

func PossibleReasonValues() []Reason

PossibleReasonValues returns the possible values for the Reason const type.

type Resource

type Resource struct {
	// READ-ONLY; Fully qualified identifier of the key vault resource.
	ID *string

	// READ-ONLY; Azure location of the key vault resource.
	Location *string

	// READ-ONLY; Name of the key vault resource.
	Name *string

	// READ-ONLY; Tags assigned to the key vault resource.
	Tags map[string]*string

	// READ-ONLY; Resource type of the key vault resource.
	Type *string
}

Resource - Key Vault resource

func (Resource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Resource.

func (*Resource) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Resource.

type ResourceListResult

type ResourceListResult struct {
	// The URL to get the next set of vault resources.
	NextLink *string

	// The list of vault resources.
	Value []*Resource
}

ResourceListResult - List of vault resources.

func (ResourceListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ResourceListResult.

func (*ResourceListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceListResult.

type RotationPolicy

type RotationPolicy struct {
	// The attributes of key rotation policy.
	Attributes *KeyRotationPolicyAttributes

	// The lifetimeActions for key rotation action.
	LifetimeActions []*LifetimeAction
}

func (RotationPolicy) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RotationPolicy.

func (*RotationPolicy) UnmarshalJSON added in v1.2.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type RotationPolicy.

type SKU

type SKU struct {
	// REQUIRED; SKU family name
	Family *SKUFamily

	// REQUIRED; SKU name to specify whether the key vault is a standard vault or a premium vault.
	Name *SKUName
}

SKU details

func (SKU) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type SKU.

func (*SKU) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SKU.

type SKUFamily

type SKUFamily string

SKUFamily - SKU family name

const (
	SKUFamilyA SKUFamily = "A"
)

func PossibleSKUFamilyValues

func PossibleSKUFamilyValues() []SKUFamily

PossibleSKUFamilyValues returns the possible values for the SKUFamily const type.

type SKUName

type SKUName string

SKUName - SKU name to specify whether the key vault is a standard vault or a premium vault.

const (
	SKUNamePremium  SKUName = "premium"
	SKUNameStandard SKUName = "standard"
)

func PossibleSKUNameValues

func PossibleSKUNameValues() []SKUName

PossibleSKUNameValues returns the possible values for the SKUName const type.

type Secret

type Secret struct {
	// REQUIRED; Properties of the secret
	Properties *SecretProperties

	// READ-ONLY; Fully qualified identifier of the key vault resource.
	ID *string

	// READ-ONLY; Azure location of the key vault resource.
	Location *string

	// READ-ONLY; Name of the key vault resource.
	Name *string

	// READ-ONLY; Tags assigned to the key vault resource.
	Tags map[string]*string

	// READ-ONLY; Resource type of the key vault resource.
	Type *string
}

Secret - Resource information with extended details.

func (Secret) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Secret.

func (*Secret) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Secret.

type SecretAttributes

type SecretAttributes struct {
	// Determines whether the object is enabled.
	Enabled *bool

	// Expiry date in seconds since 1970-01-01T00:00:00Z.
	Expires *time.Time

	// Not before date in seconds since 1970-01-01T00:00:00Z.
	NotBefore *time.Time

	// READ-ONLY; Creation time in seconds since 1970-01-01T00:00:00Z.
	Created *time.Time

	// READ-ONLY; Last updated time in seconds since 1970-01-01T00:00:00Z.
	Updated *time.Time
}

SecretAttributes - The secret management attributes.

func (SecretAttributes) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type SecretAttributes.

func (*SecretAttributes) UnmarshalJSON added in v0.3.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SecretAttributes.

type SecretCreateOrUpdateParameters

type SecretCreateOrUpdateParameters struct {
	// REQUIRED; Properties of the secret
	Properties *SecretProperties

	// The tags that will be assigned to the secret.
	Tags map[string]*string
}

SecretCreateOrUpdateParameters - Parameters for creating or updating a secret

func (SecretCreateOrUpdateParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SecretCreateOrUpdateParameters.

func (*SecretCreateOrUpdateParameters) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SecretCreateOrUpdateParameters.

type SecretListResult

type SecretListResult struct {
	// The URL to get the next set of secrets.
	NextLink *string

	// The list of secrets.
	Value []*Secret
}

SecretListResult - List of secrets

func (SecretListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SecretListResult.

func (*SecretListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SecretListResult.

type SecretPatchParameters

type SecretPatchParameters struct {
	// Properties of the secret
	Properties *SecretPatchProperties

	// The tags that will be assigned to the secret.
	Tags map[string]*string
}

SecretPatchParameters - Parameters for patching a secret

func (SecretPatchParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SecretPatchParameters.

func (*SecretPatchParameters) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SecretPatchParameters.

type SecretPatchProperties

type SecretPatchProperties struct {
	// The attributes of the secret.
	Attributes *SecretAttributes

	// The content type of the secret.
	ContentType *string

	// The value of the secret.
	Value *string
}

SecretPatchProperties - Properties of the secret

func (SecretPatchProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type SecretPatchProperties.

func (*SecretPatchProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SecretPatchProperties.

type SecretPermissions

type SecretPermissions string
const (
	SecretPermissionsAll     SecretPermissions = "all"
	SecretPermissionsBackup  SecretPermissions = "backup"
	SecretPermissionsDelete  SecretPermissions = "delete"
	SecretPermissionsGet     SecretPermissions = "get"
	SecretPermissionsList    SecretPermissions = "list"
	SecretPermissionsPurge   SecretPermissions = "purge"
	SecretPermissionsRecover SecretPermissions = "recover"
	SecretPermissionsRestore SecretPermissions = "restore"
	SecretPermissionsSet     SecretPermissions = "set"
)

func PossibleSecretPermissionsValues

func PossibleSecretPermissionsValues() []SecretPermissions

PossibleSecretPermissionsValues returns the possible values for the SecretPermissions const type.

type SecretProperties

type SecretProperties struct {
	// The attributes of the secret.
	Attributes *SecretAttributes

	// The content type of the secret.
	ContentType *string

	// The value of the secret. NOTE: 'value' will never be returned from the service, as APIs using this model are is intended
	// for internal use in ARM deployments. Users should use the data-plane REST
	// service for interaction with vault secrets.
	Value *string

	// READ-ONLY; The URI to retrieve the current version of the secret.
	SecretURI *string

	// READ-ONLY; The URI to retrieve the specific version of the secret.
	SecretURIWithVersion *string
}

SecretProperties - Properties of the secret

func (SecretProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type SecretProperties.

func (*SecretProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SecretProperties.

type SecretsClient

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

SecretsClient contains the methods for the Secrets group. Don't use this type directly, use NewSecretsClient() instead.

func NewSecretsClient

func NewSecretsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecretsClient, error)

NewSecretsClient creates a new instance of SecretsClient with the specified values.

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

func (*SecretsClient) CreateOrUpdate

func (client *SecretsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, vaultName string, secretName string, parameters SecretCreateOrUpdateParameters, options *SecretsClientCreateOrUpdateOptions) (SecretsClientCreateOrUpdateResponse, error)

CreateOrUpdate - Create or update a secret in a key vault in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the Resource Group to which the vault belongs.
  • vaultName - Name of the vault
  • secretName - Name of the secret. The value you provide may be copied globally for the purpose of running the service. The value provided should not include personally identifiable or sensitive information.
  • parameters - Parameters to create or update the secret
  • options - SecretsClientCreateOrUpdateOptions contains the optional parameters for the SecretsClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/createSecret.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/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSecretsClient().CreateOrUpdate(ctx, "sample-group", "sample-vault", "secret-name", armkeyvault.SecretCreateOrUpdateParameters{
		Properties: &armkeyvault.SecretProperties{
			Value: to.Ptr("secret-value"),
		},
	}, 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.Secret = armkeyvault.Secret{
	// 	Name: to.Ptr("secret-name"),
	// 	Type: to.Ptr("Microsoft.KeyVault/vaults/secrets"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault/secrets/secret-name"),
	// 	Location: to.Ptr("westus"),
	// 	Properties: &armkeyvault.SecretProperties{
	// 		Attributes: &armkeyvault.SecretAttributes{
	// 			Created: to.Ptr(time.Unix(1514938738, 0)),
	// 			Enabled: to.Ptr(true),
	// 			Updated: to.Ptr(time.Unix(1514938738, 0)),
	// 		},
	// 		SecretURI: to.Ptr("https://sample-vault.vault.azure.net/secrets/secret-name"),
	// 		SecretURIWithVersion: to.Ptr("https:/sample-vault.vault.azure.net/secrets/secret-name/baf6de32c4774c7c81345f6476cf90a4"),
	// 	},
	// }
}
Output:

func (*SecretsClient) Get

func (client *SecretsClient) Get(ctx context.Context, resourceGroupName string, vaultName string, secretName string, options *SecretsClientGetOptions) (SecretsClientGetResponse, error)

Get - Gets the specified secret. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the Resource Group to which the vault belongs.
  • vaultName - The name of the vault.
  • secretName - The name of the secret.
  • options - SecretsClientGetOptions contains the optional parameters for the SecretsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/getSecret.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSecretsClient().Get(ctx, "sample-group", "sample-vault", "secret-name", 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.Secret = armkeyvault.Secret{
	// 	Name: to.Ptr("secret-name"),
	// 	Type: to.Ptr("Microsoft.KeyVault/vaults/secrets"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault/secrets/secret-name"),
	// 	Location: to.Ptr("westus"),
	// 	Properties: &armkeyvault.SecretProperties{
	// 		Attributes: &armkeyvault.SecretAttributes{
	// 			Created: to.Ptr(time.Unix(1514940950, 0)),
	// 			Enabled: to.Ptr(true),
	// 			Updated: to.Ptr(time.Unix(1514940950, 0)),
	// 		},
	// 		SecretURI: to.Ptr("https://sample-vault.vault.azure.net/secrets/secret-name"),
	// 		SecretURIWithVersion: to.Ptr("https://sample-vault.vault.azure.net/secrets/secret-name/77445834f7de41bab81d0723bf996860"),
	// 	},
	// }
}
Output:

func (*SecretsClient) NewListPager added in v0.5.0

func (client *SecretsClient) NewListPager(resourceGroupName string, vaultName string, options *SecretsClientListOptions) *runtime.Pager[SecretsClientListResponse]

NewListPager - The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the Resource Group to which the vault belongs.
  • vaultName - The name of the vault.
  • options - SecretsClientListOptions contains the optional parameters for the SecretsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/listSecrets.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewSecretsClient().NewListPager("sample-group", "sample-vault", &armkeyvault.SecretsClientListOptions{Top: 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.SecretListResult = armkeyvault.SecretListResult{
		// 	Value: []*armkeyvault.Secret{
		// 		{
		// 			Name: to.Ptr("secret-name"),
		// 			Type: to.Ptr("Microsoft.KeyVault/vaults/secrets"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault/secrets/secret-name"),
		// 			Location: to.Ptr("westus"),
		// 			Properties: &armkeyvault.SecretProperties{
		// 				Attributes: &armkeyvault.SecretAttributes{
		// 					Created: to.Ptr(time.Unix(1514941476, 0)),
		// 					Enabled: to.Ptr(true),
		// 					Updated: to.Ptr(time.Unix(1514941476, 0)),
		// 				},
		// 				SecretURI: to.Ptr("https://sample-vault.vault.azure.net/secrets/secret-name"),
		// 				SecretURIWithVersion: to.Ptr("https://sample-vault.vault.azure.net/secrets/secret-name/40af42fbc10047f8a756a73211492f56"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("secret-name2"),
		// 			Type: to.Ptr("Microsoft.KeyVault/vaults/secrets"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault/secrets/secret-name2"),
		// 			Location: to.Ptr("westus"),
		// 			Properties: &armkeyvault.SecretProperties{
		// 				Attributes: &armkeyvault.SecretAttributes{
		// 					Created: to.Ptr(time.Unix(1514941476, 0)),
		// 					Enabled: to.Ptr(true),
		// 					Updated: to.Ptr(time.Unix(1514941476, 0)),
		// 				},
		// 				SecretURI: to.Ptr("https://sample-vault.vault.azure.net/secrets/secret-name2"),
		// 				SecretURIWithVersion: to.Ptr("https://sample-vault.vault.azure.net/secrets/secret-name2/cd7264a6f56c44d1b594423c80609aae"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*SecretsClient) Update

func (client *SecretsClient) Update(ctx context.Context, resourceGroupName string, vaultName string, secretName string, parameters SecretPatchParameters, options *SecretsClientUpdateOptions) (SecretsClientUpdateResponse, error)

Update - Update a secret in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the Resource Group to which the vault belongs.
  • vaultName - Name of the vault
  • secretName - Name of the secret
  • parameters - Parameters to patch the secret
  • options - SecretsClientUpdateOptions contains the optional parameters for the SecretsClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/updateSecret.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/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSecretsClient().Update(ctx, "sample-group", "sample-vault", "secret-name", armkeyvault.SecretPatchParameters{
		Properties: &armkeyvault.SecretPatchProperties{
			Value: to.Ptr("secret-value2"),
		},
	}, 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.Secret = armkeyvault.Secret{
	// 	Name: to.Ptr("secret-name"),
	// 	Type: to.Ptr("Microsoft.KeyVault/vaults/secrets"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault/secrets/secret-name"),
	// 	Location: to.Ptr("westus"),
	// 	Properties: &armkeyvault.SecretProperties{
	// 		Attributes: &armkeyvault.SecretAttributes{
	// 			Created: to.Ptr(time.Unix(1514940684, 0)),
	// 			Enabled: to.Ptr(true),
	// 			Updated: to.Ptr(time.Unix(1514940698, 0)),
	// 		},
	// 		SecretURI: to.Ptr("https://sample-vault.vault.azure.net/secrets/secret-name"),
	// 		SecretURIWithVersion: to.Ptr("https://sample-vault.vault.azure.net/secrets/secret-name/b8c802f549764f2d97885d152f92ee9d"),
	// 	},
	// }
}
Output:

type SecretsClientCreateOrUpdateOptions added in v0.3.0

type SecretsClientCreateOrUpdateOptions struct {
}

SecretsClientCreateOrUpdateOptions contains the optional parameters for the SecretsClient.CreateOrUpdate method.

type SecretsClientCreateOrUpdateResponse added in v0.3.0

type SecretsClientCreateOrUpdateResponse struct {
	// Resource information with extended details.
	Secret
}

SecretsClientCreateOrUpdateResponse contains the response from method SecretsClient.CreateOrUpdate.

type SecretsClientGetOptions added in v0.3.0

type SecretsClientGetOptions struct {
}

SecretsClientGetOptions contains the optional parameters for the SecretsClient.Get method.

type SecretsClientGetResponse added in v0.3.0

type SecretsClientGetResponse struct {
	// Resource information with extended details.
	Secret
}

SecretsClientGetResponse contains the response from method SecretsClient.Get.

type SecretsClientListOptions added in v0.3.0

type SecretsClientListOptions struct {
	// Maximum number of results to return.
	Top *int32
}

SecretsClientListOptions contains the optional parameters for the SecretsClient.NewListPager method.

type SecretsClientListResponse added in v0.3.0

type SecretsClientListResponse struct {
	// List of secrets
	SecretListResult
}

SecretsClientListResponse contains the response from method SecretsClient.NewListPager.

type SecretsClientUpdateOptions added in v0.3.0

type SecretsClientUpdateOptions struct {
}

SecretsClientUpdateOptions contains the optional parameters for the SecretsClient.Update method.

type SecretsClientUpdateResponse added in v0.3.0

type SecretsClientUpdateResponse struct {
	// Resource information with extended details.
	Secret
}

SecretsClientUpdateResponse contains the response from method SecretsClient.Update.

type ServiceSpecification

type ServiceSpecification struct {
	// Log specifications of operation.
	LogSpecifications []*LogSpecification

	// Metric specifications of operation.
	MetricSpecifications []*MetricSpecification
}

ServiceSpecification - One property of operation, include log specifications.

func (ServiceSpecification) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServiceSpecification.

func (*ServiceSpecification) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceSpecification.

type StoragePermissions

type StoragePermissions string
const (
	StoragePermissionsAll           StoragePermissions = "all"
	StoragePermissionsBackup        StoragePermissions = "backup"
	StoragePermissionsDelete        StoragePermissions = "delete"
	StoragePermissionsDeletesas     StoragePermissions = "deletesas"
	StoragePermissionsGet           StoragePermissions = "get"
	StoragePermissionsGetsas        StoragePermissions = "getsas"
	StoragePermissionsList          StoragePermissions = "list"
	StoragePermissionsListsas       StoragePermissions = "listsas"
	StoragePermissionsPurge         StoragePermissions = "purge"
	StoragePermissionsRecover       StoragePermissions = "recover"
	StoragePermissionsRegeneratekey StoragePermissions = "regeneratekey"
	StoragePermissionsRestore       StoragePermissions = "restore"
	StoragePermissionsSet           StoragePermissions = "set"
	StoragePermissionsSetsas        StoragePermissions = "setsas"
	StoragePermissionsUpdate        StoragePermissions = "update"
)

func PossibleStoragePermissionsValues

func PossibleStoragePermissionsValues() []StoragePermissions

PossibleStoragePermissionsValues returns the possible values for the StoragePermissions const type.

type SystemData

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

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

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

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

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

	// The type of identity that last modified the key vault resource.
	LastModifiedByType *IdentityType
}

SystemData - Metadata pertaining to creation and last modification of the key vault 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.

type Trigger

type Trigger struct {
	// The time duration after key creation to rotate the key. It only applies to rotate. It will be in ISO 8601 duration format.
	// Eg: 'P90D', 'P1Y'.
	TimeAfterCreate *string

	// The time duration before key expiring to rotate or notify. It will be in ISO 8601 duration format. Eg: 'P90D', 'P1Y'.
	TimeBeforeExpiry *string
}

func (Trigger) MarshalJSON added in v1.2.0

func (t Trigger) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Trigger.

func (*Trigger) UnmarshalJSON added in v1.2.0

func (t *Trigger) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Trigger.

type UserAssignedIdentity added in v1.3.0

type UserAssignedIdentity struct {
	// READ-ONLY; The client ID of the assigned identity.
	ClientID *string

	// READ-ONLY; The principal ID of the assigned identity.
	PrincipalID *string
}

UserAssignedIdentity - User assigned identity properties

func (UserAssignedIdentity) MarshalJSON added in v1.3.0

func (u UserAssignedIdentity) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity.

func (*UserAssignedIdentity) UnmarshalJSON added in v1.3.0

func (u *UserAssignedIdentity) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentity.

type Vault

type Vault struct {
	// REQUIRED; Properties of the vault
	Properties *VaultProperties

	// Azure location of the key vault resource.
	Location *string

	// Tags assigned to the key vault resource.
	Tags map[string]*string

	// READ-ONLY; Fully qualified identifier of the key vault resource.
	ID *string

	// READ-ONLY; Name of the key vault resource.
	Name *string

	// READ-ONLY; System metadata for the key vault.
	SystemData *SystemData

	// READ-ONLY; Resource type of the key vault resource.
	Type *string
}

Vault - Resource information with extended details.

func (Vault) MarshalJSON

func (v Vault) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Vault.

func (*Vault) UnmarshalJSON added in v1.1.0

func (v *Vault) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Vault.

type VaultAccessPolicyParameters

type VaultAccessPolicyParameters struct {
	// REQUIRED; Properties of the access policy
	Properties *VaultAccessPolicyProperties

	// READ-ONLY; The resource id of the access policy.
	ID *string

	// READ-ONLY; The resource type of the access policy.
	Location *string

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

	// READ-ONLY; The resource name of the access policy.
	Type *string
}

VaultAccessPolicyParameters - Parameters for updating the access policy in a vault

func (VaultAccessPolicyParameters) MarshalJSON added in v1.1.0

func (v VaultAccessPolicyParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VaultAccessPolicyParameters.

func (*VaultAccessPolicyParameters) UnmarshalJSON added in v1.1.0

func (v *VaultAccessPolicyParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VaultAccessPolicyParameters.

type VaultAccessPolicyProperties

type VaultAccessPolicyProperties struct {
	// REQUIRED; An array of 0 to 16 identities that have access to the key vault. All identities in the array must use the same
	// tenant ID as the key vault's tenant ID.
	AccessPolicies []*AccessPolicyEntry
}

VaultAccessPolicyProperties - Properties of the vault access policy

func (VaultAccessPolicyProperties) MarshalJSON

func (v VaultAccessPolicyProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VaultAccessPolicyProperties.

func (*VaultAccessPolicyProperties) UnmarshalJSON added in v1.1.0

func (v *VaultAccessPolicyProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VaultAccessPolicyProperties.

type VaultCheckNameAvailabilityParameters

type VaultCheckNameAvailabilityParameters struct {
	// REQUIRED; The vault name.
	Name *string

	// CONSTANT; The type of resource, Microsoft.KeyVault/vaults
	// Field has constant value "Microsoft.KeyVault/vaults", any specified value is ignored.
	Type *string
}

VaultCheckNameAvailabilityParameters - The parameters used to check the availability of the vault name.

func (VaultCheckNameAvailabilityParameters) MarshalJSON added in v1.1.0

func (v VaultCheckNameAvailabilityParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VaultCheckNameAvailabilityParameters.

func (*VaultCheckNameAvailabilityParameters) UnmarshalJSON added in v1.1.0

func (v *VaultCheckNameAvailabilityParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VaultCheckNameAvailabilityParameters.

type VaultCreateOrUpdateParameters

type VaultCreateOrUpdateParameters struct {
	// REQUIRED; The supported Azure location where the key vault should be created.
	Location *string

	// REQUIRED; Properties of the vault
	Properties *VaultProperties

	// The tags that will be assigned to the key vault.
	Tags map[string]*string
}

VaultCreateOrUpdateParameters - Parameters for creating or updating a vault

func (VaultCreateOrUpdateParameters) MarshalJSON

func (v VaultCreateOrUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VaultCreateOrUpdateParameters.

func (*VaultCreateOrUpdateParameters) UnmarshalJSON added in v1.1.0

func (v *VaultCreateOrUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VaultCreateOrUpdateParameters.

type VaultListResult

type VaultListResult struct {
	// The URL to get the next set of vaults.
	NextLink *string

	// The list of vaults.
	Value []*Vault
}

VaultListResult - List of vaults

func (VaultListResult) MarshalJSON

func (v VaultListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VaultListResult.

func (*VaultListResult) UnmarshalJSON added in v1.1.0

func (v *VaultListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VaultListResult.

type VaultPatchParameters

type VaultPatchParameters struct {
	// Properties of the vault
	Properties *VaultPatchProperties

	// The tags that will be assigned to the key vault.
	Tags map[string]*string
}

VaultPatchParameters - Parameters for creating or updating a vault

func (VaultPatchParameters) MarshalJSON

func (v VaultPatchParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VaultPatchParameters.

func (*VaultPatchParameters) UnmarshalJSON added in v1.1.0

func (v *VaultPatchParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VaultPatchParameters.

type VaultPatchProperties

type VaultPatchProperties struct {
	// An array of 0 to 16 identities that have access to the key vault. All identities in the array must use the same tenant
	// ID as the key vault's tenant ID.
	AccessPolicies []*AccessPolicyEntry

	// The vault's create mode to indicate whether the vault need to be recovered or not.
	CreateMode *CreateMode

	// Property specifying whether protection against purge is enabled for this vault. Setting this property to true activates
	// protection against purge for this vault and its content - only the Key Vault
	// service may initiate a hard, irrecoverable deletion. The setting is effective only if soft delete is also enabled. Enabling
	// this functionality is irreversible - that is, the property does not accept
	// false as its value.
	EnablePurgeProtection *bool

	// Property that controls how data actions are authorized. When true, the key vault will use Role Based Access Control (RBAC)
	// for authorization of data actions, and the access policies specified in vault
	// properties will be ignored. When false, the key vault will use the access policies specified in vault properties, and any
	// policy stored on Azure Resource Manager will be ignored. If null or not
	// specified, the value of this property will not change.
	EnableRbacAuthorization *bool

	// Property to specify whether the 'soft delete' functionality is enabled for this key vault. Once set to true, it cannot
	// be reverted to false.
	EnableSoftDelete *bool

	// Property to specify whether Azure Virtual Machines are permitted to retrieve certificates stored as secrets from the key
	// vault.
	EnabledForDeployment *bool

	// Property to specify whether Azure Disk Encryption is permitted to retrieve secrets from the vault and unwrap keys.
	EnabledForDiskEncryption *bool

	// Property to specify whether Azure Resource Manager is permitted to retrieve secrets from the key vault.
	EnabledForTemplateDeployment *bool

	// A collection of rules governing the accessibility of the vault from specific network locations.
	NetworkACLs *NetworkRuleSet

	// Property to specify whether the vault will accept traffic from public internet. If set to 'disabled' all traffic except
	// private endpoint traffic and that that originates from trusted services will be
	// blocked. This will override the set firewall rules, meaning that even if the firewall rules are present we will not honor
	// the rules.
	PublicNetworkAccess *string

	// SKU details
	SKU *SKU

	// softDelete data retention days. It accepts >=7 and <=90.
	SoftDeleteRetentionInDays *int32

	// The Azure Active Directory tenant ID that should be used for authenticating requests to the key vault.
	TenantID *string
}

VaultPatchProperties - Properties of the vault

func (VaultPatchProperties) MarshalJSON

func (v VaultPatchProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VaultPatchProperties.

func (*VaultPatchProperties) UnmarshalJSON added in v1.1.0

func (v *VaultPatchProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VaultPatchProperties.

type VaultProperties

type VaultProperties struct {
	// REQUIRED; SKU details
	SKU *SKU

	// REQUIRED; The Azure Active Directory tenant ID that should be used for authenticating requests to the key vault.
	TenantID *string

	// An array of 0 to 1024 identities that have access to the key vault. All identities in the array must use the same tenant
	// ID as the key vault's tenant ID. When createMode is set to recover, access
	// policies are not required. Otherwise, access policies are required.
	AccessPolicies []*AccessPolicyEntry

	// The vault's create mode to indicate whether the vault need to be recovered or not.
	CreateMode *CreateMode

	// Property specifying whether protection against purge is enabled for this vault. Setting this property to true activates
	// protection against purge for this vault and its content - only the Key Vault
	// service may initiate a hard, irrecoverable deletion. The setting is effective only if soft delete is also enabled. Enabling
	// this functionality is irreversible - that is, the property does not accept
	// false as its value.
	EnablePurgeProtection *bool

	// Property that controls how data actions are authorized. When true, the key vault will use Role Based Access Control (RBAC)
	// for authorization of data actions, and the access policies specified in vault
	// properties will be ignored. When false, the key vault will use the access policies specified in vault properties, and any
	// policy stored on Azure Resource Manager will be ignored. If null or not
	// specified, the vault is created with the default value of false. Note that management actions are always authorized with
	// RBAC.
	EnableRbacAuthorization *bool

	// Property to specify whether the 'soft delete' functionality is enabled for this key vault. If it's not set to any value(true
	// or false) when creating new key vault, it will be set to true by default.
	// Once set to true, it cannot be reverted to false.
	EnableSoftDelete *bool

	// Property to specify whether Azure Virtual Machines are permitted to retrieve certificates stored as secrets from the key
	// vault.
	EnabledForDeployment *bool

	// Property to specify whether Azure Disk Encryption is permitted to retrieve secrets from the vault and unwrap keys.
	EnabledForDiskEncryption *bool

	// Property to specify whether Azure Resource Manager is permitted to retrieve secrets from the key vault.
	EnabledForTemplateDeployment *bool

	// Rules governing the accessibility of the key vault from specific network locations.
	NetworkACLs *NetworkRuleSet

	// Provisioning state of the vault.
	ProvisioningState *VaultProvisioningState

	// Property to specify whether the vault will accept traffic from public internet. If set to 'disabled' all traffic except
	// private endpoint traffic and that that originates from trusted services will be
	// blocked. This will override the set firewall rules, meaning that even if the firewall rules are present we will not honor
	// the rules.
	PublicNetworkAccess *string

	// softDelete data retention days. It accepts >=7 and <=90.
	SoftDeleteRetentionInDays *int32

	// The URI of the vault for performing operations on keys and secrets.
	VaultURI *string

	// READ-ONLY; The resource id of HSM Pool.
	HsmPoolResourceID *string

	// READ-ONLY; List of private endpoint connections associated with the key vault.
	PrivateEndpointConnections []*PrivateEndpointConnectionItem
}

VaultProperties - Properties of the vault

func (VaultProperties) MarshalJSON

func (v VaultProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VaultProperties.

func (*VaultProperties) UnmarshalJSON added in v1.1.0

func (v *VaultProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VaultProperties.

type VaultProvisioningState

type VaultProvisioningState string

VaultProvisioningState - Provisioning state of the vault.

const (
	VaultProvisioningStateRegisteringDNS VaultProvisioningState = "RegisteringDns"
	VaultProvisioningStateSucceeded      VaultProvisioningState = "Succeeded"
)

func PossibleVaultProvisioningStateValues

func PossibleVaultProvisioningStateValues() []VaultProvisioningState

PossibleVaultProvisioningStateValues returns the possible values for the VaultProvisioningState const type.

type VaultsClient

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

VaultsClient contains the methods for the Vaults group. Don't use this type directly, use NewVaultsClient() instead.

func NewVaultsClient

func NewVaultsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VaultsClient, error)

NewVaultsClient creates a new instance of VaultsClient with the specified values.

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

func (*VaultsClient) BeginCreateOrUpdate

func (client *VaultsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vaultName string, parameters VaultCreateOrUpdateParameters, options *VaultsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VaultsClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Create or update a key vault in the specified subscription. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the Resource Group to which the server belongs.
  • vaultName - Name of the vault
  • parameters - Parameters to create or update the vault
  • options - VaultsClientBeginCreateOrUpdateOptions contains the optional parameters for the VaultsClient.BeginCreateOrUpdate method.
Example (CreateANewVaultOrUpdateAnExistingVault)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/createVault.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/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVaultsClient().BeginCreateOrUpdate(ctx, "sample-resource-group", "sample-vault", armkeyvault.VaultCreateOrUpdateParameters{
		Location: to.Ptr("westus"),
		Properties: &armkeyvault.VaultProperties{
			AccessPolicies: []*armkeyvault.AccessPolicyEntry{
				{
					ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"),
					Permissions: &armkeyvault.Permissions{
						Certificates: []*armkeyvault.CertificatePermissions{
							to.Ptr(armkeyvault.CertificatePermissionsGet),
							to.Ptr(armkeyvault.CertificatePermissionsList),
							to.Ptr(armkeyvault.CertificatePermissionsDelete),
							to.Ptr(armkeyvault.CertificatePermissionsCreate),
							to.Ptr(armkeyvault.CertificatePermissionsImport),
							to.Ptr(armkeyvault.CertificatePermissionsUpdate),
							to.Ptr(armkeyvault.CertificatePermissionsManagecontacts),
							to.Ptr(armkeyvault.CertificatePermissionsGetissuers),
							to.Ptr(armkeyvault.CertificatePermissionsListissuers),
							to.Ptr(armkeyvault.CertificatePermissionsSetissuers),
							to.Ptr(armkeyvault.CertificatePermissionsDeleteissuers),
							to.Ptr(armkeyvault.CertificatePermissionsManageissuers),
							to.Ptr(armkeyvault.CertificatePermissionsRecover),
							to.Ptr(armkeyvault.CertificatePermissionsPurge)},
						Keys: []*armkeyvault.KeyPermissions{
							to.Ptr(armkeyvault.KeyPermissionsEncrypt),
							to.Ptr(armkeyvault.KeyPermissionsDecrypt),
							to.Ptr(armkeyvault.KeyPermissionsWrapKey),
							to.Ptr(armkeyvault.KeyPermissionsUnwrapKey),
							to.Ptr(armkeyvault.KeyPermissionsSign),
							to.Ptr(armkeyvault.KeyPermissionsVerify),
							to.Ptr(armkeyvault.KeyPermissionsGet),
							to.Ptr(armkeyvault.KeyPermissionsList),
							to.Ptr(armkeyvault.KeyPermissionsCreate),
							to.Ptr(armkeyvault.KeyPermissionsUpdate),
							to.Ptr(armkeyvault.KeyPermissionsImport),
							to.Ptr(armkeyvault.KeyPermissionsDelete),
							to.Ptr(armkeyvault.KeyPermissionsBackup),
							to.Ptr(armkeyvault.KeyPermissionsRestore),
							to.Ptr(armkeyvault.KeyPermissionsRecover),
							to.Ptr(armkeyvault.KeyPermissionsPurge)},
						Secrets: []*armkeyvault.SecretPermissions{
							to.Ptr(armkeyvault.SecretPermissionsGet),
							to.Ptr(armkeyvault.SecretPermissionsList),
							to.Ptr(armkeyvault.SecretPermissionsSet),
							to.Ptr(armkeyvault.SecretPermissionsDelete),
							to.Ptr(armkeyvault.SecretPermissionsBackup),
							to.Ptr(armkeyvault.SecretPermissionsRestore),
							to.Ptr(armkeyvault.SecretPermissionsRecover),
							to.Ptr(armkeyvault.SecretPermissionsPurge)},
					},
					TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
				}},
			EnabledForDeployment:         to.Ptr(true),
			EnabledForDiskEncryption:     to.Ptr(true),
			EnabledForTemplateDeployment: to.Ptr(true),
			PublicNetworkAccess:          to.Ptr("Enabled"),
			SKU: &armkeyvault.SKU{
				Name:   to.Ptr(armkeyvault.SKUNameStandard),
				Family: to.Ptr(armkeyvault.SKUFamilyA),
			},
			TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		},
	}, 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.Vault = armkeyvault.Vault{
	// 	Name: to.Ptr("sample-vault"),
	// 	Type: to.Ptr("Microsoft.KeyVault/vaults"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.KeyVault/vaults/sample-vault"),
	// 	Location: to.Ptr("westus"),
	// 	Properties: &armkeyvault.VaultProperties{
	// 		AccessPolicies: []*armkeyvault.AccessPolicyEntry{
	// 			{
	// 				ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 				Permissions: &armkeyvault.Permissions{
	// 					Certificates: []*armkeyvault.CertificatePermissions{
	// 						to.Ptr(armkeyvault.CertificatePermissionsGet),
	// 						to.Ptr(armkeyvault.CertificatePermissionsList),
	// 						to.Ptr(armkeyvault.CertificatePermissionsDelete),
	// 						to.Ptr(armkeyvault.CertificatePermissionsCreate),
	// 						to.Ptr(armkeyvault.CertificatePermissionsImport),
	// 						to.Ptr(armkeyvault.CertificatePermissionsUpdate),
	// 						to.Ptr(armkeyvault.CertificatePermissionsManagecontacts),
	// 						to.Ptr(armkeyvault.CertificatePermissionsGetissuers),
	// 						to.Ptr(armkeyvault.CertificatePermissionsListissuers),
	// 						to.Ptr(armkeyvault.CertificatePermissionsSetissuers),
	// 						to.Ptr(armkeyvault.CertificatePermissionsDeleteissuers),
	// 						to.Ptr(armkeyvault.CertificatePermissionsManageissuers),
	// 						to.Ptr(armkeyvault.CertificatePermissionsRecover),
	// 						to.Ptr(armkeyvault.CertificatePermissionsPurge)},
	// 						Keys: []*armkeyvault.KeyPermissions{
	// 							to.Ptr(armkeyvault.KeyPermissionsEncrypt),
	// 							to.Ptr(armkeyvault.KeyPermissionsDecrypt),
	// 							to.Ptr(armkeyvault.KeyPermissionsWrapKey),
	// 							to.Ptr(armkeyvault.KeyPermissionsUnwrapKey),
	// 							to.Ptr(armkeyvault.KeyPermissionsSign),
	// 							to.Ptr(armkeyvault.KeyPermissionsVerify),
	// 							to.Ptr(armkeyvault.KeyPermissionsGet),
	// 							to.Ptr(armkeyvault.KeyPermissionsList),
	// 							to.Ptr(armkeyvault.KeyPermissionsCreate),
	// 							to.Ptr(armkeyvault.KeyPermissionsUpdate),
	// 							to.Ptr(armkeyvault.KeyPermissionsImport),
	// 							to.Ptr(armkeyvault.KeyPermissionsDelete),
	// 							to.Ptr(armkeyvault.KeyPermissionsBackup),
	// 							to.Ptr(armkeyvault.KeyPermissionsRestore),
	// 							to.Ptr(armkeyvault.KeyPermissionsRecover),
	// 							to.Ptr(armkeyvault.KeyPermissionsPurge)},
	// 							Secrets: []*armkeyvault.SecretPermissions{
	// 								to.Ptr(armkeyvault.SecretPermissionsGet),
	// 								to.Ptr(armkeyvault.SecretPermissionsList),
	// 								to.Ptr(armkeyvault.SecretPermissionsSet),
	// 								to.Ptr(armkeyvault.SecretPermissionsDelete),
	// 								to.Ptr(armkeyvault.SecretPermissionsBackup),
	// 								to.Ptr(armkeyvault.SecretPermissionsRestore),
	// 								to.Ptr(armkeyvault.SecretPermissionsRecover),
	// 								to.Ptr(armkeyvault.SecretPermissionsPurge)},
	// 							},
	// 							TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 					}},
	// 					EnabledForDeployment: to.Ptr(true),
	// 					EnabledForDiskEncryption: to.Ptr(true),
	// 					EnabledForTemplateDeployment: to.Ptr(true),
	// 					HsmPoolResourceID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 					NetworkACLs: &armkeyvault.NetworkRuleSet{
	// 						Bypass: to.Ptr(armkeyvault.NetworkRuleBypassOptionsAzureServices),
	// 						DefaultAction: to.Ptr(armkeyvault.NetworkRuleActionDeny),
	// 						IPRules: []*armkeyvault.IPRule{
	// 							{
	// 								Value: to.Ptr(""),
	// 						}},
	// 						VirtualNetworkRules: []*armkeyvault.VirtualNetworkRule{
	// 							{
	// 								ID: to.Ptr(""),
	// 								IgnoreMissingVnetServiceEndpoint: to.Ptr(false),
	// 						}},
	// 					},
	// 					PrivateEndpointConnections: []*armkeyvault.PrivateEndpointConnectionItem{
	// 						{
	// 							Etag: to.Ptr(""),
	// 							ID: to.Ptr(""),
	// 							Properties: &armkeyvault.PrivateEndpointConnectionProperties{
	// 								PrivateEndpoint: &armkeyvault.PrivateEndpoint{
	// 									ID: to.Ptr(""),
	// 								},
	// 								PrivateLinkServiceConnectionState: &armkeyvault.PrivateLinkServiceConnectionState{
	// 									ActionsRequired: to.Ptr(armkeyvault.ActionsRequiredNone),
	// 									Status: to.Ptr(armkeyvault.PrivateEndpointServiceConnectionStatusApproved),
	// 								},
	// 								ProvisioningState: to.Ptr(armkeyvault.PrivateEndpointConnectionProvisioningStateSucceeded),
	// 							},
	// 					}},
	// 					ProvisioningState: to.Ptr(armkeyvault.VaultProvisioningStateSucceeded),
	// 					PublicNetworkAccess: to.Ptr("Enabled"),
	// 					SKU: &armkeyvault.SKU{
	// 						Name: to.Ptr(armkeyvault.SKUNameStandard),
	// 						Family: to.Ptr(armkeyvault.SKUFamilyA),
	// 					},
	// 					TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 					VaultURI: to.Ptr("https://sample-vault.vault.azure.net"),
	// 				},
	// 				SystemData: &armkeyvault.SystemData{
	// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.000Z"); return t}()),
	// 					CreatedBy: to.Ptr("keyVaultUser1"),
	// 					CreatedByType: to.Ptr(armkeyvault.IdentityTypeUser),
	// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.000Z"); return t}()),
	// 					LastModifiedBy: to.Ptr("keyVaultUser2"),
	// 					LastModifiedByType: to.Ptr(armkeyvault.IdentityTypeUser),
	// 				},
	// 				Tags: map[string]*string{
	// 				},
	// 			}
}
Output:

Example (CreateOrUpdateAVaultWithNetworkAcls)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/createVaultWithNetworkAcls.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/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVaultsClient().BeginCreateOrUpdate(ctx, "sample-resource-group", "sample-vault", armkeyvault.VaultCreateOrUpdateParameters{
		Location: to.Ptr("westus"),
		Properties: &armkeyvault.VaultProperties{
			EnabledForDeployment:         to.Ptr(true),
			EnabledForDiskEncryption:     to.Ptr(true),
			EnabledForTemplateDeployment: to.Ptr(true),
			NetworkACLs: &armkeyvault.NetworkRuleSet{
				Bypass:        to.Ptr(armkeyvault.NetworkRuleBypassOptionsAzureServices),
				DefaultAction: to.Ptr(armkeyvault.NetworkRuleActionDeny),
				IPRules: []*armkeyvault.IPRule{
					{
						Value: to.Ptr("124.56.78.91"),
					},
					{
						Value: to.Ptr("'10.91.4.0/24'"),
					}},
				VirtualNetworkRules: []*armkeyvault.VirtualNetworkRule{
					{
						ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"),
					}},
			},
			SKU: &armkeyvault.SKU{
				Name:   to.Ptr(armkeyvault.SKUNameStandard),
				Family: to.Ptr(armkeyvault.SKUFamilyA),
			},
			TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		},
	}, 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.Vault = armkeyvault.Vault{
	// 	Name: to.Ptr("sample-vault"),
	// 	Type: to.Ptr("Microsoft.KeyVault/vaults"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.KeyVault/vaults/sample-vault"),
	// 	Location: to.Ptr("westus"),
	// 	Properties: &armkeyvault.VaultProperties{
	// 		EnabledForDeployment: to.Ptr(true),
	// 		EnabledForDiskEncryption: to.Ptr(true),
	// 		EnabledForTemplateDeployment: to.Ptr(true),
	// 		HsmPoolResourceID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 		NetworkACLs: &armkeyvault.NetworkRuleSet{
	// 			Bypass: to.Ptr(armkeyvault.NetworkRuleBypassOptionsAzureServices),
	// 			DefaultAction: to.Ptr(armkeyvault.NetworkRuleActionDeny),
	// 			IPRules: []*armkeyvault.IPRule{
	// 				{
	// 					Value: to.Ptr("124.56.78.91/32"),
	// 				},
	// 				{
	// 					Value: to.Ptr("'10.91.4.0/24'"),
	// 			}},
	// 			VirtualNetworkRules: []*armkeyvault.VirtualNetworkRule{
	// 				{
	// 					ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/microsoft.network/virtualnetworks/test-vnet/subnets/subnet1"),
	// 			}},
	// 		},
	// 		SKU: &armkeyvault.SKU{
	// 			Name: to.Ptr(armkeyvault.SKUNameStandard),
	// 			Family: to.Ptr(armkeyvault.SKUFamilyA),
	// 		},
	// 		TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 		VaultURI: to.Ptr("https://sample-vault.vault.azure.net"),
	// 	},
	// 	SystemData: &armkeyvault.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.000Z"); return t}()),
	// 		CreatedBy: to.Ptr("keyVaultUser1"),
	// 		CreatedByType: to.Ptr(armkeyvault.IdentityTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.000Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("keyVaultUser2"),
	// 		LastModifiedByType: to.Ptr(armkeyvault.IdentityTypeUser),
	// 	},
	// 	Tags: map[string]*string{
	// 	},
	// }
}
Output:

func (*VaultsClient) BeginPurgeDeleted

func (client *VaultsClient) BeginPurgeDeleted(ctx context.Context, vaultName string, location string, options *VaultsClientBeginPurgeDeletedOptions) (*runtime.Poller[VaultsClientPurgeDeletedResponse], error)

BeginPurgeDeleted - Permanently deletes the specified vault. aka Purges the deleted Azure key vault. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • vaultName - The name of the soft-deleted vault.
  • location - The location of the soft-deleted vault.
  • options - VaultsClientBeginPurgeDeletedOptions contains the optional parameters for the VaultsClient.BeginPurgeDeleted method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/purgeDeletedVault.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVaultsClient().BeginPurgeDeleted(ctx, "sample-vault", "westus", 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 (*VaultsClient) CheckNameAvailability

CheckNameAvailability - Checks that the vault name is valid and is not already in use. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • vaultName - The name of the vault.
  • options - VaultsClientCheckNameAvailabilityOptions contains the optional parameters for the VaultsClient.CheckNameAvailability method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/checkVaultNameAvailability.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/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewVaultsClient().CheckNameAvailability(ctx, armkeyvault.VaultCheckNameAvailabilityParameters{
		Name: to.Ptr("sample-vault"),
		Type: to.Ptr("Microsoft.KeyVault/vaults"),
	}, 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.CheckNameAvailabilityResult = armkeyvault.CheckNameAvailabilityResult{
	// 	NameAvailable: to.Ptr(true),
	// }
}
Output:

func (*VaultsClient) Delete

func (client *VaultsClient) Delete(ctx context.Context, resourceGroupName string, vaultName string, options *VaultsClientDeleteOptions) (VaultsClientDeleteResponse, error)

Delete - Deletes the specified Azure key vault. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the Resource Group to which the vault belongs.
  • vaultName - The name of the vault to delete
  • options - VaultsClientDeleteOptions contains the optional parameters for the VaultsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/deleteVault.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewVaultsClient().Delete(ctx, "sample-resource-group", "sample-vault", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*VaultsClient) Get

func (client *VaultsClient) Get(ctx context.Context, resourceGroupName string, vaultName string, options *VaultsClientGetOptions) (VaultsClientGetResponse, error)

Get - Gets the specified Azure key vault. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the Resource Group to which the vault belongs.
  • vaultName - The name of the vault.
  • options - VaultsClientGetOptions contains the optional parameters for the VaultsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/getVault.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewVaultsClient().Get(ctx, "sample-resource-group", "sample-vault", 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.Vault = armkeyvault.Vault{
	// 	Name: to.Ptr("sample-vault"),
	// 	Type: to.Ptr("Microsoft.KeyVault/vaults"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.KeyVault/vaults/sample-vault"),
	// 	Location: to.Ptr("westus"),
	// 	Properties: &armkeyvault.VaultProperties{
	// 		AccessPolicies: []*armkeyvault.AccessPolicyEntry{
	// 			{
	// 				ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 				Permissions: &armkeyvault.Permissions{
	// 					Certificates: []*armkeyvault.CertificatePermissions{
	// 						to.Ptr(armkeyvault.CertificatePermissionsGet),
	// 						to.Ptr(armkeyvault.CertificatePermissionsList),
	// 						to.Ptr(armkeyvault.CertificatePermissionsDelete),
	// 						to.Ptr(armkeyvault.CertificatePermissionsCreate),
	// 						to.Ptr(armkeyvault.CertificatePermissionsImport),
	// 						to.Ptr(armkeyvault.CertificatePermissionsUpdate),
	// 						to.Ptr(armkeyvault.CertificatePermissionsManagecontacts),
	// 						to.Ptr(armkeyvault.CertificatePermissionsGetissuers),
	// 						to.Ptr(armkeyvault.CertificatePermissionsListissuers),
	// 						to.Ptr(armkeyvault.CertificatePermissionsSetissuers),
	// 						to.Ptr(armkeyvault.CertificatePermissionsDeleteissuers),
	// 						to.Ptr(armkeyvault.CertificatePermissionsManageissuers),
	// 						to.Ptr(armkeyvault.CertificatePermissionsRecover),
	// 						to.Ptr(armkeyvault.CertificatePermissionsPurge)},
	// 						Keys: []*armkeyvault.KeyPermissions{
	// 							to.Ptr(armkeyvault.KeyPermissionsEncrypt),
	// 							to.Ptr(armkeyvault.KeyPermissionsDecrypt),
	// 							to.Ptr(armkeyvault.KeyPermissionsWrapKey),
	// 							to.Ptr(armkeyvault.KeyPermissionsUnwrapKey),
	// 							to.Ptr(armkeyvault.KeyPermissionsSign),
	// 							to.Ptr(armkeyvault.KeyPermissionsVerify),
	// 							to.Ptr(armkeyvault.KeyPermissionsGet),
	// 							to.Ptr(armkeyvault.KeyPermissionsList),
	// 							to.Ptr(armkeyvault.KeyPermissionsCreate),
	// 							to.Ptr(armkeyvault.KeyPermissionsUpdate),
	// 							to.Ptr(armkeyvault.KeyPermissionsImport),
	// 							to.Ptr(armkeyvault.KeyPermissionsDelete),
	// 							to.Ptr(armkeyvault.KeyPermissionsBackup),
	// 							to.Ptr(armkeyvault.KeyPermissionsRestore),
	// 							to.Ptr(armkeyvault.KeyPermissionsRecover),
	// 							to.Ptr(armkeyvault.KeyPermissionsPurge)},
	// 							Secrets: []*armkeyvault.SecretPermissions{
	// 								to.Ptr(armkeyvault.SecretPermissionsGet),
	// 								to.Ptr(armkeyvault.SecretPermissionsList),
	// 								to.Ptr(armkeyvault.SecretPermissionsSet),
	// 								to.Ptr(armkeyvault.SecretPermissionsDelete),
	// 								to.Ptr(armkeyvault.SecretPermissionsBackup),
	// 								to.Ptr(armkeyvault.SecretPermissionsRestore),
	// 								to.Ptr(armkeyvault.SecretPermissionsRecover),
	// 								to.Ptr(armkeyvault.SecretPermissionsPurge)},
	// 							},
	// 							TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 					}},
	// 					EnabledForDeployment: to.Ptr(true),
	// 					EnabledForDiskEncryption: to.Ptr(true),
	// 					EnabledForTemplateDeployment: to.Ptr(true),
	// 					HsmPoolResourceID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 					ProvisioningState: to.Ptr(armkeyvault.VaultProvisioningStateSucceeded),
	// 					PublicNetworkAccess: to.Ptr("Enabled"),
	// 					SKU: &armkeyvault.SKU{
	// 						Name: to.Ptr(armkeyvault.SKUNameStandard),
	// 						Family: to.Ptr(armkeyvault.SKUFamilyA),
	// 					},
	// 					TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 					VaultURI: to.Ptr("https://sample-vault.vault.azure.net"),
	// 				},
	// 				SystemData: &armkeyvault.SystemData{
	// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.000Z"); return t}()),
	// 					CreatedBy: to.Ptr("keyVaultUser1"),
	// 					CreatedByType: to.Ptr(armkeyvault.IdentityTypeUser),
	// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.000Z"); return t}()),
	// 					LastModifiedBy: to.Ptr("keyVaultUser2"),
	// 					LastModifiedByType: to.Ptr(armkeyvault.IdentityTypeUser),
	// 				},
	// 				Tags: map[string]*string{
	// 				},
	// 			}
}
Output:

func (*VaultsClient) GetDeleted

func (client *VaultsClient) GetDeleted(ctx context.Context, vaultName string, location string, options *VaultsClientGetDeletedOptions) (VaultsClientGetDeletedResponse, error)

GetDeleted - Gets the deleted Azure key vault. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • vaultName - The name of the vault.
  • location - The location of the deleted vault.
  • options - VaultsClientGetDeletedOptions contains the optional parameters for the VaultsClient.GetDeleted method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/getDeletedVault.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewVaultsClient().GetDeleted(ctx, "sample-vault", "westus", 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.DeletedVault = armkeyvault.DeletedVault{
	// 	Name: to.Ptr("sample-vault"),
	// 	Type: to.Ptr("Microsoft.KeyVault/deletedVaults"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/westus/deletedVaults/sample-vault"),
	// 	Properties: &armkeyvault.DeletedVaultProperties{
	// 		DeletionDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-01-01T00:00:59.000Z"); return t}()),
	// 		Location: to.Ptr("westus"),
	// 		PurgeProtectionEnabled: to.Ptr(true),
	// 		ScheduledPurgeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-01T00:00:59.000Z"); return t}()),
	// 		Tags: map[string]*string{
	// 		},
	// 		VaultID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault"),
	// 	},
	// }
}
Output:

func (*VaultsClient) NewListByResourceGroupPager added in v0.5.0

func (client *VaultsClient) NewListByResourceGroupPager(resourceGroupName string, options *VaultsClientListByResourceGroupOptions) *runtime.Pager[VaultsClientListByResourceGroupResponse]

NewListByResourceGroupPager - The List operation gets information about the vaults associated with the subscription and within the specified resource group.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the Resource Group to which the vault belongs.
  • options - VaultsClientListByResourceGroupOptions contains the optional parameters for the VaultsClient.NewListByResourceGroupPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/listVaultByResourceGroup.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/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewVaultsClient().NewListByResourceGroupPager("sample-group", &armkeyvault.VaultsClientListByResourceGroupOptions{Top: to.Ptr[int32](1)})
	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.VaultListResult = armkeyvault.VaultListResult{
		// 	Value: []*armkeyvault.Vault{
		// 		{
		// 			Name: to.Ptr("sample-vault"),
		// 			Type: to.Ptr("Microsoft.KeyVault/vaults"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault"),
		// 			Location: to.Ptr("westus"),
		// 			Properties: &armkeyvault.VaultProperties{
		// 				AccessPolicies: []*armkeyvault.AccessPolicyEntry{
		// 					{
		// 						ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 						Permissions: &armkeyvault.Permissions{
		// 							Certificates: []*armkeyvault.CertificatePermissions{
		// 								to.Ptr(armkeyvault.CertificatePermissionsGet),
		// 								to.Ptr(armkeyvault.CertificatePermissionsList),
		// 								to.Ptr(armkeyvault.CertificatePermissionsDelete),
		// 								to.Ptr(armkeyvault.CertificatePermissionsCreate),
		// 								to.Ptr(armkeyvault.CertificatePermissionsImport),
		// 								to.Ptr(armkeyvault.CertificatePermissionsUpdate),
		// 								to.Ptr(armkeyvault.CertificatePermissionsManagecontacts),
		// 								to.Ptr(armkeyvault.CertificatePermissionsGetissuers),
		// 								to.Ptr(armkeyvault.CertificatePermissionsListissuers),
		// 								to.Ptr(armkeyvault.CertificatePermissionsSetissuers),
		// 								to.Ptr(armkeyvault.CertificatePermissionsDeleteissuers),
		// 								to.Ptr(armkeyvault.CertificatePermissionsManageissuers),
		// 								to.Ptr(armkeyvault.CertificatePermissionsRecover),
		// 								to.Ptr(armkeyvault.CertificatePermissionsPurge)},
		// 								Keys: []*armkeyvault.KeyPermissions{
		// 									to.Ptr(armkeyvault.KeyPermissionsEncrypt),
		// 									to.Ptr(armkeyvault.KeyPermissionsDecrypt),
		// 									to.Ptr(armkeyvault.KeyPermissionsWrapKey),
		// 									to.Ptr(armkeyvault.KeyPermissionsUnwrapKey),
		// 									to.Ptr(armkeyvault.KeyPermissionsSign),
		// 									to.Ptr(armkeyvault.KeyPermissionsVerify),
		// 									to.Ptr(armkeyvault.KeyPermissionsGet),
		// 									to.Ptr(armkeyvault.KeyPermissionsList),
		// 									to.Ptr(armkeyvault.KeyPermissionsCreate),
		// 									to.Ptr(armkeyvault.KeyPermissionsUpdate),
		// 									to.Ptr(armkeyvault.KeyPermissionsImport),
		// 									to.Ptr(armkeyvault.KeyPermissionsDelete),
		// 									to.Ptr(armkeyvault.KeyPermissionsBackup),
		// 									to.Ptr(armkeyvault.KeyPermissionsRestore),
		// 									to.Ptr(armkeyvault.KeyPermissionsRecover),
		// 									to.Ptr(armkeyvault.KeyPermissionsPurge)},
		// 									Secrets: []*armkeyvault.SecretPermissions{
		// 										to.Ptr(armkeyvault.SecretPermissionsGet),
		// 										to.Ptr(armkeyvault.SecretPermissionsList),
		// 										to.Ptr(armkeyvault.SecretPermissionsSet),
		// 										to.Ptr(armkeyvault.SecretPermissionsDelete),
		// 										to.Ptr(armkeyvault.SecretPermissionsBackup),
		// 										to.Ptr(armkeyvault.SecretPermissionsRestore),
		// 										to.Ptr(armkeyvault.SecretPermissionsRecover),
		// 										to.Ptr(armkeyvault.SecretPermissionsPurge)},
		// 									},
		// 									TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 							}},
		// 							EnableSoftDelete: to.Ptr(true),
		// 							EnabledForDeployment: to.Ptr(true),
		// 							EnabledForDiskEncryption: to.Ptr(true),
		// 							EnabledForTemplateDeployment: to.Ptr(true),
		// 							HsmPoolResourceID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 							ProvisioningState: to.Ptr(armkeyvault.VaultProvisioningStateSucceeded),
		// 							SKU: &armkeyvault.SKU{
		// 								Name: to.Ptr(armkeyvault.SKUNamePremium),
		// 								Family: to.Ptr(armkeyvault.SKUFamilyA),
		// 							},
		// 							TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 							VaultURI: to.Ptr("https://sample-vault.vault.azure.net/"),
		// 						},
		// 						SystemData: &armkeyvault.SystemData{
		// 							CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.000Z"); return t}()),
		// 							CreatedBy: to.Ptr("keyVaultUser1"),
		// 							CreatedByType: to.Ptr(armkeyvault.IdentityTypeUser),
		// 							LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.000Z"); return t}()),
		// 							LastModifiedBy: to.Ptr("keyVaultUser2"),
		// 							LastModifiedByType: to.Ptr(armkeyvault.IdentityTypeUser),
		// 						},
		// 						Tags: map[string]*string{
		// 						},
		// 				}},
		// 			}
	}
}
Output:

func (*VaultsClient) NewListBySubscriptionPager added in v0.5.0

NewListBySubscriptionPager - The List operation gets information about the vaults associated with the subscription.

Generated from API version 2023-07-01

  • options - VaultsClientListBySubscriptionOptions contains the optional parameters for the VaultsClient.NewListBySubscriptionPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/listVaultBySubscription.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/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewVaultsClient().NewListBySubscriptionPager(&armkeyvault.VaultsClientListBySubscriptionOptions{Top: to.Ptr[int32](1)})
	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.VaultListResult = armkeyvault.VaultListResult{
		// 	Value: []*armkeyvault.Vault{
		// 		{
		// 			Name: to.Ptr("sample-vault"),
		// 			Type: to.Ptr("Microsoft.KeyVault/vaults"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault"),
		// 			Location: to.Ptr("westus"),
		// 			Properties: &armkeyvault.VaultProperties{
		// 				AccessPolicies: []*armkeyvault.AccessPolicyEntry{
		// 					{
		// 						ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 						Permissions: &armkeyvault.Permissions{
		// 							Certificates: []*armkeyvault.CertificatePermissions{
		// 								to.Ptr(armkeyvault.CertificatePermissionsGet),
		// 								to.Ptr(armkeyvault.CertificatePermissionsList),
		// 								to.Ptr(armkeyvault.CertificatePermissionsDelete),
		// 								to.Ptr(armkeyvault.CertificatePermissionsCreate),
		// 								to.Ptr(armkeyvault.CertificatePermissionsImport),
		// 								to.Ptr(armkeyvault.CertificatePermissionsUpdate),
		// 								to.Ptr(armkeyvault.CertificatePermissionsManagecontacts),
		// 								to.Ptr(armkeyvault.CertificatePermissionsGetissuers),
		// 								to.Ptr(armkeyvault.CertificatePermissionsListissuers),
		// 								to.Ptr(armkeyvault.CertificatePermissionsSetissuers),
		// 								to.Ptr(armkeyvault.CertificatePermissionsDeleteissuers),
		// 								to.Ptr(armkeyvault.CertificatePermissionsManageissuers),
		// 								to.Ptr(armkeyvault.CertificatePermissionsRecover),
		// 								to.Ptr(armkeyvault.CertificatePermissionsPurge)},
		// 								Keys: []*armkeyvault.KeyPermissions{
		// 									to.Ptr(armkeyvault.KeyPermissionsEncrypt),
		// 									to.Ptr(armkeyvault.KeyPermissionsDecrypt),
		// 									to.Ptr(armkeyvault.KeyPermissionsWrapKey),
		// 									to.Ptr(armkeyvault.KeyPermissionsUnwrapKey),
		// 									to.Ptr(armkeyvault.KeyPermissionsSign),
		// 									to.Ptr(armkeyvault.KeyPermissionsVerify),
		// 									to.Ptr(armkeyvault.KeyPermissionsGet),
		// 									to.Ptr(armkeyvault.KeyPermissionsList),
		// 									to.Ptr(armkeyvault.KeyPermissionsCreate),
		// 									to.Ptr(armkeyvault.KeyPermissionsUpdate),
		// 									to.Ptr(armkeyvault.KeyPermissionsImport),
		// 									to.Ptr(armkeyvault.KeyPermissionsDelete),
		// 									to.Ptr(armkeyvault.KeyPermissionsBackup),
		// 									to.Ptr(armkeyvault.KeyPermissionsRestore),
		// 									to.Ptr(armkeyvault.KeyPermissionsRecover),
		// 									to.Ptr(armkeyvault.KeyPermissionsPurge)},
		// 									Secrets: []*armkeyvault.SecretPermissions{
		// 										to.Ptr(armkeyvault.SecretPermissionsGet),
		// 										to.Ptr(armkeyvault.SecretPermissionsList),
		// 										to.Ptr(armkeyvault.SecretPermissionsSet),
		// 										to.Ptr(armkeyvault.SecretPermissionsDelete),
		// 										to.Ptr(armkeyvault.SecretPermissionsBackup),
		// 										to.Ptr(armkeyvault.SecretPermissionsRestore),
		// 										to.Ptr(armkeyvault.SecretPermissionsRecover),
		// 										to.Ptr(armkeyvault.SecretPermissionsPurge)},
		// 									},
		// 									TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 							}},
		// 							EnableSoftDelete: to.Ptr(true),
		// 							EnabledForDeployment: to.Ptr(true),
		// 							EnabledForDiskEncryption: to.Ptr(true),
		// 							EnabledForTemplateDeployment: to.Ptr(true),
		// 							HsmPoolResourceID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 							ProvisioningState: to.Ptr(armkeyvault.VaultProvisioningStateSucceeded),
		// 							SKU: &armkeyvault.SKU{
		// 								Name: to.Ptr(armkeyvault.SKUNamePremium),
		// 								Family: to.Ptr(armkeyvault.SKUFamilyA),
		// 							},
		// 							TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 							VaultURI: to.Ptr("https://sample-vault.vault.azure.net/"),
		// 						},
		// 						SystemData: &armkeyvault.SystemData{
		// 							CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.000Z"); return t}()),
		// 							CreatedBy: to.Ptr("keyVaultUser1"),
		// 							CreatedByType: to.Ptr(armkeyvault.IdentityTypeUser),
		// 							LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.000Z"); return t}()),
		// 							LastModifiedBy: to.Ptr("keyVaultUser2"),
		// 							LastModifiedByType: to.Ptr(armkeyvault.IdentityTypeUser),
		// 						},
		// 						Tags: map[string]*string{
		// 						},
		// 				}},
		// 			}
	}
}
Output:

func (*VaultsClient) NewListDeletedPager added in v0.5.0

NewListDeletedPager - Gets information about the deleted vaults in a subscription.

Generated from API version 2023-07-01

  • options - VaultsClientListDeletedOptions contains the optional parameters for the VaultsClient.NewListDeletedPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/listDeletedVaults.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewVaultsClient().NewListDeletedPager(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.DeletedVaultListResult = armkeyvault.DeletedVaultListResult{
		// 	Value: []*armkeyvault.DeletedVault{
		// 		{
		// 			Name: to.Ptr("vault-agile-drawer-6404"),
		// 			Type: to.Ptr("Microsoft.KeyVault/deletedVaults"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/westus/deletedVaults/sample-vault"),
		// 			Properties: &armkeyvault.DeletedVaultProperties{
		// 				DeletionDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-01-01T00:00:59.000Z"); return t}()),
		// 				Location: to.Ptr("westus"),
		// 				PurgeProtectionEnabled: to.Ptr(true),
		// 				ScheduledPurgeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-01T00:00:59.000Z"); return t}()),
		// 				Tags: map[string]*string{
		// 				},
		// 				VaultID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*VaultsClient) NewListPager added in v0.5.0

NewListPager - The List operation gets information about the vaults associated with the subscription.

Generated from API version 2023-07-01

  • options - VaultsClientListOptions contains the optional parameters for the VaultsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/listVault.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/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewVaultsClient().NewListPager(&armkeyvault.VaultsClientListOptions{Top: to.Ptr[int32](1)})
	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.ResourceListResult = armkeyvault.ResourceListResult{
		// 	Value: []*armkeyvault.Resource{
		// 		{
		// 			Name: to.Ptr("sample-vault"),
		// 			Type: to.Ptr("Microsoft.KeyVault/vaults"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault"),
		// 			Location: to.Ptr("westus"),
		// 			Tags: map[string]*string{
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*VaultsClient) Update

func (client *VaultsClient) Update(ctx context.Context, resourceGroupName string, vaultName string, parameters VaultPatchParameters, options *VaultsClientUpdateOptions) (VaultsClientUpdateResponse, error)

Update - Update a key vault in the specified subscription. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the Resource Group to which the server belongs.
  • vaultName - Name of the vault
  • parameters - Parameters to patch the vault
  • options - VaultsClientUpdateOptions contains the optional parameters for the VaultsClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/updateVault.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/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewVaultsClient().Update(ctx, "sample-resource-group", "sample-vault", armkeyvault.VaultPatchParameters{
		Properties: &armkeyvault.VaultPatchProperties{
			AccessPolicies: []*armkeyvault.AccessPolicyEntry{
				{
					ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"),
					Permissions: &armkeyvault.Permissions{
						Certificates: []*armkeyvault.CertificatePermissions{
							to.Ptr(armkeyvault.CertificatePermissionsGet),
							to.Ptr(armkeyvault.CertificatePermissionsList),
							to.Ptr(armkeyvault.CertificatePermissionsDelete),
							to.Ptr(armkeyvault.CertificatePermissionsCreate),
							to.Ptr(armkeyvault.CertificatePermissionsImport),
							to.Ptr(armkeyvault.CertificatePermissionsUpdate),
							to.Ptr(armkeyvault.CertificatePermissionsManagecontacts),
							to.Ptr(armkeyvault.CertificatePermissionsGetissuers),
							to.Ptr(armkeyvault.CertificatePermissionsListissuers),
							to.Ptr(armkeyvault.CertificatePermissionsSetissuers),
							to.Ptr(armkeyvault.CertificatePermissionsDeleteissuers),
							to.Ptr(armkeyvault.CertificatePermissionsManageissuers),
							to.Ptr(armkeyvault.CertificatePermissionsRecover),
							to.Ptr(armkeyvault.CertificatePermissionsPurge)},
						Keys: []*armkeyvault.KeyPermissions{
							to.Ptr(armkeyvault.KeyPermissionsEncrypt),
							to.Ptr(armkeyvault.KeyPermissionsDecrypt),
							to.Ptr(armkeyvault.KeyPermissionsWrapKey),
							to.Ptr(armkeyvault.KeyPermissionsUnwrapKey),
							to.Ptr(armkeyvault.KeyPermissionsSign),
							to.Ptr(armkeyvault.KeyPermissionsVerify),
							to.Ptr(armkeyvault.KeyPermissionsGet),
							to.Ptr(armkeyvault.KeyPermissionsList),
							to.Ptr(armkeyvault.KeyPermissionsCreate),
							to.Ptr(armkeyvault.KeyPermissionsUpdate),
							to.Ptr(armkeyvault.KeyPermissionsImport),
							to.Ptr(armkeyvault.KeyPermissionsDelete),
							to.Ptr(armkeyvault.KeyPermissionsBackup),
							to.Ptr(armkeyvault.KeyPermissionsRestore),
							to.Ptr(armkeyvault.KeyPermissionsRecover),
							to.Ptr(armkeyvault.KeyPermissionsPurge)},
						Secrets: []*armkeyvault.SecretPermissions{
							to.Ptr(armkeyvault.SecretPermissionsGet),
							to.Ptr(armkeyvault.SecretPermissionsList),
							to.Ptr(armkeyvault.SecretPermissionsSet),
							to.Ptr(armkeyvault.SecretPermissionsDelete),
							to.Ptr(armkeyvault.SecretPermissionsBackup),
							to.Ptr(armkeyvault.SecretPermissionsRestore),
							to.Ptr(armkeyvault.SecretPermissionsRecover),
							to.Ptr(armkeyvault.SecretPermissionsPurge)},
					},
					TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
				}},
			EnabledForDeployment:         to.Ptr(true),
			EnabledForDiskEncryption:     to.Ptr(true),
			EnabledForTemplateDeployment: to.Ptr(true),
			PublicNetworkAccess:          to.Ptr("Enabled"),
			SKU: &armkeyvault.SKU{
				Name:   to.Ptr(armkeyvault.SKUNameStandard),
				Family: to.Ptr(armkeyvault.SKUFamilyA),
			},
			TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		},
	}, 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.Vault = armkeyvault.Vault{
	// 	Name: to.Ptr("sample-vault"),
	// 	Type: to.Ptr("Microsoft.KeyVault/vaults"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-resource-group/providers/Microsoft.KeyVault/vaults/sample-vault"),
	// 	Location: to.Ptr("westus"),
	// 	Properties: &armkeyvault.VaultProperties{
	// 		AccessPolicies: []*armkeyvault.AccessPolicyEntry{
	// 			{
	// 				ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 				Permissions: &armkeyvault.Permissions{
	// 					Certificates: []*armkeyvault.CertificatePermissions{
	// 						to.Ptr(armkeyvault.CertificatePermissionsGet),
	// 						to.Ptr(armkeyvault.CertificatePermissionsList),
	// 						to.Ptr(armkeyvault.CertificatePermissionsDelete),
	// 						to.Ptr(armkeyvault.CertificatePermissionsCreate),
	// 						to.Ptr(armkeyvault.CertificatePermissionsImport),
	// 						to.Ptr(armkeyvault.CertificatePermissionsUpdate),
	// 						to.Ptr(armkeyvault.CertificatePermissionsManagecontacts),
	// 						to.Ptr(armkeyvault.CertificatePermissionsGetissuers),
	// 						to.Ptr(armkeyvault.CertificatePermissionsListissuers),
	// 						to.Ptr(armkeyvault.CertificatePermissionsSetissuers),
	// 						to.Ptr(armkeyvault.CertificatePermissionsDeleteissuers),
	// 						to.Ptr(armkeyvault.CertificatePermissionsManageissuers),
	// 						to.Ptr(armkeyvault.CertificatePermissionsRecover),
	// 						to.Ptr(armkeyvault.CertificatePermissionsPurge)},
	// 						Keys: []*armkeyvault.KeyPermissions{
	// 							to.Ptr(armkeyvault.KeyPermissionsEncrypt),
	// 							to.Ptr(armkeyvault.KeyPermissionsDecrypt),
	// 							to.Ptr(armkeyvault.KeyPermissionsWrapKey),
	// 							to.Ptr(armkeyvault.KeyPermissionsUnwrapKey),
	// 							to.Ptr(armkeyvault.KeyPermissionsSign),
	// 							to.Ptr(armkeyvault.KeyPermissionsVerify),
	// 							to.Ptr(armkeyvault.KeyPermissionsGet),
	// 							to.Ptr(armkeyvault.KeyPermissionsList),
	// 							to.Ptr(armkeyvault.KeyPermissionsCreate),
	// 							to.Ptr(armkeyvault.KeyPermissionsUpdate),
	// 							to.Ptr(armkeyvault.KeyPermissionsImport),
	// 							to.Ptr(armkeyvault.KeyPermissionsDelete),
	// 							to.Ptr(armkeyvault.KeyPermissionsBackup),
	// 							to.Ptr(armkeyvault.KeyPermissionsRestore),
	// 							to.Ptr(armkeyvault.KeyPermissionsRecover),
	// 							to.Ptr(armkeyvault.KeyPermissionsPurge)},
	// 							Secrets: []*armkeyvault.SecretPermissions{
	// 								to.Ptr(armkeyvault.SecretPermissionsGet),
	// 								to.Ptr(armkeyvault.SecretPermissionsList),
	// 								to.Ptr(armkeyvault.SecretPermissionsSet),
	// 								to.Ptr(armkeyvault.SecretPermissionsDelete),
	// 								to.Ptr(armkeyvault.SecretPermissionsBackup),
	// 								to.Ptr(armkeyvault.SecretPermissionsRestore),
	// 								to.Ptr(armkeyvault.SecretPermissionsRecover),
	// 								to.Ptr(armkeyvault.SecretPermissionsPurge)},
	// 							},
	// 							TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 					}},
	// 					EnabledForDeployment: to.Ptr(true),
	// 					EnabledForDiskEncryption: to.Ptr(true),
	// 					EnabledForTemplateDeployment: to.Ptr(true),
	// 					HsmPoolResourceID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 					NetworkACLs: &armkeyvault.NetworkRuleSet{
	// 						Bypass: to.Ptr(armkeyvault.NetworkRuleBypassOptionsAzureServices),
	// 						DefaultAction: to.Ptr(armkeyvault.NetworkRuleActionDeny),
	// 						IPRules: []*armkeyvault.IPRule{
	// 							{
	// 								Value: to.Ptr(""),
	// 						}},
	// 						VirtualNetworkRules: []*armkeyvault.VirtualNetworkRule{
	// 							{
	// 								ID: to.Ptr(""),
	// 								IgnoreMissingVnetServiceEndpoint: to.Ptr(false),
	// 						}},
	// 					},
	// 					PrivateEndpointConnections: []*armkeyvault.PrivateEndpointConnectionItem{
	// 						{
	// 							ID: to.Ptr(""),
	// 							Properties: &armkeyvault.PrivateEndpointConnectionProperties{
	// 								PrivateEndpoint: &armkeyvault.PrivateEndpoint{
	// 									ID: to.Ptr(""),
	// 								},
	// 								PrivateLinkServiceConnectionState: &armkeyvault.PrivateLinkServiceConnectionState{
	// 									ActionsRequired: to.Ptr(armkeyvault.ActionsRequiredNone),
	// 									Status: to.Ptr(armkeyvault.PrivateEndpointServiceConnectionStatusApproved),
	// 								},
	// 								ProvisioningState: to.Ptr(armkeyvault.PrivateEndpointConnectionProvisioningStateSucceeded),
	// 							},
	// 					}},
	// 					ProvisioningState: to.Ptr(armkeyvault.VaultProvisioningStateSucceeded),
	// 					PublicNetworkAccess: to.Ptr("Enabled"),
	// 					SKU: &armkeyvault.SKU{
	// 						Name: to.Ptr(armkeyvault.SKUNameStandard),
	// 						Family: to.Ptr(armkeyvault.SKUFamilyA),
	// 					},
	// 					TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 					VaultURI: to.Ptr("https://sample-vault.vault.azure.net"),
	// 				},
	// 				SystemData: &armkeyvault.SystemData{
	// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.000Z"); return t}()),
	// 					CreatedBy: to.Ptr("keyVaultUser1"),
	// 					CreatedByType: to.Ptr(armkeyvault.IdentityTypeUser),
	// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.000Z"); return t}()),
	// 					LastModifiedBy: to.Ptr("keyVaultUser2"),
	// 					LastModifiedByType: to.Ptr(armkeyvault.IdentityTypeUser),
	// 				},
	// 				Tags: map[string]*string{
	// 				},
	// 			}
}
Output:

func (*VaultsClient) UpdateAccessPolicy

func (client *VaultsClient) UpdateAccessPolicy(ctx context.Context, resourceGroupName string, vaultName string, operationKind AccessPolicyUpdateKind, parameters VaultAccessPolicyParameters, options *VaultsClientUpdateAccessPolicyOptions) (VaultsClientUpdateAccessPolicyResponse, error)

UpdateAccessPolicy - Update access policies in a key vault in the specified subscription. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the Resource Group to which the vault belongs.
  • vaultName - Name of the vault
  • operationKind - Name of the operation
  • parameters - Access policy to merge into the vault
  • options - VaultsClientUpdateAccessPolicyOptions contains the optional parameters for the VaultsClient.UpdateAccessPolicy method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/updateAccessPoliciesAdd.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/keyvault/armkeyvault"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewVaultsClient().UpdateAccessPolicy(ctx, "sample-group", "sample-vault", armkeyvault.AccessPolicyUpdateKindAdd, armkeyvault.VaultAccessPolicyParameters{
		Properties: &armkeyvault.VaultAccessPolicyProperties{
			AccessPolicies: []*armkeyvault.AccessPolicyEntry{
				{
					ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"),
					Permissions: &armkeyvault.Permissions{
						Certificates: []*armkeyvault.CertificatePermissions{
							to.Ptr(armkeyvault.CertificatePermissionsGet)},
						Keys: []*armkeyvault.KeyPermissions{
							to.Ptr(armkeyvault.KeyPermissionsEncrypt)},
						Secrets: []*armkeyvault.SecretPermissions{
							to.Ptr(armkeyvault.SecretPermissionsGet)},
					},
					TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
				}},
		},
	}, 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.VaultAccessPolicyParameters = armkeyvault.VaultAccessPolicyParameters{
	// 	Type: to.Ptr("Microsoft.KeyVault/vaults/accessPolicies"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault/accessPolicies/"),
	// 	Properties: &armkeyvault.VaultAccessPolicyProperties{
	// 		AccessPolicies: []*armkeyvault.AccessPolicyEntry{
	// 			{
	// 				ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 				Permissions: &armkeyvault.Permissions{
	// 					Certificates: []*armkeyvault.CertificatePermissions{
	// 						to.Ptr(armkeyvault.CertificatePermissionsGet)},
	// 						Keys: []*armkeyvault.KeyPermissions{
	// 							to.Ptr(armkeyvault.KeyPermissionsEncrypt)},
	// 							Secrets: []*armkeyvault.SecretPermissions{
	// 								to.Ptr(armkeyvault.SecretPermissionsGet)},
	// 							},
	// 							TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 					}},
	// 				},
	// 			}
}
Output:

type VaultsClientBeginCreateOrUpdateOptions added in v0.3.0

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

VaultsClientBeginCreateOrUpdateOptions contains the optional parameters for the VaultsClient.BeginCreateOrUpdate method.

type VaultsClientBeginPurgeDeletedOptions added in v0.3.0

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

VaultsClientBeginPurgeDeletedOptions contains the optional parameters for the VaultsClient.BeginPurgeDeleted method.

type VaultsClientCheckNameAvailabilityOptions added in v0.3.0

type VaultsClientCheckNameAvailabilityOptions struct {
}

VaultsClientCheckNameAvailabilityOptions contains the optional parameters for the VaultsClient.CheckNameAvailability method.

type VaultsClientCheckNameAvailabilityResponse added in v0.3.0

type VaultsClientCheckNameAvailabilityResponse struct {
	// The CheckNameAvailability operation response.
	CheckNameAvailabilityResult
}

VaultsClientCheckNameAvailabilityResponse contains the response from method VaultsClient.CheckNameAvailability.

type VaultsClientCreateOrUpdateResponse added in v0.3.0

type VaultsClientCreateOrUpdateResponse struct {
	// Resource information with extended details.
	Vault
}

VaultsClientCreateOrUpdateResponse contains the response from method VaultsClient.BeginCreateOrUpdate.

type VaultsClientDeleteOptions added in v0.3.0

type VaultsClientDeleteOptions struct {
}

VaultsClientDeleteOptions contains the optional parameters for the VaultsClient.Delete method.

type VaultsClientDeleteResponse added in v0.3.0

type VaultsClientDeleteResponse struct {
}

VaultsClientDeleteResponse contains the response from method VaultsClient.Delete.

type VaultsClientGetDeletedOptions added in v0.3.0

type VaultsClientGetDeletedOptions struct {
}

VaultsClientGetDeletedOptions contains the optional parameters for the VaultsClient.GetDeleted method.

type VaultsClientGetDeletedResponse added in v0.3.0

type VaultsClientGetDeletedResponse struct {
	// Deleted vault information with extended details.
	DeletedVault
}

VaultsClientGetDeletedResponse contains the response from method VaultsClient.GetDeleted.

type VaultsClientGetOptions added in v0.3.0

type VaultsClientGetOptions struct {
}

VaultsClientGetOptions contains the optional parameters for the VaultsClient.Get method.

type VaultsClientGetResponse added in v0.3.0

type VaultsClientGetResponse struct {
	// Resource information with extended details.
	Vault
}

VaultsClientGetResponse contains the response from method VaultsClient.Get.

type VaultsClientListByResourceGroupOptions added in v0.3.0

type VaultsClientListByResourceGroupOptions struct {
	// Maximum number of results to return.
	Top *int32
}

VaultsClientListByResourceGroupOptions contains the optional parameters for the VaultsClient.NewListByResourceGroupPager method.

type VaultsClientListByResourceGroupResponse added in v0.3.0

type VaultsClientListByResourceGroupResponse struct {
	// List of vaults
	VaultListResult
}

VaultsClientListByResourceGroupResponse contains the response from method VaultsClient.NewListByResourceGroupPager.

type VaultsClientListBySubscriptionOptions added in v0.3.0

type VaultsClientListBySubscriptionOptions struct {
	// Maximum number of results to return.
	Top *int32
}

VaultsClientListBySubscriptionOptions contains the optional parameters for the VaultsClient.NewListBySubscriptionPager method.

type VaultsClientListBySubscriptionResponse added in v0.3.0

type VaultsClientListBySubscriptionResponse struct {
	// List of vaults
	VaultListResult
}

VaultsClientListBySubscriptionResponse contains the response from method VaultsClient.NewListBySubscriptionPager.

type VaultsClientListDeletedOptions added in v0.3.0

type VaultsClientListDeletedOptions struct {
}

VaultsClientListDeletedOptions contains the optional parameters for the VaultsClient.NewListDeletedPager method.

type VaultsClientListDeletedResponse added in v0.3.0

type VaultsClientListDeletedResponse struct {
	// List of vaults
	DeletedVaultListResult
}

VaultsClientListDeletedResponse contains the response from method VaultsClient.NewListDeletedPager.

type VaultsClientListOptions added in v0.3.0

type VaultsClientListOptions struct {
	// Maximum number of results to return.
	Top *int32
}

VaultsClientListOptions contains the optional parameters for the VaultsClient.NewListPager method.

type VaultsClientListResponse added in v0.3.0

type VaultsClientListResponse struct {
	// List of vault resources.
	ResourceListResult
}

VaultsClientListResponse contains the response from method VaultsClient.NewListPager.

type VaultsClientPurgeDeletedResponse added in v0.3.0

type VaultsClientPurgeDeletedResponse struct {
}

VaultsClientPurgeDeletedResponse contains the response from method VaultsClient.BeginPurgeDeleted.

type VaultsClientUpdateAccessPolicyOptions added in v0.3.0

type VaultsClientUpdateAccessPolicyOptions struct {
}

VaultsClientUpdateAccessPolicyOptions contains the optional parameters for the VaultsClient.UpdateAccessPolicy method.

type VaultsClientUpdateAccessPolicyResponse added in v0.3.0

type VaultsClientUpdateAccessPolicyResponse struct {
	// Parameters for updating the access policy in a vault
	VaultAccessPolicyParameters
}

VaultsClientUpdateAccessPolicyResponse contains the response from method VaultsClient.UpdateAccessPolicy.

type VaultsClientUpdateOptions added in v0.3.0

type VaultsClientUpdateOptions struct {
}

VaultsClientUpdateOptions contains the optional parameters for the VaultsClient.Update method.

type VaultsClientUpdateResponse added in v0.3.0

type VaultsClientUpdateResponse struct {
	// Resource information with extended details.
	Vault
}

VaultsClientUpdateResponse contains the response from method VaultsClient.Update.

type VirtualNetworkRule

type VirtualNetworkRule struct {
	// REQUIRED; Full resource id of a vnet subnet, such as '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'.
	ID *string

	// Property to specify whether NRP will ignore the check if parent subnet has serviceEndpoints configured.
	IgnoreMissingVnetServiceEndpoint *bool
}

VirtualNetworkRule - A rule governing the accessibility of a vault from a specific virtual network.

func (VirtualNetworkRule) MarshalJSON added in v1.1.0

func (v VirtualNetworkRule) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualNetworkRule.

func (*VirtualNetworkRule) UnmarshalJSON added in v1.1.0

func (v *VirtualNetworkRule) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkRule.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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