[Release] sdk/resourcemanager/mongocluster/armmongocluster/1.0.1 (#23575)

* [Release] sdk/resourcemanager/mongocluster/armmongocluster/1.0.1 generation from spec commit: 02ff8f08a132a5a68fcdd48da118e36e5ececc3d

* Update CHANGELOG.md

---------

Co-authored-by: fz <v-fending@microsoft.com>
This commit is contained in:
Mitse1n 2024-10-22 15:02:39 +08:00 коммит произвёл GitHub
Родитель 685b0db9b2
Коммит 16395d8b25
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
10 изменённых файлов: 1625 добавлений и 4 удалений

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

@ -1,5 +1,9 @@
# Release History
## 1.0.1 (2024-10-14)
### Other Changes
- Add examples
## 1.0.0 (2024-09-27)
### Breaking Changes
@ -55,4 +59,4 @@
The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html).
To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/go/mgmt).
To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/go/mgmt).

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

@ -6,7 +6,7 @@ package armmongocluster
const (
moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster"
moduleVersion = "v1.0.0"
moduleVersion = "v1.0.1"
)
// ActionType - Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.

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

@ -0,0 +1,190 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
package armmongocluster_test
import (
"context"
"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/mongocluster/armmongocluster"
"log"
)
// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_FirewallRuleCreate.json
func ExampleFirewallRulesClient_BeginCreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmongocluster.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewFirewallRulesClient().BeginCreateOrUpdate(ctx, "TestGroup", "myMongoCluster", "rule1", armmongocluster.FirewallRule{
Properties: &armmongocluster.FirewallRuleProperties{
StartIPAddress: to.Ptr("0.0.0.0"),
EndIPAddress: to.Ptr("255.255.255.255"),
},
}, 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 = armmongocluster.FirewallRulesClientCreateOrUpdateResponse{
// FirewallRule: &armmongocluster.FirewallRule{
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster/firewallRules/rule1"),
// Name: to.Ptr("rule1"),
// Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters/firewallRules"),
// SystemData: &armmongocluster.SystemData{
// CreatedBy: to.Ptr("user1"),
// CreatedByType: to.Ptr(armmongocluster.CreatedByTypeUser),
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()),
// LastModifiedBy: to.Ptr("user2"),
// LastModifiedByType: to.Ptr(armmongocluster.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()),
// },
// Properties: &armmongocluster.FirewallRuleProperties{
// ProvisioningState: to.Ptr(armmongocluster.ProvisioningStateSucceeded),
// StartIPAddress: to.Ptr("0.0.0.0"),
// EndIPAddress: to.Ptr("255.255.255.255"),
// },
// },
// }
}
// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_FirewallRuleDelete.json
func ExampleFirewallRulesClient_BeginDelete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmongocluster.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewFirewallRulesClient().BeginDelete(ctx, "TestGroup", "myMongoCluster", "rule1", 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)
}
}
// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_FirewallRuleGet.json
func ExampleFirewallRulesClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmongocluster.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewFirewallRulesClient().Get(ctx, "TestGroup", "myMongoCluster", "rule1", 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 = armmongocluster.FirewallRulesClientGetResponse{
// FirewallRule: &armmongocluster.FirewallRule{
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster/firewallRules/rule1"),
// Name: to.Ptr("rule1"),
// Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters/firewallRules"),
// SystemData: &armmongocluster.SystemData{
// CreatedBy: to.Ptr("user1"),
// CreatedByType: to.Ptr(armmongocluster.CreatedByTypeUser),
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()),
// LastModifiedBy: to.Ptr("user2"),
// LastModifiedByType: to.Ptr(armmongocluster.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()),
// },
// Properties: &armmongocluster.FirewallRuleProperties{
// ProvisioningState: to.Ptr(armmongocluster.ProvisioningStateSucceeded),
// StartIPAddress: to.Ptr("0.0.0.0"),
// EndIPAddress: to.Ptr("255.255.255.255"),
// },
// },
// }
}
// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_FirewallRuleList.json
func ExampleFirewallRulesClient_NewListByMongoClusterPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmongocluster.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewFirewallRulesClient().NewListByMongoClusterPager("TestGroup", "myMongoCluster", 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 = armmongocluster.FirewallRulesClientListByMongoClusterResponse{
// FirewallRuleListResult: armmongocluster.FirewallRuleListResult{
// Value: []*armmongocluster.FirewallRule{
// {
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster/firewallRules/rule1"),
// Name: to.Ptr("rule1"),
// Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters/firewallRules"),
// SystemData: &armmongocluster.SystemData{
// CreatedBy: to.Ptr("user1"),
// CreatedByType: to.Ptr(armmongocluster.CreatedByTypeUser),
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()),
// LastModifiedBy: to.Ptr("user2"),
// LastModifiedByType: to.Ptr(armmongocluster.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()),
// },
// Properties: &armmongocluster.FirewallRuleProperties{
// ProvisioningState: to.Ptr(armmongocluster.ProvisioningStateSucceeded),
// StartIPAddress: to.Ptr("0.0.0.0"),
// EndIPAddress: to.Ptr("255.255.255.255"),
// },
// },
// {
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster/firewallRules/rule2"),
// Name: to.Ptr("rule2"),
// Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters/firewallRules"),
// SystemData: &armmongocluster.SystemData{
// CreatedBy: to.Ptr("user1"),
// CreatedByType: to.Ptr(armmongocluster.CreatedByTypeUser),
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()),
// LastModifiedBy: to.Ptr("user2"),
// LastModifiedByType: to.Ptr(armmongocluster.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()),
// },
// Properties: &armmongocluster.FirewallRuleProperties{
// ProvisioningState: to.Ptr(armmongocluster.ProvisioningStateSucceeded),
// StartIPAddress: to.Ptr("1.0.0.0"),
// EndIPAddress: to.Ptr("255.0.0.0"),
// },
// },
// },
// },
// }
}
}

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

