armkeyvault

package module
v1.1.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2022 License: MIT Imports: 17 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

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.

Clients

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

client, err := armkeyvault.NewKeysClient(<subscription ID>, cred, nil)

You can use ClientOptions in package github.com/Azure/azure-sdk-for-go/sdk/azcore/arm to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for azcore at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore.

options := arm.ClientOptions {
    ClientOptions: azcore.ClientOptions {
        Cloud: cloud.AzureChina,
    },
}
client, err := armkeyvault.NewKeysClient(<subscription ID>, cred, &options)

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

	// REQUIRED; Permissions the identity has for keys, secrets and certificates.
	Permissions *Permissions `json:"permissions,omitempty"`

	// REQUIRED; The Azure Active Directory tenant ID that should be used for authenticating requests to the key vault.
	TenantID *string `json:"tenantId,omitempty"`

	// Application ID of the client making request on behalf of a principal
	ApplicationID *string `json:"applicationId,omitempty"`
}

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.

type AccessPolicyUpdateKind

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

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

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 Attributes

type Attributes struct {
	// Determines whether the object is enabled.
	Enabled *bool `json:"enabled,omitempty"`

	// Expiry date in seconds since 1970-01-01T00:00:00Z.
	Expires *time.Time `json:"exp,omitempty"`

	// Not before date in seconds since 1970-01-01T00:00:00Z.
	NotBefore *time.Time `json:"nbf,omitempty"`

	// READ-ONLY; Creation time in seconds since 1970-01-01T00:00:00Z.
	Created *time.Time `json:"created,omitempty" azure:"ro"`

	// READ-ONLY; Last updated time in seconds since 1970-01-01T00:00:00Z.
	Updated *time.Time `json:"updated,omitempty" azure:"ro"`
}

Attributes - The object attributes managed by the KeyVault service.

func (Attributes) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Attributes.

func (*Attributes) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type Attributes.

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 CheckNameAvailabilityResult

type CheckNameAvailabilityResult struct {
	// READ-ONLY; An error message explaining the Reason value in more detail.
	Message *string `json:"message,omitempty" azure:"ro"`

	// 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 `json:"nameAvailable,omitempty" azure:"ro"`

	// READ-ONLY; The reason that a vault name could not be used. The Reason element is only returned if NameAvailable is false.
	Reason *Reason `json:"reason,omitempty" azure:"ro"`
}

CheckNameAvailabilityResult - The CheckNameAvailability operation response.

type CloudError

type CloudError struct {
	// An error response from Key Vault resource provider
	Error *CloudErrorBody `json:"error,omitempty"`
}

CloudError - An error response from Key Vault resource provider

type CloudErrorBody

type CloudErrorBody struct {
	// Error code. This is a mnemonic that can be consumed programmatically.
	Code *string `json:"code,omitempty"`

	// User friendly error message. The message is typically localized and may vary with service version.
	Message *string `json:"message,omitempty"`
}

CloudErrorBody - An error response from Key Vault resource provider

type CreateMode

type CreateMode string

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

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

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

	// READ-ONLY; The Azure Resource Manager resource ID for the deleted managed HSM Pool.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the managed HSM Pool.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The resource type of the managed HSM Pool.
	Type *string `json:"type,omitempty" azure:"ro"`
}

type DeletedManagedHsmListResult

type DeletedManagedHsmListResult struct {
	// The URL to get the next set of deleted managed HSM Pools.
	NextLink *string `json:"nextLink,omitempty"`

	// The list of deleted managed HSM Pools.
	Value []*DeletedManagedHsm `json:"value,omitempty"`
}

DeletedManagedHsmListResult - List of deleted managed HSM Pools

type DeletedManagedHsmProperties

type DeletedManagedHsmProperties struct {
	// READ-ONLY; The deleted date.
	DeletionDate *time.Time `json:"deletionDate,omitempty" azure:"ro"`

	// READ-ONLY; The location of the original managed HSM.
	Location *string `json:"location,omitempty" azure:"ro"`

	// READ-ONLY; The resource id of the original managed HSM.
	MhsmID *string `json:"mhsmId,omitempty" azure:"ro"`

	// READ-ONLY; Purge protection status of the original managed HSM.
	PurgeProtectionEnabled *bool `json:"purgeProtectionEnabled,omitempty" azure:"ro"`

	// READ-ONLY; The scheduled purged date.
	ScheduledPurgeDate *time.Time `json:"scheduledPurgeDate,omitempty" azure:"ro"`

	// READ-ONLY; Tags of the original managed HSM.
	Tags map[string]*string `json:"tags,omitempty" azure:"ro"`
}

DeletedManagedHsmProperties - Properties of the deleted managed HSM.

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

	// READ-ONLY; The resource ID for the deleted key vault.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the key vault.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The resource type of the key vault.
	Type *string `json:"type,omitempty" azure:"ro"`
}

DeletedVault - Deleted vault information with extended details.

type DeletedVaultListResult

type DeletedVaultListResult struct {
	// The URL to get the next set of deleted vaults.
	NextLink *string `json:"nextLink,omitempty"`

	// The list of deleted vaults.
	Value []*DeletedVault `json:"value,omitempty"`
}

DeletedVaultListResult - List of vaults

type DeletedVaultProperties

type DeletedVaultProperties struct {
	// READ-ONLY; The deleted date.
	DeletionDate *time.Time `json:"deletionDate,omitempty" azure:"ro"`

	// READ-ONLY; The location of the original vault.
	Location *string `json:"location,omitempty" azure:"ro"`

	// READ-ONLY; Purge protection status of the original vault.
	PurgeProtectionEnabled *bool `json:"purgeProtectionEnabled,omitempty" azure:"ro"`

	// READ-ONLY; The scheduled purged date.
	ScheduledPurgeDate *time.Time `json:"scheduledPurgeDate,omitempty" azure:"ro"`

	// READ-ONLY; Tags of the original vault.
	Tags map[string]*string `json:"tags,omitempty" azure:"ro"`

	// READ-ONLY; The resource id of the original vault.
	VaultID *string `json:"vaultId,omitempty" azure:"ro"`
}

DeletedVaultProperties - Properties of the deleted vault.

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

	// Name of dimension.
	Name *string `json:"name,omitempty"`

	// Property to specify whether the dimension should be exported for Shoebox.
	ToBeExportedForShoebox *bool `json:"toBeExportedForShoebox,omitempty"`
}

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

type Error

type Error struct {
	// READ-ONLY; The error code.
	Code *string `json:"code,omitempty" azure:"ro"`

	// READ-ONLY; The inner error, contains a more specific error code.
	InnerError *Error `json:"innererror,omitempty" azure:"ro"`

	// READ-ONLY; The error message.
	Message *string `json:"message,omitempty" azure:"ro"`
}

