secrets

package
v0.20230503.1121530 Latest Latest
Warning

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

Go to latest
Published: May 3, 2023 License: MPL-2.0 Imports: 9 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/secrets Documentation

The secrets SDK allows for interaction with the Azure Resource Manager Service keyvault (API Version 2023-02-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/keyvault/2023-02-01/secrets"

Client Initialization

client := secrets.NewSecretsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: SecretsClient.CreateOrUpdate

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

payload := secrets.SecretCreateOrUpdateParameters{
	// ...
}


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

Example Usage: SecretsClient.Get

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

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: SecretsClient.List

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

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

Example Usage: SecretsClient.Update

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

payload := secrets.SecretPatchParameters{
	// ...
}


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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateSecretID

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

ValidateSecretID checks that 'input' can be parsed as a Secret ID

Types

type Attributes

type Attributes struct {
	Created *int64 `json:"created,omitempty"`
	Enabled *bool  `json:"enabled,omitempty"`
	Exp     *int64 `json:"exp,omitempty"`
	Nbf     *int64 `json:"nbf,omitempty"`
	Updated *int64 `json:"updated,omitempty"`
}

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	HttpResponse *http.Response
	Model        *Secret
}

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	Model        *Secret
}

type ListCompleteResult

type ListCompleteResult struct {
	Items []Secret
}

type ListOperationOptions

type ListOperationOptions struct {
	Top *int64
}

func DefaultListOperationOptions

func DefaultListOperationOptions() ListOperationOptions

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	Model        *[]Secret
	// contains filtered or unexported fields
}

func (ListOperationResponse) HasMore

func (r ListOperationResponse) HasMore() bool

func (ListOperationResponse) LoadMore

func (r ListOperationResponse) LoadMore(ctx context.Context) (resp ListOperationResponse, err error)

type Secret

type Secret struct {
	Id         *string            `json:"id,omitempty"`
	Location   *string            `json:"location,omitempty"`
	Name       *string            `json:"name,omitempty"`
	Properties SecretProperties   `json:"properties"`
	Tags       *map[string]string `json:"tags,omitempty"`
	Type       *string            `json:"type,omitempty"`
}

type SecretCreateOrUpdateParameters

type SecretCreateOrUpdateParameters struct {
	Properties SecretProperties   `json:"properties"`
	Tags       *map[string]string `json:"tags,omitempty"`
}

type SecretId

type SecretId struct {
	SubscriptionId    string
	ResourceGroupName string
	VaultName         string
	SecretName        string
}

SecretId is a struct representing the Resource ID for a Secret

func NewSecretID

func NewSecretID(subscriptionId string, resourceGroupName string, vaultName string, secretName string) SecretId

NewSecretID returns a new SecretId struct

func ParseSecretID

func ParseSecretID(input string) (*SecretId, error)

ParseSecretID parses 'input' into a SecretId

func ParseSecretIDInsensitively

func ParseSecretIDInsensitively(input string) (*SecretId, error)

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

func (SecretId) ID

func (id SecretId) ID() string

ID returns the formatted Secret ID

func (SecretId) Segments

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

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

func (SecretId) String

func (id SecretId) String() string

String returns a human-readable description of this Secret ID

type SecretOperationPredicate

type SecretOperationPredicate struct {
	Id       *string
	Location *string
	Name     *string
	Type     *string
}

func (SecretOperationPredicate) Matches

func (p SecretOperationPredicate) Matches(input Secret) bool

type SecretPatchParameters

type SecretPatchParameters struct {
	Properties *SecretPatchProperties `json:"properties,omitempty"`
	Tags       *map[string]string     `json:"tags,omitempty"`
}

type SecretPatchProperties

type SecretPatchProperties struct {
	Attributes  *Attributes `json:"attributes,omitempty"`
	ContentType *string     `json:"contentType,omitempty"`
	Value       *string     `json:"value,omitempty"`
}

type SecretProperties

type SecretProperties struct {
	Attributes           *Attributes `json:"attributes,omitempty"`
	ContentType          *string     `json:"contentType,omitempty"`
	SecretUri            *string     `json:"secretUri,omitempty"`
	SecretUriWithVersion *string     `json:"secretUriWithVersion,omitempty"`
	Value                *string     `json:"value,omitempty"`
}

type SecretsClient

type SecretsClient struct {
	Client autorest.Client
	// contains filtered or unexported fields
}

func NewSecretsClientWithBaseURI

func NewSecretsClientWithBaseURI(endpoint string) SecretsClient

func (SecretsClient) CreateOrUpdate

CreateOrUpdate ...

func (SecretsClient) Get

func (c SecretsClient) Get(ctx context.Context, id SecretId) (result GetOperationResponse, err error)

Get ...

func (SecretsClient) List

List ...

func (SecretsClient) ListComplete

ListComplete retrieves all of the results into a single object

func (SecretsClient) ListCompleteMatchingPredicate

func (c SecretsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.KeyVaultId, options ListOperationOptions, predicate SecretOperationPredicate) (resp ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all of the results and then applied the predicate

func (SecretsClient) Update

Update ...

type UpdateOperationResponse

type UpdateOperationResponse struct {
	HttpResponse *http.Response
	Model        *Secret
}

Jump to

Keyboard shortcuts

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