@ -4,11 +4,11 @@ go 1.18
require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0
)
require (
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -0,0 +1,61 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
package armmongocluster_test
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster"
"log"
)
// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/Operations_List.json
func ExampleOperationsClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmongocluster.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewOperationsClient().NewListPager(nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page = armmongocluster.OperationsClientListResponse{
// OperationListResult: armmongocluster.OperationListResult{
// Value: []*armmongocluster.Operation{
// {
// Name: to.Ptr("Microsoft.DocumentDB/mongoClusters/read"),
// Display: &armmongocluster.OperationDisplay{
// Provider: to.Ptr("Microsoft.DocumentDB"),
// Resource: to.Ptr("Mongo Cluster"),
// Operation: to.Ptr("Read Mongo Clusters"),
// Description: to.Ptr("Reads a Mongo Cluster or list all Mongo Clusters."),
// },
// },
// {
// Name: to.Ptr("Microsoft.DocumentDB/mongoClusters/write"),
// Display: &armmongocluster.OperationDisplay{
// Provider: to.Ptr("Microsoft.DocumentDB"),
// Resource: to.Ptr("Mongo Cluster"),
// Operation: to.Ptr("Create or Update Mongo Cluster"),
// Description: to.Ptr("Create or Update the properties or tags of the specified Mongo Cluster."),
// },
// },
// },
// },
// }
}
}

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