Error - The server error.

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

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

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

	// READ-ONLY; Fully qualified identifier of the key vault resource.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Azure location of the key vault resource.
	Location *string `json:"location,omitempty" azure:"ro"`

	// READ-ONLY; Name of the key vault resource.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Tags assigned to the key vault resource.
	Tags map[string]*string `json:"tags,omitempty" azure:"ro"`

	// READ-ONLY; Resource type of the key vault resource.
	Type *string `json:"type,omitempty" azure:"ro"`
}

Key - The key resource.

func (Key) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Key.

type KeyAttributes

type KeyAttributes struct {
	// Determines whether or not the object is enabled.
	Enabled *bool `json:"enabled,omitempty"`

	// Expiry date in seconds since 1970-01-01T00:00:00Z.
	Expires *int64 `json:"exp,omitempty"`

	// Indicates if the private key can be exported.
	Exportable *bool `json:"exportable,omitempty"`

	// Not before date in seconds since 1970-01-01T00:00:00Z.
	NotBefore *int64 `json:"nbf,omitempty"`

	// READ-ONLY; Creation time in seconds since 1970-01-01T00:00:00Z.
	Created *int64 `json:"created,omitempty" azure:"ro"`

	// 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 `json:"recoveryLevel,omitempty" azure:"ro"`

	// READ-ONLY; Last updated time in seconds since 1970-01-01T00:00:00Z.
	Updated *int64 `json:"updated,omitempty" azure:"ro"`
}

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

type KeyCreateParameters

type KeyCreateParameters struct {
	// REQUIRED; The properties of the key to be created.
	Properties *KeyProperties `json:"properties,omitempty"`

	// The tags that will be assigned to the key.
	Tags map[string]*string `json:"tags,omitempty"`
}

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.

type KeyListResult

type KeyListResult struct {
	// The URL to get the next page of keys.
	NextLink *string `json:"nextLink,omitempty"`

	// The key resources.
	Value []*Key `json:"value,omitempty"`
}

KeyListResult - The page of keys.

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

	// The elliptic curve name. For valid values, see JsonWebKeyCurveName.
	CurveName *JSONWebKeyCurveName   `json:"curveName,omitempty"`
	KeyOps    []*JSONWebKeyOperation `json:"keyOps,omitempty"`

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

	// The type of the key. For valid values, see JsonWebKeyType.
	Kty *JSONWebKeyType `json:"kty,omitempty"`

	// Key release policy in response. It will be used for both output and input. Omitted if empty
	ReleasePolicy *KeyReleasePolicy `json:"release_policy,omitempty"`

	// Key rotation policy in response. It will be used for both output and input. Omitted if empty
	RotationPolicy *RotationPolicy `json:"rotationPolicy,omitempty"`

	// READ-ONLY; The URI to retrieve the current version of the key.
	KeyURI *string `json:"keyUri,omitempty" azure:"ro"`

	// READ-ONLY; The URI to retrieve the specific version of the key.
	KeyURIWithVersion *string `json:"keyUriWithVersion,omitempty" azure:"ro"`
}

KeyProperties - The properties of the key.

