Skip to content

Commit

Permalink
Release track 2 armcompute v0.3.0 (Azure#15426)
Browse files Browse the repository at this point in the history
* [Release] sdk/compute/armcompute/0.2.1 generation from spec commit: d5ad9431bbc19c34090d97209eb497167db32879

* fix exmaple

* goimports

* fix

* fix

* fix

* fix CHANGELOG release date

* fix
  • Loading branch information
Alancere authored and vindicatesociety committed Sep 18, 2021
1 parent 21a8fc7 commit 56ac512
Show file tree
Hide file tree
Showing 66 changed files with 21,055 additions and 12,562 deletions.
7 changes: 5 additions & 2 deletions sdk/compute/armcompute/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Release History

## v0.2.0 (released)
## v0.3.0 (2021-09-03)
Updated with the latest track 2 code generator.

## v0.1.0 (released)
## v0.2.0 (2021-06-18)
Updated with the latest track 2 code generator.

## v0.1.0 (2021-05-26)
10 changes: 5 additions & 5 deletions sdk/compute/armcompute/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/compute/armcompute)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/compute/armcompute)

The `armcompute` module provides operations for working with Azure compute.
The `armcompute` module provides operations for working with Azure Compute.

[Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/compute/armcompute)

Expand Down Expand Up @@ -35,17 +35,17 @@ For more information on authentication, please see the documentation for `aziden

## Connecting to Azure Compute

Once you have a credential, create a connection to the desired ARM endpoint. The `armcore` module provides facilities for connecting with ARM endpoints including public and sovereign clouds as well as Azure Stack.
Once you have a credential, create a connection to the desired ARM endpoint. The `github.com/Azure/azure-sdk-for-go/sdk/azcore/arm` package provides facilities for connecting with ARM endpoints including public and sovereign clouds as well as Azure Stack.

```go
con := armcore.NewDefaultConnection(cred, nil)
con := arm.NewDefaultConnection(cred, nil)
```

For more information on ARM connections, please see the documentation for `armcore` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/armcore](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/armcore).
For more information on ARM connections, please see the documentation for `azcore` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore).

## Clients

Azure Compute modules consist of one or more clients. A client groups a set of related APIs, providing access to its functionality within the specified subscription. Create one or more clients to access the APIs you require using your `armcore.Connection`.
Azure Compute modules consist of one or more clients. A client groups a set of related APIs, providing access to its functionality within the specified subscription. Create one or more clients to access the APIs you require using your `arm.Connection`.

```go
client := armcompute.NewVirtualMachinesClient(con, "<subscription ID>")
Expand Down
11 changes: 0 additions & 11 deletions sdk/compute/armcompute/_meta.json

This file was deleted.

11 changes: 11 additions & 0 deletions sdk/compute/armcompute/autorest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### AutoRest Configuration

> see https://aka.ms/autorest
``` yaml
require:
- https://github.com/Azure/azure-rest-api-specs/blob/d5ad9431bbc19c34090d97209eb497167db32879/specification/compute/resource-manager/readme.md
- https://github.com/Azure/azure-rest-api-specs/blob/d5ad9431bbc19c34090d97209eb497167db32879/specification/compute/resource-manager/readme.go.md
module-version: 0.3.0

```
7 changes: 7 additions & 0 deletions sdk/compute/armcompute/build.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

// This file enables 'go generate' to regenerate this specific SDK
//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate armcompute

package armcompute
2 changes: 1 addition & 1 deletion sdk/compute/armcompute/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ pr:
- sdk/compute/armcompute/

stages:
- template: ../../../eng/pipelines/templates/jobs/archetype-sdk-client.yml
- template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml
parameters:
ServiceDirectory: 'compute/armcompute'
11 changes: 6 additions & 5 deletions sdk/compute/armcompute/example_availabilitysets_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// +build go1.13
//go:build go1.16
// +build go1.16

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
Expand All @@ -9,18 +10,18 @@ import (
"context"
"log"

"github.com/Azure/azure-sdk-for-go/sdk/armcore"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
"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/compute/armcompute"
"github.com/Azure/azure-sdk-for-go/sdk/to"
)