@ -0,0 +1,201 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
package armmongocluster_test
import (
"context"
"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/mongocluster/armmongocluster"
"log"
)
// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_PrivateEndpointConnectionPut.json
func ExamplePrivateEndpointConnectionsClient_BeginCreate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmongocluster.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginCreate(ctx, "TestGroup", "myMongoCluster", "pecTest", armmongocluster.PrivateEndpointConnectionResource{
Properties: &armmongocluster.PrivateEndpointConnectionProperties{
PrivateLinkServiceConnectionState: &armmongocluster.PrivateLinkServiceConnectionState{
Status: to.Ptr(armmongocluster.PrivateEndpointServiceConnectionStatusApproved),
Description: to.Ptr("Auto-Approved"),
},
},
}, 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 = armmongocluster.PrivateEndpointConnectionsClientCreateResponse{
// PrivateEndpointConnectionResource: &armmongocluster.PrivateEndpointConnectionResource{
// Name: to.Ptr("pecTest.5d393f64-ef64-46d0-9959-308321c44ac0"),
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster/privateEndpointConnections/pecTest.5d393f64-ef64-46d0-9959-308321c44ac0"),
// Type: to.Ptr("Microsoft.DocumentDB/mongoClusters/privateEndpointConnections"),
// SystemData: &armmongocluster.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-09T05:51:31.1386869Z"); return t}()),
// CreatedBy: to.Ptr("2df9eb86-36b5-49dc-86ae-9a63135bfa8c"),
// CreatedByType: to.Ptr(armmongocluster.CreatedByTypeApplication),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-09T05:51:31.1386869Z"); return t}()),
// LastModifiedBy: to.Ptr("2ff9eb86-36b5-49dc-86ae-9a63135bfa8c"),
// LastModifiedByType: to.Ptr(armmongocluster.CreatedByTypeApplication),
// },
// Properties: &armmongocluster.PrivateEndpointConnectionProperties{
// ProvisioningState: to.Ptr(armmongocluster.PrivateEndpointConnectionProvisioningStateSucceeded),
// PrivateEndpoint: &armmongocluster.PrivateEndpoint{
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/privateEndpoints/pecTest"),
// },
// GroupIDs: []*string{
// to.Ptr("MongoCluster"),
// },
// PrivateLinkServiceConnectionState: &armmongocluster.PrivateLinkServiceConnectionState{
// Status: to.Ptr(armmongocluster.PrivateEndpointServiceConnectionStatusApproved),
// Description: to.Ptr("Approved by admin"),
// ActionsRequired: to.Ptr("None"),
// },
// },
// },
// }
}
// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_PrivateEndpointConnectionDelete.json
func ExamplePrivateEndpointConnectionsClient_BeginDelete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmongocluster.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "TestGroup", "myMongoCluster", "pecTest.5d393f64-ef64-46d0-9959-308321c44ac0", 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)
}
}
// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_PrivateEndpointConnectionGet.json
func ExamplePrivateEndpointConnectionsClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmongocluster.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "TestGroup", "myMongoCluster", "pecTest.5d393f64-ef64-46d0-9959-308321c44ac0", 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 = armmongocluster.PrivateEndpointConnectionsClientGetResponse{
// PrivateEndpointConnectionResource: &armmongocluster.PrivateEndpointConnectionResource{
// Name: to.Ptr("pecTest.5d393f64-ef64-46d0-9959-308321c44ac0"),
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster/privateEndpointConnections/pecTest.5d393f64-ef64-46d0-9959-308321c44ac0"),
// Type: to.Ptr("Microsoft.DocumentDB/mongoClusters/privateEndpointConnections"),
// SystemData: &armmongocluster.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-09T05:51:31.1386869Z"); return t}()),
// CreatedBy: to.Ptr("2df9eb86-36b5-49dc-86ae-9a63135bfa8c"),
// CreatedByType: to.Ptr(armmongocluster.CreatedByTypeApplication),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-09T05:51:31.1386869Z"); return t}()),
// LastModifiedBy: to.Ptr("2ff9eb86-36b5-49dc-86ae-9a63135bfa8c"),
// LastModifiedByType: to.Ptr(armmongocluster.CreatedByTypeApplication),
// },
// Properties: &armmongocluster.PrivateEndpointConnectionProperties{
// ProvisioningState: to.Ptr(armmongocluster.PrivateEndpointConnectionProvisioningStateSucceeded),
// PrivateEndpoint: &armmongocluster.PrivateEndpoint{
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/privateEndpoints/pecTest"),
// },
// GroupIDs: []*string{
// to.Ptr("MongoCluster"),
// },
// PrivateLinkServiceConnectionState: &armmongocluster.PrivateLinkServiceConnectionState{
// Status: to.Ptr(armmongocluster.PrivateEndpointServiceConnectionStatusApproved),
// Description: to.Ptr("Auto-approved"),
// ActionsRequired: to.Ptr("None"),
// },
// },
// },
// }
}
// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_PrivateEndpointConnectionList.json
func ExamplePrivateEndpointConnectionsClient_NewListByMongoClusterPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmongocluster.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListByMongoClusterPager("TestGroup", "myMongoCluster", 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 = armmongocluster.PrivateEndpointConnectionsClientListByMongoClusterResponse{
// PrivateEndpointConnectionResourceListResult: armmongocluster.PrivateEndpointConnectionResourceListResult{
// Value: []*armmongocluster.PrivateEndpointConnectionResource{
// {
// Name: to.Ptr("pecTest.5d393f64-ef64-46d0-9959-308321c44ac0"),
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster/privateEndpointConnections/pecTest.5d393f64-ef64-46d0-9959-308321c44ac0"),
// Type: to.Ptr("Microsoft.DocumentDB/mongoClusters/privateEndpointConnections"),
// SystemData: &armmongocluster.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-09T05:51:31.1386869Z"); return t}()),
// CreatedBy: to.Ptr("2df9eb86-36b5-49dc-86ae-9a63135bfa8c"),
// CreatedByType: to.Ptr(armmongocluster.CreatedByTypeApplication),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-02-09T05:51:31.1386869Z"); return t}()),
// LastModifiedBy: to.Ptr("2ff9eb86-36b5-49dc-86ae-9a63135bfa8c"),
// LastModifiedByType: to.Ptr(armmongocluster.CreatedByTypeApplication),
// },
// Properties: &armmongocluster.PrivateEndpointConnectionProperties{
// ProvisioningState: to.Ptr(armmongocluster.PrivateEndpointConnectionProvisioningStateSucceeded),
// PrivateEndpoint: &armmongocluster.PrivateEndpoint{
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/privateEndpoints/pecTest"),
// },
// GroupIDs: []*string{
// to.Ptr("MongoCluster"),
// },
// PrivateLinkServiceConnectionState: &armmongocluster.PrivateLinkServiceConnectionState{
// Status: to.Ptr(armmongocluster.PrivateEndpointServiceConnectionStatusApproved),
// Description: to.Ptr("Auto-approved"),
// ActionsRequired: to.Ptr("None"),
// },
// },
// },
// },
// },
// }
}
}

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