func (KeyProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type KeyProperties.

type KeyReleasePolicy

type KeyReleasePolicy struct {
	// Content type and version of key release policy
	ContentType *string `json:"contentType,omitempty"`

	// Blob encoding the policy rules under which the key can be released.
	Data []byte `json:"data,omitempty"`
}

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 (
	KeyRotationPolicyActionTypeRotate KeyRotationPolicyActionType = "rotate"
	KeyRotationPolicyActionTypeNotify KeyRotationPolicyActionType = "notify"
)

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

	// READ-ONLY; Creation time in seconds since 1970-01-01T00:00:00Z.
	Created *int64 `json:"created,omitempty" azure:"ro"`

	// READ-ONLY; Last updated time in seconds since 1970-01-01T00:00:00Z.
	Updated *int64 `json:"updated,omitempty" azure:"ro"`
}

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 2021-11-01-preview 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. 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/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewKeysClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.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)
	}
	// TODO: use response item
	_ = res
}
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 2021-11-01-preview 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/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewKeysClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Get(ctx,
		"sample-group",
		"sample-vault-name",
		"sample-key-name",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
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 2021-11-01-preview 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/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewKeysClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.GetVersion(ctx,
		"sample-group",
		"sample-vault-name",
		"sample-key-name",
		"fd618d9519b74f9aae94ade66b876acc",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
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. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-11-01-preview 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.List method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewKeysClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListPager("sample-group",
		"sample-vault-name",
		nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
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. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-11-01-preview 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.ListVersions method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewKeysClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListVersionsPager("sample-group",
		"sample-vault-name",
		"sample-key-name",
		nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
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 {
	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 {
	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 {
	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.List method.

type KeysClientListResponse added in v0.3.0

type KeysClientListResponse struct {
	KeyListResult
}

KeysClientListResponse contains the response from method KeysClient.List.

type KeysClientListVersionsOptions added in v0.3.0

type KeysClientListVersionsOptions struct {
}

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

type KeysClientListVersionsResponse added in v0.3.0

type KeysClientListVersionsResponse struct {
	KeyListResult
}

KeysClientListVersionsResponse contains the response from method KeysClient.ListVersions.

type LifetimeAction

type LifetimeAction struct {
	// The action of key rotation policy lifetimeAction.
	Action *Action `json:"action,omitempty"`

	// The trigger of key rotation policy lifetimeAction.
	Trigger *Trigger `json:"trigger,omitempty"`
}

type LogSpecification

type LogSpecification struct {
	// Blob duration of specification.
	BlobDuration *string `json:"blobDuration,omitempty"`

	// Display name of log specification.
	DisplayName *string `json:"displayName,omitempty"`

	// Name of log specification.
	Name *string `json:"name,omitempty"`
}

LogSpecification - Log specification of operation.

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

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

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

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

	// The list of IP address rules.
	IPRules []*MHSMIPRule `json:"ipRules,omitempty"`

	// The list of virtual network rules.
	VirtualNetworkRules []*MHSMVirtualNetworkRule `json:"virtualNetworkRules,omitempty"`
}

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.

type MHSMPrivateEndpoint

type MHSMPrivateEndpoint struct {
	// READ-ONLY; Full identifier of the private endpoint resource.
	ID *string `json:"id,omitempty" azure:"ro"`
}

MHSMPrivateEndpoint - Private endpoint object properties.

type MHSMPrivateEndpointConnection

type MHSMPrivateEndpointConnection struct {
	// Modified whenever there is a change in the state of private endpoint connection.
	Etag *string `json:"etag,omitempty"`

	// The supported Azure location where the managed HSM Pool should be created.
	Location *string `json:"location,omitempty"`

	// Resource properties.
	Properties *MHSMPrivateEndpointConnectionProperties `json:"properties,omitempty"`

	// SKU details
	SKU *ManagedHsmSKU `json:"sku,omitempty"`

	// Resource tags
	Tags map[string]*string `json:"tags,omitempty"`

	// READ-ONLY; The Azure Resource Manager resource ID for the managed HSM Pool.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the managed HSM Pool.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Metadata pertaining to creation and last modification of the key vault resource.
	SystemData *SystemData `json:"systemData,omitempty" azure:"ro"`

	// READ-ONLY; The resource type of the managed HSM Pool.
	Type *string `json:"type,omitempty" azure:"ro"`
}

MHSMPrivateEndpointConnection - Private endpoint connection resource.

func (MHSMPrivateEndpointConnection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MHSMPrivateEndpointConnection.

type MHSMPrivateEndpointConnectionItem

type MHSMPrivateEndpointConnectionItem struct {
	// Private endpoint connection properties.
	Properties *MHSMPrivateEndpointConnectionProperties `json:"properties,omitempty"`
}

MHSMPrivateEndpointConnectionItem - Private endpoint connection item.

type MHSMPrivateEndpointConnectionProperties

type MHSMPrivateEndpointConnectionProperties struct {
	// Properties of the private endpoint object.
	PrivateEndpoint *MHSMPrivateEndpoint `json:"privateEndpoint,omitempty"`

	// Approval state of the private link connection.
	PrivateLinkServiceConnectionState *MHSMPrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"`

	// Provisioning state of the private endpoint connection.
	ProvisioningState *PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"`
}

MHSMPrivateEndpointConnectionProperties - Properties of the private endpoint connection resource.

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 2021-11-01-preview 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/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewMHSMPrivateEndpointConnectionsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.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)
	}
	// TODO: use response item
	_ = res
}
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 2021-11-01-preview 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/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewMHSMPrivateEndpointConnectionsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Get(ctx,
		"sample-group",
		"sample-mhsm",
		"sample-pec",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
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. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-11-01-preview 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.ListByResource method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewMHSMPrivateEndpointConnectionsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListByResourcePager("sample-group",
		"sample-mhsm",
		nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
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 2021-11-01-preview 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/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewMHSMPrivateEndpointConnectionsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.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)
	}
	// TODO: use response item
	_ = res
}
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 {
	MHSMPrivateEndpointConnection
}

MHSMPrivateEndpointConnectionsClientDeleteResponse contains the response from method MHSMPrivateEndpointConnectionsClient.Delete.

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 {
	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.ListByResource method.

type MHSMPrivateEndpointConnectionsClientListByResourceResponse added in v0.3.0

type MHSMPrivateEndpointConnectionsClientListByResourceResponse struct {
	MHSMPrivateEndpointConnectionsListResult
}

MHSMPrivateEndpointConnectionsClientListByResourceResponse contains the response from method MHSMPrivateEndpointConnectionsClient.ListByResource.

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

	// The private endpoint connection associated with a managed HSM Pools.
	Value []*MHSMPrivateEndpointConnection `json:"value,omitempty"`
}

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

type MHSMPrivateLinkResource

type MHSMPrivateLinkResource struct {
	// The supported Azure location where the managed HSM Pool should be created.
	Location *string `json:"location,omitempty"`

	// Resource properties.
	Properties *MHSMPrivateLinkResourceProperties `json:"properties,omitempty"`

	// SKU details
	SKU *ManagedHsmSKU `json:"sku,omitempty"`

	// Resource tags
	Tags map[string]*string `json:"tags,omitempty"`

	// READ-ONLY; The Azure Resource Manager resource ID for the managed HSM Pool.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the managed HSM Pool.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Metadata pertaining to creation and last modification of the key vault resource.
	SystemData *SystemData `json:"systemData,omitempty" azure:"ro"`

	// READ-ONLY; The resource type of the managed HSM Pool.
	Type *string `json:"type,omitempty" azure:"ro"`
}

MHSMPrivateLinkResource - A private link resource

func (MHSMPrivateLinkResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MHSMPrivateLinkResource.

type MHSMPrivateLinkResourceListResult

type MHSMPrivateLinkResourceListResult struct {
	// Array of private link resources
	Value []*MHSMPrivateLinkResource `json:"value,omitempty"`
}

MHSMPrivateLinkResourceListResult - A list of private link resources

type MHSMPrivateLinkResourceProperties

type MHSMPrivateLinkResourceProperties struct {
	// Required DNS zone names of the the private link resource.
	RequiredZoneNames []*string `json:"requiredZoneNames,omitempty"`

	// READ-ONLY; Group identifier of private link resource.
	GroupID *string `json:"groupId,omitempty" azure:"ro"`

	// READ-ONLY; Required member names of private link resource.
	RequiredMembers []*string `json:"requiredMembers,omitempty" azure:"ro"`
}

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.

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 2021-11-01-preview 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/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewMHSMPrivateLinkResourcesClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.ListByMHSMResource(ctx,
		"sample-group",
		"sample-mhsm",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
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 {
	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 `json:"actionsRequired,omitempty"`

	// The reason for approval or rejection.
	Description *string `json:"description,omitempty"`

	// Indicates whether the connection has been approved, rejected or removed by the key vault owner.
	Status *PrivateEndpointServiceConnectionStatus `json:"status,omitempty"`
}

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

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

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

type ManagedHsm

type ManagedHsm struct {
	// The supported Azure location where the managed HSM Pool should be created.
	Location *string `json:"location,omitempty"`

	// Properties of the managed HSM
	Properties *ManagedHsmProperties `json:"properties,omitempty"`

	// SKU details
	SKU *ManagedHsmSKU `json:"sku,omitempty"`

	// Resource tags
	Tags map[string]*string `json:"tags,omitempty"`

	// READ-ONLY; The Azure Resource Manager resource ID for the managed HSM Pool.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the managed HSM Pool.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Metadata pertaining to creation and last modification of the key vault resource.
	SystemData *SystemData `json:"systemData,omitempty" azure:"ro"`

	// READ-ONLY; The resource type of the managed HSM Pool.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ManagedHsm - Resource information with extended details.

func (ManagedHsm) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagedHsm.

type ManagedHsmError

type ManagedHsmError struct {
	// READ-ONLY; The server error.
	Error *Error `json:"error,omitempty" azure:"ro"`
}

ManagedHsmError - The error exception.

type ManagedHsmListResult

type ManagedHsmListResult struct {
	// The URL to get the next set of managed HSM Pools.
	NextLink *string `json:"nextLink,omitempty"`

	// The list of managed HSM Pools.
	Value []*ManagedHsm `json:"value,omitempty"`
}

ManagedHsmListResult - List of managed HSM Pools

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

	// 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. The setting is effective only if soft delete
	// is also enabled. Enabling this functionality is irreversible.
	EnablePurgeProtection *bool `json:"enablePurgeProtection,omitempty"`

	// Property to specify whether the 'soft delete' functionality is enabled for this managed HSM pool. If it's not set to any
	// value(true or false) when creating new managed HSM pool, it will be set to true
	// by default. Once set to true, it cannot be reverted to false.
	EnableSoftDelete *bool `json:"enableSoftDelete,omitempty"`

	// Array of initial administrators object ids for this managed hsm pool.
	InitialAdminObjectIDs []*string `json:"initialAdminObjectIds,omitempty"`

	// Rules governing the accessibility of the key vault from specific network locations.
	NetworkACLs *MHSMNetworkRuleSet `json:"networkAcls,omitempty"`

	// Control permission for data plane traffic coming from public networks while private endpoint is enabled.
	PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"`

	// softDelete data retention days. It accepts >=7 and <=90.
	SoftDeleteRetentionInDays *int32 `json:"softDeleteRetentionInDays,omitempty"`

	// The Azure Active Directory tenant ID that should be used for authenticating requests to the managed HSM pool.
	TenantID *string `json:"tenantId,omitempty"`

	// READ-ONLY; The URI of the managed hsm pool for performing operations on keys.
	HsmURI *string `json:"hsmUri,omitempty" azure:"ro"`

	// READ-ONLY; List of private endpoint connections associated with the managed hsm pool.
	PrivateEndpointConnections []*MHSMPrivateEndpointConnectionItem `json:"privateEndpointConnections,omitempty" azure:"ro"`

	// READ-ONLY; Provisioning state.
	ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"`

	// READ-ONLY; The scheduled purge date in UTC.
	ScheduledPurgeDate *time.Time `json:"scheduledPurgeDate,omitempty" azure:"ro"`

	// READ-ONLY; Resource Status Message.
	StatusMessage *string `json:"statusMessage,omitempty" azure:"ro"`
}

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 ManagedHsmResource

type ManagedHsmResource struct {
	// The supported Azure location where the managed HSM Pool should be created.
	Location *string `json:"location,omitempty"`

	// SKU details
	SKU *ManagedHsmSKU `json:"sku,omitempty"`

	// Resource tags
	Tags map[string]*string `json:"tags,omitempty"`

	// READ-ONLY; The Azure Resource Manager resource ID for the managed HSM Pool.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the managed HSM Pool.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Metadata pertaining to creation and last modification of the key vault resource.
	SystemData *SystemData `json:"systemData,omitempty" azure:"ro"`

	// READ-ONLY; The resource type of the managed HSM Pool.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ManagedHsmResource - Managed HSM resource

func (ManagedHsmResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagedHsmResource.

type ManagedHsmSKU

type ManagedHsmSKU struct {
	// REQUIRED; SKU Family of the managed HSM Pool
	Family *ManagedHsmSKUFamily `json:"family,omitempty"`

	// REQUIRED; SKU of the managed HSM Pool
	Name *ManagedHsmSKUName `json:"name,omitempty"`
}

ManagedHsmSKU - SKU details

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 (
	ManagedHsmSKUNameStandardB1 ManagedHsmSKUName = "Standard_B1"
	ManagedHsmSKUNameCustomB32  ManagedHsmSKUName = "Custom_B32"
)

func PossibleManagedHsmSKUNameValues

func PossibleManagedHsmSKUNameValues() []ManagedHsmSKUName

PossibleManagedHsmSKUNameValues returns the possible values for the ManagedHsmSKUName const type.

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 2021-11-01-preview 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/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewManagedHsmsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.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(true),
				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)
	}
	// TODO: use response item
	_ = res
}
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 2021-11-01-preview 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/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewManagedHsmsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.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 2021-11-01-preview 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/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewManagedHsmsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.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 2021-11-01-preview 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/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewManagedHsmsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.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)
	}
	// TODO: use response item
	_ = res
}
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 2021-11-01-preview 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/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewManagedHsmsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Get(ctx,
		"hsm-group",
		"hsm1",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
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 2021-11-01-preview 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/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewManagedHsmsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.GetDeleted(ctx,
		"hsm1",
		"westus",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
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. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-11-01-preview resourceGroupName - Name of the resource group that contains the managed HSM pool. options - ManagedHsmsClientListByResourceGroupOptions contains the optional parameters for the ManagedHsmsClient.ListByResourceGroup method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewManagedHsmsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListByResourceGroupPager("hsm-group",
		&armkeyvault.ManagedHsmsClientListByResourceGroupOptions{Top: nil})
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

func (*ManagedHsmsClient) NewListBySubscriptionPager added in v0.5.0

NewListBySubscriptionPager - The List operation gets information about the managed HSM Pools associated with the subscription. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-11-01-preview options - ManagedHsmsClientListBySubscriptionOptions contains the optional parameters for the ManagedHsmsClient.ListBySubscription method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewManagedHsmsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListBySubscriptionPager(&armkeyvault.ManagedHsmsClientListBySubscriptionOptions{Top: nil})
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

func (*ManagedHsmsClient) NewListDeletedPager added in v0.5.0

NewListDeletedPager - The List operation gets information about the deleted managed HSMs associated with the subscription. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-11-01-preview options - ManagedHsmsClientListDeletedOptions contains the optional parameters for the ManagedHsmsClient.ListDeleted method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewManagedHsmsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListDeletedPager(nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
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 ManagedHsmsClientCreateOrUpdateResponse added in v0.3.0

type ManagedHsmsClientCreateOrUpdateResponse struct {
	ManagedHsm
}

ManagedHsmsClientCreateOrUpdateResponse contains the response from method ManagedHsmsClient.CreateOrUpdate.

type ManagedHsmsClientDeleteResponse added in v0.3.0

type ManagedHsmsClientDeleteResponse struct {
}

ManagedHsmsClientDeleteResponse contains the response from method ManagedHsmsClient.Delete.

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 {
	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.ListByResourceGroup method.

type ManagedHsmsClientListByResourceGroupResponse added in v0.3.0

type ManagedHsmsClientListByResourceGroupResponse struct {
	ManagedHsmListResult
}

ManagedHsmsClientListByResourceGroupResponse contains the response from method ManagedHsmsClient.ListByResourceGroup.

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.ListBySubscription method.

type ManagedHsmsClientListBySubscriptionResponse added in v0.3.0

type ManagedHsmsClientListBySubscriptionResponse struct {
	ManagedHsmListResult
}

ManagedHsmsClientListBySubscriptionResponse contains the response from method ManagedHsmsClient.ListBySubscription.

type ManagedHsmsClientListDeletedOptions added in v0.3.0

type ManagedHsmsClientListDeletedOptions struct {
}

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

type ManagedHsmsClientListDeletedResponse added in v0.3.0

type ManagedHsmsClientListDeletedResponse struct {
	DeletedManagedHsmListResult
}

ManagedHsmsClientListDeletedResponse contains the response from method ManagedHsmsClient.ListDeleted.

type ManagedHsmsClientPurgeDeletedResponse added in v0.3.0

type ManagedHsmsClientPurgeDeletedResponse struct {
}

ManagedHsmsClientPurgeDeletedResponse contains the response from method ManagedHsmsClient.PurgeDeleted.

type ManagedHsmsClientUpdateResponse added in v0.3.0

type ManagedHsmsClientUpdateResponse struct {
	ManagedHsm
}

ManagedHsmsClientUpdateResponse contains the response from method ManagedHsmsClient.Update.

type MetricSpecification

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

	// The dimensions of metric
	Dimensions []*DimensionProperties `json:"dimensions,omitempty"`

	// Display description of metric specification.
	DisplayDescription *string `json:"displayDescription,omitempty"`

	// Display name of metric specification.
	DisplayName *string `json:"displayName,omitempty"`

	// Property to specify whether to fill gap with zero.
	FillGapWithZero *bool `json:"fillGapWithZero,omitempty"`

	// The internal metric name.
	InternalMetricName *string `json:"internalMetricName,omitempty"`

	// The metric lock aggregation type.
	LockAggregationType *string `json:"lockAggregationType,omitempty"`

	// Name of metric specification.
	Name *string `json:"name,omitempty"`

	// The supported aggregation types for the metrics.
	SupportedAggregationTypes []*string `json:"supportedAggregationTypes,omitempty"`

	// The supported time grain types for the metrics.
	SupportedTimeGrainTypes []*string `json:"supportedTimeGrainTypes,omitempty"`

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

MetricSpecification - Metric specification of operation.

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

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

	// The list of IP address rules.
	IPRules []*IPRule `json:"ipRules,omitempty"`

	// The list of virtual network rules.
	VirtualNetworkRules []*VirtualNetworkRule `json:"virtualNetworkRules,omitempty"`
}

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.

type Operation

type Operation struct {
	// Display metadata associated with the operation.
	Display *OperationDisplay `json:"display,omitempty"`

	// Property to specify whether the action is a data action.
	IsDataAction *bool `json:"isDataAction,omitempty"`

	// Operation name: {provider}/{resource}/{operation}
	Name *string `json:"name,omitempty"`

	// Properties of operation, include metric specifications.
	OperationProperties *OperationProperties `json:"properties,omitempty"`

	// The origin of operations.
	Origin *string `json:"origin,omitempty"`
}

Operation - Key Vault REST API operation definition.

type OperationDisplay

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

	// Type of operation: get, read, delete, etc.
	Operation *string `json:"operation,omitempty"`

	// Service provider: Microsoft Key Vault.
	Provider *string `json:"provider,omitempty"`

	// Resource on which the operation is performed etc.
	Resource *string `json:"resource,omitempty"`
}

OperationDisplay - Display metadata associated with the operation.

type OperationListResult

type OperationListResult struct {
	// The URL to get the next set of operations.
	NextLink *string `json:"nextLink,omitempty"`

	// List of Storage operations supported by the Storage resource provider.
	Value []*Operation `json:"value,omitempty"`
}

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.

type OperationProperties

type OperationProperties struct {
	// One property of operation, include metric specifications.
	ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"`
}

OperationProperties - Properties of operation, include metric specifications.

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. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-11-01-preview options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewOperationsClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListPager(nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

type OperationsClientListOptions added in v0.3.0

type OperationsClientListOptions struct {
}

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

type OperationsClientListResponse added in v0.3.0

type OperationsClientListResponse struct {
	OperationListResult
}

OperationsClientListResponse contains the response from method OperationsClient.List.

type Permissions

type Permissions struct {
	// Permissions to certificates
	Certificates []*CertificatePermissions `json:"certificates,omitempty"`

	// Permissions to keys
	Keys []*KeyPermissions `json:"keys,omitempty"`

	// Permissions to secrets
	Secrets []*SecretPermissions `json:"secrets,omitempty"`

	// Permissions to storage accounts
	Storage []*StoragePermissions `json:"storage,omitempty"`
}

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.

type PrivateEndpoint

type PrivateEndpoint struct {
	// READ-ONLY; Full identifier of the private endpoint resource.
	ID *string `json:"id,omitempty" azure:"ro"`
}

PrivateEndpoint - Private endpoint object properties.

type PrivateEndpointConnection

type PrivateEndpointConnection struct {
	// Modified whenever there is a change in the state of private endpoint connection.
	Etag *string `json:"etag,omitempty"`

	// Resource properties.
	Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"`

	// READ-ONLY; Fully qualified identifier of the key vault resource.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Azure location of the key vault resource.
	Location *string `json:"location,omitempty" azure:"ro"`

	// READ-ONLY; Name of the key vault resource.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Tags assigned to the key vault resource.
	Tags map[string]*string `json:"tags,omitempty" azure:"ro"`

	// READ-ONLY; Resource type of the key vault resource.
	Type *string `json:"type,omitempty" azure:"ro"`
}

PrivateEndpointConnection - Private endpoint connection resource.

func (PrivateEndpointConnection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection.

type PrivateEndpointConnectionItem

type PrivateEndpointConnectionItem struct {
	// Modified whenever there is a change in the state of private endpoint connection.
	Etag *string `json:"etag,omitempty"`

	// Id of private endpoint connection.
	ID *string `json:"id,omitempty"`

	// Private endpoint connection properties.
	Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"`
}

PrivateEndpointConnectionItem - Private endpoint connection item.

type PrivateEndpointConnectionListResult

type PrivateEndpointConnectionListResult struct {
	// The URL to get the next set of private endpoint connections.
	NextLink *string `json:"nextLink,omitempty"`

	// The list of private endpoint connections.
	Value []*PrivateEndpointConnection `json:"value,omitempty"`
}

PrivateEndpointConnectionListResult - List of private endpoint connections.

type PrivateEndpointConnectionProperties

type PrivateEndpointConnectionProperties struct {
	// Properties of the private endpoint object.
	PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"`

	// Approval state of the private link connection.
	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"`

	// Provisioning state of the private endpoint connection.
	ProvisioningState *PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"`
}

PrivateEndpointConnectionProperties - Properties of the private endpoint connection resource.

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 2021-11-01-preview 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/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewPrivateEndpointConnectionsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.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)
	}
	// TODO: use response item
	_ = res
}
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 2021-11-01-preview 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/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewPrivateEndpointConnectionsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Get(ctx,
		"sample-group",
		"sample-vault",
		"sample-pec",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*PrivateEndpointConnectionsClient) NewListByResourcePager added in v0.5.0

NewListByResourcePager - The List operation gets information about the private endpoint connections associated with the vault. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-11-01-preview 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.ListByResource method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewPrivateEndpointConnectionsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListByResourcePager("sample-group",
		"sample-vault",
		nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
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 2021-11-01-preview 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/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewPrivateEndpointConnectionsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.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)
	}
	// TODO: use response item
	_ = res
}
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 {
	PrivateEndpointConnection
}

