armhardwaresecuritymodules

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 15 Imported by: 2

README

Azure Dedicated HSM Module for Go

PkgGoDev

The armhardwaresecuritymodules module provides operations for working with Azure Dedicated HSM.

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 Dedicated HSM module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Dedicated HSM. 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 Dedicated HSM 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 := armhardwaresecuritymodules.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 := armhardwaresecuritymodules.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.NewDedicatedHsmClient()

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 Dedicated HSM 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 APIEntityReference

type APIEntityReference struct {
	// The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/…
	ID *string
}

APIEntityReference - The API entity reference.

func (APIEntityReference) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type APIEntityReference.

func (*APIEntityReference) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type APIEntityReference.

type ClientFactory added in v1.1.0

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

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

func NewClientFactory added in v1.1.0

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

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

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

func (*ClientFactory) NewDedicatedHsmClient added in v1.1.0

func (c *ClientFactory) NewDedicatedHsmClient() *DedicatedHsmClient

NewDedicatedHsmClient creates a new instance of DedicatedHsmClient.

func (*ClientFactory) NewOperationsClient added in v1.1.0

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

type DedicatedHsm

type DedicatedHsm struct {
	// REQUIRED; The supported Azure location where the dedicated HSM should be created.
	Location *string

	// REQUIRED; Properties of the dedicated HSM
	Properties *DedicatedHsmProperties

	// SKU details
	SKU *SKU

	// Resource tags
	Tags map[string]*string

	// The Dedicated Hsm zones.
	Zones []*string

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

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

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

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

DedicatedHsm - Resource information with extended details.

func (DedicatedHsm) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DedicatedHsm.

func (*DedicatedHsm) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHsm.

type DedicatedHsmClient

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

DedicatedHsmClient contains the methods for the DedicatedHsm group. Don't use this type directly, use NewDedicatedHsmClient() instead.

func NewDedicatedHsmClient

func NewDedicatedHsmClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DedicatedHsmClient, error)

NewDedicatedHsmClient creates a new instance of DedicatedHsmClient with the specified values.

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

func (*DedicatedHsmClient) BeginCreateOrUpdate

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

Generated from API version 2021-11-30

  • resourceGroupName - The name of the Resource Group to which the resource belongs.
  • name - Name of the dedicated Hsm
  • parameters - Parameters to create or update the dedicated hsm
  • options - DedicatedHsmClientBeginCreateOrUpdateOptions contains the optional parameters for the DedicatedHsmClient.BeginCreateOrUpdate method.
