vaults

package
v0.20240117.1113630 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MPL-2.0 Imports: 16 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2021-12-01/vaults Documentation

The vaults SDK allows for interaction with the Azure Resource Manager Service recoveryservices (API Version 2021-12-01).

This readme covers example usages, but further information on using this SDK can be found in the project root.

Import Path

import "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2021-12-01/vaults"

Client Initialization

client := vaults.NewVaultsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: VaultsClient.CreateOrUpdate

ctx := context.TODO()
id := vaults.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue")

payload := vaults.Vault{
	// ...
}


if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Example Usage: VaultsClient.Delete

ctx := context.TODO()
id := vaults.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue")

read, err := client.Delete(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: VaultsClient.Get

ctx := context.TODO()
id := vaults.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue")

read, err := client.Get(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: VaultsClient.ListByResourceGroup

ctx := context.TODO()
id := vaults.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group")

// alternatively `client.ListByResourceGroup(ctx, id)` can be used to do batched pagination
items, err := client.ListByResourceGroupComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: VaultsClient.ListBySubscriptionId

ctx := context.TODO()
id := vaults.NewSubscriptionID("12345678-1234-9876-4563-123456789012")

// alternatively `client.ListBySubscriptionId(ctx, id)` can be used to do batched pagination
items, err := client.ListBySubscriptionIdComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: VaultsClient.Update

ctx := context.TODO()
id := vaults.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue")

payload := vaults.PatchVault{
	// ...
}


if err := client.UpdateThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForInfrastructureEncryptionState

func PossibleValuesForInfrastructureEncryptionState() []string

func PossibleValuesForPrivateEndpointConnectionStatus

func PossibleValuesForPrivateEndpointConnectionStatus() []string

func PossibleValuesForProvisioningState

func PossibleValuesForProvisioningState() []string

func PossibleValuesForResourceMoveState

func PossibleValuesForResourceMoveState() []string

func PossibleValuesForSkuName

func PossibleValuesForSkuName() []string

func PossibleValuesForTriggerType

func PossibleValuesForTriggerType() []string

func PossibleValuesForVaultPrivateEndpointState

func PossibleValuesForVaultPrivateEndpointState() []string

func PossibleValuesForVaultUpgradeState

func PossibleValuesForVaultUpgradeState() []string

func ValidateVaultID

func ValidateVaultID(input interface{}, key string) (warnings []string, errors []error)

ValidateVaultID checks that 'input' can be parsed as a Vault ID

Types

type CmkKekIdentity

type CmkKekIdentity struct {
	UseSystemAssignedIdentity *bool   `json:"useSystemAssignedIdentity,omitempty"`
	UserAssignedIdentity      *string `json:"userAssignedIdentity,omitempty"`
}

type CmkKeyVaultProperties

type CmkKeyVaultProperties struct {
	KeyUri *string `json:"keyUri,omitempty"`
}

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

type DeleteOperationResponse

type DeleteOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
}

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *Vault
}

type InfrastructureEncryptionState

type InfrastructureEncryptionState string
const (
	InfrastructureEncryptionStateDisabled InfrastructureEncryptionState = "Disabled"
	InfrastructureEncryptionStateEnabled  InfrastructureEncryptionState = "Enabled"
)

func (*InfrastructureEncryptionState) UnmarshalJSON added in v0.20230809.1081239

func (s *InfrastructureEncryptionState) UnmarshalJSON(bytes []byte) error

type ListByResourceGroupCompleteResult

type ListByResourceGroupCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []Vault
}

type ListByResourceGroupOperationResponse

type ListByResourceGroupOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]Vault
}

type ListBySubscriptionIdCompleteResult

type ListBySubscriptionIdCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []Vault
}

type ListBySubscriptionIdOperationResponse

type ListBySubscriptionIdOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]Vault
}

type PatchVault

type PatchVault struct {
	Etag       *string                            `json:"etag,omitempty"`
	Id         *string                            `json:"id,omitempty"`
	Identity   *identity.SystemAndUserAssignedMap `json:"identity,omitempty"`
	Location   *string                            `json:"location,omitempty"`
	Name       *string                            `json:"name,omitempty"`
	Properties *VaultProperties                   `json:"properties,omitempty"`
	Sku        *Sku                               `json:"sku,omitempty"`
	Tags       *map[string]string                 `json:"tags,omitempty"`
	Type       *string                            `json:"type,omitempty"`
}

type PrivateEndpoint

type PrivateEndpoint struct {
	Id *string `json:"id,omitempty"`
}

type PrivateEndpointConnection

type PrivateEndpointConnection struct {
	PrivateEndpoint                   *PrivateEndpoint                   `json:"privateEndpoint,omitempty"`
	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"`
	ProvisioningState                 *ProvisioningState                 `json:"provisioningState,omitempty"`
}

type PrivateEndpointConnectionStatus

type PrivateEndpointConnectionStatus string
const (
	PrivateEndpointConnectionStatusApproved     PrivateEndpointConnectionStatus = "Approved"
	PrivateEndpointConnectionStatusDisconnected PrivateEndpointConnectionStatus = "Disconnected"
	PrivateEndpointConnectionStatusPending      PrivateEndpointConnectionStatus = "Pending"
	PrivateEndpointConnectionStatusRejected     PrivateEndpointConnectionStatus = "Rejected"
)

func (*PrivateEndpointConnectionStatus) UnmarshalJSON added in v0.20230809.1081239

func (s *PrivateEndpointConnectionStatus) UnmarshalJSON(bytes []byte) error

type PrivateEndpointConnectionVaultProperties

type PrivateEndpointConnectionVaultProperties struct {
	Id         *string                    `json:"id,omitempty"`
	Location   *string                    `json:"location,omitempty"`
	Name       *string                    `json:"name,omitempty"`
	Properties *PrivateEndpointConnection `json:"properties,omitempty"`
	Type       *string                    `json:"type,omitempty"`
}

type PrivateLinkServiceConnectionState

type PrivateLinkServiceConnectionState struct {
	ActionsRequired *string                          `json:"actionsRequired,omitempty"`
	Description     *string                          `json:"description,omitempty"`
	Status          *PrivateEndpointConnectionStatus `json:"status,omitempty"`
}

type ProvisioningState

type ProvisioningState string
const (
	ProvisioningStateDeleting  ProvisioningState = "Deleting"
	ProvisioningStateFailed    ProvisioningState = "Failed"
	ProvisioningStatePending   ProvisioningState = "Pending"
	ProvisioningStateSucceeded ProvisioningState = "Succeeded"
)

func (*ProvisioningState) UnmarshalJSON added in v0.20230809.1081239

func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error

type ResourceMoveState

type ResourceMoveState string
const (
	ResourceMoveStateCommitFailed    ResourceMoveState = "CommitFailed"
	ResourceMoveStateCommitTimedout  ResourceMoveState = "CommitTimedout"
	ResourceMoveStateCriticalFailure ResourceMoveState = "CriticalFailure"
	ResourceMoveStateFailure         ResourceMoveState = "Failure"
	ResourceMoveStateInProgress      ResourceMoveState = "InProgress"
	ResourceMoveStateMoveSucceeded   ResourceMoveState = "MoveSucceeded"
	ResourceMoveStatePartialSuccess  ResourceMoveState = "PartialSuccess"
	ResourceMoveStatePrepareFailed   ResourceMoveState = "PrepareFailed"
	ResourceMoveStatePrepareTimedout ResourceMoveState = "PrepareTimedout"
	ResourceMoveStateUnknown         ResourceMoveState = "Unknown"
)

func (*ResourceMoveState) UnmarshalJSON added in v0.20230809.1081239

func (s *ResourceMoveState) UnmarshalJSON(bytes []byte) error

type Sku

type Sku struct {
	Capacity *string `json:"capacity,omitempty"`
	Family   *string `json:"family,omitempty"`
	Name     SkuName `json:"name"`
	Size     *string `json:"size,omitempty"`
	Tier     *string `json:"tier,omitempty"`
}

type SkuName

type SkuName string
const (
	SkuNameRSZero   SkuName = "RS0"
	SkuNameStandard SkuName = "Standard"
)

func (*SkuName) UnmarshalJSON added in v0.20230809.1081239

func (s *SkuName) UnmarshalJSON(bytes []byte) error

type TriggerType

type TriggerType string
const (
	TriggerTypeForcedUpgrade TriggerType = "ForcedUpgrade"
	TriggerTypeUserTriggered TriggerType = "UserTriggered"
)

func (*TriggerType) UnmarshalJSON added in v0.20230809.1081239

func (s *TriggerType) UnmarshalJSON(bytes []byte) error

type UpdateOperationResponse

type UpdateOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

type UpgradeDetails

type UpgradeDetails struct {
	EndTimeUtc         *string            `json:"endTimeUtc,omitempty"`
	LastUpdatedTimeUtc *string            `json:"lastUpdatedTimeUtc,omitempty"`
	Message            *string            `json:"message,omitempty"`
	OperationId        *string            `json:"operationId,omitempty"`
	PreviousResourceId *string            `json:"previousResourceId,omitempty"`
	StartTimeUtc       *string            `json:"startTimeUtc,omitempty"`
	Status             *VaultUpgradeState `json:"status,omitempty"`
	TriggerType        *TriggerType       `json:"triggerType,omitempty"`
	UpgradedResourceId *string            `json:"upgradedResourceId,omitempty"`
}

func (*UpgradeDetails) GetEndTimeUtcAsTime

func (o *UpgradeDetails) GetEndTimeUtcAsTime() (*time.Time, error)

func (*UpgradeDetails) GetLastUpdatedTimeUtcAsTime

func (o *UpgradeDetails) GetLastUpdatedTimeUtcAsTime() (*time.Time, error)

func (*UpgradeDetails) GetStartTimeUtcAsTime

func (o *UpgradeDetails) GetStartTimeUtcAsTime() (*time.Time, error)

func (*UpgradeDetails) SetEndTimeUtcAsTime

func (o *UpgradeDetails) SetEndTimeUtcAsTime(input time.Time)

func (*UpgradeDetails) SetLastUpdatedTimeUtcAsTime

func (o *UpgradeDetails) SetLastUpdatedTimeUtcAsTime(input time.Time)

func (*UpgradeDetails) SetStartTimeUtcAsTime

func (o *UpgradeDetails) SetStartTimeUtcAsTime(input time.Time)

type Vault

type Vault struct {
	Etag       *string                            `json:"etag,omitempty"`
	Id         *string                            `json:"id,omitempty"`
	Identity   *identity.SystemAndUserAssignedMap `json:"identity,omitempty"`
	Location   string                             `json:"location"`
	Name       *string                            `json:"name,omitempty"`
	Properties *VaultProperties                   `json:"properties,omitempty"`
	Sku        *Sku                               `json:"sku,omitempty"`
	SystemData *systemdata.SystemData             `json:"systemData,omitempty"`
	Tags       *map[string]string                 `json:"tags,omitempty"`
	Type       *string                            `json:"type,omitempty"`
}

type VaultId

type VaultId struct {
	SubscriptionId    string
	ResourceGroupName string
	VaultName         string
}

VaultId is a struct representing the Resource ID for a Vault

func NewVaultID

func NewVaultID(subscriptionId string, resourceGroupName string, vaultName string) VaultId

NewVaultID returns a new VaultId struct

func ParseVaultID

func ParseVaultID(input string) (*VaultId, error)

ParseVaultID parses 'input' into a VaultId

func ParseVaultIDInsensitively

func ParseVaultIDInsensitively(input string) (*VaultId, error)

ParseVaultIDInsensitively parses 'input' case-insensitively into a VaultId note: this method should only be used for API response data and not user input

func (*VaultId) FromParseResult added in v0.20231127.1171502

func (id *VaultId) FromParseResult(input resourceids.ParseResult) error

func (VaultId) ID

func (id VaultId) ID() string

ID returns the formatted Vault ID

func (VaultId) Segments