PrivateEndpointConnectionsClientDeleteResponse contains the response from method PrivateEndpointConnectionsClient.Delete.

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 {
	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.ListByResource method.

type PrivateEndpointConnectionsClientListByResourceResponse added in v0.3.0

type PrivateEndpointConnectionsClientListByResourceResponse struct {
	PrivateEndpointConnectionListResult
}

PrivateEndpointConnectionsClientListByResourceResponse contains the response from method PrivateEndpointConnectionsClient.ListByResource.

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

	// READ-ONLY; Fully qualified identifier of the key vault resource.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Azure location of the key vault resource.
	Location *string `json:"location,omitempty" azure:"ro"`

	// READ-ONLY; Name of the key vault resource.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Tags assigned to the key vault resource.
	Tags map[string]*string `json:"tags,omitempty" azure:"ro"`

	// READ-ONLY; Resource type of the key vault resource.
	Type *string `json:"type,omitempty" azure:"ro"`
}

PrivateLinkResource - A private link resource

func (PrivateLinkResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource.

type PrivateLinkResourceListResult

type PrivateLinkResourceListResult struct {
	// Array of private link resources
	Value []*PrivateLinkResource `json:"value,omitempty"`
}

PrivateLinkResourceListResult - A list of private link resources

type PrivateLinkResourceProperties

type PrivateLinkResourceProperties struct {
	// Required DNS zone names of the the private link resource.
	RequiredZoneNames []*string `json:"requiredZoneNames,omitempty"`

	// READ-ONLY; Group identifier of private link resource.
	GroupID *string `json:"groupId,omitempty" azure:"ro"`

	// READ-ONLY; Required member names of private link resource.
	RequiredMembers []*string `json:"requiredMembers,omitempty" azure:"ro"`
}

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.

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 2021-11-01-preview 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/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewPrivateLinkResourcesClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.ListByVault(ctx,
		"sample-group",
		"sample-vault",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
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 {
	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 `json:"actionsRequired,omitempty"`

	// The reason for approval or rejection.
	Description *string `json:"description,omitempty"`

	// Indicates whether the connection has been approved, rejected or removed by the key vault owner.
	Status *PrivateEndpointServiceConnectionStatus `json:"status,omitempty"`
}

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

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 for data plane traffic coming from public networks while private endpoint is enabled.

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 `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Azure location of the key vault resource.
	Location *string `json:"location,omitempty" azure:"ro"`

	// READ-ONLY; Name of the key vault resource.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Tags assigned to the key vault resource.
	Tags map[string]*string `json:"tags,omitempty" azure:"ro"`

	// READ-ONLY; Resource type of the key vault resource.
	Type *string `json:"type,omitempty" azure:"ro"`
}

Resource - Key Vault resource

func (Resource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Resource.

type ResourceListResult

type ResourceListResult struct {
	// The URL to get the next set of vault resources.
	NextLink *string `json:"nextLink,omitempty"`

	// The list of vault resources.
	Value []*Resource `json:"value,omitempty"`
}

ResourceListResult - List of vault resources.

type RotationPolicy

type RotationPolicy struct {
	// The attributes of key rotation policy.
	Attributes *KeyRotationPolicyAttributes `json:"attributes,omitempty"`

	// The lifetimeActions for key rotation action.
	LifetimeActions []*LifetimeAction `json:"lifetimeActions,omitempty"`
}

func (RotationPolicy) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type RotationPolicy.

type SKU

type SKU struct {
	// REQUIRED; SKU family name
	Family *SKUFamily `json:"family,omitempty"`

	// REQUIRED; SKU name to specify whether the key vault is a standard vault or a premium vault.
	Name *SKUName `json:"name,omitempty"`
}

SKU details

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 (
	SKUNameStandard SKUName = "standard"
	SKUNamePremium  SKUName = "premium"
)

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

	// READ-ONLY; Fully qualified identifier of the key vault resource.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Azure location of the key vault resource.
	Location *string `json:"location,omitempty" azure:"ro"`

	// READ-ONLY; Name of the key vault resource.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Tags assigned to the key vault resource.
	Tags map[string]*string `json:"tags,omitempty" azure:"ro"`

	// READ-ONLY; Resource type of the key vault resource.
	Type *string `json:"type,omitempty" azure:"ro"`
}

Secret - Resource information with extended details.

func (Secret) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Secret.

type SecretAttributes

type SecretAttributes struct {
	// Determines whether the object is enabled.
	Enabled *bool `json:"enabled,omitempty"`

	// Expiry date in seconds since 1970-01-01T00:00:00Z.
	Expires *time.Time `json:"exp,omitempty"`

	// Not before date in seconds since 1970-01-01T00:00:00Z.
	NotBefore *time.Time `json:"nbf,omitempty"`

	// READ-ONLY; Creation time in seconds since 1970-01-01T00:00:00Z.
	Created *time.Time `json:"created,omitempty" azure:"ro"`

	// READ-ONLY; Last updated time in seconds since 1970-01-01T00:00:00Z.
	Updated *time.Time `json:"updated,omitempty" azure:"ro"`
}

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

	// The tags that will be assigned to the secret.
	Tags map[string]*string `json:"tags,omitempty"`
}

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.

type SecretListResult

type SecretListResult struct {
	// The URL to get the next set of secrets.
	NextLink *string `json:"nextLink,omitempty"`

	// The list of secrets.
	Value []*Secret `json:"value,omitempty"`
}

SecretListResult - List of secrets

type SecretPatchParameters

type SecretPatchParameters struct {
	// Properties of the secret
	Properties *SecretPatchProperties `json:"properties,omitempty"`

	// The tags that will be assigned to the secret.
	Tags map[string]*string `json:"tags,omitempty"`
}

SecretPatchParameters - Parameters for patching a secret

func (SecretPatchParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SecretPatchParameters.

type SecretPatchProperties

type SecretPatchProperties struct {
	// The attributes of the secret.
	Attributes *SecretAttributes `json:"attributes,omitempty"`

	// The content type of the secret.
	ContentType *string `json:"contentType,omitempty"`

	// The value of the secret.
	Value *string `json:"value,omitempty"`
}

SecretPatchProperties - Properties of the secret

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

	// The content type of the secret.
	ContentType *string `json:"contentType,omitempty"`

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

	// READ-ONLY; The URI to retrieve the current version of the secret.
	SecretURI *string `json:"secretUri,omitempty" azure:"ro"`

	// READ-ONLY; The URI to retrieve the specific version of the secret.
	SecretURIWithVersion *string `json:"secretUriWithVersion,omitempty" azure:"ro"`
}

SecretProperties - Properties of the secret

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 2021-11-01-preview 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 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/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewSecretsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.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)
	}
	// TODO: use response item
	_ = res
}
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 2021-11-01-preview 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/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewSecretsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Get(ctx,
		"sample-group",
		"sample-vault",
		"secret-name",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
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. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-11-01-preview 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.List method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewSecretsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListPager("sample-group",
		"sample-vault",
		&armkeyvault.SecretsClientListOptions{Top: nil})
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
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 2021-11-01-preview 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/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewSecretsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.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)
	}
	// TODO: use response item
	_ = res
}
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 {
	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 {
	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.List method.

type SecretsClientListResponse added in v0.3.0

type SecretsClientListResponse struct {
	SecretListResult
}

SecretsClientListResponse contains the response from method SecretsClient.List.

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 {
	Secret
}

SecretsClientUpdateResponse contains the response from method SecretsClient.Update.

type ServiceSpecification

type ServiceSpecification struct {
	// Log specifications of operation.
	LogSpecifications []*LogSpecification `json:"logSpecifications,omitempty"`

	// Metric specifications of operation.
	MetricSpecifications []*MetricSpecification `json:"metricSpecifications,omitempty"`
}

ServiceSpecification - One property of operation, include log specifications.

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

	// The identity that created the key vault resource.
	CreatedBy *string `json:"createdBy,omitempty"`

	// The type of identity that created the key vault resource.
	CreatedByType *IdentityType `json:"createdByType,omitempty"`

	// The timestamp of the key vault resource last modification (UTC).
	LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"`

	// The identity that last modified the key vault resource.
	LastModifiedBy *string `json:"lastModifiedBy,omitempty"`

	// The type of identity that last modified the key vault resource.
	LastModifiedByType *IdentityType `json:"lastModifiedByType,omitempty"`
}

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

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

type Vault

type Vault struct {
	// REQUIRED; Properties of the vault
	Properties *VaultProperties `json:"properties,omitempty"`

	// Azure location of the key vault resource.
	Location *string `json:"location,omitempty"`

	// Tags assigned to the key vault resource.
	Tags map[string]*string `json:"tags,omitempty"`

	// READ-ONLY; Fully qualified identifier of the key vault resource.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Name of the key vault resource.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; System metadata for the key vault.
	SystemData *SystemData `json:"systemData,omitempty" azure:"ro"`

	// READ-ONLY; Resource type of the key vault resource.
	Type *string `json:"type,omitempty" azure:"ro"`
}

Vault - Resource information with extended details.

type VaultAccessPolicyParameters

type VaultAccessPolicyParameters struct {
	// REQUIRED; Properties of the access policy
	Properties *VaultAccessPolicyProperties `json:"properties,omitempty"`

	// READ-ONLY; The resource id of the access policy.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The resource type of the access policy.
	Location *string `json:"location,omitempty" azure:"ro"`

	// READ-ONLY; The resource name of the access policy.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The resource name of the access policy.
	Type *string `json:"type,omitempty" azure:"ro"`
}

VaultAccessPolicyParameters - Parameters for updating the access policy in a vault

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

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.

type VaultCheckNameAvailabilityParameters

type VaultCheckNameAvailabilityParameters struct {
	// REQUIRED; The vault name.
	Name *string `json:"name,omitempty"`

	// REQUIRED; The type of resource, Microsoft.KeyVault/vaults
	Type *string `json:"type,omitempty"`
}

VaultCheckNameAvailabilityParameters - The parameters used to check the availability of the vault name.

type VaultCreateOrUpdateParameters

type VaultCreateOrUpdateParameters struct {
	// REQUIRED; The supported Azure location where the key vault should be created.
	Location *string `json:"location,omitempty"`

	// REQUIRED; Properties of the vault
	Properties *VaultProperties `json:"properties,omitempty"`

	// The tags that will be assigned to the key vault.
	Tags map[string]*string `json:"tags,omitempty"`
}

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.

type VaultListResult

type VaultListResult struct {
	// The URL to get the next set of vaults.
	NextLink *string `json:"nextLink,omitempty"`

	// The list of vaults.
	Value []*Vault `json:"value,omitempty"`
}

VaultListResult - List of vaults

type VaultPatchParameters

type VaultPatchParameters struct {
	// Properties of the vault
	Properties *VaultPatchProperties `json:"properties,omitempty"`

	// The tags that will be assigned to the key vault.
	Tags map[string]*string `json:"tags,omitempty"`
}

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.

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

	// The vault's create mode to indicate whether the vault need to be recovered or not.
	CreateMode *CreateMode `json:"createMode,omitempty"`

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

	// 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 (warning: this is a preview feature). 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 `json:"enableRbacAuthorization,omitempty"`

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

	// Property to specify whether Azure Virtual Machines are permitted to retrieve certificates stored as secrets from the key
	// vault.
	EnabledForDeployment *bool `json:"enabledForDeployment,omitempty"`

	// Property to specify whether Azure Disk Encryption is permitted to retrieve secrets from the vault and unwrap keys.
	EnabledForDiskEncryption *bool `json:"enabledForDiskEncryption,omitempty"`

	// Property to specify whether Azure Resource Manager is permitted to retrieve secrets from the key vault.
	EnabledForTemplateDeployment *bool `json:"enabledForTemplateDeployment,omitempty"`

	// A collection of rules governing the accessibility of the vault from specific network locations.
	NetworkACLs *NetworkRuleSet `json:"networkAcls,omitempty"`

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

	// SKU details
	SKU *SKU `json:"sku,omitempty"`

	// softDelete data retention days. It accepts >=7 and <=90.
	SoftDeleteRetentionInDays *int32 `json:"softDeleteRetentionInDays,omitempty"`

	// The Azure Active Directory tenant ID that should be used for authenticating requests to the key vault.
	TenantID *string `json:"tenantId,omitempty"`
}

VaultPatchProperties - Properties of the vault

func (VaultPatchProperties) MarshalJSON

func (v VaultPatchProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VaultPatchProperties.

type VaultProperties

type VaultProperties struct {
	// REQUIRED; SKU details
	SKU *SKU `json:"sku,omitempty"`

	// REQUIRED; The Azure Active Directory tenant ID that should be used for authenticating requests to the key vault.
	TenantID *string `json:"tenantId,omitempty"`

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

	// The vault's create mode to indicate whether the vault need to be recovered or not.
	CreateMode *CreateMode `json:"createMode,omitempty"`

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

	// 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 (warning: this is a preview feature). 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 `json:"enableRbacAuthorization,omitempty"`

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

	// Property to specify whether Azure Virtual Machines are permitted to retrieve certificates stored as secrets from the key
	// vault.
	EnabledForDeployment *bool `json:"enabledForDeployment,omitempty"`

	// Property to specify whether Azure Disk Encryption is permitted to retrieve secrets from the vault and unwrap keys.
	EnabledForDiskEncryption *bool `json:"enabledForDiskEncryption,omitempty"`

	// Property to specify whether Azure Resource Manager is permitted to retrieve secrets from the key vault.
	EnabledForTemplateDeployment *bool `json:"enabledForTemplateDeployment,omitempty"`

	// Rules governing the accessibility of the key vault from specific network locations.
	NetworkACLs *NetworkRuleSet `json:"networkAcls,omitempty"`

	// Provisioning state of the vault.
	ProvisioningState *VaultProvisioningState `json:"provisioningState,omitempty"`

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

	// softDelete data retention days. It accepts >=7 and <=90.
	SoftDeleteRetentionInDays *int32 `json:"softDeleteRetentionInDays,omitempty"`

	// The URI of the vault for performing operations on keys and secrets.
	VaultURI *string `json:"vaultUri,omitempty"`

	// READ-ONLY; The resource id of HSM Pool.
	HsmPoolResourceID *string `json:"hsmPoolResourceId,omitempty" azure:"ro"`

	// READ-ONLY; List of private endpoint connections associated with the key vault.
	PrivateEndpointConnections []*PrivateEndpointConnectionItem `json:"privateEndpointConnections,omitempty" azure:"ro"`
}

VaultProperties - Properties of the vault

func (VaultProperties) MarshalJSON

func (v VaultProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller 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 2021-11-01-preview 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

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewVaultsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.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)
	}
	// TODO: use response item
	_ = res
}
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 2021-11-01-preview 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/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewVaultsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.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 2021-11-01-preview 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/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewVaultsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.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)
	}
	// TODO: use response item
	_ = res
}
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 2021-11-01-preview 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/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewVaultsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = client.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 2021-11-01-preview 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/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewVaultsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Get(ctx,
		"sample-resource-group",
		"sample-vault",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
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 2021-11-01-preview 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/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewVaultsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.GetDeleted(ctx,
		"sample-vault",
		"westus",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
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. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-11-01-preview resourceGroupName - The name of the Resource Group to which the vault belongs. options - VaultsClientListByResourceGroupOptions contains the optional parameters for the VaultsClient.ListByResourceGroup method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewVaultsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListByResourceGroupPager("sample-group",
		&armkeyvault.VaultsClientListByResourceGroupOptions{Top: to.Ptr[int32](1)})
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

func (*VaultsClient) NewListBySubscriptionPager added in v0.5.0

NewListBySubscriptionPager - The List operation gets information about the vaults associated with the subscription. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-11-01-preview options - VaultsClientListBySubscriptionOptions contains the optional parameters for the VaultsClient.ListBySubscription method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewVaultsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListBySubscriptionPager(&armkeyvault.VaultsClientListBySubscriptionOptions{Top: to.Ptr[int32](1)})
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

func (*VaultsClient) NewListDeletedPager added in v0.5.0

NewListDeletedPager - Gets information about the deleted vaults in a subscription. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-11-01-preview options - VaultsClientListDeletedOptions contains the optional parameters for the VaultsClient.ListDeleted method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewVaultsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListDeletedPager(nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

func (*VaultsClient) NewListPager added in v0.5.0

NewListPager - The List operation gets information about the vaults associated with the subscription. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-11-01-preview options - VaultsClientListOptions contains the optional parameters for the VaultsClient.List method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewVaultsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListPager(&armkeyvault.VaultsClientListOptions{Top: to.Ptr[int32](1)})
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
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 2021-11-01-preview 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/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewVaultsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.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)
	}
	// TODO: use response item
	_ = res
}
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 2021-11-01-preview 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/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/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()
	client, err := armkeyvault.NewVaultsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.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)
	}
	// TODO: use response item
	_ = res
}
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 {
	CheckNameAvailabilityResult
}

