-
Notifications
You must be signed in to change notification settings - Fork 13
/
getGuestConfigurationHCRPAssignmentReportById.go
107 lines (104 loc) · 4.8 KB
/
getGuestConfigurationHCRPAssignmentReportById.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
95
96
97
98
99
100
101
102
103
104
105
106
107
package armguestconfiguration_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/guestconfiguration/armguestconfiguration"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/guestconfiguration/resource-manager/Microsoft.GuestConfiguration/stable/2022-01-25/examples/getGuestConfigurationHCRPAssignmentReportById.json
func ExampleHCRPAssignmentReportsClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armguestconfiguration.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewHCRPAssignmentReportsClient().Get(ctx, "myResourceGroupName", "AuditSecureProtocol", "7367cbb8-ae99-47d0-a33b-a283564d2cb1", "myMachineName", 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.AssignmentReport = armguestconfiguration.AssignmentReport{
// Name: to.Ptr("7367cbb8-ae99-47d0-a33b-a283564d2cb1"),
// ID: to.Ptr("/subscriptions/mysubscriptionid/resourceGroups/myResourceGroupName/providers/Microsoft.HybridCompute/machines/myMachineName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/AuditSecureProtocol/reports/7367cbb8-ae99-47d0-a33b-a283564d2cb1"),
// Properties: &armguestconfiguration.AssignmentReportProperties{
// Assignment: &armguestconfiguration.AssignmentInfo{
// Name: to.Ptr("AuditSecureProtocol"),
// Configuration: &armguestconfiguration.ConfigurationInfo{
// Name: to.Ptr("AuditSecureProtocol"),
// Version: to.Ptr("1.0.0.0"),
// },
// },
// ComplianceStatus: to.Ptr(armguestconfiguration.ComplianceStatusCompliant),
// EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-29T22:14:13Z"); return t}()),
// ReportID: to.Ptr("7367cbb8-ae99-47d0-a33b-a283564d2cb1"),
// StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-29T22:13:53Z"); return t}()),
// VM: &armguestconfiguration.VMInfo{
// ID: to.Ptr("/subscriptions/mysubscriptionid/resourceGroups/myResourceGroupName/providers/Microsoft.HybridCompute/machines/myMachineName"),
// UUID: to.Ptr("vmuuid"),
// },
// Details: &armguestconfiguration.AssignmentReportDetails{
// ComplianceStatus: to.Ptr(armguestconfiguration.ComplianceStatusCompliant),
// EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-29T22:14:13Z"); return t}()),
// JobID: to.Ptr("7367cbb8-ae99-47d0-a33b-a283564d2cb1"),
// OperationType: to.Ptr(armguestconfiguration.TypeConsistency),
// Resources: []*armguestconfiguration.AssignmentReportResource{
// {
// ComplianceStatus: to.Ptr(armguestconfiguration.ComplianceStatusCompliant),
// Properties: map[string]any{
// "ConfigurationName": "IsWebServerSecure",
// "DependsOn": nil,
// "IsSingleInstance": "Yes",
// "ModuleName": "SecureProtocolWebServer",
// "ModuleVersion": "1.0.0.3",
// "Protocols":[]any{
// map[string]any{
// "Ensure": "Absent",
// "Protocol": "SSL 2.0",
// },
// map[string]any{
// "Ensure": "Absent",
// "Protocol": "SSL 3.0",
// },
// map[string]any{
// "Ensure": "Absent",
// "Protocol": "TLS 1.0",
// },
// map[string]any{
// "Ensure": "Absent",
// "Protocol": "PCT 1.0",
// },
// map[string]any{
// "Ensure": "Absent",
// "Protocol": "Multi-Protocol Unified Hello",
// },
// map[string]any{
// "Ensure": "Absent",
// "Protocol": "TLS 1.1",
// },
// map[string]any{
// "Ensure": "Absent",
// "Protocol": "TLS 1.2",
// },
// },
// "PsDscRunAsCredential": nil,
// "Reasons": nil,
// "ResourceId": "[SecureWebServer]s1",
// "SourceInfo": nil,
// },
// Reasons: []*armguestconfiguration.AssignmentReportResourceComplianceReason{
// {
// Code: to.Ptr("DSC::RESOURCE::SUCCESS"),
// Phrase: to.Ptr("Operation successful."),
// }},
// }},
// StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-29T22:13:53Z"); return t}()),
// },
// },
// }
}