func ExampleAvailabilitySetsClient_CreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
client := armcompute.NewAvailabilitySetsClient(armcore.NewDefaultConnection(cred, nil), "<subscription ID>")
client := armcompute.NewAvailabilitySetsClient(arm.NewDefaultConnection(cred, nil), "<subscription ID>")
resp, err := client.CreateOrUpdate(
context.Background(),
"<resource group name>",
Expand Down Expand Up @@ -51,7 +52,7 @@ func ExampleAvailabilitySetsClient_Get() {
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
client := armcompute.NewAvailabilitySetsClient(armcore.NewDefaultConnection(cred, nil), "<subscription ID>")
client := armcompute.NewAvailabilitySetsClient(arm.NewDefaultConnection(cred, nil), "<subscription ID>")
resp, err := client.Get(context.Background(), "<resource group name>", "<availability set name>", nil)
if err != nil {
log.Fatalf("failed to obtain a response: %v", err)
Expand Down
11 changes: 6 additions & 5 deletions sdk/compute/armcompute/example_disks_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// +build go1.13
//go:build go1.16
// +build go1.16

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
Expand All @@ -10,18 +11,18 @@ import (
"log"
"time"

"github.com/Azure/azure-sdk-for-go/sdk/armcore"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
"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/compute/armcompute"
"github.com/Azure/azure-sdk-for-go/sdk/to"
)

func ExampleDisksClient_BeginCreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
client := armcompute.NewDisksClient(armcore.NewDefaultConnection(cred, nil), "<subscription ID>")
client := armcompute.NewDisksClient(arm.NewDefaultConnection(cred, nil), "<subscription ID>")
poller, err := client.BeginCreateOrUpdate(
context.Background(),
"<resource group name>",
Expand Down Expand Up @@ -55,7 +56,7 @@ func ExampleDisksClient_Get() {
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
client := armcompute.NewDisksClient(armcore.NewDefaultConnection(cred, nil), "<subscription ID>")
client := armcompute.NewDisksClient(arm.NewDefaultConnection(cred, nil), "<subscription ID>")
resp, err := client.Get(context.Background(), "<resource group name>", "<disk name>", nil)
if err != nil {
log.Fatalf("failed to obtain a response: %v", err)
Expand Down
11 changes: 6 additions & 5 deletions sdk/compute/armcompute/example_virtualmachineextensions_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// +build go1.13
//go:build go1.16
// +build go1.16

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
Expand All @@ -11,18 +12,18 @@ import (
"log"
"time"

"github.com/Azure/azure-sdk-for-go/sdk/armcore"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
"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/compute/armcompute"
"github.com/Azure/azure-sdk-for-go/sdk/to"
)

func ExampleVirtualMachineExtensionsClient_BeginCreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
client := armcompute.NewVirtualMachineExtensionsClient(armcore.NewDefaultConnection(cred, nil), "<subscription ID>")
client := armcompute.NewVirtualMachineExtensionsClient(arm.NewDefaultConnection(cred, nil), "<subscription ID>")
poller, err := client.BeginCreateOrUpdate(
context.Background(),
"<resource group name>",
Expand Down Expand Up @@ -69,7 +70,7 @@ func ExampleVirtualMachineExtensionsClient_Get() {
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
client := armcompute.NewVirtualMachineExtensionsClient(armcore.NewDefaultConnection(cred, nil), "<subscription ID>")
client := armcompute.NewVirtualMachineExtensionsClient(arm.NewDefaultConnection(cred, nil), "<subscription ID>")
resp, err := client.Get(context.Background(), "<resource group name>", "<VM name>", "<VM extension name>", nil)
if err != nil {
log.Fatalf("failed to obtain a response: %v", err)
Expand Down
25 changes: 13 additions & 12 deletions sdk/compute/armcompute/example_virtualmachines_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// +build go1.13
//go:build go1.16
// +build go1.16

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
Expand All @@ -11,10 +12,10 @@ import (
"log"
"time"

"github.com/Azure/azure-sdk-for-go/sdk/armcore"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
"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/compute/armcompute"
"github.com/Azure/azure-sdk-for-go/sdk/to"
)

func ExampleVirtualMachinesClient_BeginCreateOrUpdate() {
Expand All @@ -24,7 +25,7 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate() {
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
client := armcompute.NewVirtualMachinesClient(armcore.NewDefaultConnection(cred, nil), "<subscription ID>")
client := armcompute.NewVirtualMachinesClient(arm.NewDefaultConnection(cred, nil), "<subscription ID>")
poller, err := client.BeginCreateOrUpdate(
context.Background(),
"<resource group name>",
Expand Down Expand Up @@ -94,7 +95,7 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_withDisk() {
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
client := armcompute.NewVirtualMachinesClient(armcore.NewDefaultConnection(cred, nil), "<subscription ID>")
client := armcompute.NewVirtualMachinesClient(arm.NewDefaultConnection(cred, nil), "<subscription ID>")
poller, err := client.BeginCreateOrUpdate(
context.Background(),
"<resource group name>",
Expand Down Expand Up @@ -172,7 +173,7 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate_withLoadBalancer() {
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
client := armcompute.NewVirtualMachinesClient(armcore.NewDefaultConnection(cred, nil), "<subscription ID>")
client := armcompute.NewVirtualMachinesClient(arm.NewDefaultConnection(cred, nil), "<subscription ID>")
poller, err := client.BeginCreateOrUpdate(
context.Background(),
"<resource group name>",
Expand Down Expand Up @@ -235,7 +236,7 @@ func ExampleVirtualMachinesClient_Get() {
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
client := armcompute.NewVirtualMachinesClient(armcore.NewDefaultConnection(cred, nil), "<subscription ID>")
client := armcompute.NewVirtualMachinesClient(arm.NewDefaultConnection(cred, nil), "<subscription ID>")
resp, err := client.Get(context.Background(), "<resource group name>", "<VM name>", nil)
if err != nil {
log.Fatalf("failed to obtain a response: %v", err)
Expand All @@ -248,7 +249,7 @@ func ExampleVirtualMachinesClient_BeginDeallocate() {
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
client := armcompute.NewVirtualMachinesClient(armcore.NewDefaultConnection(cred, nil), "<subscription ID>")
client := armcompute.NewVirtualMachinesClient(arm.NewDefaultConnection(cred, nil), "<subscription ID>")
poller, err := client.BeginDeallocate(context.Background(), "<resource group name>", "<VM name>", nil)
if err != nil {
log.Fatalf("failed to obtain a response: %v", err)
Expand All @@ -264,7 +265,7 @@ func ExampleVirtualMachinesClient_BeginUpdate() {
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
client := armcompute.NewVirtualMachinesClient(armcore.NewDefaultConnection(cred, nil), "<subscription ID>")
client := armcompute.NewVirtualMachinesClient(arm.NewDefaultConnection(cred, nil), "<subscription ID>")
poller, err := client.BeginUpdate(
context.Background(),
"<resource group name>",
Expand Down Expand Up @@ -294,7 +295,7 @@ func ExampleVirtualMachinesClient_BeginStart() {
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
client := armcompute.NewVirtualMachinesClient(armcore.NewDefaultConnection(cred, nil), "<subscription ID>")
client := armcompute.NewVirtualMachinesClient(arm.NewDefaultConnection(cred, nil), "<subscription ID>")
poller, err := client.BeginStart(
context.Background(),
"<resource group name>",
Expand All @@ -315,7 +316,7 @@ func ExampleVirtualMachinesClient_BeginRestart() {
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
client := armcompute.NewVirtualMachinesClient(armcore.NewDefaultConnection(cred, nil), "<subscription ID>")
client := armcompute.NewVirtualMachinesClient(arm.NewDefaultConnection(cred, nil), "<subscription ID>")
poller, err := client.BeginRestart(
context.Background(),
"<resource group name>",
Expand All @@ -336,7 +337,7 @@ func ExampleVirtualMachinesClient_BeginPowerOff() {
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
client := armcompute.NewVirtualMachinesClient(armcore.NewDefaultConnection(cred, nil), "<subscription ID>")
client := armcompute.NewVirtualMachinesClient(arm.NewDefaultConnection(cred, nil), "<subscription ID>")
poller, err := client.BeginPowerOff(
context.Background(),
"<resource group name>",
Expand Down
21 changes: 11 additions & 10 deletions sdk/compute/armcompute/example_virtualmachinescalesets_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// +build go1.13
//go:build go1.16
// +build go1.16

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
Expand All @@ -11,10 +12,10 @@ import (
"log"
"time"

"github.com/Azure/azure-sdk-for-go/sdk/armcore"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
"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/compute/armcompute"
"github.com/Azure/azure-sdk-for-go/sdk/to"
)

func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate() {
Expand All @@ -32,7 +33,7 @@ func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate() {
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
client := armcompute.NewVirtualMachineScaleSetsClient(armcore.NewDefaultConnection(cred, nil), "<subscription ID>")
client := armcompute.NewVirtualMachineScaleSetsClient(arm.NewDefaultConnection(cred, nil), "<subscription ID>")
poller, err := client.BeginCreateOrUpdate(
context.Background(),
"<resource group name>",
Expand Down Expand Up @@ -120,7 +121,7 @@ func ExampleVirtualMachineScaleSetsClient_Get() {
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
client := armcompute.NewVirtualMachineScaleSetsClient(armcore.NewDefaultConnection(cred, nil), "<subscription ID>")
client := armcompute.NewVirtualMachineScaleSetsClient(arm.NewDefaultConnection(cred, nil), "<subscription ID>")
resp, err := client.Get(context.Background(), "<resource group name>", "<VM scale set name>", nil)
if err != nil {
log.Fatalf("failed to obtain a response: %v", err)
Expand All @@ -133,7 +134,7 @@ func ExampleVirtualMachineScaleSetsClient_BeginUpdate() {
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
client := armcompute.NewVirtualMachineScaleSetsClient(armcore.NewDefaultConnection(cred, nil), "<subscription ID>")
client := armcompute.NewVirtualMachineScaleSetsClient(arm.NewDefaultConnection(cred, nil), "<subscription ID>")
poller, err := client.BeginUpdate(
context.Background(),
"<resource group name>",
Expand Down Expand Up @@ -163,7 +164,7 @@ func ExampleVirtualMachineScaleSetsClient_BeginDeallocate() {
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
client := armcompute.NewVirtualMachineScaleSetsClient(armcore.NewDefaultConnection(cred, nil), "<subscription ID>")
client := armcompute.NewVirtualMachineScaleSetsClient(arm.NewDefaultConnection(cred, nil), "<subscription ID>")
poller, err := client.BeginDeallocate(context.Background(), "<resource group name>", "<VM scale set name>", nil)
if err != nil {
log.Fatalf("failed to obtain a response: %v", err)
Expand All @@ -179,7 +180,7 @@ func ExampleVirtualMachineScaleSetsClient_BeginStart() {
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
client := armcompute.NewVirtualMachineScaleSetsClient(armcore.NewDefaultConnection(cred, nil), "<subscription ID>")
client := armcompute.NewVirtualMachineScaleSetsClient(arm.NewDefaultConnection(cred, nil), "<subscription ID>")
poller, err := client.BeginStart(context.Background(), "<resource group name>", "<VM scale set name>", nil)
if err != nil {
log.Fatalf("failed to obtain a response: %v", err)
Expand All @@ -195,7 +196,7 @@ func ExampleVirtualMachineScaleSetsClient_BeginRestart() {
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
client := armcompute.NewVirtualMachineScaleSetsClient(armcore.NewDefaultConnection(cred, nil), "<subscription ID>")
client := armcompute.NewVirtualMachineScaleSetsClient(arm.NewDefaultConnection(cred, nil), "<subscription ID>")
poller, err := client.BeginRestart(context.Background(), "<resource group name>", "<VM scale set name>", nil)
if err != nil {
log.Fatalf("failed to obtain a response: %v", err)
Expand All @@ -211,7 +212,7 @@ func ExampleVirtualMachineScaleSetsClient_BeginPowerOff() {
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
client := armcompute.NewVirtualMachineScaleSetsClient(armcore.NewDefaultConnection(cred, nil), "<subscription ID>")
client := armcompute.NewVirtualMachineScaleSetsClient(arm.NewDefaultConnection(cred, nil), "<subscription ID>")
poller, err := client.BeginPowerOff(context.Background(), "<resource group name>", "<VM scale set name>", nil)
if err != nil {
log.Fatalf("failed to obtain a response: %v", err)
Expand Down
10 changes: 4 additions & 6 deletions sdk/compute/armcompute/go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
module github.com/Azure/azure-sdk-for-go/sdk/compute/armcompute

go 1.13
go 1.16

require (
github.com/Azure/azure-sdk-for-go v55.2.0+incompatible
github.com/Azure/azure-sdk-for-go/sdk/armcore v0.8.0
github.com/Azure/azure-sdk-for-go/sdk/azcore v0.16.2
github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.9.1
github.com/Azure/azure-sdk-for-go/sdk/to v0.1.4
github.com/Azure/azure-sdk-for-go v57.0.0+incompatible
github.com/Azure/azure-sdk-for-go/sdk/azcore v0.19.0
github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.10.0
)
Loading

0 comments on commit 56ac512

Please sign in to comment.