[Automation] Collect examples from azure-sdk-for-go#sdk/resourcemanager/netapp/armnetapp/v7.4.0-beta.1
This commit is contained in:
Родитель
102d4c1b79
Коммит
8f1beffa45
|
@ -0,0 +1,41 @@
|
||||||
|
package armnetapp_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/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/Accounts_ChangeKeyVault.json
|
||||||
|
func ExampleAccountsClient_BeginChangeKeyVault() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
poller, err := clientFactory.NewAccountsClient().BeginChangeKeyVault(ctx, "myRG", "account1", &armnetapp.AccountsClientBeginChangeKeyVaultOptions{Body: &armnetapp.ChangeKeyVault{
|
||||||
|
KeyName: to.Ptr("rsakey"),
|
||||||
|
KeyVaultPrivateEndpoints: []*armnetapp.KeyVaultPrivateEndpoint{
|
||||||
|
{
|
||||||
|
PrivateEndpointID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.Network/privateEndpoints/privip1"),
|
||||||
|
VirtualNetworkID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.Network/virtualNetworks/vnet1"),
|
||||||
|
}},
|
||||||
|
KeyVaultResourceID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.KeyVault/managedHSMs/my-hsm"),
|
||||||
|
KeyVaultURI: to.Ptr("https://my-key-vault.managedhsm.azure.net"),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
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%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,46 @@
|
||||||
|
package armnetapp_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/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/Accounts_CreateOrUpdate.json
|
||||||
|
func ExampleAccountsClient_BeginCreateOrUpdate_accountsCreateOrUpdate() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
poller, err := clientFactory.NewAccountsClient().BeginCreateOrUpdate(ctx, "myRG", "account1", armnetapp.Account{
|
||||||
|
Location: to.Ptr("eastus"),
|
||||||
|
Properties: &armnetapp.AccountProperties{},
|
||||||
|
}, 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.Account = armnetapp.Account{
|
||||||
|
// Name: to.Ptr("account1"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/netAppAccounts"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1"),
|
||||||
|
// Location: to.Ptr("eastus"),
|
||||||
|
// Properties: &armnetapp.AccountProperties{
|
||||||
|
// ProvisioningState: to.Ptr("Succeeded"),
|
||||||
|
// },
|
||||||
|
// }
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,73 @@
|
||||||
|
package armnetapp_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/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/Accounts_CreateOrUpdateAD.json
|
||||||
|
func ExampleAccountsClient_BeginCreateOrUpdate_accountsCreateOrUpdateWithActiveDirectory() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
poller, err := clientFactory.NewAccountsClient().BeginCreateOrUpdate(ctx, "myRG", "account1", armnetapp.Account{
|
||||||
|
Location: to.Ptr("eastus"),
|
||||||
|
Properties: &armnetapp.AccountProperties{
|
||||||
|
ActiveDirectories: []*armnetapp.ActiveDirectory{
|
||||||
|
{
|
||||||
|
AesEncryption: to.Ptr(true),
|
||||||
|
DNS: to.Ptr("10.10.10.3"),
|
||||||
|
Domain: to.Ptr("10.10.10.3"),
|
||||||
|
LdapOverTLS: to.Ptr(false),
|
||||||
|
LdapSigning: to.Ptr(false),
|
||||||
|
OrganizationalUnit: to.Ptr("OU=Engineering"),
|
||||||
|
Password: to.Ptr("ad_password"),
|
||||||
|
Site: to.Ptr("SiteName"),
|
||||||
|
SmbServerName: to.Ptr("SMBServer"),
|
||||||
|
Username: to.Ptr("ad_user_name"),
|
||||||
|
}},
|
||||||
|
},
|
||||||
|
}, 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.Account = armnetapp.Account{
|
||||||
|
// Name: to.Ptr("account1"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/netAppAccounts"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1"),
|
||||||
|
// Location: to.Ptr("eastus"),
|
||||||
|
// Properties: &armnetapp.AccountProperties{
|
||||||
|
// ActiveDirectories: []*armnetapp.ActiveDirectory{
|
||||||
|
// {
|
||||||
|
// ActiveDirectoryID: to.Ptr("503d38f9-f17c-f92d-ef26-b0d46374534b"),
|
||||||
|
// AesEncryption: to.Ptr(true),
|
||||||
|
// DNS: to.Ptr("10.10.10.3"),
|
||||||
|
// Domain: to.Ptr("10.10.10.3"),
|
||||||
|
// LdapOverTLS: to.Ptr(false),
|
||||||
|
// LdapSigning: to.Ptr(false),
|
||||||
|
// OrganizationalUnit: to.Ptr("OU=Engineering"),
|
||||||
|
// Site: to.Ptr("SiteName"),
|
||||||
|
// SmbServerName: to.Ptr("SMBServer"),
|
||||||
|
// Username: to.Ptr("ad_user_name"),
|
||||||
|
// }},
|
||||||
|
// ProvisioningState: to.Ptr("Succeeded"),
|
||||||
|
// },
|
||||||
|
// }
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,30 @@
|
||||||
|
package armnetapp_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/Accounts_Delete.json
|
||||||
|
func ExampleAccountsClient_BeginDelete() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
poller, err := clientFactory.NewAccountsClient().BeginDelete(ctx, "myRG", "account1", 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%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,52 @@
|
||||||
|
package armnetapp_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/Accounts_Get.json
|
||||||
|
func ExampleAccountsClient_Get() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
res, err := clientFactory.NewAccountsClient().Get(ctx, "myRG", "account1", 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.Account = armnetapp.Account{
|
||||||
|
// Name: to.Ptr("account1"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/netAppAccounts"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1"),
|
||||||
|
// Location: to.Ptr("eastus"),
|
||||||
|
// Properties: &armnetapp.AccountProperties{
|
||||||
|
// ActiveDirectories: []*armnetapp.ActiveDirectory{
|
||||||
|
// {
|
||||||
|
// ActiveDirectoryID: to.Ptr("02da3711-6c58-2d64-098a-e3af7afaf936"),
|
||||||
|
// AesEncryption: to.Ptr(true),
|
||||||
|
// DNS: to.Ptr("10.10.10.3"),
|
||||||
|
// Domain: to.Ptr("10.10.10.3"),
|
||||||
|
// LdapSigning: to.Ptr(true),
|
||||||
|
// OrganizationalUnit: to.Ptr("OU=Engineering"),
|
||||||
|
// Site: to.Ptr("SiteName"),
|
||||||
|
// SmbServerName: to.Ptr("SMBServer"),
|
||||||
|
// Status: to.Ptr(armnetapp.ActiveDirectoryStatusInUse),
|
||||||
|
// StatusDetails: to.Ptr("Status Details"),
|
||||||
|
// Username: to.Ptr("ad_user_name"),
|
||||||
|
// }},
|
||||||
|
// ProvisioningState: to.Ptr("Succeeded"),
|
||||||
|
// },
|
||||||
|
// }
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,30 @@
|
||||||
|
package armnetapp_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/Accounts_GetChangeKeyVaultInformation.json
|
||||||
|
func ExampleAccountsClient_BeginGetChangeKeyVaultInformation() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
poller, err := clientFactory.NewAccountsClient().BeginGetChangeKeyVaultInformation(ctx, "myRG", "account1", 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%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,46 @@
|
||||||
|
package armnetapp_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/Accounts_List.json
|
||||||
|
func ExampleAccountsClient_NewListBySubscriptionPager() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
pager := clientFactory.NewAccountsClient().NewListBySubscriptionPager(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.AccountList = armnetapp.AccountList{
|
||||||
|
// Value: []*armnetapp.Account{
|
||||||
|
// {
|
||||||
|
// Name: to.Ptr("account1"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/netAppAccounts"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1"),
|
||||||
|
// Location: to.Ptr("eastus"),
|
||||||
|
// Properties: &armnetapp.AccountProperties{
|
||||||
|
// ProvisioningState: to.Ptr("Succeeded"),
|
||||||
|
// },
|
||||||
|
// }},
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,30 @@
|
||||||
|
package armnetapp_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/Accounts_RenewCredentials.json
|
||||||
|
func ExampleAccountsClient_BeginRenewCredentials() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
poller, err := clientFactory.NewAccountsClient().BeginRenewCredentials(ctx, "myRG", "account1", 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%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,35 @@
|
||||||
|
package armnetapp_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/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/Accounts_TransitionEncryptionKey.json
|
||||||
|
func ExampleAccountsClient_BeginTransitionToCmk() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
poller, err := clientFactory.NewAccountsClient().BeginTransitionToCmk(ctx, "myRG", "account1", &armnetapp.AccountsClientBeginTransitionToCmkOptions{Body: &armnetapp.EncryptionTransitionRequest{
|
||||||
|
PrivateEndpointID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.Network/privateEndpoints/privip1"),
|
||||||
|
VirtualNetworkID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.Network/virtualNetworks/vnet1"),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
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%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,47 @@
|
||||||
|
package armnetapp_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/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/Accounts_Update.json
|
||||||
|
func ExampleAccountsClient_BeginUpdate() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
poller, err := clientFactory.NewAccountsClient().BeginUpdate(ctx, "myRG", "account1", armnetapp.AccountPatch{
|
||||||
|
Tags: map[string]*string{
|
||||||
|
"Tag1": to.Ptr("Value1"),
|
||||||
|
},
|
||||||
|
}, 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.Account = armnetapp.Account{
|
||||||
|
// Name: to.Ptr("account1"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/netAppAccounts"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1"),
|
||||||
|
// Location: to.Ptr("eastus"),
|
||||||
|
// Properties: &armnetapp.AccountProperties{
|
||||||
|
// ProvisioningState: to.Ptr("Succeeded"),
|
||||||
|
// },
|
||||||
|
// }
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,55 @@
|
||||||
|
package armnetapp_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/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/BackupPolicies_Create.json
|
||||||
|
func ExampleBackupPoliciesClient_BeginCreate() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
poller, err := clientFactory.NewBackupPoliciesClient().BeginCreate(ctx, "myRG", "account1", "backupPolicyName", armnetapp.BackupPolicy{
|
||||||
|
Location: to.Ptr("westus"),
|
||||||
|
Properties: &armnetapp.BackupPolicyProperties{
|
||||||
|
DailyBackupsToKeep: to.Ptr[int32](10),
|
||||||
|
Enabled: to.Ptr(true),
|
||||||
|
MonthlyBackupsToKeep: to.Ptr[int32](10),
|
||||||
|
WeeklyBackupsToKeep: to.Ptr[int32](10),
|
||||||
|
},
|
||||||
|
}, 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.BackupPolicy = armnetapp.BackupPolicy{
|
||||||
|
// Name: to.Ptr("account1/backupPolicyName"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/netAppAccounts/backupPolicies"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupPolicies/backupPolicyName"),
|
||||||
|
// Location: to.Ptr("westus"),
|
||||||
|
// Properties: &armnetapp.BackupPolicyProperties{
|
||||||
|
// DailyBackupsToKeep: to.Ptr[int32](10),
|
||||||
|
// Enabled: to.Ptr(true),
|
||||||
|
// MonthlyBackupsToKeep: to.Ptr[int32](10),
|
||||||
|
// ProvisioningState: to.Ptr("Succeeded"),
|
||||||
|
// WeeklyBackupsToKeep: to.Ptr[int32](10),
|
||||||
|
// },
|
||||||
|
// }
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,30 @@
|
||||||
|
package armnetapp_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/BackupPolicies_Delete.json
|
||||||
|
func ExampleBackupPoliciesClient_BeginDelete() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
poller, err := clientFactory.NewBackupPoliciesClient().BeginDelete(ctx, "resourceGroup", "accountName", "backupPolicyName", 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%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,48 @@
|
||||||
|
package armnetapp_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/BackupPolicies_Get.json
|
||||||
|
func ExampleBackupPoliciesClient_Get() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
res, err := clientFactory.NewBackupPoliciesClient().Get(ctx, "myRG", "account1", "backupPolicyName", 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.BackupPolicy = armnetapp.BackupPolicy{
|
||||||
|
// Name: to.Ptr("account1/backupPolicyName"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/netAppAccounts/backupPolicies"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupPolocies/backupPolicyName"),
|
||||||
|
// Location: to.Ptr("eastus"),
|
||||||
|
// Properties: &armnetapp.BackupPolicyProperties{
|
||||||
|
// DailyBackupsToKeep: to.Ptr[int32](10),
|
||||||
|
// Enabled: to.Ptr(true),
|
||||||
|
// MonthlyBackupsToKeep: to.Ptr[int32](10),
|
||||||
|
// VolumeBackups: []*armnetapp.VolumeBackups{
|
||||||
|
// {
|
||||||
|
// BackupsCount: to.Ptr[int32](5),
|
||||||
|
// PolicyEnabled: to.Ptr(true),
|
||||||
|
// VolumeName: to.Ptr("volume 1"),
|
||||||
|
// }},
|
||||||
|
// VolumesAssigned: to.Ptr[int32](0),
|
||||||
|
// WeeklyBackupsToKeep: to.Ptr[int32](10),
|
||||||
|
// },
|
||||||
|
// }
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,50 @@
|
||||||
|
package armnetapp_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/BackupPolicies_List.json
|
||||||
|
func ExampleBackupPoliciesClient_NewListPager() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
pager := clientFactory.NewBackupPoliciesClient().NewListPager("myRG", "account1", 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.BackupPoliciesList = armnetapp.BackupPoliciesList{
|
||||||
|
// Value: []*armnetapp.BackupPolicy{
|
||||||
|
// {
|
||||||
|
// Name: to.Ptr("account1/backupPolicy1"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/netAppAccounts/backupPolicies"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupPolocies/backupPolicy1"),
|
||||||
|
// Location: to.Ptr("eastus"),
|
||||||
|
// Properties: &armnetapp.BackupPolicyProperties{
|
||||||
|
// DailyBackupsToKeep: to.Ptr[int32](10),
|
||||||
|
// Enabled: to.Ptr(true),
|
||||||
|
// MonthlyBackupsToKeep: to.Ptr[int32](10),
|
||||||
|
// VolumesAssigned: to.Ptr[int32](0),
|
||||||
|
// WeeklyBackupsToKeep: to.Ptr[int32](10),
|
||||||
|
// },
|
||||||
|
// }},
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,62 @@
|
||||||
|
package armnetapp_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/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/BackupPolicies_Update.json
|
||||||
|
func ExampleBackupPoliciesClient_BeginUpdate() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
poller, err := clientFactory.NewBackupPoliciesClient().BeginUpdate(ctx, "myRG", "account1", "backupPolicyName", armnetapp.BackupPolicyPatch{
|
||||||
|
Location: to.Ptr("westus"),
|
||||||
|
Properties: &armnetapp.BackupPolicyProperties{
|
||||||
|
DailyBackupsToKeep: to.Ptr[int32](5),
|
||||||
|
Enabled: to.Ptr(false),
|
||||||
|
MonthlyBackupsToKeep: to.Ptr[int32](10),
|
||||||
|
WeeklyBackupsToKeep: to.Ptr[int32](10),
|
||||||
|
},
|
||||||
|
}, 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.BackupPolicy = armnetapp.BackupPolicy{
|
||||||
|
// Name: to.Ptr("account1/backupPolicyName"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/netAppAccounts/backupPolicies"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupPolocies/backupPolicyName"),
|
||||||
|
// Location: to.Ptr("westus"),
|
||||||
|
// Properties: &armnetapp.BackupPolicyProperties{
|
||||||
|
// DailyBackupsToKeep: to.Ptr[int32](5),
|
||||||
|
// Enabled: to.Ptr(false),
|
||||||
|
// MonthlyBackupsToKeep: to.Ptr[int32](10),
|
||||||
|
// ProvisioningState: to.Ptr("Succeeded"),
|
||||||
|
// VolumeBackups: []*armnetapp.VolumeBackups{
|
||||||
|
// {
|
||||||
|
// BackupsCount: to.Ptr[int32](5),
|
||||||
|
// PolicyEnabled: to.Ptr(true),
|
||||||
|
// VolumeName: to.Ptr("volume 1"),
|
||||||
|
// }},
|
||||||
|
// VolumesAssigned: to.Ptr[int32](1),
|
||||||
|
// WeeklyBackupsToKeep: to.Ptr[int32](10),
|
||||||
|
// },
|
||||||
|
// }
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,45 @@
|
||||||
|
package armnetapp_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/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/BackupVaults_Create.json
|
||||||
|
func ExampleBackupVaultsClient_BeginCreateOrUpdate() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
poller, err := clientFactory.NewBackupVaultsClient().BeginCreateOrUpdate(ctx, "myRG", "account1", "backupVault1", armnetapp.BackupVault{
|
||||||
|
Location: to.Ptr("eastus"),
|
||||||
|
}, 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.BackupVault = armnetapp.BackupVault{
|
||||||
|
// Name: to.Ptr("account1/backupVault1"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/netAppAccounts/backupVaults"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupVaults/backupVault1"),
|
||||||
|
// Location: to.Ptr("eastus"),
|
||||||
|
// Properties: &armnetapp.BackupVaultProperties{
|
||||||
|
// ProvisioningState: to.Ptr("Succeeded"),
|
||||||
|
// },
|
||||||
|
// }
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,30 @@
|
||||||
|
package armnetapp_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/BackupVaults_Delete.json
|
||||||
|
func ExampleBackupVaultsClient_BeginDelete() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
poller, err := clientFactory.NewBackupVaultsClient().BeginDelete(ctx, "resourceGroup", "account1", "backupVault1", 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%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,41 @@
|
||||||
|
package armnetapp_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/BackupVaults_Get.json
|
||||||
|
func ExampleBackupVaultsClient_Get() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
res, err := clientFactory.NewBackupVaultsClient().Get(ctx, "myRG", "account1", "backupVault1", 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.BackupVault = armnetapp.BackupVault{
|
||||||
|
// Name: to.Ptr("account1/backupVault1"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/netAppAccounts/backupVaults"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupVaults/backupVault1"),
|
||||||
|
// Location: to.Ptr("eastus"),
|
||||||
|
// Tags: map[string]*string{
|
||||||
|
// "Tag1": to.Ptr("Value1"),
|
||||||
|
// },
|
||||||
|
// Properties: &armnetapp.BackupVaultProperties{
|
||||||
|
// ProvisioningState: to.Ptr("Succeeded"),
|
||||||
|
// },
|
||||||
|
// }
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,49 @@
|
||||||
|
package armnetapp_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/BackupVaults_List.json
|
||||||
|
func ExampleBackupVaultsClient_NewListByNetAppAccountPager() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
pager := clientFactory.NewBackupVaultsClient().NewListByNetAppAccountPager("myRG", "account1", 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.BackupVaultsList = armnetapp.BackupVaultsList{
|
||||||
|
// Value: []*armnetapp.BackupVault{
|
||||||
|
// {
|
||||||
|
// Name: to.Ptr("account1/backupVault1"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/netAppAccounts/backupVaults"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupVaults/backupVault1"),
|
||||||
|
// Location: to.Ptr("eastus"),
|
||||||
|
// Tags: map[string]*string{
|
||||||
|
// "Tag1": to.Ptr("Value1"),
|
||||||
|
// },
|
||||||
|
// Properties: &armnetapp.BackupVaultProperties{
|
||||||
|
// ProvisioningState: to.Ptr("Succeeded"),
|
||||||
|
// },
|
||||||
|
// }},
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,50 @@
|
||||||
|
package armnetapp_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/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/BackupVaults_Update.json
|
||||||
|
func ExampleBackupVaultsClient_BeginUpdate() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
poller, err := clientFactory.NewBackupVaultsClient().BeginUpdate(ctx, "myRG", "account1", "backupVault1", armnetapp.BackupVaultPatch{
|
||||||
|
Tags: map[string]*string{
|
||||||
|
"Tag1": to.Ptr("Value1"),
|
||||||
|
},
|
||||||
|
}, 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.BackupVault = armnetapp.BackupVault{
|
||||||
|
// Name: to.Ptr("account1/backupVault1"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/netAppAccounts/backupVaults"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupVaults/backupVault1"),
|
||||||
|
// Location: to.Ptr("eastus"),
|
||||||
|
// Tags: map[string]*string{
|
||||||
|
// "Tag1": to.Ptr("Value1"),
|
||||||
|
// },
|
||||||
|
// Properties: &armnetapp.BackupVaultProperties{
|
||||||
|
// ProvisioningState: to.Ptr("Succeeded"),
|
||||||
|
// },
|
||||||
|
// }
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,33 @@
|
||||||
|
package armnetapp_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/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/BackupsUnderAccount_Migrate.json
|
||||||
|
func ExampleBackupsUnderAccountClient_BeginMigrateBackups() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
poller, err := clientFactory.NewBackupsUnderAccountClient().BeginMigrateBackups(ctx, "myRG", "account1", armnetapp.BackupsMigrationRequest{
|
||||||
|
BackupVaultID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupVaults/backupVault1"),
|
||||||
|
}, 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%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,53 @@
|
||||||
|
package armnetapp_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/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/BackupsUnderBackupVault_Create.json
|
||||||
|
func ExampleBackupsClient_BeginCreate() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
poller, err := clientFactory.NewBackupsClient().BeginCreate(ctx, "myRG", "account1", "backupVault1", "backup1", armnetapp.Backup{
|
||||||
|
Properties: &armnetapp.BackupProperties{
|
||||||
|
Label: to.Ptr("myLabel"),
|
||||||
|
VolumeResourceID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPool/pool1/volumes/volume1"),
|
||||||
|
},
|
||||||
|
}, 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.Backup = armnetapp.Backup{
|
||||||
|
// Name: to.Ptr("account1/backupVault1/backup1"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/netAppAccounts/backupVaults/backups"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupVaults/backupVault1/backups/backup1"),
|
||||||
|
// Properties: &armnetapp.BackupProperties{
|
||||||
|
// BackupType: to.Ptr(armnetapp.BackupTypeManual),
|
||||||
|
// CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33.000Z"); return t}()),
|
||||||
|
// Label: to.Ptr("myLabel"),
|
||||||
|
// ProvisioningState: to.Ptr("Succeeded"),
|
||||||
|
// Size: to.Ptr[int64](10011),
|
||||||
|
// SnapshotName: to.Ptr("backup1"),
|
||||||
|
// VolumeResourceID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPool/pool1/volumes/volume1"),
|
||||||
|
// },
|
||||||
|
// }
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,30 @@
|
||||||
|
package armnetapp_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/BackupsUnderBackupVault_Delete.json
|
||||||
|
func ExampleBackupsClient_BeginDelete() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
poller, err := clientFactory.NewBackupsClient().BeginDelete(ctx, "resourceGroup", "account1", "backupVault1", "backup1", 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%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,44 @@
|
||||||
|
package armnetapp_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/BackupsUnderBackupVault_Get.json
|
||||||
|
func ExampleBackupsClient_Get() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
res, err := clientFactory.NewBackupsClient().Get(ctx, "myRG", "account1", "backupVault1", "backup1", 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.Backup = armnetapp.Backup{
|
||||||
|
// Name: to.Ptr("account1/backupVault1/backup1"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/netAppAccounts/backupVaults/backups"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupVaults/backupVault1/backups/backup1"),
|
||||||
|
// Properties: &armnetapp.BackupProperties{
|
||||||
|
// BackupPolicyResourceID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupPolicies/policy1"),
|
||||||
|
// BackupType: to.Ptr(armnetapp.BackupTypeManual),
|
||||||
|
// CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33.000Z"); return t}()),
|
||||||
|
// Label: to.Ptr("myLabel"),
|
||||||
|
// ProvisioningState: to.Ptr("Succeeded"),
|
||||||
|
// Size: to.Ptr[int64](10011),
|
||||||
|
// SnapshotName: to.Ptr("backup1"),
|
||||||
|
// VolumeResourceID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPool/pool1/volumes/volume1"),
|
||||||
|
// },
|
||||||
|
// }
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,52 @@
|
||||||
|
package armnetapp_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/BackupsUnderBackupVault_List.json
|
||||||
|
func ExampleBackupsClient_NewListByVaultPager() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
pager := clientFactory.NewBackupsClient().NewListByVaultPager("myRG", "account1", "backupVault1", &armnetapp.BackupsClientListByVaultOptions{Filter: 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.BackupsList = armnetapp.BackupsList{
|
||||||
|
// Value: []*armnetapp.Backup{
|
||||||
|
// {
|
||||||
|
// Name: to.Ptr("account1/backupVault1/backup1"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/netAppAccounts/backupVaults/backups"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupVaults/backupVault1/backups/backup1"),
|
||||||
|
// Properties: &armnetapp.BackupProperties{
|
||||||
|
// BackupPolicyResourceID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupPolicies/policy1"),
|
||||||
|
// BackupType: to.Ptr(armnetapp.BackupTypeManual),
|
||||||
|
// CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33.000Z"); return t}()),
|
||||||
|
// Label: to.Ptr("myLabel"),
|
||||||
|
// ProvisioningState: to.Ptr("Succeeded"),
|
||||||
|
// Size: to.Ptr[int64](10011),
|
||||||
|
// SnapshotName: to.Ptr("backup1"),
|
||||||
|
// VolumeResourceID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPool/pool1/volumes/volume1"),
|
||||||
|
// },
|
||||||
|
// }},
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,36 @@
|
||||||
|
package armnetapp_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/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/BackupsUnderBackupVault_SingleFileRestore.json
|
||||||
|
func ExampleBackupsUnderBackupVaultClient_BeginRestoreFiles() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
poller, err := clientFactory.NewBackupsUnderBackupVaultClient().BeginRestoreFiles(ctx, "myRG", "account1", "backupVault1", "backup1", armnetapp.BackupRestoreFiles{
|
||||||
|
DestinationVolumeID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1"),
|
||||||
|
FileList: []*string{
|
||||||
|
to.Ptr("/dir1/customer1.db"),
|
||||||
|
to.Ptr("/dir1/customer2.db")},
|
||||||
|
}, 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%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,47 @@
|
||||||
|
package armnetapp_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/BackupsUnderBackupVault_Update.json
|
||||||
|
func ExampleBackupsClient_BeginUpdate() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
poller, err := clientFactory.NewBackupsClient().BeginUpdate(ctx, "myRG", "account1", "backupVault1", "backup1", armnetapp.BackupPatch{}, 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.Backup = armnetapp.Backup{
|
||||||
|
// Name: to.Ptr("account1/backupVault1/backup1"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/netAppAccounts/backupVaults/backups"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupVaults/backupVault1/backups/backup1"),
|
||||||
|
// Properties: &armnetapp.BackupProperties{
|
||||||
|
// BackupType: to.Ptr(armnetapp.BackupTypeManual),
|
||||||
|
// CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33.000Z"); return t}()),
|
||||||
|
// Label: to.Ptr("myLabel"),
|
||||||
|
// ProvisioningState: to.Ptr("Succeeded"),
|
||||||
|
// Size: to.Ptr[int64](10011),
|
||||||
|
// SnapshotName: to.Ptr("backup1"),
|
||||||
|
// VolumeResourceID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPool/pool1/volumes/volume1"),
|
||||||
|
// },
|
||||||
|
// }
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,33 @@
|
||||||
|
package armnetapp_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/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/BackupsUnderVolume_Migrate.json
|
||||||
|
func ExampleBackupsUnderVolumeClient_BeginMigrateBackups() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
poller, err := clientFactory.NewBackupsUnderVolumeClient().BeginMigrateBackups(ctx, "myRG", "account1", "pool1", "volume1", armnetapp.BackupsMigrationRequest{
|
||||||
|
BackupVaultID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupVaults/backupVault1"),
|
||||||
|
}, 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%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,36 @@
|
||||||
|
package armnetapp_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/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/CheckFilePathAvailability.json
|
||||||
|
func ExampleResourceClient_CheckFilePathAvailability() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
res, err := clientFactory.NewResourceClient().CheckFilePathAvailability(ctx, "eastus", armnetapp.FilePathAvailabilityRequest{
|
||||||
|
Name: to.Ptr("my-exact-filepth"),
|
||||||
|
SubnetID: to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"),
|
||||||
|
}, 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.CheckAvailabilityResponse = armnetapp.CheckAvailabilityResponse{
|
||||||
|
// IsAvailable: to.Ptr(true),
|
||||||
|
// }
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,37 @@
|
||||||
|
package armnetapp_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/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/CheckNameAvailability.json
|
||||||
|
func ExampleResourceClient_CheckNameAvailability() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
res, err := clientFactory.NewResourceClient().CheckNameAvailability(ctx, "eastus", armnetapp.ResourceNameAvailabilityRequest{
|
||||||
|
Name: to.Ptr("accName"),
|
||||||
|
Type: to.Ptr(armnetapp.CheckNameResourceTypesMicrosoftNetAppNetAppAccounts),
|
||||||
|
ResourceGroup: to.Ptr("myRG"),
|
||||||
|
}, 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.CheckAvailabilityResponse = armnetapp.CheckAvailabilityResponse{
|
||||||
|
// IsAvailable: to.Ptr(true),
|
||||||
|
// }
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,37 @@
|
||||||
|
package armnetapp_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/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/CheckQuotaAvailability.json
|
||||||
|
func ExampleResourceClient_CheckQuotaAvailability() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
res, err := clientFactory.NewResourceClient().CheckQuotaAvailability(ctx, "eastus", armnetapp.QuotaAvailabilityRequest{
|
||||||
|
Name: to.Ptr("resource1"),
|
||||||
|
Type: to.Ptr(armnetapp.CheckQuotaNameResourceTypesMicrosoftNetAppNetAppAccounts),
|
||||||
|
ResourceGroup: to.Ptr("myRG"),
|
||||||
|
}, 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.CheckAvailabilityResponse = armnetapp.CheckAvailabilityResponse{
|
||||||
|
// IsAvailable: to.Ptr(true),
|
||||||
|
// }
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,41 @@
|
||||||
|
package armnetapp_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/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/GroupIdListForLDAPUser.json
|
||||||
|
func ExampleVolumesClient_BeginListGetGroupIDListForLdapUser() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
poller, err := clientFactory.NewVolumesClient().BeginListGetGroupIDListForLdapUser(ctx, "myRG", "account1", "pool1", "volume1", armnetapp.GetGroupIDListForLDAPUserRequest{
|
||||||
|
Username: to.Ptr("user1"),
|
||||||
|
}, 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.GetGroupIDListForLDAPUserResponse = armnetapp.GetGroupIDListForLDAPUserResponse{
|
||||||
|
// GroupIDsForLdapUser: []*string{
|
||||||
|
// to.Ptr("123"),
|
||||||
|
// to.Ptr("224")},
|
||||||
|
// }
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,58 @@
|
||||||
|
package armnetapp_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/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/NetworkSiblingSet_Query.json
|
||||||
|
func ExampleResourceClient_QueryNetworkSiblingSet() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
res, err := clientFactory.NewResourceClient().QueryNetworkSiblingSet(ctx, "eastus", armnetapp.QueryNetworkSiblingSetRequest{
|
||||||
|
NetworkSiblingSetID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca3333"),
|
||||||
|
SubnetID: to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/testSubnet"),
|
||||||
|
}, 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.NetworkSiblingSet = armnetapp.NetworkSiblingSet{
|
||||||
|
// NetworkFeatures: to.Ptr(armnetapp.NetworkFeaturesStandard),
|
||||||
|
// NetworkSiblingSetID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca3333"),
|
||||||
|
// NetworkSiblingSetStateID: to.Ptr("12345_44420.8001578125"),
|
||||||
|
// NicInfoList: []*armnetapp.NicInfo{
|
||||||
|
// {
|
||||||
|
// IPAddress: to.Ptr("1.2.3.4"),
|
||||||
|
// VolumeResourceIDs: []*string{
|
||||||
|
// to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume10"),
|
||||||
|
// to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume11")},
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// IPAddress: to.Ptr("1.2.3.5"),
|
||||||
|
// VolumeResourceIDs: []*string{
|
||||||
|
// to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account2/capacityPools/pool2/volumes/volume20"),
|
||||||
|
// to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account2/capacityPools/pool2/volumes/volume21")},
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// IPAddress: to.Ptr("1.2.3.9"),
|
||||||
|
// VolumeResourceIDs: []*string{
|
||||||
|
// },
|
||||||
|
// }},
|
||||||
|
// ProvisioningState: to.Ptr(armnetapp.NetworkSiblingSetProvisioningStateSucceeded),
|
||||||
|
// SubnetID: to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/testSubnet"),
|
||||||
|
// }
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,64 @@
|
||||||
|
package armnetapp_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/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/NetworkSiblingSet_Update.json
|
||||||
|
func ExampleResourceClient_BeginUpdateNetworkSiblingSet() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
poller, err := clientFactory.NewResourceClient().BeginUpdateNetworkSiblingSet(ctx, "eastus", armnetapp.UpdateNetworkSiblingSetRequest{
|
||||||
|
NetworkFeatures: to.Ptr(armnetapp.NetworkFeaturesStandard),
|
||||||
|
NetworkSiblingSetID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca3333"),
|
||||||
|
NetworkSiblingSetStateID: to.Ptr("12345_44420.8001578125"),
|
||||||
|
SubnetID: to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/testSubnet"),
|
||||||
|
}, 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.NetworkSiblingSet = armnetapp.NetworkSiblingSet{
|
||||||
|
// NetworkFeatures: to.Ptr(armnetapp.NetworkFeaturesStandard),
|
||||||
|
// NetworkSiblingSetID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca3333"),
|
||||||
|
// NetworkSiblingSetStateID: to.Ptr("12345_44420.8001578125"),
|
||||||
|
// NicInfoList: []*armnetapp.NicInfo{
|
||||||
|
// {
|
||||||
|
// IPAddress: to.Ptr("1.2.3.4"),
|
||||||
|
// VolumeResourceIDs: []*string{
|
||||||
|
// to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume10"),
|
||||||
|
// to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume11")},
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// IPAddress: to.Ptr("1.2.3.5"),
|
||||||
|
// VolumeResourceIDs: []*string{
|
||||||
|
// to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account2/capacityPools/pool2/volumes/volume20"),
|
||||||
|
// to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account2/capacityPools/pool2/volumes/volume21")},
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// IPAddress: to.Ptr("1.2.3.9"),
|
||||||
|
// VolumeResourceIDs: []*string{
|
||||||
|
// },
|
||||||
|
// }},
|
||||||
|
// ProvisioningState: to.Ptr(armnetapp.NetworkSiblingSetProvisioningStateSucceeded),
|
||||||
|
// SubnetID: to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/testSubnet"),
|
||||||
|
// }
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,55 @@
|
||||||
|
package armnetapp_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/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/Pools_CreateOrUpdate.json
|
||||||
|
func ExamplePoolsClient_BeginCreateOrUpdate_poolsCreateOrUpdate() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
poller, err := clientFactory.NewPoolsClient().BeginCreateOrUpdate(ctx, "myRG", "account1", "pool1", armnetapp.CapacityPool{
|
||||||
|
Location: to.Ptr("eastus"),
|
||||||
|
Properties: &armnetapp.PoolProperties{
|
||||||
|
QosType: to.Ptr(armnetapp.QosTypeAuto),
|
||||||
|
ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium),
|
||||||
|
Size: to.Ptr[int64](4398046511104),
|
||||||
|
},
|
||||||
|
}, 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.CapacityPool = armnetapp.CapacityPool{
|
||||||
|
// Name: to.Ptr("account1/pool1"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1"),
|
||||||
|
// Location: to.Ptr("eastus"),
|
||||||
|
// Properties: &armnetapp.PoolProperties{
|
||||||
|
// PoolID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca7778"),
|
||||||
|
// ProvisioningState: to.Ptr("Succeeded"),
|
||||||
|
// QosType: to.Ptr(armnetapp.QosTypeAuto),
|
||||||
|
// ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium),
|
||||||
|
// Size: to.Ptr[int64](4398046511104),
|
||||||
|
// TotalThroughputMibps: to.Ptr[float32](281.474),
|
||||||
|
// },
|
||||||
|
// }
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,57 @@
|
||||||
|
package armnetapp_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/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/Pools_CreateOrUpdate_CustomThroughput.json
|
||||||
|
func ExamplePoolsClient_BeginCreateOrUpdate_poolsCreateOrUpdateCustomThroughput() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
poller, err := clientFactory.NewPoolsClient().BeginCreateOrUpdate(ctx, "myRG", "account1", "customPool1", armnetapp.CapacityPool{
|
||||||
|
Location: to.Ptr("eastus"),
|
||||||
|
Properties: &armnetapp.PoolProperties{
|
||||||
|
CustomThroughputMibps: to.Ptr[float32](128),
|
||||||
|
QosType: to.Ptr(armnetapp.QosTypeManual),
|
||||||
|
ServiceLevel: to.Ptr(armnetapp.ServiceLevelFlexible),
|
||||||
|
Size: to.Ptr[int64](4398046511104),
|
||||||
|
},
|
||||||
|
}, 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.CapacityPool = armnetapp.CapacityPool{
|
||||||
|
// Name: to.Ptr("account1/customPool1"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/customPool1"),
|
||||||
|
// Location: to.Ptr("eastus"),
|
||||||
|
// Properties: &armnetapp.PoolProperties{
|
||||||
|
// CustomThroughputMibps: to.Ptr[float32](128),
|
||||||
|
// PoolID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca7778"),
|
||||||
|
// ProvisioningState: to.Ptr("Succeeded"),
|
||||||
|
// QosType: to.Ptr(armnetapp.QosTypeManual),
|
||||||
|
// ServiceLevel: to.Ptr(armnetapp.ServiceLevelFlexible),
|
||||||
|
// Size: to.Ptr[int64](4398046511104),
|
||||||
|
// TotalThroughputMibps: to.Ptr[float32](128),
|
||||||
|
// },
|
||||||
|
// }
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,30 @@
|
||||||
|
package armnetapp_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/Pools_Delete.json
|
||||||
|
func ExamplePoolsClient_BeginDelete() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
poller, err := clientFactory.NewPoolsClient().BeginDelete(ctx, "myRG", "account1", "pool1", 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%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,44 @@
|
||||||
|
package armnetapp_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/Pools_Get.json
|
||||||
|
func ExamplePoolsClient_Get_poolsGet() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
res, err := clientFactory.NewPoolsClient().Get(ctx, "myRG", "account1", "pool1", 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.CapacityPool = armnetapp.CapacityPool{
|
||||||
|
// Name: to.Ptr("account1/pool1"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1"),
|
||||||
|
// Location: to.Ptr("eastus"),
|
||||||
|
// Properties: &armnetapp.PoolProperties{
|
||||||
|
// PoolID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca7778"),
|
||||||
|
// ProvisioningState: to.Ptr("Succeeded"),
|
||||||
|
// QosType: to.Ptr(armnetapp.QosTypeManual),
|
||||||
|
// ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium),
|
||||||
|
// Size: to.Ptr[int64](4398046511104),
|
||||||
|
// TotalThroughputMibps: to.Ptr[float32](281.474),
|
||||||
|
// UtilizedThroughputMibps: to.Ptr[float32](100.47),
|
||||||
|
// },
|
||||||
|
// }
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,45 @@
|
||||||
|
package armnetapp_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/Pools_Get_CustomThroughput.json
|
||||||
|
func ExamplePoolsClient_Get_poolsGetCustomThroughput() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
res, err := clientFactory.NewPoolsClient().Get(ctx, "myRG", "account1", "customPool1", 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.CapacityPool = armnetapp.CapacityPool{
|
||||||
|
// Name: to.Ptr("account1/customPool1"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/customPool1"),
|
||||||
|
// Location: to.Ptr("eastus"),
|
||||||
|
// Properties: &armnetapp.PoolProperties{
|
||||||
|
// CustomThroughputMibps: to.Ptr[float32](128),
|
||||||
|
// PoolID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca7778"),
|
||||||
|
// ProvisioningState: to.Ptr("Succeeded"),
|
||||||
|
// QosType: to.Ptr(armnetapp.QosTypeManual),
|
||||||
|
// ServiceLevel: to.Ptr(armnetapp.ServiceLevelFlexible),
|
||||||
|
// Size: to.Ptr[int64](4398046511104),
|
||||||
|
// TotalThroughputMibps: to.Ptr[float32](128),
|
||||||
|
// UtilizedThroughputMibps: to.Ptr[float32](100.47),
|
||||||
|
// },
|
||||||
|
// }
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,68 @@
|
||||||
|
package armnetapp_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/Pools_List.json
|
||||||
|
func ExamplePoolsClient_NewListPager() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
pager := clientFactory.NewPoolsClient().NewListPager("myRG", "account1", 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.CapacityPoolList = armnetapp.CapacityPoolList{
|
||||||
|
// Value: []*armnetapp.CapacityPool{
|
||||||
|
// {
|
||||||
|
// Name: to.Ptr("account1/pool1"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1"),
|
||||||
|
// Location: to.Ptr("eastus"),
|
||||||
|
// Properties: &armnetapp.PoolProperties{
|
||||||
|
// PoolID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca7778"),
|
||||||
|
// ProvisioningState: to.Ptr("Succeeded"),
|
||||||
|
// QosType: to.Ptr(armnetapp.QosTypeAuto),
|
||||||
|
// ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium),
|
||||||
|
// Size: to.Ptr[int64](4398046511104),
|
||||||
|
// TotalThroughputMibps: to.Ptr[float32](281.474),
|
||||||
|
// UtilizedThroughputMibps: to.Ptr[float32](100.47),
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// Name: to.Ptr("account1/customPool1"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/customPool1"),
|
||||||
|
// Location: to.Ptr("eastus"),
|
||||||
|
// Properties: &armnetapp.PoolProperties{
|
||||||
|
// CustomThroughputMibps: to.Ptr[float32](128),
|
||||||
|
// PoolID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca7778"),
|
||||||
|
// ProvisioningState: to.Ptr("Succeeded"),
|
||||||
|
// QosType: to.Ptr(armnetapp.QosTypeManual),
|
||||||
|
// ServiceLevel: to.Ptr(armnetapp.ServiceLevelFlexible),
|
||||||
|
// Size: to.Ptr[int64](4398046511104),
|
||||||
|
// TotalThroughputMibps: to.Ptr[float32](128),
|
||||||
|
// UtilizedThroughputMibps: to.Ptr[float32](100.47),
|
||||||
|
// },
|
||||||
|
// }},
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,48 @@
|
||||||
|
package armnetapp_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/Pools_Update.json
|
||||||
|
func ExamplePoolsClient_BeginUpdate_poolsUpdate() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
poller, err := clientFactory.NewPoolsClient().BeginUpdate(ctx, "myRG", "account1", "pool1", armnetapp.CapacityPoolPatch{}, 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.CapacityPool = armnetapp.CapacityPool{
|
||||||
|
// Name: to.Ptr("account1/pool1"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1"),
|
||||||
|
// Location: to.Ptr("eastus"),
|
||||||
|
// Properties: &armnetapp.PoolProperties{
|
||||||
|
// PoolID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca7778"),
|
||||||
|
// ProvisioningState: to.Ptr("Succeeded"),
|
||||||
|
// QosType: to.Ptr(armnetapp.QosTypeManual),
|
||||||
|
// ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium),
|
||||||
|
// Size: to.Ptr[int64](4398046511104),
|
||||||
|
// TotalThroughputMibps: to.Ptr[float32](281.474),
|
||||||
|
// UtilizedThroughputMibps: to.Ptr[float32](100.47),
|
||||||
|
// },
|
||||||
|
// }
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,49 @@
|
||||||
|
package armnetapp_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/Pools_Update_CustomThroughput.json
|
||||||
|
func ExamplePoolsClient_BeginUpdate_poolsUpdateCustomThroughput() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
poller, err := clientFactory.NewPoolsClient().BeginUpdate(ctx, "myRG", "account1", "customPool1", armnetapp.CapacityPoolPatch{}, 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.CapacityPool = armnetapp.CapacityPool{
|
||||||
|
// Name: to.Ptr("account1/customPool1"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/customPool1"),
|
||||||
|
// Location: to.Ptr("eastus"),
|
||||||
|
// Properties: &armnetapp.PoolProperties{
|
||||||
|
// CustomThroughputMibps: to.Ptr[float32](128),
|
||||||
|
// PoolID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca7778"),
|
||||||
|
// ProvisioningState: to.Ptr("Succeeded"),
|
||||||
|
// QosType: to.Ptr(armnetapp.QosTypeManual),
|
||||||
|
// ServiceLevel: to.Ptr(armnetapp.ServiceLevelFlexible),
|
||||||
|
// Size: to.Ptr[int64](4398046511104),
|
||||||
|
// TotalThroughputMibps: to.Ptr[float32](128),
|
||||||
|
// UtilizedThroughputMibps: to.Ptr[float32](100.47),
|
||||||
|
// },
|
||||||
|
// }
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,38 @@
|
||||||
|
package armnetapp_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/QuotaLimits_Get.json
|
||||||
|
func ExampleResourceQuotaLimitsClient_Get() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
res, err := clientFactory.NewResourceQuotaLimitsClient().Get(ctx, "eastus", "totalCoolAccessVolumesPerSubscription", 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.SubscriptionQuotaItem = armnetapp.SubscriptionQuotaItem{
|
||||||
|
// Name: to.Ptr("eastus/totalCoolAccessVolumesPerSubscription"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/locations/quotaLimits"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/providers/Microsoft.NetApp/locations/eastus/quotaLimits/totalCoolAccessVolumesPerSubscription"),
|
||||||
|
// Properties: &armnetapp.SubscriptionQuotaItemProperties{
|
||||||
|
// Default: to.Ptr[int32](10),
|
||||||
|
// Current: to.Ptr[int32](10),
|
||||||
|
// },
|
||||||
|
// }
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,109 @@
|
||||||
|
package armnetapp_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/QuotaLimits_List.json
|
||||||
|
func ExampleResourceQuotaLimitsClient_NewListPager() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
pager := clientFactory.NewResourceQuotaLimitsClient().NewListPager("eastus", 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.SubscriptionQuotaItemList = armnetapp.SubscriptionQuotaItemList{
|
||||||
|
// Value: []*armnetapp.SubscriptionQuotaItem{
|
||||||
|
// {
|
||||||
|
// Name: to.Ptr("eastus/accountsPerSubscription"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/locations/quotaLimits"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/providers/Microsoft.NetApp/locations/eastus/quotaLimits/accountsPerSubscription"),
|
||||||
|
// Properties: &armnetapp.SubscriptionQuotaItemProperties{
|
||||||
|
// Default: to.Ptr[int32](10),
|
||||||
|
// Current: to.Ptr[int32](10),
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// Name: to.Ptr("eastus/poolsPerAccount"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/locations/quotaLimits"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/providers/Microsoft.NetApp/locations/eastus/quotaLimits/poolsPerAccount"),
|
||||||
|
// Properties: &armnetapp.SubscriptionQuotaItemProperties{
|
||||||
|
// Default: to.Ptr[int32](25),
|
||||||
|
// Current: to.Ptr[int32](25),
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// Name: to.Ptr("eastus/volumesPerPool"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/locations/quotaLimits"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/providers/Microsoft.NetApp/locations/eastus/quotaLimits/volumesPerPool"),
|
||||||
|
// Properties: &armnetapp.SubscriptionQuotaItemProperties{
|
||||||
|
// Default: to.Ptr[int32](500),
|
||||||
|
// Current: to.Ptr[int32](500),
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// Name: to.Ptr("eastus/snapshotsPerVolume"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/locations/quotaLimits"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/providers/Microsoft.NetApp/locations/eastus/quotaLimits/snapshotsPerVolume"),
|
||||||
|
// Properties: &armnetapp.SubscriptionQuotaItemProperties{
|
||||||
|
// Default: to.Ptr[int32](255),
|
||||||
|
// Current: to.Ptr[int32](255),
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// Name: to.Ptr("eastus/totalTiBsPerSubscription"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/locations/quotaLimits"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/providers/Microsoft.NetApp/locations/eastus/quotaLimits/totalTiBsPerSubscription"),
|
||||||
|
// Properties: &armnetapp.SubscriptionQuotaItemProperties{
|
||||||
|
// Default: to.Ptr[int32](25),
|
||||||
|
// Current: to.Ptr[int32](1000),
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// Name: to.Ptr("eastus/totalDPVolumesPerSubscription"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/locations/quotaLimits"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/providers/Microsoft.NetApp/locations/eastus/quotaLimits/totalDPVolumesPerSubscription"),
|
||||||
|
// Properties: &armnetapp.SubscriptionQuotaItemProperties{
|
||||||
|
// Default: to.Ptr[int32](10),
|
||||||
|
// Current: to.Ptr[int32](10),
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// Name: to.Ptr("eastus/totalVolumesPerSubscription"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/locations/quotaLimits"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/providers/Microsoft.NetApp/locations/eastus/quotaLimits/totalVolumesPerSubscription"),
|
||||||
|
// Properties: &armnetapp.SubscriptionQuotaItemProperties{
|
||||||
|
// Default: to.Ptr[int32](500),
|
||||||
|
// Current: to.Ptr[int32](500),
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// Name: to.Ptr("eastus/totalCoolAccessVolumesPerSubscription"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/locations/quotaLimits"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/providers/Microsoft.NetApp/locations/eastus/quotaLimits/totalCoolAccessVolumesPerSubscription"),
|
||||||
|
// Properties: &armnetapp.SubscriptionQuotaItemProperties{
|
||||||
|
// Default: to.Ptr[int32](10),
|
||||||
|
// Current: to.Ptr[int32](10),
|
||||||
|
// },
|
||||||
|
// }},
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,37 @@
|
||||||
|
package armnetapp_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/RegionInfo.json
|
||||||
|
func ExampleResourceClient_QueryRegionInfo() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
res, err := clientFactory.NewResourceClient().QueryRegionInfo(ctx, "eastus", 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.RegionInfo = armnetapp.RegionInfo{
|
||||||
|
// AvailabilityZoneMappings: []*armnetapp.RegionInfoAvailabilityZoneMappingsItem{
|
||||||
|
// {
|
||||||
|
// AvailabilityZone: to.Ptr("1"),
|
||||||
|
// IsAvailable: to.Ptr(true),
|
||||||
|
// }},
|
||||||
|
// StorageToNetworkProximity: to.Ptr(armnetapp.RegionStorageToNetworkProximityT2),
|
||||||
|
// }
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,50 @@
|
||||||
|
package armnetapp_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/RegionInfos_Get.json
|
||||||
|
func ExampleResourceRegionInfosClient_Get() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
res, err := clientFactory.NewResourceRegionInfosClient().Get(ctx, "eastus", 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.RegionInfoResource = armnetapp.RegionInfoResource{
|
||||||
|
// Name: to.Ptr("eastus/default"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/locations/regionInfos"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/providers/Microsoft.NetApp/locations/eastus/regionInfos/default"),
|
||||||
|
// Properties: &armnetapp.RegionInfo{
|
||||||
|
// AvailabilityZoneMappings: []*armnetapp.RegionInfoAvailabilityZoneMappingsItem{
|
||||||
|
// {
|
||||||
|
// AvailabilityZone: to.Ptr("1"),
|
||||||
|
// IsAvailable: to.Ptr(true),
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// AvailabilityZone: to.Ptr("2"),
|
||||||
|
// IsAvailable: to.Ptr(true),
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// AvailabilityZone: to.Ptr("3"),
|
||||||
|
// IsAvailable: to.Ptr(true),
|
||||||
|
// }},
|
||||||
|
// StorageToNetworkProximity: to.Ptr(armnetapp.RegionStorageToNetworkProximityT2),
|
||||||
|
// },
|
||||||
|
// }
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,58 @@
|
||||||
|
package armnetapp_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/RegionInfos_List.json
|
||||||
|
func ExampleResourceRegionInfosClient_NewListPager() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
pager := clientFactory.NewResourceRegionInfosClient().NewListPager("eastus", 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.RegionInfosList = armnetapp.RegionInfosList{
|
||||||
|
// Value: []*armnetapp.RegionInfoResource{
|
||||||
|
// {
|
||||||
|
// Name: to.Ptr("eastus/default"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/locations/regionInfos"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/providers/Microsoft.NetApp/locations/eastus/regionInfos/default"),
|
||||||
|
// Properties: &armnetapp.RegionInfo{
|
||||||
|
// AvailabilityZoneMappings: []*armnetapp.RegionInfoAvailabilityZoneMappingsItem{
|
||||||
|
// {
|
||||||
|
// AvailabilityZone: to.Ptr("1"),
|
||||||
|
// IsAvailable: to.Ptr(true),
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// AvailabilityZone: to.Ptr("2"),
|
||||||
|
// IsAvailable: to.Ptr(true),
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// AvailabilityZone: to.Ptr("3"),
|
||||||
|
// IsAvailable: to.Ptr(true),
|
||||||
|
// }},
|
||||||
|
// StorageToNetworkProximity: to.Ptr(armnetapp.RegionStorageToNetworkProximityT2),
|
||||||
|
// },
|
||||||
|
// }},
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,87 @@
|
||||||
|
package armnetapp_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/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/SnapshotPolicies_Create.json
|
||||||
|
func ExampleSnapshotPoliciesClient_Create() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
res, err := clientFactory.NewSnapshotPoliciesClient().Create(ctx, "myRG", "account1", "snapshotPolicyName", armnetapp.SnapshotPolicy{
|
||||||
|
Location: to.Ptr("eastus"),
|
||||||
|
Properties: &armnetapp.SnapshotPolicyProperties{
|
||||||
|
DailySchedule: &armnetapp.DailySchedule{
|
||||||
|
Hour: to.Ptr[int32](14),
|
||||||
|
Minute: to.Ptr[int32](30),
|
||||||
|
SnapshotsToKeep: to.Ptr[int32](4),
|
||||||
|
},
|
||||||
|
Enabled: to.Ptr(true),
|
||||||
|
HourlySchedule: &armnetapp.HourlySchedule{
|
||||||
|
Minute: to.Ptr[int32](50),
|
||||||
|
SnapshotsToKeep: to.Ptr[int32](2),
|
||||||
|
},
|
||||||
|
MonthlySchedule: &armnetapp.MonthlySchedule{
|
||||||
|
DaysOfMonth: to.Ptr("10,11,12"),
|
||||||
|
Hour: to.Ptr[int32](14),
|
||||||
|
Minute: to.Ptr[int32](15),
|
||||||
|
SnapshotsToKeep: to.Ptr[int32](5),
|
||||||
|
},
|
||||||
|
WeeklySchedule: &armnetapp.WeeklySchedule{
|
||||||
|
Day: to.Ptr("Wednesday"),
|
||||||
|
Hour: to.Ptr[int32](14),
|
||||||
|
Minute: to.Ptr[int32](45),
|
||||||
|
SnapshotsToKeep: to.Ptr[int32](3),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}, 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.SnapshotPolicy = armnetapp.SnapshotPolicy{
|
||||||
|
// Name: to.Ptr("account1/snapshotPolicy1"),
|
||||||
|
// Type: to.Ptr("Microsoft.NetApp/netAppAccounts/snapshotPolicies"),
|
||||||
|
// ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/snapshotPolicies/snapshotPolicy1"),
|
||||||
|
// Location: to.Ptr("eastus"),
|
||||||
|
// Properties: &armnetapp.SnapshotPolicyProperties{
|
||||||
|
// DailySchedule: &armnetapp.DailySchedule{
|
||||||
|
// Hour: to.Ptr[int32](14),
|
||||||
|
// Minute: to.Ptr[int32](30),
|
||||||
|
// SnapshotsToKeep: to.Ptr[int32](4),
|
||||||
|
// },
|
||||||
|
// Enabled: to.Ptr(true),
|
||||||
|
// HourlySchedule: &armnetapp.HourlySchedule{
|
||||||
|
// Minute: to.Ptr[int32](50),
|
||||||
|
// SnapshotsToKeep: to.Ptr[int32](2),
|
||||||
|
// },
|
||||||
|
// MonthlySchedule: &armnetapp.MonthlySchedule{
|
||||||
|
// DaysOfMonth: to.Ptr("10,11,12"),
|
||||||
|
// Hour: to.Ptr[int32](14),
|
||||||
|
// Minute: to.Ptr[int32](15),
|
||||||
|
// SnapshotsToKeep: to.Ptr[int32](5),
|
||||||
|
// },
|
||||||
|
// ProvisioningState: to.Ptr("Succeeded"),
|
||||||
|
// WeeklySchedule: &armnetapp.WeeklySchedule{
|
||||||
|
// Day: to.Ptr("Wednesday"),
|
||||||
|
// Hour: to.Ptr[int32](14),
|
||||||
|
// Minute: to.Ptr[int32](45),
|
||||||
|
// SnapshotsToKeep: to.Ptr[int32](3),
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// }
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
|
@ -0,0 +1,30 @@
|
||||||
|
package armnetapp_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
|
||||||
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v7"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/netapp/resource-manager/Microsoft.NetApp/preview/2024-07-01-preview/examples/SnapshotPolicies_Delete.json
|
||||||
|
func ExampleSnapshotPoliciesClient_BeginDelete() {
|
||||||
|
cred, err := azidentity.NewDefaultAzureCredential(nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to obtain a credential: %v", err)
|
||||||
|
}
|
||||||
|
ctx := context.Background()
|
||||||
|
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to create client: %v", err)
|
||||||
|
}
|
||||||
|
poller, err := clientFactory.NewSnapshotPoliciesClient().BeginDelete(ctx, "resourceGroup", "accountName", "snapshotPolicyName", 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%2Fnetapp%2Farmnetapp%2Fv7.4.0-beta.1/sdk/resourcemanager/netapp/armnetapp/README.md"}
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче