-
Notifications
You must be signed in to change notification settings - Fork 12
/
WorkbookTemplateGet.go
74 lines (71 loc) · 3.22 KB
/
WorkbookTemplateGet.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
package armapplicationinsights_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7932c2df6c8435d6c0e5cbebbca79bce627d5f06/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-11-20/examples/WorkbookTemplateGet.json
func ExampleWorkbookTemplatesClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewWorkbookTemplatesClient().Get(ctx, "my-resource-group", "my-resource-name", 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.WorkbookTemplate = armapplicationinsights.WorkbookTemplate{
// Name: to.Ptr("my-resource-name"),
// Type: to.Ptr("microsoft.insights/workbooktemplate"),
// ID: to.Ptr("/subscriptions/6b643656-33eb-422f-aee8-3ac145d124af/resourceGroups/my-resource-group/providers/microsoft.insights/workbooktemplates/my-resource-name"),
// Location: to.Ptr("westus"),
// Properties: &armapplicationinsights.WorkbookTemplateProperties{
// Author: to.Ptr("Contoso"),
// Galleries: []*armapplicationinsights.WorkbookTemplateGallery{
// {
// Name: to.Ptr("Simple Template"),
// Type: to.Ptr("tsg"),
// Category: to.Ptr("Failures"),
// Order: to.Ptr[int32](100),
// ResourceType: to.Ptr("microsoft.insights/components"),
// }},
// Priority: to.Ptr[int32](1),
// TemplateData: map[string]any{
// "$schema": "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json",
// "items":[]any{
// map[string]any{
// "name": "text - 2",
// "type": float64(1),
// "content":map[string]any{
// "json": "## New workbook\n---\n\nWelcome to your new workbook. This area will display text formatted as markdown.\n\n\nWe've included a basic analytics query to get you started. Use the `Edit` button below each section to configure it or add more sections.",
// },
// },
// map[string]any{
// "name": "query - 2",
// "type": float64(3),
// "content":map[string]any{
// "exportToExcelOptions": "visible",
// "query": "union withsource=TableName *\n| summarize Count=count() by TableName\n| render barchart",
// "queryType": float64(0),
// "resourceType": "microsoft.operationalinsights/workspaces",
// "size": float64(1),
// "version": "KqlItem/1.0",
// },
// },
// },
// "styleSettings":map[string]any{
// },
// "version": "Notebook/1.0",
// },
// },
// }
}