[Automation] Collect examples from azure-sdk-for-go#sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/v2.0.0-beta.2

This commit is contained in:
Azure SDK Bot 2024-11-19 18:56:38 -08:00 коммит произвёл GitHub
Родитель 745cd5894f
Коммит 102d4c1b79
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
60 изменённых файлов: 2194 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,61 @@
package armhardwaresecuritymodules_test
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/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmClusterPrivateEndpointConnection_Create_MaximumSet_Gen.json
func ExampleCloudHsmClusterPrivateEndpointConnectionsClient_Create() {
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.NewCloudHsmClusterPrivateEndpointConnectionsClient().Create(ctx, "rgcloudhsm", "chsm1", "sample-pec", armhardwaresecuritymodules.PrivateEndpointConnection{
Properties: &armhardwaresecuritymodules.PrivateEndpointConnectionProperties{
PrivateLinkServiceConnectionState: &armhardwaresecuritymodules.PrivateLinkServiceConnectionState{
Description: to.Ptr("My name is Joe and I'm approving this."),
Status: to.Ptr(armhardwaresecuritymodules.PrivateEndpointServiceConnectionStatusApproved),
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.PrivateEndpointConnection = armhardwaresecuritymodules.PrivateEndpointConnection{
// Name: to.Ptr("sample-pec"),
// Type: to.Ptr("Microsoft.HardwareSecurityModules/cloudHsmClusters/privateEndpointConnections"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgcloudhsm/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/chsm1/privateEndpointConnections/sample-pec"),
// 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.CreatedByTypeUser),
// 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.CreatedByTypeUser),
// },
// Properties: &armhardwaresecuritymodules.PrivateEndpointConnectionProperties{
// PrivateEndpoint: &armhardwaresecuritymodules.PrivateEndpoint{
// ID: to.Ptr("/subscriptions/00000000-0000-0000-1234-000000000000/resourceGroups/rgcloudhsm/providers/Microsoft.Network/privateEndpoints/sample-pec"),
// },
// PrivateLinkServiceConnectionState: &armhardwaresecuritymodules.PrivateLinkServiceConnectionState{
// Description: to.Ptr("My name is Joe and I'm approving this."),
// ActionsRequired: to.Ptr("None"),
// Status: to.Ptr(armhardwaresecuritymodules.PrivateEndpointServiceConnectionStatusApproved),
// },
// ProvisioningState: to.Ptr(armhardwaresecuritymodules.PrivateEndpointConnectionProvisioningStateSucceeded),
// },
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fhardwaresecuritymodules%2Farmhardwaresecuritymodules%2Fv2.0.0-beta.2/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/README.md"}

Просмотреть файл

@ -0,0 +1,30 @@
package armhardwaresecuritymodules_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmClusterPrivateEndpointConnection_Delete_MaximumSet_Gen.json
func ExampleCloudHsmClusterPrivateEndpointConnectionsClient_BeginDelete() {
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.NewCloudHsmClusterPrivateEndpointConnectionsClient().BeginDelete(ctx, "rgcloudhsm", "chsm1", "sample-pec", 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)
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fhardwaresecuritymodules%2Farmhardwaresecuritymodules%2Fv2.0.0-beta.2/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/README.md"}

Просмотреть файл

@ -0,0 +1,53 @@
package armhardwaresecuritymodules_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmClusterPrivateEndpointConnection_Get_MaximumSet_Gen.json
func ExampleCloudHsmClusterPrivateEndpointConnectionsClient_Get() {
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.NewCloudHsmClusterPrivateEndpointConnectionsClient().Get(ctx, "rgcloudhsm", "chsm1", "sample-pec", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.PrivateEndpointConnection = armhardwaresecuritymodules.PrivateEndpointConnection{
// Name: to.Ptr("sample-pec"),
// Type: to.Ptr("Microsoft.HardwareSecurityModules/cloudHsmClusters/privateEndpointConnections"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgcloudhsm/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/chsm1/privateEndpointConnections/sample-pec"),
// 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.CreatedByTypeUser),
// 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.CreatedByTypeUser),
// },
// Properties: &armhardwaresecuritymodules.PrivateEndpointConnectionProperties{
// PrivateEndpoint: &armhardwaresecuritymodules.PrivateEndpoint{
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.Network/privateEndpoints/sample-pec"),
// },
// PrivateLinkServiceConnectionState: &armhardwaresecuritymodules.PrivateLinkServiceConnectionState{
// Description: to.Ptr("This was automatically approved by user1234@contoso.com"),
// ActionsRequired: to.Ptr("None"),
// Status: to.Ptr(armhardwaresecuritymodules.PrivateEndpointServiceConnectionStatusApproved),
// },
// ProvisioningState: to.Ptr(armhardwaresecuritymodules.PrivateEndpointConnectionProvisioningStateSucceeded),
// },
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fhardwaresecuritymodules%2Farmhardwaresecuritymodules%2Fv2.0.0-beta.2/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/README.md"}

Просмотреть файл

@ -0,0 +1,85 @@
package armhardwaresecuritymodules_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmClusterPrivateEndpointConnection_ListByCloudHsmCluster_MaximumSet_Gen.json
func ExamplePrivateEndpointConnectionsClient_NewListByCloudHsmClusterPager() {
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.NewPrivateEndpointConnectionsClient().NewListByCloudHsmClusterPager("rgcloudhsm", "chsm1", nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.PrivateEndpointConnectionListResult = armhardwaresecuritymodules.PrivateEndpointConnectionListResult{
// Value: []*armhardwaresecuritymodules.PrivateEndpointConnection{
// {
// Name: to.Ptr("chsm1"),
// Type: to.Ptr("Microsoft.HardwareSecurityModules/cloudHsmClusters/privateEndpointConnections"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgcloudhsm/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/chsm1/privateEndpointConnections/sample-pec1"),
// 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.CreatedByTypeUser),
// 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.CreatedByTypeUser),
// },
// Properties: &armhardwaresecuritymodules.PrivateEndpointConnectionProperties{
// PrivateEndpoint: &armhardwaresecuritymodules.PrivateEndpoint{
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgcloudhsm/providers/Microsoft.Network/privateEndpoints/sample-pec1"),
// },
// PrivateLinkServiceConnectionState: &armhardwaresecuritymodules.PrivateLinkServiceConnectionState{
// Description: to.Ptr("This was automatically approved by user1234@contoso.com"),
// ActionsRequired: to.Ptr("None"),
// Status: to.Ptr(armhardwaresecuritymodules.PrivateEndpointServiceConnectionStatusApproved),
// },
// ProvisioningState: to.Ptr(armhardwaresecuritymodules.PrivateEndpointConnectionProvisioningStateSucceeded),
// },
// },
// {
// Name: to.Ptr("chsm2"),
// Type: to.Ptr("Microsoft.HardwareSecurityModules/cloudHsmClusters/privateEndpointConnections"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgcloudhsm/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/chsm2/privateEndpointConnections/sample-pec2"),
// 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.CreatedByTypeUser),
// 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.CreatedByTypeUser),
// },
// Properties: &armhardwaresecuritymodules.PrivateEndpointConnectionProperties{
// PrivateEndpoint: &armhardwaresecuritymodules.PrivateEndpoint{
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgcloudhsm/providers/Microsoft.Network/privateEndpoints/sample-pec2"),
// },
// PrivateLinkServiceConnectionState: &armhardwaresecuritymodules.PrivateLinkServiceConnectionState{
// Description: to.Ptr("This was automatically approved by user1234@contoso.com"),
// ActionsRequired: to.Ptr("None"),
// Status: to.Ptr(armhardwaresecuritymodules.PrivateEndpointServiceConnectionStatusApproved),
// },
// ProvisioningState: to.Ptr(armhardwaresecuritymodules.PrivateEndpointConnectionProvisioningStateSucceeded),
// },
// }},
// }
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fhardwaresecuritymodules%2Farmhardwaresecuritymodules%2Fv2.0.0-beta.2/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/README.md"}

Просмотреть файл

@ -0,0 +1,51 @@
package armhardwaresecuritymodules_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmClusterPrivateLinkResource_ListByCloudHsmCluster_MaximumSet_Gen.json
func ExampleCloudHsmClusterPrivateLinkResourcesClient_NewListByCloudHsmClusterPager() {
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.NewCloudHsmClusterPrivateLinkResourcesClient().NewListByCloudHsmClusterPager("rgcloudhsm", "chsm1", 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.PrivateLinkResourceListResult = armhardwaresecuritymodules.PrivateLinkResourceListResult{
// Value: []*armhardwaresecuritymodules.PrivateLinkResource{
// {
// Name: to.Ptr("sample-pls"),
// Type: to.Ptr("Microsoft.HardwareSecurityModules/cloudHsmClusters/privateLinkResources"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgcloudhsm/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/chsm1/privateLinkResources/sample-pls"),
// Properties: &armhardwaresecuritymodules.PrivateLinkResourceProperties{
// GroupID: to.Ptr("cloudHsm"),
// RequiredMembers: []*string{
// to.Ptr("hsm1"),
// to.Ptr("hsm2"),
// to.Ptr("hsm3")},
// RequiredZoneNames: []*string{
// to.Ptr("privatelink.cloudhsm.azure-int.net")},
// },
// }},
// }
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fhardwaresecuritymodules%2Farmhardwaresecuritymodules%2Fv2.0.0-beta.2/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/README.md"}

Просмотреть файл

@ -0,0 +1,39 @@
package armhardwaresecuritymodules_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_Backup_Pending_MaximumSet_Gen.json
func ExampleCloudHsmClusterBackupStatusClient_Get() {
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.NewCloudHsmClusterBackupStatusClient().Get(ctx, "rgcloudhsm", "chsm1", "572a45927fc240e1ac075de27371680b", 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.BackupResult = armhardwaresecuritymodules.BackupResult{
// Properties: &armhardwaresecuritymodules.BackupResultProperties{
// EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-12T12:00:00.000Z"); return t}()),
// JobID: to.Ptr("572a45927fc240e1ac075de27371680b"),
// StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-12T12:00:00.000Z"); return t}()),
// Status: to.Ptr(armhardwaresecuritymodules.BackupRestoreOperationStatusInProgress),
// StatusDetails: to.Ptr("Backup operation is in progress"),
// AzureStorageBlobContainerURI: to.Ptr("https://myaccount.blob.core.windows.net/sascontainer/sasContainer"),
// },
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fhardwaresecuritymodules%2Farmhardwaresecuritymodules%2Fv2.0.0-beta.2/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/README.md"}

Просмотреть файл

@ -0,0 +1,91 @@
package armhardwaresecuritymodules_test
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/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_CreateOrUpdate_MaximumSet_Gen.json
func ExampleCloudHsmClustersClient_BeginCreateOrUpdate() {
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.NewCloudHsmClustersClient().BeginCreateOrUpdate(ctx, "rgcloudhsm", "chsm1", armhardwaresecuritymodules.CloudHsmCluster{
Location: to.Ptr("eastus2"),
Tags: map[string]*string{
"Dept": to.Ptr("hsm"),
"Environment": to.Ptr("dogfood"),
},
Identity: &armhardwaresecuritymodules.ManagedServiceIdentity{
Type: to.Ptr(armhardwaresecuritymodules.ManagedServiceIdentityTypeUserAssigned),
UserAssignedIdentities: map[string]*armhardwaresecuritymodules.UserAssignedIdentity{
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-1": {},
},
},
SKU: &armhardwaresecuritymodules.CloudHsmClusterSKU{
Name: to.Ptr(armhardwaresecuritymodules.CloudHsmClusterSKUNameStandardB1),
Family: to.Ptr(armhardwaresecuritymodules.CloudHsmClusterSKUFamilyB),
},
Properties: &armhardwaresecuritymodules.CloudHsmClusterProperties{
PublicNetworkAccess: to.Ptr(armhardwaresecuritymodules.PublicNetworkAccessDisabled),
},
}, 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.CloudHsmCluster = armhardwaresecuritymodules.CloudHsmCluster{
// Name: to.Ptr("chsm1"),
// Type: to.Ptr("Microsoft.HardwareSecurityModules/cloudHsmClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgcloudhsm/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/chsm1"),
// SystemData: &armhardwaresecuritymodules.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-12T12:00:00.000Z"); return t}()),
// CreatedBy: to.Ptr("CHsmUser1"),
// CreatedByType: to.Ptr(armhardwaresecuritymodules.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-12T12:00:00.000Z"); return t}()),
// LastModifiedBy: to.Ptr("CHsmUser2"),
// LastModifiedByType: to.Ptr(armhardwaresecuritymodules.CreatedByTypeUser),
// },
// Location: to.Ptr("eastus2"),
// Tags: map[string]*string{
// "Dept": to.Ptr("hsm"),
// "Environment": to.Ptr("dogfood"),
// },
// Identity: &armhardwaresecuritymodules.ManagedServiceIdentity{
// Type: to.Ptr(armhardwaresecuritymodules.ManagedServiceIdentityTypeUserAssigned),
// UserAssignedIdentities: map[string]*armhardwaresecuritymodules.UserAssignedIdentity{
// "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-1": &armhardwaresecuritymodules.UserAssignedIdentity{
// ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// },
// },
// },
// SKU: &armhardwaresecuritymodules.CloudHsmClusterSKU{
// Name: to.Ptr(armhardwaresecuritymodules.CloudHsmClusterSKUNameStandardB1),
// Family: to.Ptr(armhardwaresecuritymodules.CloudHsmClusterSKUFamilyB),
// },
// Properties: &armhardwaresecuritymodules.CloudHsmClusterProperties{
// ActivationState: to.Ptr(armhardwaresecuritymodules.ActivationState("null")),
// AutoGeneratedDomainNameLabelScope: to.Ptr(armhardwaresecuritymodules.AutoGeneratedDomainNameLabelScopeTenantReuse),
// ProvisioningState: to.Ptr(armhardwaresecuritymodules.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armhardwaresecuritymodules.PublicNetworkAccessDisabled),
// StatusMessage: to.Ptr("This is a status message"),
// },
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fhardwaresecuritymodules%2Farmhardwaresecuritymodules%2Fv2.0.0-beta.2/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/README.md"}

Просмотреть файл

@ -0,0 +1,43 @@
package armhardwaresecuritymodules_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_CreateOrValidate_Backup_MaximumSet_Gen.json
func ExampleCloudHsmClustersClient_BeginValidateBackupProperties() {
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.NewCloudHsmClustersClient().BeginValidateBackupProperties(ctx, "rgcloudhsm", "chsm1", &armhardwaresecuritymodules.CloudHsmClustersClientBeginValidateBackupPropertiesOptions{BackupRequestProperties: 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.BackupResult = armhardwaresecuritymodules.BackupResult{
// Properties: &armhardwaresecuritymodules.BackupResultProperties{
// EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-12T12:00:00.000Z"); return t}()),
// JobID: to.Ptr("572a45927fc240e1ac075de27371680b"),
// StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-12T12:00:00.000Z"); return t}()),
// Status: to.Ptr(armhardwaresecuritymodules.BackupRestoreOperationStatusInProgress),
// StatusDetails: to.Ptr("Backup operation is in progress"),
// AzureStorageBlobContainerURI: to.Ptr("https://myaccount.blob.core.windows.net/sascontainer/sasContainer"),
// },
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fhardwaresecuritymodules%2Farmhardwaresecuritymodules%2Fv2.0.0-beta.2/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/README.md"}

Просмотреть файл

@ -0,0 +1,30 @@
package armhardwaresecuritymodules_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_Delete_MaximumSet_Gen.json
func ExampleCloudHsmClustersClient_BeginDelete() {
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.NewCloudHsmClustersClient().BeginDelete(ctx, "rgcloudhsm", "chsm1", 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)
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fhardwaresecuritymodules%2Farmhardwaresecuritymodules%2Fv2.0.0-beta.2/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/README.md"}

Просмотреть файл

@ -0,0 +1,67 @@
package armhardwaresecuritymodules_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_Get_MaximumSet_Gen.json
func ExampleCloudHsmClustersClient_Get() {
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.NewCloudHsmClustersClient().Get(ctx, "rgcloudhsm", "chsm1", 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.CloudHsmCluster = armhardwaresecuritymodules.CloudHsmCluster{
// Name: to.Ptr("chsm1"),
// Type: to.Ptr("Microsoft.HardwareSecurityModules/cloudHsmClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgcloudhsm/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/chsm1"),
// SystemData: &armhardwaresecuritymodules.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-12T12:00:00.000Z"); return t}()),
// CreatedBy: to.Ptr("CHsmUser1"),
// CreatedByType: to.Ptr(armhardwaresecuritymodules.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-12T12:00:00.000Z"); return t}()),
// LastModifiedBy: to.Ptr("CHsmUser2"),
// LastModifiedByType: to.Ptr(armhardwaresecuritymodules.CreatedByTypeUser),
// },
// Location: to.Ptr("eastus2"),
// Tags: map[string]*string{
// "Dept": to.Ptr("hsm"),
// "Environment": to.Ptr("dogfood"),
// },
// Identity: &armhardwaresecuritymodules.ManagedServiceIdentity{
// Type: to.Ptr(armhardwaresecuritymodules.ManagedServiceIdentityTypeUserAssigned),
// UserAssignedIdentities: map[string]*armhardwaresecuritymodules.UserAssignedIdentity{
// "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-1": &armhardwaresecuritymodules.UserAssignedIdentity{
// ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// },
// },
// },
// SKU: &armhardwaresecuritymodules.CloudHsmClusterSKU{
// Name: to.Ptr(armhardwaresecuritymodules.CloudHsmClusterSKUNameStandardB1),
// Family: to.Ptr(armhardwaresecuritymodules.CloudHsmClusterSKUFamilyB),
// },
// Properties: &armhardwaresecuritymodules.CloudHsmClusterProperties{
// ActivationState: to.Ptr(armhardwaresecuritymodules.ActivationState("null")),
// AutoGeneratedDomainNameLabelScope: to.Ptr(armhardwaresecuritymodules.AutoGeneratedDomainNameLabelScopeTenantReuse),
// ProvisioningState: to.Ptr(armhardwaresecuritymodules.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armhardwaresecuritymodules.PublicNetworkAccessDisabled),
// StatusMessage: to.Ptr("This is a status message"),
// },
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fhardwaresecuritymodules%2Farmhardwaresecuritymodules%2Fv2.0.0-beta.2/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/README.md"}

Просмотреть файл

@ -0,0 +1,112 @@
package armhardwaresecuritymodules_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_ListByResourceGroup_MaximumSet_Gen.json
func ExampleCloudHsmClustersClient_NewListByResourceGroupPager() {
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.NewCloudHsmClustersClient().NewListByResourceGroupPager("rgcloudhsm", &armhardwaresecuritymodules.CloudHsmClustersClientListByResourceGroupOptions{Skiptoken: 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.CloudHsmClusterListResult = armhardwaresecuritymodules.CloudHsmClusterListResult{
// Value: []*armhardwaresecuritymodules.CloudHsmCluster{
// {
// Name: to.Ptr("chsm1"),
// Type: to.Ptr("Microsoft.HardwareSecurityModules/cloudHsmClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgcloudhsm/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/chsm1"),
// SystemData: &armhardwaresecuritymodules.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-12T12:00:00.000Z"); return t}()),
// CreatedBy: to.Ptr("CHsmUser1"),
// CreatedByType: to.Ptr(armhardwaresecuritymodules.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-12T12:00:00.000Z"); return t}()),
// LastModifiedBy: to.Ptr("CHsmUser2"),
// LastModifiedByType: to.Ptr(armhardwaresecuritymodules.CreatedByTypeUser),
// },
// Location: to.Ptr("eastus2"),
// Tags: map[string]*string{
// "Dept": to.Ptr("hsm"),
// "Environment": to.Ptr("dogfood"),
// },
// Identity: &armhardwaresecuritymodules.ManagedServiceIdentity{
// Type: to.Ptr(armhardwaresecuritymodules.ManagedServiceIdentityTypeUserAssigned),
// UserAssignedIdentities: map[string]*armhardwaresecuritymodules.UserAssignedIdentity{
// "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-1": &armhardwaresecuritymodules.UserAssignedIdentity{
// ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// },
// },
// },
// SKU: &armhardwaresecuritymodules.CloudHsmClusterSKU{
// Name: to.Ptr(armhardwaresecuritymodules.CloudHsmClusterSKUNameStandardB1),
// Family: to.Ptr(armhardwaresecuritymodules.CloudHsmClusterSKUFamilyB),
// },
// Properties: &armhardwaresecuritymodules.CloudHsmClusterProperties{
// ActivationState: to.Ptr(armhardwaresecuritymodules.ActivationState("null")),
// AutoGeneratedDomainNameLabelScope: to.Ptr(armhardwaresecuritymodules.AutoGeneratedDomainNameLabelScopeTenantReuse),
// ProvisioningState: to.Ptr(armhardwaresecuritymodules.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armhardwaresecuritymodules.PublicNetworkAccessDisabled),
// StatusMessage: to.Ptr("This is a status message"),
// },
// },
// {
// Name: to.Ptr("chsm2"),
// Type: to.Ptr("Microsoft.HardwareSecurityModules/cloudHsmClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgcloudhsm/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/chsm2"),
// SystemData: &armhardwaresecuritymodules.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-12T12:00:00.000Z"); return t}()),
// CreatedBy: to.Ptr("CHsmUser1"),
// CreatedByType: to.Ptr(armhardwaresecuritymodules.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-12T12:00:00.000Z"); return t}()),
// LastModifiedBy: to.Ptr("CHsmUser2"),
// LastModifiedByType: to.Ptr(armhardwaresecuritymodules.CreatedByTypeUser),
// },
// Location: to.Ptr("eastus2"),
// Tags: map[string]*string{
// "Dept": to.Ptr("hsm"),
// "Environment": to.Ptr("dogfood"),
// },
// Identity: &armhardwaresecuritymodules.ManagedServiceIdentity{
// Type: to.Ptr(armhardwaresecuritymodules.ManagedServiceIdentityTypeUserAssigned),
// UserAssignedIdentities: map[string]*armhardwaresecuritymodules.UserAssignedIdentity{
// "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-2": &armhardwaresecuritymodules.UserAssignedIdentity{
// ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// },
// },
// },
// SKU: &armhardwaresecuritymodules.CloudHsmClusterSKU{
// Name: to.Ptr(armhardwaresecuritymodules.CloudHsmClusterSKUNameStandardB1),
// Family: to.Ptr(armhardwaresecuritymodules.CloudHsmClusterSKUFamilyB),
// },
// Properties: &armhardwaresecuritymodules.CloudHsmClusterProperties{
// ActivationState: to.Ptr(armhardwaresecuritymodules.ActivationState("null")),
// AutoGeneratedDomainNameLabelScope: to.Ptr(armhardwaresecuritymodules.AutoGeneratedDomainNameLabelScopeTenantReuse),
// ProvisioningState: to.Ptr(armhardwaresecuritymodules.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armhardwaresecuritymodules.PublicNetworkAccessDisabled),
// },
// }},
// }
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fhardwaresecuritymodules%2Farmhardwaresecuritymodules%2Fv2.0.0-beta.2/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/README.md"}

Просмотреть файл

@ -0,0 +1,111 @@
package armhardwaresecuritymodules_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_ListBySubscription_MaximumSet_Gen.json
func ExampleCloudHsmClustersClient_NewListBySubscriptionPager() {
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.NewCloudHsmClustersClient().NewListBySubscriptionPager(&armhardwaresecuritymodules.CloudHsmClustersClientListBySubscriptionOptions{Skiptoken: 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.CloudHsmClusterListResult = armhardwaresecuritymodules.CloudHsmClusterListResult{
// Value: []*armhardwaresecuritymodules.CloudHsmCluster{
// {
// Name: to.Ptr("chsm1"),
// Type: to.Ptr("Microsoft.HardwareSecurityModules/cloudHsmClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgcloudhsm/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/chsm1"),
// SystemData: &armhardwaresecuritymodules.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-12T12:00:00.000Z"); return t}()),
// CreatedBy: to.Ptr("CHsmUser1"),
// CreatedByType: to.Ptr(armhardwaresecuritymodules.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-12T12:00:00.000Z"); return t}()),
// LastModifiedBy: to.Ptr("CHsmUser2"),
// LastModifiedByType: to.Ptr(armhardwaresecuritymodules.CreatedByTypeUser),
// },
// Location: to.Ptr("eastus2"),
// Tags: map[string]*string{
// "Dept": to.Ptr("hsm"),
// "Environment": to.Ptr("dogfood"),
// },
// Identity: &armhardwaresecuritymodules.ManagedServiceIdentity{
// Type: to.Ptr(armhardwaresecuritymodules.ManagedServiceIdentityTypeUserAssigned),
// UserAssignedIdentities: map[string]*armhardwaresecuritymodules.UserAssignedIdentity{
// "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-1": &armhardwaresecuritymodules.UserAssignedIdentity{
// },
// },
// },
// SKU: &armhardwaresecuritymodules.CloudHsmClusterSKU{
// Name: to.Ptr(armhardwaresecuritymodules.CloudHsmClusterSKUNameStandardB1),
// Family: to.Ptr(armhardwaresecuritymodules.CloudHsmClusterSKUFamilyB),
// },
// Properties: &armhardwaresecuritymodules.CloudHsmClusterProperties{
// ActivationState: to.Ptr(armhardwaresecuritymodules.ActivationState("null")),
// AutoGeneratedDomainNameLabelScope: to.Ptr(armhardwaresecuritymodules.AutoGeneratedDomainNameLabelScopeTenantReuse),
// ProvisioningState: to.Ptr(armhardwaresecuritymodules.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armhardwaresecuritymodules.PublicNetworkAccessDisabled),
// StatusMessage: to.Ptr("This is a status message"),
// },
// },
// {
// Name: to.Ptr("chsm2"),
// Type: to.Ptr("Microsoft.HardwareSecurityModules/cloudHsmClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgcloudhsm/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/chsm2"),
// SystemData: &armhardwaresecuritymodules.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-12T12:00:00.000Z"); return t}()),
// CreatedBy: to.Ptr("CHsmUser1"),
// CreatedByType: to.Ptr(armhardwaresecuritymodules.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-12T12:00:00.000Z"); return t}()),
// LastModifiedBy: to.Ptr("CHsmUser2"),
// LastModifiedByType: to.Ptr(armhardwaresecuritymodules.CreatedByTypeUser),
// },
// Location: to.Ptr("eastus2"),
// Tags: map[string]*string{
// "Dept": to.Ptr("hsm"),
// "Environment": to.Ptr("dogfood"),
// },
// Identity: &armhardwaresecuritymodules.ManagedServiceIdentity{
// Type: to.Ptr(armhardwaresecuritymodules.ManagedServiceIdentityTypeUserAssigned),
// UserAssignedIdentities: map[string]*armhardwaresecuritymodules.UserAssignedIdentity{
// "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-2": &armhardwaresecuritymodules.UserAssignedIdentity{
// ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// },
// },
// },
// SKU: &armhardwaresecuritymodules.CloudHsmClusterSKU{
// Name: to.Ptr(armhardwaresecuritymodules.CloudHsmClusterSKUNameStandardB1),
// Family: to.Ptr(armhardwaresecuritymodules.CloudHsmClusterSKUFamilyB),
// },
// Properties: &armhardwaresecuritymodules.CloudHsmClusterProperties{
// ActivationState: to.Ptr(armhardwaresecuritymodules.ActivationState("null")),
// AutoGeneratedDomainNameLabelScope: to.Ptr(armhardwaresecuritymodules.AutoGeneratedDomainNameLabelScopeTenantReuse),
// ProvisioningState: to.Ptr(armhardwaresecuritymodules.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armhardwaresecuritymodules.PublicNetworkAccessDisabled),
// StatusMessage: to.Ptr("This is a status message"),
// },
// }},
// }
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fhardwaresecuritymodules%2Farmhardwaresecuritymodules%2Fv2.0.0-beta.2/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/README.md"}

Просмотреть файл

@ -0,0 +1,47 @@
package armhardwaresecuritymodules_test
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/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_RequestOrValidate_Restore_MaximumSet_Gen.json
func ExampleCloudHsmClustersClient_BeginValidateRestoreProperties() {
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.NewCloudHsmClustersClient().BeginValidateRestoreProperties(ctx, "rgcloudhsm", "chsm1", &armhardwaresecuritymodules.CloudHsmClustersClientBeginValidateRestorePropertiesOptions{RestoreRequestProperties: &armhardwaresecuritymodules.RestoreRequestProperties{
AzureStorageBlobContainerURI: to.Ptr("https://myaccount.blob.core.windows.net/sascontainer/sasContainer"),
BackupID: to.Ptr("backupId"),
},
})
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.RestoreResult = armhardwaresecuritymodules.RestoreResult{
// Properties: &armhardwaresecuritymodules.BackupRestoreBaseResultProperties{
// EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-12T12:00:00.000Z"); return t}()),
// JobID: to.Ptr("572a45927fc240e1ac075de27371680b"),
// StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-12T12:00:00.000Z"); return t}()),
// Status: to.Ptr(armhardwaresecuritymodules.BackupRestoreOperationStatusInProgress),
// StatusDetails: to.Ptr("Restore operation is in progress"),
// },
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fhardwaresecuritymodules%2Farmhardwaresecuritymodules%2Fv2.0.0-beta.2/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/README.md"}

Просмотреть файл

@ -0,0 +1,38 @@
package armhardwaresecuritymodules_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_Restore_Pending_MaximumSet_Gen.json
func ExampleCloudHsmClusterRestoreStatusClient_Get() {
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.NewCloudHsmClusterRestoreStatusClient().Get(ctx, "rgcloudhsm", "chsm1", "572a45927fc240e1ac075de27371680b", 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.RestoreResult = armhardwaresecuritymodules.RestoreResult{
// Properties: &armhardwaresecuritymodules.BackupRestoreBaseResultProperties{
// EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-12T12:00:00.000Z"); return t}()),
// JobID: to.Ptr("572a45927fc240e1ac075de27371680b"),
// StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-12T12:00:00.000Z"); return t}()),
// Status: to.Ptr(armhardwaresecuritymodules.BackupRestoreOperationStatusInProgress),
// StatusDetails: to.Ptr("Restore operation is in progress"),
// },
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fhardwaresecuritymodules%2Farmhardwaresecuritymodules%2Fv2.0.0-beta.2/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/README.md"}

Просмотреть файл

@ -0,0 +1,85 @@
package armhardwaresecuritymodules_test
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/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/CloudHsmCluster_Update_MaximumSet_Gen.json
func ExampleCloudHsmClustersClient_BeginUpdate() {
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.NewCloudHsmClustersClient().BeginUpdate(ctx, "rgcloudhsm", "chsm1", armhardwaresecuritymodules.CloudHsmClusterPatchParameters{
Identity: &armhardwaresecuritymodules.ManagedServiceIdentity{
Type: to.Ptr(armhardwaresecuritymodules.ManagedServiceIdentityTypeUserAssigned),
UserAssignedIdentities: map[string]*armhardwaresecuritymodules.UserAssignedIdentity{
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-1": {},
},
},
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.CloudHsmCluster = armhardwaresecuritymodules.CloudHsmCluster{
// Name: to.Ptr("chsm1"),
// Type: to.Ptr("Microsoft.HardwareSecurityModules/cloudHsmClusters"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgcloudhsm/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/chsm1"),
// SystemData: &armhardwaresecuritymodules.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-12T12:00:00.000Z"); return t}()),
// CreatedBy: to.Ptr("CHsmUser1"),
// CreatedByType: to.Ptr(armhardwaresecuritymodules.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-12T12:00:00.000Z"); return t}()),
// LastModifiedBy: to.Ptr("CHsmUser2"),
// LastModifiedByType: to.Ptr(armhardwaresecuritymodules.CreatedByTypeUser),
// },
// Location: to.Ptr("eastus2"),
// Tags: map[string]*string{
// "Dept": to.Ptr("hsm"),
// "Environment": to.Ptr("dogfood"),
// "Slice": to.Ptr("A"),
// },
// Identity: &armhardwaresecuritymodules.ManagedServiceIdentity{
// Type: to.Ptr(armhardwaresecuritymodules.ManagedServiceIdentityTypeUserAssigned),
// UserAssignedIdentities: map[string]*armhardwaresecuritymodules.UserAssignedIdentity{
// "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-1": &armhardwaresecuritymodules.UserAssignedIdentity{
// ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// },
// },
// },
// SKU: &armhardwaresecuritymodules.CloudHsmClusterSKU{
// Name: to.Ptr(armhardwaresecuritymodules.CloudHsmClusterSKUNameStandardB1),
// Family: to.Ptr(armhardwaresecuritymodules.CloudHsmClusterSKUFamilyB),
// },
// Properties: &armhardwaresecuritymodules.CloudHsmClusterProperties{
// ActivationState: to.Ptr(armhardwaresecuritymodules.ActivationState("null")),
// AutoGeneratedDomainNameLabelScope: to.Ptr(armhardwaresecuritymodules.AutoGeneratedDomainNameLabelScopeTenantReuse),
// ProvisioningState: to.Ptr(armhardwaresecuritymodules.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armhardwaresecuritymodules.PublicNetworkAccessDisabled),
// StatusMessage: to.Ptr("This is a status message"),
// },
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fhardwaresecuritymodules%2Farmhardwaresecuritymodules%2Fv2.0.0-beta.2/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/README.md"}

Просмотреть файл

@ -0,0 +1,83 @@
package armhardwaresecuritymodules_test
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/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_CreateOrUpdate.json
func ExampleDedicatedHsmClient_BeginCreateOrUpdate_createANewOrUpdateAnExistingDedicatedHsm() {
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"),
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{
ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01"),
},
},
StampID: to.Ptr("stamp01"),
},
SKU: &armhardwaresecuritymodules.SKU{
Name: to.Ptr(armhardwaresecuritymodules.SKUNameSafeNetLunaNetworkHSMA790),
},
}, 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"),
// 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"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm_vnic"),
// }},
// Subnet: &armhardwaresecuritymodules.APIEntityReference{
// ResourceID: 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."),
// },
// SKU: &armhardwaresecuritymodules.SKU{
// Name: to.Ptr(armhardwaresecuritymodules.SKUNameSafeNetLunaNetworkHSMA790),
// },
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fhardwaresecuritymodules%2Farmhardwaresecuritymodules%2Fv2.0.0-beta.2/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/README.md"}

Просмотреть файл

@ -0,0 +1,30 @@
package armhardwaresecuritymodules_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_Delete.json
func ExampleDedicatedHsmClient_BeginDelete() {
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)
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fhardwaresecuritymodules%2Farmhardwaresecuritymodules%2Fv2.0.0-beta.2/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/README.md"}

Просмотреть файл

@ -0,0 +1,58 @@
package armhardwaresecuritymodules_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_Get.json
func ExampleDedicatedHsmClient_Get_getADedicatedHsm() {
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"),
// 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{
// {
// PrivateIPAddress: to.Ptr("1.0.0.1"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm_vnic"),
// }},
// Subnet: &armhardwaresecuritymodules.APIEntityReference{
// ResourceID: 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."),
// },
// SKU: &armhardwaresecuritymodules.SKU{
// Name: to.Ptr(armhardwaresecuritymodules.SKUNameSafeNetLunaNetworkHSMA790),
// },
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fhardwaresecuritymodules%2Farmhardwaresecuritymodules%2Fv2.0.0-beta.2/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/README.md"}

Просмотреть файл

@ -0,0 +1,95 @@
package armhardwaresecuritymodules_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_ListByResourceGroup.json
func ExampleDedicatedHsmClient_NewListByResourceGroupPager_listDedicatedHsmDevicesInAResourceGroup() {
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"),
// 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{
// {
// PrivateIPAddress: to.Ptr("1.0.0.1"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm_vnic"),
// }},
// Subnet: &armhardwaresecuritymodules.APIEntityReference{
// ResourceID: 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."),
// },
// SKU: &armhardwaresecuritymodules.SKU{
// Name: to.Ptr(armhardwaresecuritymodules.SKUNameSafeNetLunaNetworkHSMA790),
// },
// },
// {
// 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"),
// 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{
// {
// PrivateIPAddress: to.Ptr("1.0.0.2"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm_vnic"),
// }},
// Subnet: &armhardwaresecuritymodules.APIEntityReference{
// ResourceID: 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."),
// },
// SKU: &armhardwaresecuritymodules.SKU{
// Name: to.Ptr(armhardwaresecuritymodules.SKUNameSafeNetLunaNetworkHSMA790),
// },
// }},
// }
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fhardwaresecuritymodules%2Farmhardwaresecuritymodules%2Fv2.0.0-beta.2/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/README.md"}

Просмотреть файл

@ -0,0 +1,95 @@
package armhardwaresecuritymodules_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_ListBySubscription.json
func ExampleDedicatedHsmClient_NewListBySubscriptionPager_listDedicatedHsmDevicesInASubscription() {
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"),
// 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{
// {
// PrivateIPAddress: to.Ptr("1.0.0.1"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm_vnic"),
// }},
// Subnet: &armhardwaresecuritymodules.APIEntityReference{
// ResourceID: 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."),
// },
// SKU: &armhardwaresecuritymodules.SKU{
// Name: to.Ptr(armhardwaresecuritymodules.SKUNameSafeNetLunaNetworkHSMA790),
// },
// },
// {
// 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"),
// 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{
// {
// PrivateIPAddress: to.Ptr("1.0.0.2"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm_vnic"),
// }},
// Subnet: &armhardwaresecuritymodules.APIEntityReference{
// ResourceID: 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."),
// },
// SKU: &armhardwaresecuritymodules.SKU{
// Name: to.Ptr(armhardwaresecuritymodules.SKUNameSafeNetLunaNetworkHSMA790),
// },
// }},
// }
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fhardwaresecuritymodules%2Farmhardwaresecuritymodules%2Fv2.0.0-beta.2/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/README.md"}

Просмотреть файл

@ -0,0 +1,69 @@
package armhardwaresecuritymodules_test
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/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/DedicatedHsm_Update.json
func ExampleDedicatedHsmClient_BeginUpdate_updateAnExistingDedicatedHsm() {
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"),
// 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{
// {
// PrivateIPAddress: to.Ptr("1.0.0.1"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm_vnic"),
// }},
// Subnet: &armhardwaresecuritymodules.APIEntityReference{
// ResourceID: 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."),
// },
// SKU: &armhardwaresecuritymodules.SKU{
// Name: to.Ptr(armhardwaresecuritymodules.SKUNameSafeNetLunaNetworkHSMA790),
// },
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fhardwaresecuritymodules%2Farmhardwaresecuritymodules%2Fv2.0.0-beta.2/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/README.md"}

Просмотреть файл

@ -0,0 +1,38 @@
package armhardwaresecuritymodules_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/GetOutboundNetworkDependenciesEndpointsList.json
func ExampleDedicatedHsmClient_NewListOutboundNetworkDependenciesEndpointsPager() {
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{
// },
// }
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fhardwaresecuritymodules%2Farmhardwaresecuritymodules%2Fv2.0.0-beta.2/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/README.md"}

Просмотреть файл

@ -0,0 +1,59 @@
package armhardwaresecuritymodules_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/OperationsList.json
func ExampleOperationsClient_NewListPager_getAListOfDedicatedHsmOperations() {
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.OperationListResult = armhardwaresecuritymodules.OperationListResult{
// Value: []*armhardwaresecuritymodules.Operation{
// {
// Name: to.Ptr("Microsoft.HardwareSecurityModules/dedicatedhsms/read"),
// Display: &armhardwaresecuritymodules.OperationDisplay{
// Description: to.Ptr("View the properties of a DedicatedHsm"),
// Operation: to.Ptr("View DedicatedHsm"),
// Provider: to.Ptr("Microsoft Hardware Security Modules"),
// Resource: to.Ptr("DedicatedHsm"),
// },
// IsDataAction: to.Ptr(false),
// Origin: to.Ptr(armhardwaresecuritymodules.OriginSystem),
// },
// {
// Name: to.Ptr("Microsoft.HardwareSecurityModules/cloudHsmClusters/read"),
// Display: &armhardwaresecuritymodules.OperationDisplay{
// Description: to.Ptr("View the properties of a CloudHsm"),
// Operation: to.Ptr("View CloudHsm"),
// Provider: to.Ptr("Microsoft Hardware Security Modules"),
// Resource: to.Ptr("CloudHsm"),
// },
// IsDataAction: to.Ptr(false),
// Origin: to.Ptr(armhardwaresecuritymodules.OriginSystem),
// }},
// }
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fhardwaresecuritymodules%2Farmhardwaresecuritymodules%2Fv2.0.0-beta.2/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/README.md"}

Просмотреть файл

@ -0,0 +1,101 @@
package armhardwaresecuritymodules_test
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/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/PaymentHsm_CreateOrUpdate.json
func ExampleDedicatedHsmClient_BeginCreateOrUpdate_createANewOrUpdateAnExistingPaymentHsm() {
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"),
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{
ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01"),
},
},
StampID: to.Ptr("stamp01"),
},
SKU: &armhardwaresecuritymodules.SKU{
Name: to.Ptr(armhardwaresecuritymodules.SKUNamePayShield10KLMK1CPS60),
},
}, 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"),
// 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.CreatedByTypeUser),
// 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.CreatedByTypeUser),
// },
// Location: to.Ptr("westus"),
// 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"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm1_HSMMgmtNic"),
// }},
// Subnet: &armhardwaresecuritymodules.APIEntityReference{
// ResourceID: 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"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm1_HSMHost1Nic"),
// }},
// Subnet: &armhardwaresecuritymodules.APIEntityReference{
// ResourceID: 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."),
// },
// SKU: &armhardwaresecuritymodules.SKU{
// Name: to.Ptr(armhardwaresecuritymodules.SKUNamePayShield10KLMK1CPS60),
// },
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fhardwaresecuritymodules%2Farmhardwaresecuritymodules%2Fv2.0.0-beta.2/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/README.md"}

Просмотреть файл

@ -0,0 +1,110 @@
package armhardwaresecuritymodules_test
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/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/PaymentHsm_CreateOrUpdate_WithManagementProfile.json
func ExampleDedicatedHsmClient_BeginCreateOrUpdate_createANewOrUpdateAnExistingPaymentHsmWithManagementProfile() {
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"),
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{
ResourceID: 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{
ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/virtualNetworks/stamp01/subnets/stamp01"),
},
},
StampID: to.Ptr("stamp01"),
},
SKU: &armhardwaresecuritymodules.SKU{
Name: to.Ptr(armhardwaresecuritymodules.SKUNamePayShield10KLMK1CPS60),
},
}, 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"),
// 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.CreatedByTypeUser),
// 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.CreatedByTypeUser),
// },
// Location: to.Ptr("westus"),
// 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"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm1_HSMMgmtNic"),
// }},
// Subnet: &armhardwaresecuritymodules.APIEntityReference{
// ResourceID: 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"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm1_HSMHost1Nic"),
// }},
// Subnet: &armhardwaresecuritymodules.APIEntityReference{
// ResourceID: 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."),
// },
// SKU: &armhardwaresecuritymodules.SKU{
// Name: to.Ptr(armhardwaresecuritymodules.SKUNamePayShield10KLMK1CPS60),
// },
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fhardwaresecuritymodules%2Farmhardwaresecuritymodules%2Fv2.0.0-beta.2/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/README.md"}

Просмотреть файл

@ -0,0 +1,76 @@
package armhardwaresecuritymodules_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/PaymentHsm_Get.json
func ExampleDedicatedHsmClient_Get_getAPaymentHsm() {
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"),
// 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.CreatedByTypeUser),
// 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.CreatedByTypeUser),
// },
// Location: to.Ptr("westus"),
// 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{
// {
// PrivateIPAddress: to.Ptr("1.0.0.2"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm1_HSMMgmtNic"),
// }},
// Subnet: &armhardwaresecuritymodules.APIEntityReference{
// ResourceID: 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"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm1_HSMHost1Nic"),
// }},
// Subnet: &armhardwaresecuritymodules.APIEntityReference{
// ResourceID: 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."),
// },
// SKU: &armhardwaresecuritymodules.SKU{
// Name: to.Ptr(armhardwaresecuritymodules.SKUNamePayShield10KLMK1CPS60),
// },
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fhardwaresecuritymodules%2Farmhardwaresecuritymodules%2Fv2.0.0-beta.2/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/README.md"}

Просмотреть файл

@ -0,0 +1,58 @@
package armhardwaresecuritymodules_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/PaymentHsm_Get_With_2018-10-31Preview_Version.json
func ExampleDedicatedHsmClient_Get_getAPaymentHsmWith20181031PreviewApiVersion() {
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"),
// 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{
// {
// PrivateIPAddress: to.Ptr("1.0.0.1"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm1_HSMHost1Nic"),
// }},
// Subnet: &armhardwaresecuritymodules.APIEntityReference{
// ResourceID: 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."),
// },
// SKU: &armhardwaresecuritymodules.SKU{
// Name: to.Ptr(armhardwaresecuritymodules.SKUNamePayShield10KLMK1CPS60),
// },
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fhardwaresecuritymodules%2Farmhardwaresecuritymodules%2Fv2.0.0-beta.2/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/README.md"}

Просмотреть файл

@ -0,0 +1,131 @@
package armhardwaresecuritymodules_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/PaymentHsm_ListByResourceGroup.json
func ExampleDedicatedHsmClient_NewListByResourceGroupPager_listDedicatedHsmDevicesInAResourceGroupIncludingPaymentHsm() {
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"),
// 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.CreatedByTypeUser),
// 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.CreatedByTypeUser),
// },
// Location: to.Ptr("westus"),
// 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{
// {
// PrivateIPAddress: to.Ptr("1.0.0.2"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm1_HSMMgmtNic"),
// }},
// Subnet: &armhardwaresecuritymodules.APIEntityReference{
// ResourceID: 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"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm1_HSMHost1Nic"),
// }},
// Subnet: &armhardwaresecuritymodules.APIEntityReference{
// ResourceID: 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."),
// },
// SKU: &armhardwaresecuritymodules.SKU{
// Name: to.Ptr(armhardwaresecuritymodules.SKUNamePayShield10KLMK1CPS60),
// },
// },
// {
// 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"),
// 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.CreatedByTypeUser),
// 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.CreatedByTypeUser),
// },
// Location: to.Ptr("westus"),
// 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{
// {
// PrivateIPAddress: to.Ptr("1.0.0.4"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm2_HSMMgmtNic"),
// }},
// Subnet: &armhardwaresecuritymodules.APIEntityReference{
// ResourceID: 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.3"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm2_HSMHost1Nic"),
// }},
// Subnet: &armhardwaresecuritymodules.APIEntityReference{
// ResourceID: 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."),
// },
// SKU: &armhardwaresecuritymodules.SKU{
// Name: to.Ptr(armhardwaresecuritymodules.SKUNamePayShield10KLMK1CPS60),
// },
// }},
// }
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fhardwaresecuritymodules%2Farmhardwaresecuritymodules%2Fv2.0.0-beta.2/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/README.md"}

Просмотреть файл

@ -0,0 +1,131 @@
package armhardwaresecuritymodules_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/PaymentHsm_ListBySubscription.json
func ExampleDedicatedHsmClient_NewListBySubscriptionPager_listDedicatedHsmDevicesInASubscriptionIncludingPaymentHsm() {
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"),
// 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.CreatedByTypeUser),
// 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.CreatedByTypeUser),
// },
// Location: to.Ptr("westus"),
// 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{
// {
// PrivateIPAddress: to.Ptr("1.0.0.2"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm1_HSMMgmtNic"),
// }},
// Subnet: &armhardwaresecuritymodules.APIEntityReference{
// ResourceID: 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"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm1_HSMHost1Nic"),
// }},
// Subnet: &armhardwaresecuritymodules.APIEntityReference{
// ResourceID: 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."),
// },
// SKU: &armhardwaresecuritymodules.SKU{
// Name: to.Ptr(armhardwaresecuritymodules.SKUNamePayShield10KLMK1CPS60),
// },
// },
// {
// 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"),
// 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.CreatedByTypeUser),
// 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.CreatedByTypeUser),
// },
// Location: to.Ptr("westus"),
// 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{
// {
// PrivateIPAddress: to.Ptr("1.0.0.4"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm2_HSMMgmtNic"),
// }},
// Subnet: &armhardwaresecuritymodules.APIEntityReference{
// ResourceID: 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.3"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm2_HSMHost1Nic"),
// }},
// Subnet: &armhardwaresecuritymodules.APIEntityReference{
// ResourceID: 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."),
// },
// SKU: &armhardwaresecuritymodules.SKU{
// Name: to.Ptr(armhardwaresecuritymodules.SKUNamePayShield10KLMK1CPS60),
// },
// }},
// }
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fhardwaresecuritymodules%2Farmhardwaresecuritymodules%2Fv2.0.0-beta.2/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/README.md"}

Просмотреть файл

@ -0,0 +1,87 @@
package armhardwaresecuritymodules_test
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/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/preview/2024-06-30-preview/examples/PaymentHsm_Update.json
func ExampleDedicatedHsmClient_BeginUpdate_updateAnExistingPaymentHsm() {
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"),
// 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.CreatedByTypeUser),
// 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.CreatedByTypeUser),
// },
// Location: to.Ptr("westus"),
// 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{
// {
// PrivateIPAddress: to.Ptr("1.0.0.2"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm1_HSMMgmtNic"),
// }},
// Subnet: &armhardwaresecuritymodules.APIEntityReference{
// ResourceID: 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"),
// ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.Network/networkInterfaces/hsm1_HSMHost1Nic"),
// }},
// Subnet: &armhardwaresecuritymodules.APIEntityReference{
// ResourceID: 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."),
// },
// SKU: &armhardwaresecuritymodules.SKU{
// Name: to.Ptr(armhardwaresecuritymodules.SKUNamePayShield10KLMK1CPS60),
// },
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fhardwaresecuritymodules%2Farmhardwaresecuritymodules%2Fv2.0.0-beta.2/sdk/resourcemanager/hardwaresecuritymodules/armhardwaresecuritymodules/README.md"}