-
Notifications
You must be signed in to change notification settings - Fork 13
/
CPURegressionAnalysisResultGet.go
53 lines (50 loc) · 2.58 KB
/
CPURegressionAnalysisResultGet.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
package armtestbase_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/testbase/armtestbase"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/CPURegressionAnalysisResultGet.json
func ExampleAnalysisResultsClient_Get_cpuRegressionAnalysisResultGet() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armtestbase.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAnalysisResultsClient().Get(ctx, "contoso-rg1", "contoso-testBaseAccount1", "contoso-package2", "Windows-10-1909-Test-Id", armtestbase.AnalysisResultNameCPURegression, 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.AnalysisResultSingletonResource = armtestbase.AnalysisResultSingletonResource{
// Name: to.Ptr("cpuRegression"),
// Type: to.Ptr("Microsoft.TestBase/testBaseAccounts/packages/testResults/analysisResults"),
// ID: to.Ptr("/subscriptions/476f61a4-952c-422a-b4db-568a828f35df/resourceGroups/contoso-rg1/providers/Microsoft.TestBase/testBaseAccounts/contoso-testBaseAccount1/packages/contoso-package2/testResults/Windows-10-1909-Test-Id/analysisResults/cpuRegression"),
// Properties: &armtestbase.CPURegressionResultSingletonResourceProperties{
// AnalysisResultType: to.Ptr(armtestbase.AnalysisResultTypeCPURegression),
// Grade: to.Ptr(armtestbase.GradePass),
// CPURegressionResults: []*armtestbase.RegressionResult{
// {
// Diff: to.Ptr[float64](0.1),
// FileName: to.Ptr("testApp.exe"),
// Grade: to.Ptr(armtestbase.GradePass),
// IsRegressed: to.Ptr(false),
// Details: to.Ptr("Some details of testApp"),
// },
// {
// Diff: to.Ptr[float64](0.15),
// FileName: to.Ptr("dependencies.exe"),
// Grade: to.Ptr(armtestbase.GradePass),
// IsRegressed: to.Ptr(false),
// Details: to.Ptr("Some details of dependencies"),
// }},
// },
// }
}