VaultsClientCheckNameAvailabilityResponse contains the response from method VaultsClient.CheckNameAvailability.

type VaultsClientCreateOrUpdateResponse added in v0.3.0

type VaultsClientCreateOrUpdateResponse struct {
	Vault
}

VaultsClientCreateOrUpdateResponse contains the response from method VaultsClient.CreateOrUpdate.

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 {
	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 {
	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.ListByResourceGroup method.

type VaultsClientListByResourceGroupResponse added in v0.3.0

type VaultsClientListByResourceGroupResponse struct {
	VaultListResult
}

VaultsClientListByResourceGroupResponse contains the response from method VaultsClient.ListByResourceGroup.

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.ListBySubscription method.

type VaultsClientListBySubscriptionResponse added in v0.3.0

type VaultsClientListBySubscriptionResponse struct {
	VaultListResult
}

VaultsClientListBySubscriptionResponse contains the response from method VaultsClient.ListBySubscription.

type VaultsClientListDeletedOptions added in v0.3.0

type VaultsClientListDeletedOptions struct {
}

VaultsClientListDeletedOptions contains the optional parameters for the VaultsClient.ListDeleted method.

type VaultsClientListDeletedResponse added in v0.3.0

type VaultsClientListDeletedResponse struct {
	DeletedVaultListResult
}

VaultsClientListDeletedResponse contains the response from method VaultsClient.ListDeleted.

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.List method.

type VaultsClientListResponse added in v0.3.0

type VaultsClientListResponse struct {
	ResourceListResult
}

VaultsClientListResponse contains the response from method VaultsClient.List.

type VaultsClientPurgeDeletedResponse added in v0.3.0

type VaultsClientPurgeDeletedResponse struct {
}

VaultsClientPurgeDeletedResponse contains the response from method VaultsClient.PurgeDeleted.

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

	// Property to specify whether NRP will ignore the check if parent subnet has serviceEndpoints configured.
	IgnoreMissingVnetServiceEndpoint *bool `json:"ignoreMissingVnetServiceEndpoint,omitempty"`
}

VirtualNetworkRule - A rule governing the accessibility of a vault from a specific virtual network.

Jump to

Keyboard shortcuts

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