-
Notifications
You must be signed in to change notification settings - Fork 11
/
GalleryApplicationVersion_Get_WithReplicationStatus.go
94 lines (91 loc) · 4.49 KB
/
GalleryApplicationVersion_Get_WithReplicationStatus.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
package armcompute_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/compute/armcompute/v4"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/19f98c9f526f8db961f172276dd6d6882a86ed86/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-03-03/examples/galleryExamples/GalleryApplicationVersion_Get_WithReplicationStatus.json
func ExampleGalleryApplicationVersionsClient_Get_getAGalleryApplicationVersionWithReplicationStatus() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewGalleryApplicationVersionsClient().Get(ctx, "myResourceGroup", "myGalleryName", "myGalleryApplicationName", "1.0.0", &armcompute.GalleryApplicationVersionsClientGetOptions{Expand: to.Ptr(armcompute.ReplicationStatusTypesReplicationStatus)})
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.GalleryApplicationVersion = armcompute.GalleryApplicationVersion{
// Name: to.Ptr("1.0.0"),
// Location: to.Ptr("West US"),
// Properties: &armcompute.GalleryApplicationVersionProperties{
// ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded),
// PublishingProfile: &armcompute.GalleryApplicationVersionPublishingProfile{
// EndOfLifeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-01T07:00:00+00:00"); return t}()),
// ExcludeFromLatest: to.Ptr(false),
// PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-06-21T17:13:57.5972568+00:00"); return t}()),
// ReplicaCount: to.Ptr[int32](1),
// StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS),
// TargetRegions: []*armcompute.TargetRegion{
// {
// Name: to.Ptr("West US"),
// ExcludeFromLatest: to.Ptr(false),
// RegionalReplicaCount: to.Ptr[int32](1),
// StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS),
// }},
// AdvancedSettings: map[string]*string{
// "timeout": to.Ptr("300"),
// "user": to.Ptr("root"),
// },
// CustomActions: []*armcompute.GalleryApplicationCustomAction{
// {
// Name: to.Ptr("myCustomAction"),
// Description: to.Ptr("This is the custom action description."),
// Parameters: []*armcompute.GalleryApplicationCustomActionParameter{
// {
// Name: to.Ptr("myCustomActionParameter"),
// Type: to.Ptr(armcompute.GalleryApplicationCustomActionParameterTypeString),
// Description: to.Ptr("This is the description of the parameter"),
// DefaultValue: to.Ptr("default value of parameter."),
// Required: to.Ptr(false),
// }},
// Script: to.Ptr("myCustomActionScript"),
// }},
// EnableHealthCheck: to.Ptr(false),
// ManageActions: &armcompute.UserArtifactManage{
// Install: to.Ptr("powershell -command \"Expand-Archive -Path package.zip -DestinationPath C:\\package\""),
// Remove: to.Ptr("del C:\\package "),
// },
// Settings: &armcompute.UserArtifactSettings{
// ConfigFileName: to.Ptr("configuration.cfg"),
// PackageFileName: to.Ptr("package.zip"),
// },
// Source: &armcompute.UserArtifactSource{
// MediaLink: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}"),
// },
// },
// ReplicationStatus: &armcompute.ReplicationStatus{
// AggregatedState: to.Ptr(armcompute.AggregatedReplicationStateCompleted),
// Summary: []*armcompute.RegionalReplicationStatus{
// {
// Progress: to.Ptr[int32](100),
// Region: to.Ptr("West US"),
// State: to.Ptr(armcompute.ReplicationStateCompleted),
// Details: to.Ptr(""),
// }},
// },
// SafetyProfile: &armcompute.GalleryApplicationVersionSafetyProfile{
// AllowDeletionOfReplicatedLocations: to.Ptr(false),
// },
// },
// }
}