@ -0,0 +1,57 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
package armmongocluster_test
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster"
"log"
)
// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_PrivateLinkResourceList.json
func ExamplePrivateLinksClient_NewListByMongoClusterPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmongocluster.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewPrivateLinksClient().NewListByMongoClusterPager("TestGroup", "myMongoCluster", 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 = armmongocluster.PrivateLinksClientListByMongoClusterResponse{
// PrivateLinkResourceListResult: armmongocluster.PrivateLinkResourceListResult{
// Value: []*armmongocluster.PrivateLinkResource{
// {
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DocumentDB/mongoClusters/myMongoCluster/privateLinkResources/MongoCluster"),
// Name: to.Ptr("MongoCluster"),
// Type: to.Ptr("Microsoft.DocumentDB/mongoClusters/privateLinkResources"),
// Properties: &armmongocluster.PrivateLinkResourceProperties{
// GroupID: to.Ptr("MongoCluster"),
// RequiredMembers: []*string{
// to.Ptr("c.p7ex3v2euquypn"),
// },
// RequiredZoneNames: []*string{
// to.Ptr("privatelink.mongocluster.cosmos.azure.com"),
// },
// },
// },
// },
// },
// }
}
}

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

@ -0,0 +1,50 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.
package armmongocluster_test
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster"
"log"
)
// Generated from example definition: D:/ws/azure-sdk-for-go/sdk/resourcemanager/mongocluster/armmongocluster/TempTypeSpecFiles/DocumentDB.MongoCluster.Management/examples/2024-07-01/MongoClusters_ReplicaList.json
func ExampleReplicasClient_NewListByParentPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmongocluster.NewClientFactory("ffffffff-ffff-ffff-ffff-ffffffffffff", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewReplicasClient().NewListByParentPager("TestGroup", "myMongoCluster", 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 = armmongocluster.ReplicasClientListByParentResponse{
// ReplicaListResult: armmongocluster.ReplicaListResult{
// Value: []*armmongocluster.Replica{
// {
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myReplicaMongoCluster"),
// Name: to.Ptr("myReplicaMongoCluster"),
// Type: to.Ptr("/Microsoft.DocumentDB/mongoClusters"),
// Properties: &armmongocluster.Properties{
// },
// },
// },
// },
// }
}
}

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

@ -1,4 +1,4 @@
directory: specification/mongocluster/DocumentDB.MongoCluster.Management
commit: 2a3294803a8df71659e27711e5fbfe4e97826828
commit: 02ff8f08a132a5a68fcdd48da118e36e5ececc3d
repo: Azure/azure-rest-api-specs
additionalDirectories: