-
Notifications
You must be signed in to change notification settings - Fork 11
/
PrivateEndpointConnectionProxy_Validate.go
46 lines (43 loc) · 2.41 KB
/
PrivateEndpointConnectionProxy_Validate.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package armdeviceupdate_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/deviceupdate/armdeviceupdate"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80065490402157d0df0dd37ab347c651b22eb576/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/stable/2022-10-01/examples/PrivateEndpointConnectionProxies/PrivateEndpointConnectionProxy_Validate.json
func ExamplePrivateEndpointConnectionProxiesClient_Validate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdeviceupdate.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewPrivateEndpointConnectionProxiesClient().Validate(ctx, "test-rg", "contoso", "peexample01", armdeviceupdate.PrivateEndpointConnectionProxy{
RemotePrivateEndpoint: &armdeviceupdate.RemotePrivateEndpoint{
ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Network/privateEndpoints/{privateEndpointConnectionProxyId}"),
ImmutableResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Network/privateEndpoints/{peName}"),
ImmutableSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
Location: to.Ptr("westus2"),
ManualPrivateLinkServiceConnections: []*armdeviceupdate.PrivateLinkServiceConnection{
{
Name: to.Ptr("{privateEndpointConnectionProxyId}"),
GroupIDs: []*string{
to.Ptr("DeviceUpdate")},
RequestMessage: to.Ptr("Please approve my connection, thanks."),
}},
PrivateLinkServiceProxies: []*armdeviceupdate.PrivateLinkServiceProxy{
{
GroupConnectivityInformation: []*armdeviceupdate.GroupConnectivityInformation{},
ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Network/privateEndpoints/{privateEndpointConnectionProxyId}/privateLinkServiceProxies/{privateEndpointConnectionProxyId}"),
}},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
}