armattestation

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 14 Imported by: 1

README

Azure Attestation Module for Go

PkgGoDev

The armattestation module provides operations for working with Azure Attestation.

Source code

Getting started

Prerequisites

  • an Azure subscription
  • Go 1.18 or above (You could download and install the latest version of Go from here. It will replace the existing Go on your machine. If you want to install multiple Go versions on the same machine, you could refer this doc.)

Install the package

This project uses Go modules for versioning and dependency management.

Install the Azure Attestation module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/attestation/armattestation

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Attestation. The azidentity module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.

cred, err := azidentity.NewDefaultAzureCredential(nil)

For more information on authentication, please see the documentation for azidentity at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity.

Client Factory

Azure Attestation module consists of one or more clients. We provide a client factory which could be used to create any client in this module.

clientFactory, err := armattestation.NewClientFactory(<subscription ID>, cred, nil)

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

options := arm.ClientOptions {
    ClientOptions: azcore.ClientOptions {
        Cloud: cloud.AzureChina,
    },
}
clientFactory, err := armattestation.NewClientFactory(<subscription ID>, cred, &options)

Clients

A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory.

client := clientFactory.NewProvidersClient()

Fakes

The fake package contains types used for constructing in-memory fake servers used in unit tests. This allows writing tests to cover various success/error conditions without the need for connecting to a live service.

Please see https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/samples/fakes for details and examples on how to use fakes.

Provide Feedback

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

type AttestationServiceStatus string

AttestationServiceStatus - Status of attestation service.

const (
	AttestationServiceStatusError    AttestationServiceStatus = "Error"
	AttestationServiceStatusNotReady AttestationServiceStatus = "NotReady"
	AttestationServiceStatusReady    AttestationServiceStatus = "Ready"
)

func PossibleAttestationServiceStatusValues

func PossibleAttestationServiceStatusValues() []AttestationServiceStatus

PossibleAttestationServiceStatusValues returns the possible values for the AttestationServiceStatus const type.

type ClientFactory added in v1.1.0

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

ClientFactory is a client factory used to create any client in this module. Don't use this type directly, use NewClientFactory instead.

func NewClientFactory added in v1.1.0

func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error)

NewClientFactory creates a new instance of ClientFactory with the specified values. The parameter values will be propagated to any client created from this factory.

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

func (*ClientFactory) NewOperationsClient added in v1.1.0

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

func (*ClientFactory) NewPrivateEndpointConnectionsClient added in v1.1.0

func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient

NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient.

func (*ClientFactory) NewProvidersClient added in v1.1.0

func (c *ClientFactory) NewProvidersClient() *ProvidersClient

NewProvidersClient creates a new instance of ProvidersClient.

type CreatedByType

type CreatedByType string

CreatedByType - The type of identity that created the resource.

const (
	CreatedByTypeApplication     CreatedByType = "Application"
	CreatedByTypeKey             CreatedByType = "Key"
	CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity"
	CreatedByTypeUser            CreatedByType = "User"
)

func PossibleCreatedByTypeValues

func PossibleCreatedByTypeValues() []CreatedByType

PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.

type JSONWebKey

type JSONWebKey struct {
	// REQUIRED; The "kty" (key type) parameter identifies the cryptographic algorithm family used with the key, such as "RSA"
	// or "EC". "kty" values should either be registered in the IANA "JSON Web Key Types"
	// registry established by [JWA] or be a value that contains a Collision- Resistant Name. The "kty" value is a case-sensitive
	// string.
	Kty *string

	// The "alg" (algorithm) parameter identifies the algorithm intended for use with the key. The values used should either be
	// registered in the IANA "JSON Web Signature and Encryption Algorithms" registry
	// established by [JWA] or be a value that contains a Collision- Resistant Name.
	Alg *string

	// The "crv" (curve) parameter identifies the curve type
	Crv *string

	// RSA private exponent or ECC private key
	D *string

	// RSA Private Key Parameter
	Dp *string

	// RSA Private Key Parameter
	Dq *string

	// RSA public exponent, in Base64
	E *string

	// Symmetric key
	K *string

	// The "kid" (key ID) parameter is used to match a specific key. This is used, for instance, to choose among a set of keys
	// within a JWK Set during key rollover. The structure of the "kid" value is
	// unspecified. When "kid" values are used within a JWK Set, different keys within the JWK Set SHOULD use distinct "kid" values.
	// (One example in which different keys might use the same "kid" value is if
	// they have different "kty" (key type) values but are considered to be equivalent alternatives by the application using them.)
	// The "kid" value is a case-sensitive string.
	Kid *string

	// RSA modulus, in Base64
	N *string

	// RSA secret prime
	P *string

	// RSA secret prime, with p < q
	Q *string

	// RSA Private Key Parameter
	Qi *string

	// Use ("public key use") identifies the intended use of the public key. The "use" parameter is employed to indicate whether
	// a public key is used for encrypting data or verifying the signature on data.
	// Values are commonly "sig" (signature) or "enc" (encryption).
	Use *string

	// X coordinate for the Elliptic Curve point
	X *string

	// The "x5c" (X.509 certificate chain) parameter contains a chain of one or more PKIX certificates [RFC5280]. The certificate
	// chain is represented as a JSON array of certificate value strings. Each
	// string in the array is a base64-encoded (Section 4 of [RFC4648] -- not base64url-encoded) DER [ITU.X690.1994] PKIX certificate
	// value. The PKIX certificate containing the key value MUST be the first
	// certificate.
	X5C []*string

	// Y coordinate for the Elliptic Curve point
	Y *string
}