func (id VaultId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Vault ID

func (VaultId) String

func (id VaultId) String() string

String returns a human-readable description of this Vault ID

type VaultOperationPredicate

type VaultOperationPredicate struct {
	Etag     *string
	Id       *string
	Location *string
	Name     *string
	Type     *string
}

func (VaultOperationPredicate) Matches

func (p VaultOperationPredicate) Matches(input Vault) bool

type VaultPrivateEndpointState

type VaultPrivateEndpointState string
const (
	VaultPrivateEndpointStateEnabled VaultPrivateEndpointState = "Enabled"
	VaultPrivateEndpointStateNone    VaultPrivateEndpointState = "None"
)

func (*VaultPrivateEndpointState) UnmarshalJSON added in v0.20230809.1081239

func (s *VaultPrivateEndpointState) UnmarshalJSON(bytes []byte) error

type VaultProperties

type VaultProperties struct {
	Encryption                          *VaultPropertiesEncryption                  `json:"encryption,omitempty"`
	MoveDetails                         *VaultPropertiesMoveDetails                 `json:"moveDetails,omitempty"`
	MoveState                           *ResourceMoveState                          `json:"moveState,omitempty"`
	PrivateEndpointConnections          *[]PrivateEndpointConnectionVaultProperties `json:"privateEndpointConnections,omitempty"`
	PrivateEndpointStateForBackup       *VaultPrivateEndpointState                  `json:"privateEndpointStateForBackup,omitempty"`
	PrivateEndpointStateForSiteRecovery *VaultPrivateEndpointState                  `json:"privateEndpointStateForSiteRecovery,omitempty"`
	ProvisioningState                   *string                                     `json:"provisioningState,omitempty"`
	UpgradeDetails                      *UpgradeDetails                             `json:"upgradeDetails,omitempty"`
}

type VaultPropertiesEncryption

type VaultPropertiesEncryption struct {
	InfrastructureEncryption *InfrastructureEncryptionState `json:"infrastructureEncryption,omitempty"`
	KekIdentity              *CmkKekIdentity                `json:"kekIdentity,omitempty"`
	KeyVaultProperties       *CmkKeyVaultProperties         `json:"keyVaultProperties,omitempty"`
}

type VaultPropertiesMoveDetails

type VaultPropertiesMoveDetails struct {
	CompletionTimeUtc *string `json:"completionTimeUtc,omitempty"`
	OperationId       *string `json:"operationId,omitempty"`
	SourceResourceId  *string `json:"sourceResourceId,omitempty"`
	StartTimeUtc      *string `json:"startTimeUtc,omitempty"`
	TargetResourceId  *string `json:"targetResourceId,omitempty"`
}

func (*VaultPropertiesMoveDetails) GetCompletionTimeUtcAsTime

func (o *VaultPropertiesMoveDetails) GetCompletionTimeUtcAsTime() (*time.Time, error)

func (*VaultPropertiesMoveDetails) GetStartTimeUtcAsTime

func (o *VaultPropertiesMoveDetails) GetStartTimeUtcAsTime() (*time.Time, error)

func (*VaultPropertiesMoveDetails) SetCompletionTimeUtcAsTime

func (o *VaultPropertiesMoveDetails) SetCompletionTimeUtcAsTime(input time.Time)

func (*VaultPropertiesMoveDetails) SetStartTimeUtcAsTime

func (o *VaultPropertiesMoveDetails) SetStartTimeUtcAsTime(input time.Time)

type VaultUpgradeState

type VaultUpgradeState string
const (
	VaultUpgradeStateFailed     VaultUpgradeState = "Failed"
	VaultUpgradeStateInProgress VaultUpgradeState = "InProgress"
	VaultUpgradeStateUnknown    VaultUpgradeState = "Unknown"
	VaultUpgradeStateUpgraded   VaultUpgradeState = "Upgraded"
)

func (*VaultUpgradeState) UnmarshalJSON added in v0.20230809.1081239

func (s *VaultUpgradeState) UnmarshalJSON(bytes []byte) error

type VaultsClient

type VaultsClient struct {
	Client *resourcemanager.Client
}

func NewVaultsClientWithBaseURI

func NewVaultsClientWithBaseURI(sdkApi sdkEnv.Api) (*VaultsClient, error)

func (VaultsClient) CreateOrUpdate

func (c VaultsClient) CreateOrUpdate(ctx context.Context, id VaultId, input Vault) (result CreateOrUpdateOperationResponse, err error)

CreateOrUpdate ...

func (VaultsClient) CreateOrUpdateThenPoll

func (c VaultsClient) CreateOrUpdateThenPoll(ctx context.Context, id VaultId, input Vault) error

CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed

func (VaultsClient) Delete

func (c VaultsClient) Delete(ctx context.Context, id VaultId) (result DeleteOperationResponse, err error)

Delete ...

func (VaultsClient) Get

func (c VaultsClient) Get(ctx context.Context, id VaultId) (result GetOperationResponse, err error)

Get ...

func (VaultsClient) ListByResourceGroup

ListByResourceGroup ...

func (VaultsClient) ListByResourceGroupComplete

ListByResourceGroupComplete retrieves all the results into a single object

func (VaultsClient) ListByResourceGroupCompleteMatchingPredicate

func (c VaultsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate VaultOperationPredicate) (result ListByResourceGroupCompleteResult, err error)

ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (VaultsClient) ListBySubscriptionId

func (c VaultsClient) ListBySubscriptionId(ctx context.Context, id commonids.SubscriptionId) (result ListBySubscriptionIdOperationResponse, err error)

ListBySubscriptionId ...

func (VaultsClient) ListBySubscriptionIdComplete

ListBySubscriptionIdComplete retrieves all the results into a single object

func (VaultsClient) ListBySubscriptionIdCompleteMatchingPredicate

func (c VaultsClient) ListBySubscriptionIdCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate VaultOperationPredicate) (result ListBySubscriptionIdCompleteResult, err error)

ListBySubscriptionIdCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (VaultsClient) Update

func (c VaultsClient) Update(ctx context.Context, id VaultId, input PatchVault) (result UpdateOperationResponse, err error)

Update ...

func (VaultsClient) UpdateThenPoll

func (c VaultsClient) UpdateThenPoll(ctx context.Context, id VaultId, input PatchVault) error

UpdateThenPoll performs Update then polls until it's completed

Jump to

Keyboard shortcuts

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