Example (CreateANewOrUpdateAnExistingDedicatedHsm)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_CreateOrUpdate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhardwaresecuritymodules.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDedicatedHsmClient().BeginCreateOrUpdate(ctx, "hsm-group", "hsm1", armhardwaresecuritymodules.DedicatedHsm{
		Location: to.Ptr("westus"),
		SKU: &armhardwaresecuritymodules.SKU{
			Name: to.Ptr(armhardwaresecuritymodules.SKUNameSafeNetLunaNetworkHSMA790),
		},
		Tags: map[string]*string{
			"Dept":        to.Ptr("hsm"),
			"Environment": to.Ptr("dogfood"),
		},
		Properties: &armhardwaresecuritymodules.DedicatedHsmProperties{
			NetworkProfile: &armhardwaresecuritymodules.NetworkProfile{
				NetworkInterfaces: []*armhardwaresecuritymodules.NetworkInterface{
					{
						PrivateIPAddress: to.Ptr("1.0.0.1"),
					}},
				Subnet: &armhardwaresecuritymodules.APIEntityReference{
					ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01"),
				},
			},
			StampID: to.Ptr("stamp01"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.DedicatedHsm = armhardwaresecuritymodules.DedicatedHsm{
	// 	Name: to.Ptr("hsm1"),
	// 	Type: to.Ptr("Microsoft.HardwareSecurityModules/dedicatedHSMs"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/hsm1"),
	// 	Location: to.Ptr("westus"),
	// 	SKU: &armhardwaresecuritymodules.SKU{
	// 		Name: to.Ptr(armhardwaresecuritymodules.SKUNameSafeNetLunaNetworkHSMA790),
	// 	},
	// 	Tags: map[string]*string{
	// 		"Dept": to.Ptr("hsm"),
	// 		"Environment": to.Ptr("dogfood"),
	// 	},
	// 	Properties: &armhardwaresecuritymodules.DedicatedHsmProperties{
	// 		NetworkProfile: &armhardwaresecuritymodules.NetworkProfile{
	// 			NetworkInterfaces: []*armhardwaresecuritymodules.NetworkInterface{
	// 				{
	// 					ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm_vnic"),
	// 					PrivateIPAddress: to.Ptr("1.0.0.1"),
	// 			}},
	// 			Subnet: &armhardwaresecuritymodules.APIEntityReference{
	// 				ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01"),
	// 			},
	// 		},
	// 		ProvisioningState: to.Ptr(armhardwaresecuritymodules.JSONWebKeyTypeSucceeded),
	// 		StampID: to.Ptr("stamp01"),
	// 		StatusMessage: to.Ptr("DedicatedHsm device is functional."),
	// 	},
	// }
}
Output:

Example (CreateANewOrUpdateAnExistingPaymentHsm)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/PaymentHsm_CreateOrUpdate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhardwaresecuritymodules.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDedicatedHsmClient().BeginCreateOrUpdate(ctx, "hsm-group", "hsm1", armhardwaresecuritymodules.DedicatedHsm{
		Location: to.Ptr("westus"),
		SKU: &armhardwaresecuritymodules.SKU{
			Name: to.Ptr(armhardwaresecuritymodules.SKUNamePayShield10KLMK1CPS60),
		},
		Tags: map[string]*string{
			"Dept":        to.Ptr("hsm"),
			"Environment": to.Ptr("dogfood"),
		},
		Properties: &armhardwaresecuritymodules.DedicatedHsmProperties{
			NetworkProfile: &armhardwaresecuritymodules.NetworkProfile{
				NetworkInterfaces: []*armhardwaresecuritymodules.NetworkInterface{
					{
						PrivateIPAddress: to.Ptr("1.0.0.1"),
					}},
				Subnet: &armhardwaresecuritymodules.APIEntityReference{
					ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01"),
				},
			},
			StampID: to.Ptr("stamp01"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.DedicatedHsm = armhardwaresecuritymodules.DedicatedHsm{
	// 	Name: to.Ptr("hsm1"),
	// 	Type: to.Ptr("Microsoft.HardwareSecurityModules/dedicatedHSMs"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/hsm1"),
	// 	Location: to.Ptr("westus"),
	// 	SKU: &armhardwaresecuritymodules.SKU{
	// 		Name: to.Ptr(armhardwaresecuritymodules.SKUNamePayShield10KLMK1CPS60),
	// 	},
	// 	Tags: map[string]*string{
	// 		"Dept": to.Ptr("hsm"),
	// 		"Environment": to.Ptr("dogfood"),
	// 	},
	// 	Properties: &armhardwaresecuritymodules.DedicatedHsmProperties{
	// 		ManagementNetworkProfile: &armhardwaresecuritymodules.NetworkProfile{
	// 			NetworkInterfaces: []*armhardwaresecuritymodules.NetworkInterface{
	// 				{
	// 					ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm1_HSMMgmtNic"),
	// 					PrivateIPAddress: to.Ptr("1.0.0.2"),
	// 			}},
	// 			Subnet: &armhardwaresecuritymodules.APIEntityReference{
	// 				ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01"),
	// 			},
	// 		},
	// 		NetworkProfile: &armhardwaresecuritymodules.NetworkProfile{
	// 			NetworkInterfaces: []*armhardwaresecuritymodules.NetworkInterface{
	// 				{
	// 					ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm1_HSMHost1Nic"),
	// 					PrivateIPAddress: to.Ptr("1.0.0.1"),
	// 			}},
	// 			Subnet: &armhardwaresecuritymodules.APIEntityReference{
	// 				ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01"),
	// 			},
	// 		},
	// 		ProvisioningState: to.Ptr(armhardwaresecuritymodules.JSONWebKeyTypeSucceeded),
	// 		StampID: to.Ptr("stamp01"),
	// 		StatusMessage: to.Ptr("DedicatedHsm device is functional."),
	// 	},
	// 	SystemData: &armhardwaresecuritymodules.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.000Z"); return t}()),
	// 		CreatedBy: to.Ptr("user1"),
	// 		CreatedByType: to.Ptr(armhardwaresecuritymodules.IdentityTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.000Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("user2"),
	// 		LastModifiedByType: to.Ptr(armhardwaresecuritymodules.IdentityTypeUser),
	// 	},
	// }
}
Output:

Example (CreateANewOrUpdateAnExistingPaymentHsmWithManagementProfile)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/PaymentHsm_CreateOrUpdate_WithManagementProfile.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/hardwaresecuritymodules/armhardwaresecuritymodules"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhardwaresecuritymodules.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDedicatedHsmClient().BeginCreateOrUpdate(ctx, "hsm-group", "hsm1", armhardwaresecuritymodules.DedicatedHsm{
		Location: to.Ptr("westus"),
		SKU: &armhardwaresecuritymodules.SKU{
			Name: to.Ptr(armhardwaresecuritymodules.SKUNamePayShield10KLMK1CPS60),
		},
		Tags: map[string]*string{
			"Dept":        to.Ptr("hsm"),
			"Environment": to.Ptr("dogfood"),
		},
		Properties: &armhardwaresecuritymodules.DedicatedHsmProperties{
			ManagementNetworkProfile: &armhardwaresecuritymodules.NetworkProfile{
				NetworkInterfaces: []*armhardwaresecuritymodules.NetworkInterface{
					{
						PrivateIPAddress: to.Ptr("1.0.0.2"),
					}},
				Subnet: &armhardwaresecuritymodules.APIEntityReference{
					ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01"),
				},
			},
			NetworkProfile: &armhardwaresecuritymodules.NetworkProfile{
				NetworkInterfaces: []*armhardwaresecuritymodules.NetworkInterface{
					{
						PrivateIPAddress: to.Ptr("1.0.0.1"),
					}},
				Subnet: &armhardwaresecuritymodules.APIEntityReference{
					ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01"),
				},
			},
			StampID: to.Ptr("stamp01"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.DedicatedHsm = armhardwaresecuritymodules.DedicatedHsm{
	// 	Name: to.Ptr("hsm1"),
	// 	Type: to.Ptr("Microsoft.HardwareSecurityModules/dedicatedHSMs"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/hsm1"),
	// 	Location: to.Ptr("westus"),
	// 	SKU: &armhardwaresecuritymodules.SKU{
	// 		Name: to.Ptr(armhardwaresecuritymodules.SKUNamePayShield10KLMK1CPS60),
	// 	},
	// 	Tags: map[string]*string{
	// 		"Dept": to.Ptr("hsm"),
	// 		"Environment": to.Ptr("dogfood"),
	// 	},
	// 	Properties: &armhardwaresecuritymodules.DedicatedHsmProperties{
	// 		ManagementNetworkProfile: &armhardwaresecuritymodules.NetworkProfile{
	// 			NetworkInterfaces: []*armhardwaresecuritymodules.NetworkInterface{
	// 				{
	// 					ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm1_HSMMgmtNic"),
	// 					PrivateIPAddress: to.Ptr("1.0.0.2"),
	// 			}},
	// 			Subnet: &armhardwaresecuritymodules.APIEntityReference{
	// 				ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01"),
	// 			},
	// 		},
	// 		NetworkProfile: &armhardwaresecuritymodules.NetworkProfile{
	// 			NetworkInterfaces: []*armhardwaresecuritymodules.NetworkInterface{
	// 				{
	// 					ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm1_HSMHost1Nic"),
	// 					PrivateIPAddress: to.Ptr("1.0.0.1"),
	// 			}},
	// 			Subnet: &armhardwaresecuritymodules.APIEntityReference{
	// 				ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01"),
	// 			},
	// 		},
	// 		ProvisioningState: to.Ptr(armhardwaresecuritymodules.JSONWebKeyTypeSucceeded),
	// 		StampID: to.Ptr("stamp01"),
	// 		StatusMessage: to.Ptr("DedicatedHsm device is functional."),
	// 	},
	// 	SystemData: &armhardwaresecuritymodules.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.000Z"); return t}()),
	// 		CreatedBy: to.Ptr("user1"),
	// 		CreatedByType: to.Ptr(armhardwaresecuritymodules.IdentityTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.000Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("user2"),
	// 		LastModifiedByType: to.Ptr(armhardwaresecuritymodules.IdentityTypeUser),
	// 	},
	// }
}
Output:

func (*DedicatedHsmClient) BeginDelete

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

Generated from API version 2021-11-30

  • resourceGroupName - The name of the Resource Group to which the dedicated HSM belongs.
  • name - The name of the dedicated HSM to delete
  • options - DedicatedHsmClientBeginDeleteOptions contains the optional parameters for the DedicatedHsmClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhardwaresecuritymodules.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDedicatedHsmClient().BeginDelete(ctx, "hsm-group", "hsm1", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*DedicatedHsmClient) BeginUpdate

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

Generated from API version 2021-11-30

  • resourceGroupName - The name of the Resource Group to which the server belongs.
  • name - Name of the dedicated HSM
  • parameters - Parameters to patch the dedicated HSM
  • options - DedicatedHsmClientBeginUpdateOptions contains the optional parameters for the DedicatedHsmClient.BeginUpdate method.
Example (UpdateAnExistingDedicatedHsm)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_Update.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhardwaresecuritymodules.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDedicatedHsmClient().BeginUpdate(ctx, "hsm-group", "hsm1", armhardwaresecuritymodules.DedicatedHsmPatchParameters{
		Tags: map[string]*string{
			"Dept":        to.Ptr("hsm"),
			"Environment": to.Ptr("dogfood"),
			"Slice":       to.Ptr("A"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.DedicatedHsm = armhardwaresecuritymodules.DedicatedHsm{
	// 	Name: to.Ptr("hsm1"),
	// 	Type: to.Ptr("Microsoft.HardwareSecurityModules/dedicatedHSMs"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/hsm1"),
	// 	Location: to.Ptr("westus"),
	// 	SKU: &armhardwaresecuritymodules.SKU{
	// 		Name: to.Ptr(armhardwaresecuritymodules.SKUNameSafeNetLunaNetworkHSMA790),
	// 	},
	// 	Tags: map[string]*string{
	// 		"Dept": to.Ptr("hsm"),
	// 		"Environment": to.Ptr("dogfood"),
	// 		"Slice": to.Ptr("A"),
	// 	},
	// 	Properties: &armhardwaresecuritymodules.DedicatedHsmProperties{
	// 		NetworkProfile: &armhardwaresecuritymodules.NetworkProfile{
	// 			NetworkInterfaces: []*armhardwaresecuritymodules.NetworkInterface{
	// 				{
	// 					ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm_vnic"),
	// 					PrivateIPAddress: to.Ptr("1.0.0.1"),
	// 			}},
	// 			Subnet: &armhardwaresecuritymodules.APIEntityReference{
	// 				ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01"),
	// 			},
	// 		},
	// 		ProvisioningState: to.Ptr(armhardwaresecuritymodules.JSONWebKeyTypeSucceeded),
	// 		StampID: to.Ptr("stamp01"),
	// 		StatusMessage: to.Ptr("DedicatedHsm device is functional."),
	// 	},
	// }
}
Output:

Example (UpdateAnExistingPaymentHsm)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/PaymentHsm_Update.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhardwaresecuritymodules.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDedicatedHsmClient().BeginUpdate(ctx, "hsm-group", "hsm1", armhardwaresecuritymodules.DedicatedHsmPatchParameters{
		Tags: map[string]*string{
			"Dept":        to.Ptr("hsm"),
			"Environment": to.Ptr("dogfood"),
			"Slice":       to.Ptr("A"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.DedicatedHsm = armhardwaresecuritymodules.DedicatedHsm{
	// 	Name: to.Ptr("hsm1"),
	// 	Type: to.Ptr("Microsoft.HardwareSecurityModules/dedicatedHSMs"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/hsm1"),
	// 	Location: to.Ptr("westus"),
	// 	SKU: &armhardwaresecuritymodules.SKU{
	// 		Name: to.Ptr(armhardwaresecuritymodules.SKUNamePayShield10KLMK1CPS60),
	// 	},
	// 	Tags: map[string]*string{
	// 		"Dept": to.Ptr("hsm"),
	// 		"Environment": to.Ptr("dogfood"),
	// 		"Slice": to.Ptr("A"),
	// 	},
	// 	Properties: &armhardwaresecuritymodules.DedicatedHsmProperties{
	// 		ManagementNetworkProfile: &armhardwaresecuritymodules.NetworkProfile{
	// 			NetworkInterfaces: []*armhardwaresecuritymodules.NetworkInterface{
	// 				{
	// 					ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm1_HSMMgmtNic"),
	// 					PrivateIPAddress: to.Ptr("1.0.0.2"),
	// 			}},
	// 			Subnet: &armhardwaresecuritymodules.APIEntityReference{
	// 				ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01"),
	// 			},
	// 		},
	// 		NetworkProfile: &armhardwaresecuritymodules.NetworkProfile{
	// 			NetworkInterfaces: []*armhardwaresecuritymodules.NetworkInterface{
	// 				{
	// 					ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm1_HSMHost1Nic"),
	// 					PrivateIPAddress: to.Ptr("1.0.0.1"),
	// 			}},
	// 			Subnet: &armhardwaresecuritymodules.APIEntityReference{
	// 				ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01"),
	// 			},
	// 		},
	// 		ProvisioningState: to.Ptr(armhardwaresecuritymodules.JSONWebKeyTypeSucceeded),
	// 		StampID: to.Ptr("stamp01"),
	// 		StatusMessage: to.Ptr("DedicatedHsm device is functional."),
	// 	},
	// 	SystemData: &armhardwaresecuritymodules.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.000Z"); return t}()),
	// 		CreatedBy: to.Ptr("user1"),
	// 		CreatedByType: to.Ptr(armhardwaresecuritymodules.IdentityTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.000Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("user2"),
	// 		LastModifiedByType: to.Ptr(armhardwaresecuritymodules.IdentityTypeUser),
	// 	},
	// }
}
Output:

func (*DedicatedHsmClient) Get

func (client *DedicatedHsmClient) Get(ctx context.Context, resourceGroupName string, name string, options *DedicatedHsmClientGetOptions) (DedicatedHsmClientGetResponse, error)

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

Generated from API version 2021-11-30

  • resourceGroupName - The name of the Resource Group to which the dedicated hsm belongs.
  • name - The name of the dedicated HSM.
  • options - DedicatedHsmClientGetOptions contains the optional parameters for the DedicatedHsmClient.Get method.
Example (GetADedicatedHsm)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhardwaresecuritymodules.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDedicatedHsmClient().Get(ctx, "hsm-group", "hsm1", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.DedicatedHsm = armhardwaresecuritymodules.DedicatedHsm{
	// 	Name: to.Ptr("hsm1"),
	// 	Type: to.Ptr("Microsoft.HardwareSecurityModules/dedicatedHSMs"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/hsm1"),
	// 	Location: to.Ptr("westus"),
	// 	SKU: &armhardwaresecuritymodules.SKU{
	// 		Name: to.Ptr(armhardwaresecuritymodules.SKUNameSafeNetLunaNetworkHSMA790),
	// 	},
	// 	Tags: map[string]*string{
	// 		"Dept": to.Ptr("hsm"),
	// 		"Environment": to.Ptr("dogfood"),
	// 		"Slice": to.Ptr("A"),
	// 	},
	// 	Properties: &armhardwaresecuritymodules.DedicatedHsmProperties{
	// 		NetworkProfile: &armhardwaresecuritymodules.NetworkProfile{
	// 			NetworkInterfaces: []*armhardwaresecuritymodules.NetworkInterface{
	// 				{
	// 					ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm_vnic"),
	// 					PrivateIPAddress: to.Ptr("1.0.0.1"),
	// 			}},
	// 			Subnet: &armhardwaresecuritymodules.APIEntityReference{
	// 				ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01"),
	// 			},
	// 		},
	// 		ProvisioningState: to.Ptr(armhardwaresecuritymodules.JSONWebKeyTypeSucceeded),
	// 		StampID: to.Ptr("stamp01"),
	// 		StatusMessage: to.Ptr("DedicatedHsm device is functional."),
	// 	},
	// }
}
Output:

Example (GetAPaymentHsm)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/PaymentHsm_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhardwaresecuritymodules.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDedicatedHsmClient().Get(ctx, "hsm-group", "hsm1", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.DedicatedHsm = armhardwaresecuritymodules.DedicatedHsm{
	// 	Name: to.Ptr("hsm1"),
	// 	Type: to.Ptr("Microsoft.HardwareSecurityModules/dedicatedHSMs"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/hsm1"),
	// 	Location: to.Ptr("westus"),
	// 	SKU: &armhardwaresecuritymodules.SKU{
	// 		Name: to.Ptr(armhardwaresecuritymodules.SKUNamePayShield10KLMK1CPS60),
	// 	},
	// 	Tags: map[string]*string{
	// 		"Dept": to.Ptr("hsm"),
	// 		"Environment": to.Ptr("dogfood"),
	// 		"Slice": to.Ptr("A"),
	// 	},
	// 	Properties: &armhardwaresecuritymodules.DedicatedHsmProperties{
	// 		ManagementNetworkProfile: &armhardwaresecuritymodules.NetworkProfile{
	// 			NetworkInterfaces: []*armhardwaresecuritymodules.NetworkInterface{
	// 				{
	// 					ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm1_HSMMgmtNic"),
	// 					PrivateIPAddress: to.Ptr("1.0.0.2"),
	// 			}},
	// 			Subnet: &armhardwaresecuritymodules.APIEntityReference{
	// 				ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01"),
	// 			},
	// 		},
	// 		NetworkProfile: &armhardwaresecuritymodules.NetworkProfile{
	// 			NetworkInterfaces: []*armhardwaresecuritymodules.NetworkInterface{
	// 				{
	// 					ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm1_HSMHost1Nic"),
	// 					PrivateIPAddress: to.Ptr("1.0.0.1"),
	// 			}},
	// 			Subnet: &armhardwaresecuritymodules.APIEntityReference{
	// 				ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01"),
	// 			},
	// 		},
	// 		ProvisioningState: to.Ptr(armhardwaresecuritymodules.JSONWebKeyTypeSucceeded),
	// 		StampID: to.Ptr("stamp01"),
	// 		StatusMessage: to.Ptr("DedicatedHsm device is functional."),
	// 	},
	// 	SystemData: &armhardwaresecuritymodules.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.000Z"); return t}()),
	// 		CreatedBy: to.Ptr("user1"),
	// 		CreatedByType: to.Ptr(armhardwaresecuritymodules.IdentityTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.000Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("user2"),
	// 		LastModifiedByType: to.Ptr(armhardwaresecuritymodules.IdentityTypeUser),
	// 	},
	// }
}
Output:

Example (GetAPaymentHsmWith20181031PreviewApiVersion)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/PaymentHsm_Get_With_2018-10-31Preview_Version.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhardwaresecuritymodules.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDedicatedHsmClient().Get(ctx, "hsm-group", "hsm1", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.DedicatedHsm = armhardwaresecuritymodules.DedicatedHsm{
	// 	Name: to.Ptr("hsm1"),
	// 	Type: to.Ptr("Microsoft.HardwareSecurityModules/dedicatedHSMs"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/hsm1"),
	// 	Location: to.Ptr("westus"),
	// 	SKU: &armhardwaresecuritymodules.SKU{
	// 		Name: to.Ptr(armhardwaresecuritymodules.SKUNamePayShield10KLMK1CPS60),
	// 	},
	// 	Tags: map[string]*string{
	// 		"Dept": to.Ptr("hsm"),
	// 		"Environment": to.Ptr("dogfood"),
	// 		"Slice": to.Ptr("A"),
	// 	},
	// 	Properties: &armhardwaresecuritymodules.DedicatedHsmProperties{
	// 		NetworkProfile: &armhardwaresecuritymodules.NetworkProfile{
	// 			NetworkInterfaces: []*armhardwaresecuritymodules.NetworkInterface{
	// 				{
	// 					ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm1_HSMHost1Nic"),
	// 					PrivateIPAddress: to.Ptr("1.0.0.1"),
	// 			}},
	// 			Subnet: &armhardwaresecuritymodules.APIEntityReference{
	// 				ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01"),
	// 			},
	// 		},
	// 		ProvisioningState: to.Ptr(armhardwaresecuritymodules.JSONWebKeyTypeSucceeded),
	// 		StampID: to.Ptr("stamp01"),
	// 		StatusMessage: to.Ptr("DedicatedHsm device is functional."),
	// 	},
	// }
}
Output:

func (*DedicatedHsmClient) NewListByResourceGroupPager added in v0.4.0

NewListByResourceGroupPager - The List operation gets information about the dedicated hsms associated with the subscription and within the specified resource group.

Generated from API version 2021-11-30

  • resourceGroupName - The name of the Resource Group to which the dedicated HSM belongs.
  • options - DedicatedHsmClientListByResourceGroupOptions contains the optional parameters for the DedicatedHsmClient.NewListByResourceGroupPager method.
Example (ListDedicatedHsmDevicesInAResourceGroup)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_ListByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhardwaresecuritymodules.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewDedicatedHsmClient().NewListByResourceGroupPager("hsm-group", &armhardwaresecuritymodules.DedicatedHsmClientListByResourceGroupOptions{Top: nil})
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.DedicatedHsmListResult = armhardwaresecuritymodules.DedicatedHsmListResult{
		// 	Value: []*armhardwaresecuritymodules.DedicatedHsm{
		// 		{
		// 			Name: to.Ptr("hsm1"),
		// 			Type: to.Ptr("Microsoft.HardwareSecurityModules/dedicatedHSMs"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/hsm1"),
		// 			Location: to.Ptr("westus"),
		// 			SKU: &armhardwaresecuritymodules.SKU{
		// 				Name: to.Ptr(armhardwaresecuritymodules.SKUNameSafeNetLunaNetworkHSMA790),
		// 			},
		// 			Tags: map[string]*string{
		// 				"Dept": to.Ptr("hsm"),
		// 				"Environment": to.Ptr("dogfood"),
		// 				"Slice": to.Ptr("A"),
		// 			},
		// 			Properties: &armhardwaresecuritymodules.DedicatedHsmProperties{
		// 				NetworkProfile: &armhardwaresecuritymodules.NetworkProfile{
		// 					NetworkInterfaces: []*armhardwaresecuritymodules.NetworkInterface{
		// 						{
		// 							ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm_vnic"),
		// 							PrivateIPAddress: to.Ptr("1.0.0.1"),
		// 					}},
		// 					Subnet: &armhardwaresecuritymodules.APIEntityReference{
		// 						ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01"),
		// 					},
		// 				},
		// 				ProvisioningState: to.Ptr(armhardwaresecuritymodules.JSONWebKeyTypeSucceeded),
		// 				StampID: to.Ptr("stamp01"),
		// 				StatusMessage: to.Ptr("DedicatedHsm device is functional."),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("hsm1"),
		// 			Type: to.Ptr("Microsoft.HardwareSecurityModules/dedicatedHSMs"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/hsm2"),
		// 			Location: to.Ptr("westus"),
		// 			SKU: &armhardwaresecuritymodules.SKU{
		// 				Name: to.Ptr(armhardwaresecuritymodules.SKUNameSafeNetLunaNetworkHSMA790),
		// 			},
		// 			Tags: map[string]*string{
		// 				"Dept": to.Ptr("hsm"),
		// 				"Environment": to.Ptr("dogfood"),
		// 				"Slice": to.Ptr("B"),
		// 			},
		// 			Properties: &armhardwaresecuritymodules.DedicatedHsmProperties{
		// 				NetworkProfile: &armhardwaresecuritymodules.NetworkProfile{
		// 					NetworkInterfaces: []*armhardwaresecuritymodules.NetworkInterface{
		// 						{
		// 							ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm_vnic"),
		// 							PrivateIPAddress: to.Ptr("1.0.0.2"),
		// 					}},
		// 					Subnet: &armhardwaresecuritymodules.APIEntityReference{
		// 						ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01"),
		// 					},
		// 				},
		// 				ProvisioningState: to.Ptr(armhardwaresecuritymodules.JSONWebKeyTypeSucceeded),
		// 				StampID: to.Ptr("stamp01"),
		// 				StatusMessage: to.Ptr("DedicatedHsm device is functional."),
		// 			},
		// 	}},
		// }
	}
}
Output:

Example (ListDedicatedHsmDevicesInAResourceGroupIncludingPaymentHsm)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/PaymentHsm_ListByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhardwaresecuritymodules.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewDedicatedHsmClient().NewListByResourceGroupPager("hsm-group", &armhardwaresecuritymodules.DedicatedHsmClientListByResourceGroupOptions{Top: nil})
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.DedicatedHsmListResult = armhardwaresecuritymodules.DedicatedHsmListResult{
		// 	Value: []*armhardwaresecuritymodules.DedicatedHsm{
		// 		{
		// 			Name: to.Ptr("hsm1"),
		// 			Type: to.Ptr("Microsoft.HardwareSecurityModules/dedicatedHSMs"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/hsm1"),
		// 			Location: to.Ptr("westus"),
		// 			SKU: &armhardwaresecuritymodules.SKU{
		// 				Name: to.Ptr(armhardwaresecuritymodules.SKUNamePayShield10KLMK1CPS60),
		// 			},
		// 			Tags: map[string]*string{
		// 				"Dept": to.Ptr("hsm"),
		// 				"Environment": to.Ptr("dogfood"),
		// 				"Slice": to.Ptr("A"),
		// 			},
		// 			Properties: &armhardwaresecuritymodules.DedicatedHsmProperties{
		// 				ManagementNetworkProfile: &armhardwaresecuritymodules.NetworkProfile{
		// 					NetworkInterfaces: []*armhardwaresecuritymodules.NetworkInterface{
		// 						{
		// 							ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm1_HSMMgmtNic"),
		// 							PrivateIPAddress: to.Ptr("1.0.0.2"),
		// 					}},
		// 					Subnet: &armhardwaresecuritymodules.APIEntityReference{
		// 						ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01"),
		// 					},
		// 				},
		// 				NetworkProfile: &armhardwaresecuritymodules.NetworkProfile{
		// 					NetworkInterfaces: []*armhardwaresecuritymodules.NetworkInterface{
		// 						{
		// 							ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm1_HSMHost1Nic"),
		// 							PrivateIPAddress: to.Ptr("1.0.0.1"),
		// 					}},
		// 					Subnet: &armhardwaresecuritymodules.APIEntityReference{
		// 						ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01"),
		// 					},
		// 				},
		// 				ProvisioningState: to.Ptr(armhardwaresecuritymodules.JSONWebKeyTypeSucceeded),
		// 				StampID: to.Ptr("stamp01"),
		// 				StatusMessage: to.Ptr("DedicatedHsm device is functional."),
		// 			},
		// 			SystemData: &armhardwaresecuritymodules.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.000Z"); return t}()),
		// 				CreatedBy: to.Ptr("user1"),
		// 				CreatedByType: to.Ptr(armhardwaresecuritymodules.IdentityTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.000Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("user2"),
		// 				LastModifiedByType: to.Ptr(armhardwaresecuritymodules.IdentityTypeUser),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("hsm2"),
		// 			Type: to.Ptr("Microsoft.HardwareSecurityModules/dedicatedHSMs"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/hsm2"),
		// 			Location: to.Ptr("westus"),
		// 			SKU: &armhardwaresecuritymodules.SKU{
		// 				Name: to.Ptr(armhardwaresecuritymodules.SKUNamePayShield10KLMK1CPS60),
		// 			},
		// 			Tags: map[string]*string{
		// 				"Dept": to.Ptr("hsm"),
		// 				"Environment": to.Ptr("dogfood"),
		// 				"Slice": to.Ptr("B"),
		// 			},
		// 			Properties: &armhardwaresecuritymodules.DedicatedHsmProperties{
		// 				ManagementNetworkProfile: &armhardwaresecuritymodules.NetworkProfile{
		// 					NetworkInterfaces: []*armhardwaresecuritymodules.NetworkInterface{
		// 						{
		// 							ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm2_HSMMgmtNic"),
		// 							PrivateIPAddress: to.Ptr("1.0.0.4"),
		// 					}},
		// 					Subnet: &armhardwaresecuritymodules.APIEntityReference{
		// 						ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01"),
		// 					},
		// 				},
		// 				NetworkProfile: &armhardwaresecuritymodules.NetworkProfile{
		// 					NetworkInterfaces: []*armhardwaresecuritymodules.NetworkInterface{
		// 						{
		// 							ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm2_HSMHost1Nic"),
		// 							PrivateIPAddress: to.Ptr("1.0.0.3"),
		// 					}},
		// 					Subnet: &armhardwaresecuritymodules.APIEntityReference{
		// 						ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01"),
		// 					},
		// 				},
		// 				ProvisioningState: to.Ptr(armhardwaresecuritymodules.JSONWebKeyTypeSucceeded),
		// 				StampID: to.Ptr("stamp01"),
		// 				StatusMessage: to.Ptr("DedicatedHsm device is functional."),
		// 			},
		// 			SystemData: &armhardwaresecuritymodules.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.000Z"); return t}()),
		// 				CreatedBy: to.Ptr("user1"),
		// 				CreatedByType: to.Ptr(armhardwaresecuritymodules.IdentityTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.000Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("user2"),
		// 				LastModifiedByType: to.Ptr(armhardwaresecuritymodules.IdentityTypeUser),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*DedicatedHsmClient) NewListBySubscriptionPager added in v0.4.0

NewListBySubscriptionPager - The List operation gets information about the dedicated HSMs associated with the subscription.

Generated from API version 2021-11-30

  • options - DedicatedHsmClientListBySubscriptionOptions contains the optional parameters for the DedicatedHsmClient.NewListBySubscriptionPager method.
Example (ListDedicatedHsmDevicesInASubscription)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_ListBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhardwaresecuritymodules.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewDedicatedHsmClient().NewListBySubscriptionPager(&armhardwaresecuritymodules.DedicatedHsmClientListBySubscriptionOptions{Top: nil})
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.DedicatedHsmListResult = armhardwaresecuritymodules.DedicatedHsmListResult{
		// 	Value: []*armhardwaresecuritymodules.DedicatedHsm{
		// 		{
		// 			Name: to.Ptr("hsm1"),
		// 			Type: to.Ptr("Microsoft.HardwareSecurityModules/dedicatedHSMs"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/hsm1"),
		// 			Location: to.Ptr("westus"),
		// 			SKU: &armhardwaresecuritymodules.SKU{
		// 				Name: to.Ptr(armhardwaresecuritymodules.SKUNameSafeNetLunaNetworkHSMA790),
		// 			},
		// 			Tags: map[string]*string{
		// 				"Dept": to.Ptr("hsm"),
		// 				"Environment": to.Ptr("dogfood"),
		// 				"Slice": to.Ptr("A"),
		// 			},
		// 			Properties: &armhardwaresecuritymodules.DedicatedHsmProperties{
		// 				NetworkProfile: &armhardwaresecuritymodules.NetworkProfile{
		// 					NetworkInterfaces: []*armhardwaresecuritymodules.NetworkInterface{
		// 						{
		// 							ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm_vnic"),
		// 							PrivateIPAddress: to.Ptr("1.0.0.1"),
		// 					}},
		// 					Subnet: &armhardwaresecuritymodules.APIEntityReference{
		// 						ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01"),
		// 					},
		// 				},
		// 				ProvisioningState: to.Ptr(armhardwaresecuritymodules.JSONWebKeyTypeSucceeded),
		// 				StampID: to.Ptr("stamp01"),
		// 				StatusMessage: to.Ptr("DedicatedHsm device is functional."),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("hsm1"),
		// 			Type: to.Ptr("Microsoft.HardwareSecurityModules/dedicatedHSMs"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/hsm2"),
		// 			Location: to.Ptr("westus"),
		// 			SKU: &armhardwaresecuritymodules.SKU{
		// 				Name: to.Ptr(armhardwaresecuritymodules.SKUNameSafeNetLunaNetworkHSMA790),
		// 			},
		// 			Tags: map[string]*string{
		// 				"Dept": to.Ptr("hsm"),
		// 				"Environment": to.Ptr("dogfood"),
		// 				"Slice": to.Ptr("B"),
		// 			},
		// 			Properties: &armhardwaresecuritymodules.DedicatedHsmProperties{
		// 				NetworkProfile: &armhardwaresecuritymodules.NetworkProfile{
		// 					NetworkInterfaces: []*armhardwaresecuritymodules.NetworkInterface{
		// 						{
		// 							ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm_vnic"),
		// 							PrivateIPAddress: to.Ptr("1.0.0.2"),
		// 					}},
		// 					Subnet: &armhardwaresecuritymodules.APIEntityReference{
		// 						ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01"),
		// 					},
		// 				},
		// 				ProvisioningState: to.Ptr(armhardwaresecuritymodules.JSONWebKeyTypeSucceeded),
		// 				StampID: to.Ptr("stamp01"),
		// 				StatusMessage: to.Ptr("DedicatedHsm device is functional."),
		// 			},
		// 	}},
		// }
	}
}
Output:

Example (ListDedicatedHsmDevicesInASubscriptionIncludingPaymentHsm)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/PaymentHsm_ListBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhardwaresecuritymodules.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewDedicatedHsmClient().NewListBySubscriptionPager(&armhardwaresecuritymodules.DedicatedHsmClientListBySubscriptionOptions{Top: nil})
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.DedicatedHsmListResult = armhardwaresecuritymodules.DedicatedHsmListResult{
		// 	Value: []*armhardwaresecuritymodules.DedicatedHsm{
		// 		{
		// 			Name: to.Ptr("hsm1"),
		// 			Type: to.Ptr("Microsoft.HardwareSecurityModules/dedicatedHSMs"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/hsm1"),
		// 			Location: to.Ptr("westus"),
		// 			SKU: &armhardwaresecuritymodules.SKU{
		// 				Name: to.Ptr(armhardwaresecuritymodules.SKUNamePayShield10KLMK1CPS60),
		// 			},
		// 			Tags: map[string]*string{
		// 				"Dept": to.Ptr("hsm1"),
		// 				"Environment": to.Ptr("dogfood"),
		// 				"Slice": to.Ptr("A"),
		// 			},
		// 			Properties: &armhardwaresecuritymodules.DedicatedHsmProperties{
		// 				ManagementNetworkProfile: &armhardwaresecuritymodules.NetworkProfile{
		// 					NetworkInterfaces: []*armhardwaresecuritymodules.NetworkInterface{
		// 						{
		// 							ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm1_HSMMgmtNic"),
		// 							PrivateIPAddress: to.Ptr("1.0.0.2"),
		// 					}},
		// 					Subnet: &armhardwaresecuritymodules.APIEntityReference{
		// 						ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01"),
		// 					},
		// 				},
		// 				NetworkProfile: &armhardwaresecuritymodules.NetworkProfile{
		// 					NetworkInterfaces: []*armhardwaresecuritymodules.NetworkInterface{
		// 						{
		// 							ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm1_HSMHost1Nic"),
		// 							PrivateIPAddress: to.Ptr("1.0.0.1"),
		// 					}},
		// 					Subnet: &armhardwaresecuritymodules.APIEntityReference{
		// 						ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01"),
		// 					},
		// 				},
		// 				ProvisioningState: to.Ptr(armhardwaresecuritymodules.JSONWebKeyTypeSucceeded),
		// 				StampID: to.Ptr("stamp01"),
		// 				StatusMessage: to.Ptr("DedicatedHsm device is functional."),
		// 			},
		// 			SystemData: &armhardwaresecuritymodules.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.000Z"); return t}()),
		// 				CreatedBy: to.Ptr("user1"),
		// 				CreatedByType: to.Ptr(armhardwaresecuritymodules.IdentityTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.000Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("user2"),
		// 				LastModifiedByType: to.Ptr(armhardwaresecuritymodules.IdentityTypeUser),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("hsm2"),
		// 			Type: to.Ptr("Microsoft.HardwareSecurityModules/dedicatedHSMs"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/hsm2"),
		// 			Location: to.Ptr("westus"),
		// 			SKU: &armhardwaresecuritymodules.SKU{
		// 				Name: to.Ptr(armhardwaresecuritymodules.SKUNamePayShield10KLMK1CPS60),
		// 			},
		// 			Tags: map[string]*string{
		// 				"Dept": to.Ptr("hsm"),
		// 				"Environment": to.Ptr("dogfood"),
		// 				"Slice": to.Ptr("B"),
		// 			},
		// 			Properties: &armhardwaresecuritymodules.DedicatedHsmProperties{
		// 				ManagementNetworkProfile: &armhardwaresecuritymodules.NetworkProfile{
		// 					NetworkInterfaces: []*armhardwaresecuritymodules.NetworkInterface{
		// 						{
		// 							ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm2_HSMMgmtNic"),
		// 							PrivateIPAddress: to.Ptr("1.0.0.4"),
		// 					}},
		// 					Subnet: &armhardwaresecuritymodules.APIEntityReference{
		// 						ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01"),
		// 					},
		// 				},
		// 				NetworkProfile: &armhardwaresecuritymodules.NetworkProfile{
		// 					NetworkInterfaces: []*armhardwaresecuritymodules.NetworkInterface{
		// 						{
		// 							ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm2_HSMHost1Nic"),
		// 							PrivateIPAddress: to.Ptr("1.0.0.3"),
		// 					}},
		// 					Subnet: &armhardwaresecuritymodules.APIEntityReference{
		// 						ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01"),
		// 					},
		// 				},
		// 				ProvisioningState: to.Ptr(armhardwaresecuritymodules.JSONWebKeyTypeSucceeded),
		// 				StampID: to.Ptr("stamp01"),
		// 				StatusMessage: to.Ptr("DedicatedHsm device is functional."),
		// 			},
		// 			SystemData: &armhardwaresecuritymodules.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.000Z"); return t}()),
		// 				CreatedBy: to.Ptr("user1"),
		// 				CreatedByType: to.Ptr(armhardwaresecuritymodules.IdentityTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:00:00.000Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("user2"),
		// 				LastModifiedByType: to.Ptr(armhardwaresecuritymodules.IdentityTypeUser),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*DedicatedHsmClient) NewListOutboundNetworkDependenciesEndpointsPager added in v0.4.0

NewListOutboundNetworkDependenciesEndpointsPager - Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified dedicated hsm resource. The operation returns properties of each egress endpoint.

Generated from API version 2021-11-30

  • resourceGroupName - The name of the Resource Group to which the dedicated hsm belongs.
  • name - The name of the dedicated HSM.
  • options - DedicatedHsmClientListOutboundNetworkDependenciesEndpointsOptions contains the optional parameters for the DedicatedHsmClient.NewListOutboundNetworkDependenciesEndpointsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/GetOutboundNetworkDependenciesEndpointsList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhardwaresecuritymodules.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewDedicatedHsmClient().NewListOutboundNetworkDependenciesEndpointsPager("hsm-group", "hsm1", 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.OutboundEnvironmentEndpointCollection = armhardwaresecuritymodules.OutboundEnvironmentEndpointCollection{
		// 	Value: []*armhardwaresecuritymodules.OutboundEnvironmentEndpoint{
		// 	},
		// }
	}
}
Output:

type DedicatedHsmClientBeginCreateOrUpdateOptions added in v0.2.0

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

DedicatedHsmClientBeginCreateOrUpdateOptions contains the optional parameters for the DedicatedHsmClient.BeginCreateOrUpdate method.

type DedicatedHsmClientBeginDeleteOptions added in v0.2.0

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

DedicatedHsmClientBeginDeleteOptions contains the optional parameters for the DedicatedHsmClient.BeginDelete method.

type DedicatedHsmClientBeginUpdateOptions added in v0.2.0

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

DedicatedHsmClientBeginUpdateOptions contains the optional parameters for the DedicatedHsmClient.BeginUpdate method.

type DedicatedHsmClientCreateOrUpdateResponse added in v0.2.0

type DedicatedHsmClientCreateOrUpdateResponse struct {
	// Resource information with extended details.
	DedicatedHsm
}

DedicatedHsmClientCreateOrUpdateResponse contains the response from method DedicatedHsmClient.BeginCreateOrUpdate.

type DedicatedHsmClientDeleteResponse added in v0.2.0

type DedicatedHsmClientDeleteResponse struct {
}

DedicatedHsmClientDeleteResponse contains the response from method DedicatedHsmClient.BeginDelete.

type DedicatedHsmClientGetOptions added in v0.2.0

type DedicatedHsmClientGetOptions struct {
}

DedicatedHsmClientGetOptions contains the optional parameters for the DedicatedHsmClient.Get method.

type DedicatedHsmClientGetResponse added in v0.2.0

type DedicatedHsmClientGetResponse struct {
	// Resource information with extended details.
	DedicatedHsm
}

DedicatedHsmClientGetResponse contains the response from method DedicatedHsmClient.Get.

type DedicatedHsmClientListByResourceGroupOptions added in v0.2.0

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

DedicatedHsmClientListByResourceGroupOptions contains the optional parameters for the DedicatedHsmClient.NewListByResourceGroupPager method.

type DedicatedHsmClientListByResourceGroupResponse added in v0.2.0

type DedicatedHsmClientListByResourceGroupResponse struct {
	// List of dedicated HSMs
	DedicatedHsmListResult
}

DedicatedHsmClientListByResourceGroupResponse contains the response from method DedicatedHsmClient.NewListByResourceGroupPager.

type DedicatedHsmClientListBySubscriptionOptions added in v0.2.0

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

DedicatedHsmClientListBySubscriptionOptions contains the optional parameters for the DedicatedHsmClient.NewListBySubscriptionPager method.

type DedicatedHsmClientListBySubscriptionResponse added in v0.2.0

type DedicatedHsmClientListBySubscriptionResponse struct {
	// List of dedicated HSMs
	DedicatedHsmListResult
}

DedicatedHsmClientListBySubscriptionResponse contains the response from method DedicatedHsmClient.NewListBySubscriptionPager.

type DedicatedHsmClientListOutboundNetworkDependenciesEndpointsOptions added in v0.2.0

type DedicatedHsmClientListOutboundNetworkDependenciesEndpointsOptions struct {
}

DedicatedHsmClientListOutboundNetworkDependenciesEndpointsOptions contains the optional parameters for the DedicatedHsmClient.NewListOutboundNetworkDependenciesEndpointsPager method.

type DedicatedHsmClientListOutboundNetworkDependenciesEndpointsResponse added in v0.2.0

type DedicatedHsmClientListOutboundNetworkDependenciesEndpointsResponse struct {
	// Collection of OutboundEnvironmentEndpoint
	OutboundEnvironmentEndpointCollection
}

DedicatedHsmClientListOutboundNetworkDependenciesEndpointsResponse contains the response from method DedicatedHsmClient.NewListOutboundNetworkDependenciesEndpointsPager.

type DedicatedHsmClientUpdateResponse added in v0.2.0

type DedicatedHsmClientUpdateResponse struct {
	// Resource information with extended details.
	DedicatedHsm
}

DedicatedHsmClientUpdateResponse contains the response from method DedicatedHsmClient.BeginUpdate.

type DedicatedHsmError

type DedicatedHsmError struct {
	// READ-ONLY; The error detail of the operation if any.
	Error *Error
}

DedicatedHsmError - The error exception.

func (DedicatedHsmError) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type DedicatedHsmError.

func (*DedicatedHsmError) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHsmError.

type DedicatedHsmListResult

type DedicatedHsmListResult struct {
	// The URL to get the next set of dedicated hsms.
	NextLink *string

	// The list of dedicated HSMs.
	Value []*DedicatedHsm
}

DedicatedHsmListResult - List of dedicated HSMs

func (DedicatedHsmListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DedicatedHsmListResult.

func (*DedicatedHsmListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHsmListResult.

type DedicatedHsmOperation

type DedicatedHsmOperation struct {
	// The display string.
	Display *DedicatedHsmOperationDisplay

	// The name of the Dedicated HSM Resource Provider Operation.
	Name *string

	// READ-ONLY; Gets or sets a value indicating whether it is a data plane action
	IsDataAction *string
}

DedicatedHsmOperation - REST API operation

func (DedicatedHsmOperation) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type DedicatedHsmOperation.

func (*DedicatedHsmOperation) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHsmOperation.

type DedicatedHsmOperationDisplay

type DedicatedHsmOperationDisplay struct {
	// The object that represents the operation.
	Description *string

	// Operation type: Read, write, delete, etc.
	Operation *string

	// The Resource Provider of the operation
	Provider *string

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

DedicatedHsmOperationDisplay - The display string.

func (DedicatedHsmOperationDisplay) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type DedicatedHsmOperationDisplay.

func (*DedicatedHsmOperationDisplay) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHsmOperationDisplay.

type DedicatedHsmOperationListResult

type DedicatedHsmOperationListResult struct {
	// List of Dedicated HSM Resource Provider operations.
	Value []*DedicatedHsmOperation
}

DedicatedHsmOperationListResult - Result of the request to list Dedicated HSM Provider operations. It contains a list of operations.

func (DedicatedHsmOperationListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DedicatedHsmOperationListResult.

func (*DedicatedHsmOperationListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHsmOperationListResult.

type DedicatedHsmPatchParameters

type DedicatedHsmPatchParameters struct {
	// Resource tags
	Tags map[string]*string
}

DedicatedHsmPatchParameters - Patchable properties of the dedicated HSM

func (DedicatedHsmPatchParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DedicatedHsmPatchParameters.

func (*DedicatedHsmPatchParameters) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHsmPatchParameters.

type DedicatedHsmProperties

type DedicatedHsmProperties struct {
	// Specifies the management network interfaces of the dedicated hsm.
	ManagementNetworkProfile *NetworkProfile

	// Specifies the network interfaces of the dedicated hsm.
	NetworkProfile *NetworkProfile

	// This field will be used when RP does not support Availability zones.
	StampID *string

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

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

DedicatedHsmProperties - Properties of the dedicated hsm

func (DedicatedHsmProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type DedicatedHsmProperties.

func (*DedicatedHsmProperties) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHsmProperties.

type EndpointDependency added in v0.2.0

type EndpointDependency struct {
	// The domain name of the dependency.
	DomainName *string

	// The Ports and Protocols used when connecting to domainName.
	EndpointDetails []*EndpointDetail
}

EndpointDependency - A domain name that dedicated hsm services are reaching at.

func (EndpointDependency) MarshalJSON added in v0.2.0

func (e EndpointDependency) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type EndpointDependency.

func (*EndpointDependency) UnmarshalJSON added in v1.1.0

func (e *EndpointDependency) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type EndpointDependency.

type EndpointDetail added in v0.2.0

type EndpointDetail struct {
	// Description of the detail
	Description *string

	// An IP Address that Domain Name currently resolves to.
	IPAddress *string

	// The port an endpoint is connected to.
	Port *int32

	// The protocol used for connection
	Protocol *string
}

EndpointDetail - Connect information from the dedicated hsm service to a single endpoint.

func (EndpointDetail) MarshalJSON added in v1.1.0

func (e EndpointDetail) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type EndpointDetail.

func (*EndpointDetail) UnmarshalJSON added in v1.1.0

func (e *EndpointDetail) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type EndpointDetail.

type Error

type Error struct {
	// READ-ONLY; The error code.
	Code *string

	// READ-ONLY; Contains more specific error that narrows down the cause. May be null.
	InnerError *Error

	// READ-ONLY; The error message.
	Message *string
}

Error - The key vault server error.

func (Error) MarshalJSON added in v1.1.0

func (e Error) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Error.

func (*Error) UnmarshalJSON added in v1.1.0

func (e *Error) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Error.

type IdentityType added in v0.2.0

type IdentityType string

IdentityType - The type of identity.

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

func PossibleIdentityTypeValues added in v0.2.0

func PossibleIdentityTypeValues() []IdentityType

PossibleIdentityTypeValues returns the possible values for the IdentityType const type.

type JSONWebKeyType

type JSONWebKeyType string

JSONWebKeyType - Provisioning state.

const (
	// JSONWebKeyTypeAllocating - A device is currently being allocated for the dedicated HSM resource.
	JSONWebKeyTypeAllocating JSONWebKeyType = "Allocating"
	// JSONWebKeyTypeCheckingQuota - Validating the subscription has sufficient quota to allocate a dedicated HSM device.
	JSONWebKeyTypeCheckingQuota JSONWebKeyType = "CheckingQuota"
	// JSONWebKeyTypeConnecting - The dedicated HSM is being connected to the virtual network.
	JSONWebKeyTypeConnecting JSONWebKeyType = "Connecting"
	// JSONWebKeyTypeDeleting - The dedicated HSM is currently being deleted.
	JSONWebKeyTypeDeleting JSONWebKeyType = "Deleting"
	// JSONWebKeyTypeFailed - Provisioning of the dedicated HSM has failed.
	JSONWebKeyTypeFailed JSONWebKeyType = "Failed"
	// JSONWebKeyTypeProvisioning - The dedicated HSM is currently being provisioned.
	JSONWebKeyTypeProvisioning JSONWebKeyType = "Provisioning"
	// JSONWebKeyTypeSucceeded - The dedicated HSM has been full provisioned.
	JSONWebKeyTypeSucceeded JSONWebKeyType = "Succeeded"
)

func PossibleJSONWebKeyTypeValues

func PossibleJSONWebKeyTypeValues() []JSONWebKeyType

PossibleJSONWebKeyTypeValues returns the possible values for the JSONWebKeyType const type.

type NetworkInterface

type NetworkInterface struct {
	// Private Ip address of the interface
	PrivateIPAddress *string

	// READ-ONLY; The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/…
	ID *string
}

NetworkInterface - The network interface definition.

func (NetworkInterface) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type NetworkInterface.

func (*NetworkInterface) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type NetworkInterface.

type NetworkProfile

type NetworkProfile struct {
	// Specifies the list of resource Ids for the network interfaces associated with the dedicated HSM.
	NetworkInterfaces []*NetworkInterface

	// Specifies the identifier of the subnet.
	Subnet *APIEntityReference
}

NetworkProfile - The network profile definition.

func (NetworkProfile) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type NetworkProfile.

func (*NetworkProfile) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type NetworkProfile.

type OperationsClient

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

OperationsClient contains the methods for the Operations group. Don't use this type directly, use NewOperationsClient() instead.

func NewOperationsClient

func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error)

NewOperationsClient creates a new instance of OperationsClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*OperationsClient) NewListPager added in v0.4.0

NewListPager - Get a list of Dedicated HSM operations.

Generated from API version 2021-11-30

  • options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
Example (GetAListOfDedicatedHsmOperations)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/DedicatedHsm_OperationsList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhardwaresecuritymodules.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewOperationsClient().NewListPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.DedicatedHsmOperationListResult = armhardwaresecuritymodules.DedicatedHsmOperationListResult{
		// 	Value: []*armhardwaresecuritymodules.DedicatedHsmOperation{
		// 		{
		// 			Name: to.Ptr("hsm1"),
		// 			Display: &armhardwaresecuritymodules.DedicatedHsmOperationDisplay{
		// 				Description: to.Ptr("Update a dedicated HSM in the specified subscription"),
		// 				Operation: to.Ptr("DedicatedHsm_Update"),
		// 				Provider: to.Ptr("Microsoft HardwareSecurityModules"),
		// 				Resource: to.Ptr("Dedicated HSM"),
		// 			},
		// 			IsDataAction: to.Ptr("false"),
		// 	}},
		// }
	}
}
Output:

Example (GetAListOfPaymentHsmOperations)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2021-11-30/examples/PaymentHsm_OperationsList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhardwaresecuritymodules.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewOperationsClient().NewListPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.DedicatedHsmOperationListResult = armhardwaresecuritymodules.DedicatedHsmOperationListResult{
		// 	Value: []*armhardwaresecuritymodules.DedicatedHsmOperation{
		// 		{
		// 			Name: to.Ptr("hsm1"),
		// 			Display: &armhardwaresecuritymodules.DedicatedHsmOperationDisplay{
		// 				Description: to.Ptr("Update a dedicated HSM in the specified subscription"),
		// 				Operation: to.Ptr("DedicatedHsm_Update"),
		// 				Provider: to.Ptr("Microsoft HardwareSecurityModules"),
		// 				Resource: to.Ptr("Dedicated HSM"),
		// 			},
		// 			IsDataAction: to.Ptr("false"),
		// 	}},
		// }
	}
}
Output:

type OperationsClientListOptions added in v0.2.0

type OperationsClientListOptions struct {
}

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

type OperationsClientListResponse added in v0.2.0

type OperationsClientListResponse struct {
	// Result of the request to list Dedicated HSM Provider operations. It contains a list of operations.
	DedicatedHsmOperationListResult
}

OperationsClientListResponse contains the response from method OperationsClient.NewListPager.

type OutboundEnvironmentEndpoint added in v0.2.0

type OutboundEnvironmentEndpoint struct {
	// The category of endpoints accessed by the dedicated hsm service, e.g. azure-resource-management, apiserver, etc.
	Category *string

	// The endpoints that dedicated hsm service connects to
	Endpoints []*EndpointDependency
}

OutboundEnvironmentEndpoint - Egress endpoints which dedicated hsm service connects to for common purpose.

func (OutboundEnvironmentEndpoint) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type OutboundEnvironmentEndpoint.

func (*OutboundEnvironmentEndpoint) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OutboundEnvironmentEndpoint.

type OutboundEnvironmentEndpointCollection added in v0.2.0

type OutboundEnvironmentEndpointCollection struct {
	// REQUIRED; Collection of resources.
	Value []*OutboundEnvironmentEndpoint

	// READ-ONLY; Link to next page of resources.
	NextLink *string
}

OutboundEnvironmentEndpointCollection - Collection of OutboundEnvironmentEndpoint

func (OutboundEnvironmentEndpointCollection) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type OutboundEnvironmentEndpointCollection.

func (*OutboundEnvironmentEndpointCollection) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OutboundEnvironmentEndpointCollection.

type Resource

type Resource struct {
	// REQUIRED; The supported Azure location where the dedicated HSM should be created.
	Location *string

	// SKU details
	SKU *SKU

	// Resource tags
	Tags map[string]*string

	// The Dedicated Hsm zones.
	Zones []*string

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

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

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

Resource - Dedicated HSM resource

func (Resource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Resource.

func (*Resource) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Resource.

type ResourceListResult

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

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

ResourceListResult - List of dedicated HSM resources.

func (ResourceListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ResourceListResult.

func (*ResourceListResult) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceListResult.

type SKU

type SKU struct {
	// SKU of the dedicated HSM
	Name *SKUName
}

SKU of the dedicated HSM

func (SKU) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type SKU.

func (*SKU) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SKU.

type SKUName

type SKUName string

SKUName - SKU of the dedicated HSM

const (
	// SKUNamePayShield10KLMK1CPS250 - The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device
	// with 1 local master key which supports up to 250 calls per second.
	SKUNamePayShield10KLMK1CPS250 SKUName = "payShield10K_LMK1_CPS250"
	// SKUNamePayShield10KLMK1CPS2500 - The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device
	// with 1 local master key which supports up to 2500 calls per second.
	SKUNamePayShield10KLMK1CPS2500 SKUName = "payShield10K_LMK1_CPS2500"
	// SKUNamePayShield10KLMK1CPS60 - The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device
	// with 1 local master key which supports up to 60 calls per second.
	SKUNamePayShield10KLMK1CPS60 SKUName = "payShield10K_LMK1_CPS60"
	// SKUNamePayShield10KLMK2CPS250 - The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device
	// with 2 local master keys which supports up to 250 calls per second.
	SKUNamePayShield10KLMK2CPS250 SKUName = "payShield10K_LMK2_CPS250"
	// SKUNamePayShield10KLMK2CPS2500 - The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device
	// with 2 local master keys which supports up to 2500 calls per second.
	SKUNamePayShield10KLMK2CPS2500 SKUName = "payShield10K_LMK2_CPS2500"
	// SKUNamePayShield10KLMK2CPS60 - The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device
	// with 2 local master keys which supports up to 60 calls per second.
	SKUNamePayShield10KLMK2CPS60 SKUName = "payShield10K_LMK2_CPS60"
	// SKUNameSafeNetLunaNetworkHSMA790 - The dedicated HSM is a Safenet Luna Network HSM A790 device.
	SKUNameSafeNetLunaNetworkHSMA790 SKUName = "SafeNet Luna Network HSM A790"
)

func PossibleSKUNameValues

func PossibleSKUNameValues() []SKUName

PossibleSKUNameValues returns the possible values for the SKUName const type.

type SystemData added in v0.2.0

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

	// The identity that created dedicated hsm resource.
	CreatedBy *string

	// The type of identity that created dedicated hsm resource.
	CreatedByType *IdentityType

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

	// The identity that last modified dedicated hsm resource.
	LastModifiedBy *string

	// The type of identity that last modified dedicated hsm resource.
	LastModifiedByType *IdentityType
}

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

func (SystemData) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type SystemData.

func (*SystemData) UnmarshalJSON added in v0.2.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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