func (JSONWebKey) MarshalJSON

func (j JSONWebKey) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type JSONWebKey.

func (*JSONWebKey) UnmarshalJSON added in v1.1.0

func (j *JSONWebKey) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type JSONWebKey.

type JSONWebKeySet

type JSONWebKeySet struct {
	// The value of the "keys" parameter is an array of JWK values. By default, the order of the JWK values within the array does
	// not imply an order of preference among them, although applications of JWK
	// Sets can choose to assign a meaning to the order for their purposes, if desired.
	Keys []*JSONWebKey
}

func (JSONWebKeySet) MarshalJSON

func (j JSONWebKeySet) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type JSONWebKeySet.

func (*JSONWebKeySet) UnmarshalJSON added in v1.1.0

func (j *JSONWebKeySet) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type JSONWebKeySet.

type OperationList

type OperationList struct {
	// List of supported operations.
	Value []*OperationsDefinition

	// READ-ONLY; The system metadata relating to this resource
	SystemData *SystemData
}

OperationList - List of supported operations.

func (OperationList) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationList.

func (*OperationList) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationList.

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) List

List - Lists all of the available Azure attestation operations. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-10-01

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

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/Operations_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/attestation/armattestation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armattestation.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewOperationsClient().List(ctx, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.OperationList = armattestation.OperationList{
	// }
}
Output:

type OperationsClientListOptions added in v0.2.0

type OperationsClientListOptions struct {
}

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

type OperationsClientListResponse added in v0.2.0

type OperationsClientListResponse struct {
	// List of supported operations.
	OperationList
}

OperationsClientListResponse contains the response from method OperationsClient.List.

type OperationsDefinition

type OperationsDefinition struct {
	// Display object with properties of the operation.
	Display *OperationsDisplayDefinition

	// Name of the operation.
	Name *string
}

OperationsDefinition - Definition object with the name and properties of an operation.

func (OperationsDefinition) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type OperationsDefinition.

func (*OperationsDefinition) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationsDefinition.

type OperationsDisplayDefinition

type OperationsDisplayDefinition struct {
	// Description of the operation.
	Description *string

	// Short description of the operation.
	Operation *string

	// Resource provider of the operation.
	Provider *string

	// Resource for the operation.
	Resource *string
}

OperationsDisplayDefinition - Display object with properties of the operation.

func (OperationsDisplayDefinition) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type OperationsDisplayDefinition.

func (*OperationsDisplayDefinition) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationsDisplayDefinition.

type PrivateEndpoint

type PrivateEndpoint struct {
	// READ-ONLY; The ARM identifier for Private Endpoint
	ID *string
}

PrivateEndpoint - The Private Endpoint resource.

func (PrivateEndpoint) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint.

func (*PrivateEndpoint) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpoint.

type PrivateEndpointConnection

type PrivateEndpointConnection struct {
	// Resource properties.
	Properties *PrivateEndpointConnectionProperties

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

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

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

PrivateEndpointConnection - The Private Endpoint Connection resource.

func (PrivateEndpointConnection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection.

func (*PrivateEndpointConnection) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection.

type PrivateEndpointConnectionListResult

type PrivateEndpointConnectionListResult struct {
	// Array of private endpoint connections
	Value []*PrivateEndpointConnection
}

PrivateEndpointConnectionListResult - List of private endpoint connection associated with the specified storage account

func (PrivateEndpointConnectionListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult.

func (*PrivateEndpointConnectionListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult.

type PrivateEndpointConnectionProperties

type PrivateEndpointConnectionProperties struct {
	// REQUIRED; A collection of information about the state of the connection between service consumer and provider.
	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState

	// The resource of private end point.
	PrivateEndpoint *PrivateEndpoint

	// READ-ONLY; The provisioning state of the private endpoint connection resource.
	ProvisioningState *PrivateEndpointConnectionProvisioningState
}

PrivateEndpointConnectionProperties - Properties of the PrivateEndpointConnectProperties.

func (PrivateEndpointConnectionProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties.

func (*PrivateEndpointConnectionProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties.

type PrivateEndpointConnectionProvisioningState

type PrivateEndpointConnectionProvisioningState string

PrivateEndpointConnectionProvisioningState - The current provisioning state.

const (
	PrivateEndpointConnectionProvisioningStateCreating  PrivateEndpointConnectionProvisioningState = "Creating"
	PrivateEndpointConnectionProvisioningStateDeleting  PrivateEndpointConnectionProvisioningState = "Deleting"
	PrivateEndpointConnectionProvisioningStateFailed    PrivateEndpointConnectionProvisioningState = "Failed"
	PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded"
)

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 - The ID of the target subscription.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*PrivateEndpointConnectionsClient) Create

func (client *PrivateEndpointConnectionsClient) Create(ctx context.Context, resourceGroupName string, providerName string, privateEndpointConnectionName string, properties PrivateEndpointConnection, options *PrivateEndpointConnectionsClientCreateOptions) (PrivateEndpointConnectionsClientCreateResponse, error)

Create - Update the state of specified private endpoint connection associated with the attestation provider. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-10-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • providerName - The name of the attestation provider.
  • privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource
  • properties - The private endpoint connection properties.
  • options - PrivateEndpointConnectionsClientCreateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Create method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/AttestationProviderPutPrivateEndpointConnection.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/attestation/armattestation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armattestation.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPrivateEndpointConnectionsClient().Create(ctx, "res7687", "sto9699", "{privateEndpointConnectionName}", armattestation.PrivateEndpointConnection{
		Properties: &armattestation.PrivateEndpointConnectionProperties{
			PrivateLinkServiceConnectionState: &armattestation.PrivateLinkServiceConnectionState{
				Description: to.Ptr("Auto-Approved"),
				Status:      to.Ptr(armattestation.PrivateEndpointServiceConnectionStatusApproved),
			},
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.PrivateEndpointConnection = armattestation.PrivateEndpointConnection{
	// 	Name: to.Ptr("{privateEndpointConnectionName}"),
	// 	Type: to.Ptr("Microsoft.Attestation/attestationProviders/privateEndpointConnections"),
	// 	ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res7231/providers/Microsoft.Attestation/attestationProviders/sto288/privateEndpointConnections/{privateEndpointConnectionName}"),
	// 	Properties: &armattestation.PrivateEndpointConnectionProperties{
	// 		PrivateEndpoint: &armattestation.PrivateEndpoint{
	// 			ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res7231/providers/Microsoft.Network/privateEndpoints/petest01"),
	// 		},
	// 		PrivateLinkServiceConnectionState: &armattestation.PrivateLinkServiceConnectionState{
	// 			Description: to.Ptr("Auto-Approved"),
	// 			Status: to.Ptr(armattestation.PrivateEndpointServiceConnectionStatusApproved),
	// 		},
	// 		ProvisioningState: to.Ptr(armattestation.PrivateEndpointConnectionProvisioningStateSucceeded),
	// 	},
	// }
}
Output:

func (*PrivateEndpointConnectionsClient) Delete

func (client *PrivateEndpointConnectionsClient) Delete(ctx context.Context, resourceGroupName string, providerName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientDeleteOptions) (PrivateEndpointConnectionsClientDeleteResponse, error)

Delete - Deletes the specified private endpoint connection associated with the attestation provider. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-10-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • providerName - The name of the attestation provider.
  • privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource
  • options - PrivateEndpointConnectionsClientDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/AttestationProviderDeletePrivateEndpointConnection.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/attestation/armattestation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armattestation.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewPrivateEndpointConnectionsClient().Delete(ctx, "res6977", "sto2527", "{privateEndpointConnectionName}", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*PrivateEndpointConnectionsClient) Get

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

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

Generated from API version 2020-10-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • providerName - The name of the attestation provider.
  • privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource
  • options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/AttestationProviderGetPrivateEndpointConnection.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/attestation/armattestation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armattestation.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "res6977", "sto2527", "{privateEndpointConnectionName}", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.PrivateEndpointConnection = armattestation.PrivateEndpointConnection{
	// 	Name: to.Ptr("{privateEndpointConnectionName}"),
	// 	Type: to.Ptr("Microsoft.Attestation/attestationProviders/privateEndpointConnections"),
	// 	ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res7231/providers/Microsoft.Attestation/attestationProviders/sto288/privateEndpointConnections/{privateEndpointConnectionName}"),
	// 	Properties: &armattestation.PrivateEndpointConnectionProperties{
	// 		PrivateEndpoint: &armattestation.PrivateEndpoint{
	// 			ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res7231/providers/Microsoft.Network/privateEndpoints/petest01"),
	// 		},
	// 		PrivateLinkServiceConnectionState: &armattestation.PrivateLinkServiceConnectionState{
	// 			Description: to.Ptr("Auto-Approved"),
	// 			Status: to.Ptr(armattestation.PrivateEndpointServiceConnectionStatusApproved),
	// 		},
	// 		ProvisioningState: to.Ptr(armattestation.PrivateEndpointConnectionProvisioningStateSucceeded),
	// 	},
	// }
}
Output:

func (*PrivateEndpointConnectionsClient) NewListPager added in v0.4.0

NewListPager - List all the private endpoint connections associated with the attestation provider.

Generated from API version 2020-10-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • providerName - The name of the attestation provider.
  • options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/AttestationProviderListPrivateEndpointConnections.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/attestation/armattestation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armattestation.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListPager("res6977", "sto2527", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.PrivateEndpointConnectionListResult = armattestation.PrivateEndpointConnectionListResult{
		// 	Value: []*armattestation.PrivateEndpointConnection{
		// 		{
		// 			Name: to.Ptr("{privateEndpointConnectionName}"),
		// 			Type: to.Ptr("Microsoft.Attestation/attestationProviders/privateEndpointConnections"),
		// 			ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res7231/providers/Microsoft.Attestation/attestationProviders/sto288/privateEndpointConnections/{privateEndpointConnectionName}"),
		// 			Properties: &armattestation.PrivateEndpointConnectionProperties{
		// 				PrivateEndpoint: &armattestation.PrivateEndpoint{
		// 					ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res7231/providers/Microsoft.Network/privateEndpoints/petest01"),
		// 				},
		// 				PrivateLinkServiceConnectionState: &armattestation.PrivateLinkServiceConnectionState{
		// 					Description: to.Ptr("Auto-Approved"),
		// 					Status: to.Ptr(armattestation.PrivateEndpointServiceConnectionStatusApproved),
		// 				},
		// 				ProvisioningState: to.Ptr(armattestation.PrivateEndpointConnectionProvisioningStateSucceeded),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("{privateEndpointConnectionName}"),
		// 			Type: to.Ptr("Microsoft.Attestation/attestationProviders/privateEndpointConnections"),
		// 			ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res7231/providers/Microsoft.Attestation/attestationProviders/sto288/privateEndpointConnections/{privateEndpointConnectionName}"),
		// 			Properties: &armattestation.PrivateEndpointConnectionProperties{
		// 				PrivateEndpoint: &armattestation.PrivateEndpoint{
		// 					ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res7231/providers/Microsoft.Network/privateEndpoints/petest02"),
		// 				},
		// 				PrivateLinkServiceConnectionState: &armattestation.PrivateLinkServiceConnectionState{
		// 					Description: to.Ptr("Auto-Approved"),
		// 					Status: to.Ptr(armattestation.PrivateEndpointServiceConnectionStatusApproved),
		// 				},
		// 				ProvisioningState: to.Ptr(armattestation.PrivateEndpointConnectionProvisioningStateSucceeded),
		// 			},
		// 	}},
		// }
	}
}
Output:

type PrivateEndpointConnectionsClientCreateOptions added in v0.2.0

type PrivateEndpointConnectionsClientCreateOptions struct {
}

PrivateEndpointConnectionsClientCreateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Create method.

type PrivateEndpointConnectionsClientCreateResponse added in v0.2.0

type PrivateEndpointConnectionsClientCreateResponse struct {
	// The Private Endpoint Connection resource.
	PrivateEndpointConnection
}

PrivateEndpointConnectionsClientCreateResponse contains the response from method PrivateEndpointConnectionsClient.Create.

type PrivateEndpointConnectionsClientDeleteOptions added in v0.2.0

type PrivateEndpointConnectionsClientDeleteOptions struct {
}

PrivateEndpointConnectionsClientDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Delete method.

type PrivateEndpointConnectionsClientDeleteResponse added in v0.2.0

type PrivateEndpointConnectionsClientDeleteResponse struct {
}

PrivateEndpointConnectionsClientDeleteResponse contains the response from method PrivateEndpointConnectionsClient.Delete.

type PrivateEndpointConnectionsClientGetOptions added in v0.2.0

type PrivateEndpointConnectionsClientGetOptions struct {
}

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

type PrivateEndpointConnectionsClientGetResponse added in v0.2.0

type PrivateEndpointConnectionsClientGetResponse struct {
	// The Private Endpoint Connection resource.
	PrivateEndpointConnection
}

PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get.

type PrivateEndpointConnectionsClientListOptions added in v0.2.0

type PrivateEndpointConnectionsClientListOptions struct {
}

PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListPager method.

type PrivateEndpointConnectionsClientListResponse added in v0.2.0

type PrivateEndpointConnectionsClientListResponse struct {
	// List of private endpoint connection associated with the specified storage account
	PrivateEndpointConnectionListResult
}

PrivateEndpointConnectionsClientListResponse contains the response from method PrivateEndpointConnectionsClient.NewListPager.

type PrivateEndpointServiceConnectionStatus

type PrivateEndpointServiceConnectionStatus string

PrivateEndpointServiceConnectionStatus - The private endpoint connection status.

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

func PossiblePrivateEndpointServiceConnectionStatusValues

func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus

PossiblePrivateEndpointServiceConnectionStatusValues returns the possible values for the PrivateEndpointServiceConnectionStatus const type.

type PrivateLinkServiceConnectionState

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

	// The reason for approval/rejection of the connection.
	Description *string

	// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.
	Status *PrivateEndpointServiceConnectionStatus
}

PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer and provider.

func (PrivateLinkServiceConnectionState) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState.

func (*PrivateLinkServiceConnectionState) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionState.

type Provider added in v0.2.0

type Provider struct {
	// REQUIRED; The geo-location where the resource lives
	Location *string

	// Describes Attestation service status.
	Properties *StatusResult

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

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

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

	// READ-ONLY; The system metadata relating to this resource
	SystemData *SystemData

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

Provider - Attestation service response message.

func (Provider) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type Provider.

func (*Provider) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Provider.

type ProviderListResult added in v0.2.0

type ProviderListResult struct {
	// Attestation Provider array.
	Value []*Provider

	// READ-ONLY; The system metadata relating to this resource
	SystemData *SystemData
}

ProviderListResult - Attestation Providers List.

func (ProviderListResult) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type ProviderListResult.

func (*ProviderListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ProviderListResult.

type ProvidersClient added in v0.2.0

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

ProvidersClient contains the methods for the AttestationProviders group. Don't use this type directly, use NewProvidersClient() instead.

func NewProvidersClient added in v0.2.0

func NewProvidersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProvidersClient, error)

NewProvidersClient creates a new instance of ProvidersClient with the specified values.

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

func (*ProvidersClient) Create added in v0.2.0

func (client *ProvidersClient) Create(ctx context.Context, resourceGroupName string, providerName string, creationParams ServiceCreationParams, options *ProvidersClientCreateOptions) (ProvidersClientCreateResponse, error)

Create - Creates a new Attestation Provider. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-10-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • providerName - Name of the attestation provider.
  • creationParams - Client supplied parameters.
  • options - ProvidersClientCreateOptions contains the optional parameters for the ProvidersClient.Create method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/Create_AttestationProvider.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/attestation/armattestation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armattestation.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewProvidersClient().Create(ctx, "MyResourceGroup", "myattestationprovider", armattestation.ServiceCreationParams{}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Provider = armattestation.Provider{
	// 	Name: to.Ptr("myattestationprovider"),
	// 	Type: to.Ptr("Microsoft.Attestation/attestationProviders"),
	// 	ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup/providers/Microsoft.Attestation/attestationProviders/myattestationprovider"),
	// 	Location: to.Ptr("East US"),
	// 	Tags: map[string]*string{
	// 		"Property1": to.Ptr("Value1"),
	// 		"Property2": to.Ptr("Value2"),
	// 		"Property3": to.Ptr("Value3"),
	// 	},
	// 	Properties: &armattestation.StatusResult{
	// 		AttestURI: to.Ptr("https://superservice.attestation.azure.net"),
	// 		Status: to.Ptr(armattestation.AttestationServiceStatusReady),
	// 		TrustModel: to.Ptr("Isolated"),
	// 	},
	// }
}
Output:

func (*ProvidersClient) Delete added in v0.2.0

func (client *ProvidersClient) Delete(ctx context.Context, resourceGroupName string, providerName string, options *ProvidersClientDeleteOptions) (ProvidersClientDeleteResponse, error)

Delete - Delete Attestation Service. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-10-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • providerName - Name of the attestation service
  • options - ProvidersClientDeleteOptions contains the optional parameters for the ProvidersClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/Delete_AttestationProvider.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/attestation/armattestation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armattestation.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewProvidersClient().Delete(ctx, "sample-resource-group", "myattestationprovider", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*ProvidersClient) Get added in v0.2.0

func (client *ProvidersClient) Get(ctx context.Context, resourceGroupName string, providerName string, options *ProvidersClientGetOptions) (ProvidersClientGetResponse, error)

Get - Get the status of Attestation Provider. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-10-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • providerName - Name of the attestation provider.
  • options - ProvidersClientGetOptions contains the optional parameters for the ProvidersClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/Get_AttestationProvider.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/attestation/armattestation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armattestation.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewProvidersClient().Get(ctx, "MyResourceGroup", "myattestationprovider", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Provider = armattestation.Provider{
	// 	Name: to.Ptr("myattestationprovider"),
	// 	Type: to.Ptr("Microsoft.Attestation/attestationProviders"),
	// 	ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup/providers/Microsoft.Attestation/attestationProviders/myattestationprovider"),
	// 	Location: to.Ptr("East US"),
	// 	Tags: map[string]*string{
	// 		"Property1": to.Ptr("Value1"),
	// 		"Property2": to.Ptr("Value2"),
	// 		"Property3": to.Ptr("Value3"),
	// 	},
	// 	Properties: &armattestation.StatusResult{
	// 		AttestURI: to.Ptr("https://superservice.attestation.azure.net"),
	// 		Status: to.Ptr(armattestation.AttestationServiceStatusReady),
	// 		TrustModel: to.Ptr("Isolated"),
	// 	},
	// }
}
Output:

func (*ProvidersClient) GetDefaultByLocation added in v0.2.0

GetDefaultByLocation - Get the default provider by location. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-10-01

  • location - The location of the default provider.
  • options - ProvidersClientGetDefaultByLocationOptions contains the optional parameters for the ProvidersClient.GetDefaultByLocation method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/Get_DefaultProviderByLocation.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/attestation/armattestation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armattestation.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewProvidersClient().GetDefaultByLocation(ctx, "Central US", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Provider = armattestation.Provider{
	// 	Name: to.Ptr("sharedcus"),
	// 	Type: to.Ptr("Microsoft.Attestation/attestationProviders"),
	// 	ID: to.Ptr("providers/Microsoft.Attestation/attestationProviders/sharedcus"),
	// 	Location: to.Ptr("Central US"),
	// 	Properties: &armattestation.StatusResult{
	// 		AttestURI: to.Ptr("https://sharedcus.cus.attest.azure.net"),
	// 		Status: to.Ptr(armattestation.AttestationServiceStatusReady),
	// 		TrustModel: to.Ptr("AAD"),
	// 	},
	// }
}
Output:

func (*ProvidersClient) List added in v0.2.0

List - Returns a list of attestation providers in a subscription. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-10-01

  • options - ProvidersClientListOptions contains the optional parameters for the ProvidersClient.List method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/Get_AttestationProvidersList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/attestation/armattestation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armattestation.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewProvidersClient().List(ctx, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.ProviderListResult = armattestation.ProviderListResult{
	// 	Value: []*armattestation.Provider{
	// 		{
	// 			Name: to.Ptr("myattestationprovider"),
	// 			Type: to.Ptr("Microsoft.Attestation/attestationProviders"),
	// 			ID: to.Ptr("subscriptions/6c96b33e-f5b8-40a6-9011-5cb1c58b0915/resourceGroups/testrg1/providers/Microsoft.Attestation/attestationProviders/myattestationprovider"),
	// 			Location: to.Ptr("East US"),
	// 			Properties: &armattestation.StatusResult{
	// 				Status: to.Ptr(armattestation.AttestationServiceStatusReady),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("codes2"),
	// 			Type: to.Ptr("Microsoft.Attestation/attestationProviders"),
	// 			ID: to.Ptr("subscriptions/6c96b33e-f5b8-40a6-9011-5cb1c58b0915/resourceGroups/testrg2/providers/Microsoft.Attestation/attestationProviders/codes2"),
	// 			Location: to.Ptr("East US"),
	// 			Properties: &armattestation.StatusResult{
	// 				Status: to.Ptr(armattestation.AttestationServiceStatusReady),
	// 			},
	// 	}},
	// }
}
Output:

func (*ProvidersClient) ListByResourceGroup added in v0.2.0

ListByResourceGroup - Returns attestation providers list in a resource group. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-10-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • options - ProvidersClientListByResourceGroupOptions contains the optional parameters for the ProvidersClient.ListByResourceGroup method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/Get_AttestationProvidersListByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/attestation/armattestation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armattestation.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewProvidersClient().ListByResourceGroup(ctx, "testrg1", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.ProviderListResult = armattestation.ProviderListResult{
	// 	Value: []*armattestation.Provider{
	// 		{
	// 			Name: to.Ptr("myattestationprovider"),
	// 			Type: to.Ptr("Microsoft.Attestation/attestationProviders"),
	// 			ID: to.Ptr("subscriptions/6c96b33e-f5b8-40a6-9011-5cb1c58b0915/resourceGroups/testrg1/providers/Microsoft.Attestation/attestationProviders/myattestationprovider"),
	// 			Location: to.Ptr("East US"),
	// 			Properties: &armattestation.StatusResult{
	// 				Status: to.Ptr(armattestation.AttestationServiceStatusReady),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("codes2"),
	// 			Type: to.Ptr("Microsoft.Attestation/attestationProviders"),
	// 			ID: to.Ptr("subscriptions/6c96b33e-f5b8-40a6-9011-5cb1c58b0915/resourceGroups/testrg1/providers/Microsoft.Attestation/attestationProviders/codes2"),
	// 			Location: to.Ptr("East US"),
	// 			Properties: &armattestation.StatusResult{
	// 				Status: to.Ptr(armattestation.AttestationServiceStatusReady),
	// 			},
	// 	}},
	// }
}
Output:

func (*ProvidersClient) ListDefault added in v0.2.0

ListDefault - Get the default provider If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-10-01

  • options - ProvidersClientListDefaultOptions contains the optional parameters for the ProvidersClient.ListDefault method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/Get_DefaultProviders.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/attestation/armattestation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armattestation.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewProvidersClient().ListDefault(ctx, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.ProviderListResult = armattestation.ProviderListResult{
	// 	Value: []*armattestation.Provider{
	// 		{
	// 			Name: to.Ptr("sharedcus"),
	// 			Type: to.Ptr("Microsoft.Attestation/attestationProviders"),
	// 			ID: to.Ptr("providers/Microsoft.Attestation/attestationProviders/sharedcus"),
	// 			Location: to.Ptr("Central US"),
	// 			Properties: &armattestation.StatusResult{
	// 				AttestURI: to.Ptr("https://sharedcus.cus.attest.azure.net"),
	// 				Status: to.Ptr(armattestation.AttestationServiceStatusReady),
	// 				TrustModel: to.Ptr("AAD"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("shareduks"),
	// 			Type: to.Ptr("Microsoft.Attestation/attestationProviders"),
	// 			ID: to.Ptr("providers/Microsoft.Attestation/attestationProviders/shareduks"),
	// 			Location: to.Ptr("UK South"),
	// 			Properties: &armattestation.StatusResult{
	// 				AttestURI: to.Ptr("https://shareduks.uks.attest.azure.net"),
	// 				Status: to.Ptr(armattestation.AttestationServiceStatusReady),
	// 				TrustModel: to.Ptr("AAD"),
	// 			},
	// 	}},
	// }
}
Output:

func (*ProvidersClient) Update added in v0.2.0

func (client *ProvidersClient) Update(ctx context.Context, resourceGroupName string, providerName string, updateParams ServicePatchParams, options *ProvidersClientUpdateOptions) (ProvidersClientUpdateResponse, error)

Update - Updates the Attestation Provider. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-10-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • providerName - Name of the attestation provider.
  • updateParams - Client supplied parameters.
  • options - ProvidersClientUpdateOptions contains the optional parameters for the ProvidersClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/Update_AttestationProvider.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/attestation/armattestation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armattestation.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewProvidersClient().Update(ctx, "MyResourceGroup", "myattestationprovider", armattestation.ServicePatchParams{
		Tags: map[string]*string{
			"Property1": to.Ptr("Value1"),
			"Property2": to.Ptr("Value2"),
			"Property3": to.Ptr("Value3"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Provider = armattestation.Provider{
	// 	Name: to.Ptr("myattestationprovider"),
	// 	Type: to.Ptr("Microsoft.Attestation/attestationProviders"),
	// 	ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup/providers/Microsoft.Attestation/attestationProviders/myattestationprovider"),
	// 	Location: to.Ptr("East US"),
	// 	Tags: map[string]*string{
	// 		"Property1": to.Ptr("Value1"),
	// 		"Property2": to.Ptr("Value2"),
	// 		"Property3": to.Ptr("Value3"),
	// 	},
	// 	Properties: &armattestation.StatusResult{
	// 		AttestURI: to.Ptr("https://superservice.attestation.azure.net"),
	// 		Status: to.Ptr(armattestation.AttestationServiceStatusReady),
	// 		TrustModel: to.Ptr("Isolated"),
	// 	},
	// }
}
Output:

type ProvidersClientCreateOptions added in v0.2.0

type ProvidersClientCreateOptions struct {
}

ProvidersClientCreateOptions contains the optional parameters for the ProvidersClient.Create method.

type ProvidersClientCreateResponse added in v0.2.0

type ProvidersClientCreateResponse struct {
	// Attestation service response message.
	Provider
}

ProvidersClientCreateResponse contains the response from method ProvidersClient.Create.

type ProvidersClientDeleteOptions added in v0.2.0

type ProvidersClientDeleteOptions struct {
}

ProvidersClientDeleteOptions contains the optional parameters for the ProvidersClient.Delete method.

type ProvidersClientDeleteResponse added in v0.2.0

type ProvidersClientDeleteResponse struct {
}

ProvidersClientDeleteResponse contains the response from method ProvidersClient.Delete.

type ProvidersClientGetDefaultByLocationOptions added in v0.2.0

type ProvidersClientGetDefaultByLocationOptions struct {
}

ProvidersClientGetDefaultByLocationOptions contains the optional parameters for the ProvidersClient.GetDefaultByLocation method.

type ProvidersClientGetDefaultByLocationResponse added in v0.2.0

type ProvidersClientGetDefaultByLocationResponse struct {
	// Attestation service response message.
	Provider
}

ProvidersClientGetDefaultByLocationResponse contains the response from method ProvidersClient.GetDefaultByLocation.

type ProvidersClientGetOptions added in v0.2.0

type ProvidersClientGetOptions struct {
}

ProvidersClientGetOptions contains the optional parameters for the ProvidersClient.Get method.

type ProvidersClientGetResponse added in v0.2.0

type ProvidersClientGetResponse struct {
	// Attestation service response message.
	Provider
}

ProvidersClientGetResponse contains the response from method ProvidersClient.Get.

type ProvidersClientListByResourceGroupOptions added in v0.2.0

type ProvidersClientListByResourceGroupOptions struct {
}

ProvidersClientListByResourceGroupOptions contains the optional parameters for the ProvidersClient.ListByResourceGroup method.

type ProvidersClientListByResourceGroupResponse added in v0.2.0

type ProvidersClientListByResourceGroupResponse struct {
	// Attestation Providers List.
	ProviderListResult
}

ProvidersClientListByResourceGroupResponse contains the response from method ProvidersClient.ListByResourceGroup.

type ProvidersClientListDefaultOptions added in v0.2.0

type ProvidersClientListDefaultOptions struct {
}

ProvidersClientListDefaultOptions contains the optional parameters for the ProvidersClient.ListDefault method.

type ProvidersClientListDefaultResponse added in v0.2.0

type ProvidersClientListDefaultResponse struct {
	// Attestation Providers List.
	ProviderListResult
}

ProvidersClientListDefaultResponse contains the response from method ProvidersClient.ListDefault.

type ProvidersClientListOptions added in v0.2.0

type ProvidersClientListOptions struct {
}

ProvidersClientListOptions contains the optional parameters for the ProvidersClient.List method.

type ProvidersClientListResponse added in v0.2.0

type ProvidersClientListResponse struct {
	// Attestation Providers List.
	ProviderListResult
}

ProvidersClientListResponse contains the response from method ProvidersClient.List.

type ProvidersClientUpdateOptions added in v0.2.0

type ProvidersClientUpdateOptions struct {
}

ProvidersClientUpdateOptions contains the optional parameters for the ProvidersClient.Update method.

type ProvidersClientUpdateResponse added in v0.2.0

type ProvidersClientUpdateResponse struct {
	// Attestation service response message.
	Provider
}

ProvidersClientUpdateResponse contains the response from method ProvidersClient.Update.

type Resource

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

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

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

Resource - Common fields that are returned in the response for all Azure Resource Manager resources

func (Resource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Resource.

func (*Resource) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Resource.

type ServiceCreationParams added in v0.2.0

type ServiceCreationParams struct {
	// REQUIRED; The supported Azure location where the attestation provider should be created.
	Location *string

	// REQUIRED; Properties of the attestation provider
	Properties *ServiceCreationSpecificParams

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

ServiceCreationParams - Parameters for creating an attestation provider

func (ServiceCreationParams) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type ServiceCreationParams.

func (*ServiceCreationParams) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceCreationParams.

type ServiceCreationSpecificParams added in v0.2.0

type ServiceCreationSpecificParams struct {
	// JSON Web Key Set defining a set of X.509 Certificates that will represent the parent certificate for the signing certificate
	// used for policy operations
	PolicySigningCertificates *JSONWebKeySet
}

ServiceCreationSpecificParams - Client supplied parameters used to create a new attestation provider.

func (ServiceCreationSpecificParams) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ServiceCreationSpecificParams.

func (*ServiceCreationSpecificParams) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceCreationSpecificParams.

type ServicePatchParams added in v0.2.0

type ServicePatchParams struct {
	// The tags that will be assigned to the attestation provider.
	Tags map[string]*string
}

ServicePatchParams - Parameters for patching an attestation provider

func (ServicePatchParams) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type ServicePatchParams.

func (*ServicePatchParams) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServicePatchParams.

type StatusResult

type StatusResult struct {
	// Gets the uri of attestation service
	AttestURI *string

	// Status of attestation service.
	Status *AttestationServiceStatus

	// Trust model for the attestation provider.
	TrustModel *string

	// READ-ONLY; List of private endpoint connections associated with the attestation provider.
	PrivateEndpointConnections []*PrivateEndpointConnection
}

StatusResult - Status of attestation service.

func (StatusResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type StatusResult.

func (*StatusResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type StatusResult.

type SystemData

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

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

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

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

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

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

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

func (SystemData) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SystemData.

func (*SystemData) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.

type TrackedResource

type TrackedResource struct {
	// REQUIRED; The geo-location where the resource lives
	Location *string

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

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

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

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

TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'

func (TrackedResource) MarshalJSON

func (t TrackedResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TrackedResource.

func (*TrackedResource) UnmarshalJSON added in v1.1.0

func (t *TrackedResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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