vendor: update all dependencies to latest versions
This commit is contained in:
+7
-10
@@ -1,11 +1,9 @@
|
||||
// Package features implements the Azure ARM Features service API version
|
||||
// 2015-12-01.
|
||||
// Package features implements the Azure ARM Features service API version 2015-12-01.
|
||||
//
|
||||
// Azure Feature Exposure Control (AFEC) provides a mechanism for the resource
|
||||
// providers to control feature exposure to users. Resource providers typically
|
||||
// use this mechanism to provide public/private preview for new features prior
|
||||
// to making them generally available. Users need to explicitly register for
|
||||
// AFEC features to get access to such functionality.
|
||||
// Azure Feature Exposure Control (AFEC) provides a mechanism for the resource providers to control feature exposure to
|
||||
// users. Resource providers typically use this mechanism to provide public/private preview for new features prior to
|
||||
// making them generally available. Users need to explicitly register for AFEC features to get access to such
|
||||
// functionality.
|
||||
package features
|
||||
|
||||
// Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
@@ -22,9 +20,8 @@ package features
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
|
||||
Generated
Vendored
Executable → Regular
+103
-19
@@ -14,9 +14,8 @@ package features
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
@@ -24,12 +23,10 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// GroupClient is the azure Feature Exposure Control (AFEC) provides a
|
||||
// mechanism for the resource providers to control feature exposure to users.
|
||||
// Resource providers typically use this mechanism to provide public/private
|
||||
// preview for new features prior to making them generally available. Users
|
||||
// need to explicitly register for AFEC features to get access to such
|
||||
// functionality.
|
||||
// GroupClient is the azure Feature Exposure Control (AFEC) provides a mechanism for the resource providers to control
|
||||
// feature exposure to users. Resource providers typically use this mechanism to provide public/private preview for new
|
||||
// features prior to making them generally available. Users need to explicitly register for AFEC features to get access
|
||||
// to such functionality.
|
||||
type GroupClient struct {
|
||||
ManagementClient
|
||||
}
|
||||
@@ -46,8 +43,8 @@ func NewGroupClientWithBaseURI(baseURI string, subscriptionID string) GroupClien
|
||||
|
||||
// Get gets the preview feature with the specified name.
|
||||
//
|
||||
// resourceProviderNamespace is the resource provider namespace for the
|
||||
// feature. featureName is the name of the feature to get.
|
||||
// resourceProviderNamespace is the resource provider namespace for the feature. featureName is the name of the feature
|
||||
// to get.
|
||||
func (client GroupClient) Get(resourceProviderNamespace string, featureName string) (result Result, err error) {
|
||||
req, err := client.GetPreparer(resourceProviderNamespace, featureName)
|
||||
if err != nil {
|
||||
@@ -110,11 +107,9 @@ func (client GroupClient) GetResponder(resp *http.Response) (result Result, err
|
||||
return
|
||||
}
|
||||
|
||||
// List gets all the preview features in a provider namespace that are
|
||||
// available through AFEC for the subscription.
|
||||
// List gets all the preview features in a provider namespace that are available through AFEC for the subscription.
|
||||
//
|
||||
// resourceProviderNamespace is the namespace of the resource provider for
|
||||
// getting features.
|
||||
// resourceProviderNamespace is the namespace of the resource provider for getting features.
|
||||
func (client GroupClient) List(resourceProviderNamespace string) (result OperationsListResult, err error) {
|
||||
req, err := client.ListPreparer(resourceProviderNamespace)
|
||||
if err != nil {
|
||||
@@ -200,8 +195,52 @@ func (client GroupClient) ListNextResults(lastResults OperationsListResult) (res
|
||||
return
|
||||
}
|
||||
|
||||
// ListAll gets all the preview features that are available through AFEC for
|
||||
// the subscription.
|
||||
// ListComplete gets all elements from the list without paging.
|
||||
func (client GroupClient) ListComplete(resourceProviderNamespace string, cancel <-chan struct{}) (<-chan Result, <-chan error) {
|
||||
resultChan := make(chan Result)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.List(resourceProviderNamespace)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
for list.NextLink != nil {
|
||||
list, err = client.ListNextResults(list)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
// ListAll gets all the preview features that are available through AFEC for the subscription.
|
||||
func (client GroupClient) ListAll() (result OperationsListResult, err error) {
|
||||
req, err := client.ListAllPreparer()
|
||||
if err != nil {
|
||||
@@ -286,10 +325,55 @@ func (client GroupClient) ListAllNextResults(lastResults OperationsListResult) (
|
||||
return
|
||||
}
|
||||
|
||||
// ListAllComplete gets all elements from the list without paging.
|
||||
func (client GroupClient) ListAllComplete(cancel <-chan struct{}) (<-chan Result, <-chan error) {
|
||||
resultChan := make(chan Result)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.ListAll()
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
for list.NextLink != nil {
|
||||
list, err = client.ListAllNextResults(list)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
// Register registers the preview feature for the subscription.
|
||||
//
|
||||
// resourceProviderNamespace is the namespace of the resource provider.
|
||||
// featureName is the name of the feature to register.
|
||||
// resourceProviderNamespace is the namespace of the resource provider. featureName is the name of the feature to
|
||||
// register.
|
||||
func (client GroupClient) Register(resourceProviderNamespace string, featureName string) (result Result, err error) {
|
||||
req, err := client.RegisterPreparer(resourceProviderNamespace, featureName)
|
||||
if err != nil {
|
||||
+2
-3
@@ -14,9 +14,8 @@ package features
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
|
||||
+4
-5
@@ -14,16 +14,15 @@ package features
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
// UserAgent returns the UserAgent string to use when sending http.Requests.
|
||||
func UserAgent() string {
|
||||
return "Azure-SDK-For-Go/v10.1.0-beta arm-features/2015-12-01"
|
||||
return "Azure-SDK-For-Go/v11.0.0-beta arm-features/2015-12-01"
|
||||
}
|
||||
|
||||
// Version returns the semantic version (see http://semver.org) of the client.
|
||||
func Version() string {
|
||||
return "v10.1.0-beta"
|
||||
return "v11.0.0-beta"
|
||||
}
|
||||
|
||||
+6
-9
@@ -1,11 +1,9 @@
|
||||
// Package links implements the Azure ARM Links service API version 2016-09-01.
|
||||
//
|
||||
// Azure resources can be linked together to form logical relationships. You
|
||||
// can establish links between resources belonging to different resource
|
||||
// groups. However, all the linked resources must belong to the same
|
||||
// subscription. Each resource can be linked to 50 other resources. If any of
|
||||
// the linked resources are deleted or moved, the link owner must clean up the
|
||||
// remaining link.
|
||||
// Azure resources can be linked together to form logical relationships. You can establish links between resources
|
||||
// belonging to different resource groups. However, all the linked resources must belong to the same subscription. Each
|
||||
// resource can be linked to 50 other resources. If any of the linked resources are deleted or moved, the link owner
|
||||
// must clean up the remaining link.
|
||||
package links
|
||||
|
||||
// Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
@@ -22,9 +20,8 @@ package links
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
|
||||
+2
-3
@@ -14,9 +14,8 @@ package links
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
|
||||
+106
-26
@@ -14,9 +14,8 @@ package links
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
@@ -25,30 +24,25 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// ResourceLinksClient is the azure resources can be linked together to form
|
||||
// logical relationships. You can establish links between resources belonging
|
||||
// to different resource groups. However, all the linked resources must belong
|
||||
// to the same subscription. Each resource can be linked to 50 other resources.
|
||||
// If any of the linked resources are deleted or moved, the link owner must
|
||||
// clean up the remaining link.
|
||||
// ResourceLinksClient is the azure resources can be linked together to form logical relationships. You can establish
|
||||
// links between resources belonging to different resource groups. However, all the linked resources must belong to the
|
||||
// same subscription. Each resource can be linked to 50 other resources. If any of the linked resources are deleted or
|
||||
// moved, the link owner must clean up the remaining link.
|
||||
type ResourceLinksClient struct {
|
||||
ManagementClient
|
||||
}
|
||||
|
||||
// NewResourceLinksClient creates an instance of the ResourceLinksClient
|
||||
// client.
|
||||
// NewResourceLinksClient creates an instance of the ResourceLinksClient client.
|
||||
func NewResourceLinksClient(subscriptionID string) ResourceLinksClient {
|
||||
return NewResourceLinksClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewResourceLinksClientWithBaseURI creates an instance of the
|
||||
// ResourceLinksClient client.
|
||||
// NewResourceLinksClientWithBaseURI creates an instance of the ResourceLinksClient client.
|
||||
func NewResourceLinksClientWithBaseURI(baseURI string, subscriptionID string) ResourceLinksClient {
|
||||
return ResourceLinksClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// CreateOrUpdate creates or updates a resource link between the specified
|
||||
// resources.
|
||||
// CreateOrUpdate creates or updates a resource link between the specified resources.
|
||||
//
|
||||
// linkID is the fully qualified ID of the resource link. Use the format,
|
||||
// /subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/{provider-namespace}/{resource-type}/{resource-name}/Microsoft.Resources/links/{link-name}.
|
||||
@@ -253,15 +247,12 @@ func (client ResourceLinksClient) GetResponder(resp *http.Response) (result Reso
|
||||
return
|
||||
}
|
||||
|
||||
// ListAtSourceScope gets a list of resource links at and below the specified
|
||||
// source scope.
|
||||
// ListAtSourceScope gets a list of resource links at and below the specified source scope.
|
||||
//
|
||||
// scope is the fully qualified ID of the scope for getting the resource links.
|
||||
// For example, to list resource links at and under a resource group, set the
|
||||
// scope to
|
||||
// /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup.
|
||||
// filter is the filter to apply when getting resource links. To get links only
|
||||
// at the specified scope (not below the scope), use Filter.atScope().
|
||||
// scope is the fully qualified ID of the scope for getting the resource links. For example, to list resource links at
|
||||
// and under a resource group, set the scope to
|
||||
// /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup. filter is the filter to apply when
|
||||
// getting resource links. To get links only at the specified scope (not below the scope), use Filter.atScope().
|
||||
func (client ResourceLinksClient) ListAtSourceScope(scope string, filter Filter) (result ResourceLinkResult, err error) {
|
||||
req, err := client.ListAtSourceScopePreparer(scope, filter)
|
||||
if err != nil {
|
||||
@@ -349,11 +340,55 @@ func (client ResourceLinksClient) ListAtSourceScopeNextResults(lastResults Resou
|
||||
return
|
||||
}
|
||||
|
||||
// ListAtSourceScopeComplete gets all elements from the list without paging.
|
||||
func (client ResourceLinksClient) ListAtSourceScopeComplete(scope string, filter Filter, cancel <-chan struct{}) (<-chan ResourceLink, <-chan error) {
|
||||
resultChan := make(chan ResourceLink)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.ListAtSourceScope(scope, filter)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
for list.NextLink != nil {
|
||||
list, err = client.ListAtSourceScopeNextResults(list)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
// ListAtSubscription gets all the linked resources for the subscription.
|
||||
//
|
||||
// filter is the filter to apply on the list resource links operation. The
|
||||
// supported filter for list resource links is targetid. For example,
|
||||
// $filter=targetid eq {value}
|
||||
// filter is the filter to apply on the list resource links operation. The supported filter for list resource links is
|
||||
// targetid. For example, $filter=targetid eq {value}
|
||||
func (client ResourceLinksClient) ListAtSubscription(filter string) (result ResourceLinkResult, err error) {
|
||||
req, err := client.ListAtSubscriptionPreparer(filter)
|
||||
if err != nil {
|
||||
@@ -440,3 +475,48 @@ func (client ResourceLinksClient) ListAtSubscriptionNextResults(lastResults Reso
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListAtSubscriptionComplete gets all elements from the list without paging.
|
||||
func (client ResourceLinksClient) ListAtSubscriptionComplete(filter string, cancel <-chan struct{}) (<-chan ResourceLink, <-chan error) {
|
||||
resultChan := make(chan ResourceLink)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.ListAtSubscription(filter)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
for list.NextLink != nil {
|
||||
list, err = client.ListAtSubscriptionNextResults(list)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
+4
-5
@@ -14,16 +14,15 @@ package links
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
// UserAgent returns the UserAgent string to use when sending http.Requests.
|
||||
func UserAgent() string {
|
||||
return "Azure-SDK-For-Go/v10.1.0-beta arm-links/2016-09-01"
|
||||
return "Azure-SDK-For-Go/v11.0.0-beta arm-links/2016-09-01"
|
||||
}
|
||||
|
||||
// Version returns the semantic version (see http://semver.org) of the client.
|
||||
func Version() string {
|
||||
return "v10.1.0-beta"
|
||||
return "v11.0.0-beta"
|
||||
}
|
||||
|
||||
+3
-5
@@ -1,7 +1,6 @@
|
||||
// Package locks implements the Azure ARM Locks service API version 2016-09-01.
|
||||
//
|
||||
// Azure resources can be locked to prevent other users in your organization
|
||||
// from deleting or modifying resources.
|
||||
// Azure resources can be locked to prevent other users in your organization from deleting or modifying resources.
|
||||
package locks
|
||||
|
||||
// Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
@@ -18,9 +17,8 @@ package locks
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
|
||||
+189
-81
@@ -14,9 +14,8 @@ package locks
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
@@ -25,33 +24,29 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// ManagementLocksClient is the azure resources can be locked to prevent other
|
||||
// users in your organization from deleting or modifying resources.
|
||||
// ManagementLocksClient is the azure resources can be locked to prevent other users in your organization from deleting
|
||||
// or modifying resources.
|
||||
type ManagementLocksClient struct {
|
||||
ManagementClient
|
||||
}
|
||||
|
||||
// NewManagementLocksClient creates an instance of the ManagementLocksClient
|
||||
// client.
|
||||
// NewManagementLocksClient creates an instance of the ManagementLocksClient client.
|
||||
func NewManagementLocksClient(subscriptionID string) ManagementLocksClient {
|
||||
return NewManagementLocksClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewManagementLocksClientWithBaseURI creates an instance of the
|
||||
// ManagementLocksClient client.
|
||||
// NewManagementLocksClientWithBaseURI creates an instance of the ManagementLocksClient client.
|
||||
func NewManagementLocksClientWithBaseURI(baseURI string, subscriptionID string) ManagementLocksClient {
|
||||
return ManagementLocksClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// CreateOrUpdateAtResourceGroupLevel when you apply a lock at a parent scope,
|
||||
// all child resources inherit the same lock. To create management locks, you
|
||||
// must have access to Microsoft.Authorization/* or
|
||||
// Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner
|
||||
// and User Access Administrator are granted those actions.
|
||||
// CreateOrUpdateAtResourceGroupLevel when you apply a lock at a parent scope, all child resources inherit the same
|
||||
// lock. To create management locks, you must have access to Microsoft.Authorization/* or
|
||||
// Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted
|
||||
// those actions.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to lock. lockName is the
|
||||
// lock name. The lock name can be a maximum of 260 characters. It cannot
|
||||
// contain <, > %, &, :, \, ?, /, or any control characters. parameters is the
|
||||
// resourceGroupName is the name of the resource group to lock. lockName is the lock name. The lock name can be a
|
||||
// maximum of 260 characters. It cannot contain <, > %, &, :, \, ?, /, or any control characters. parameters is the
|
||||
// management lock parameters.
|
||||
func (client ManagementLocksClient) CreateOrUpdateAtResourceGroupLevel(resourceGroupName string, lockName string, parameters ManagementLockObject) (result ManagementLockObject, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
@@ -127,20 +122,15 @@ func (client ManagementLocksClient) CreateOrUpdateAtResourceGroupLevelResponder(
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdateAtResourceLevel when you apply a lock at a parent scope, all
|
||||
// child resources inherit the same lock. To create management locks, you must
|
||||
// have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/*
|
||||
// actions. Of the built-in roles, only Owner and User Access Administrator are
|
||||
// granted those actions.
|
||||
// CreateOrUpdateAtResourceLevel when you apply a lock at a parent scope, all child resources inherit the same lock. To
|
||||
// create management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/*
|
||||
// actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group containing the resource
|
||||
// to lock. resourceProviderNamespace is the resource provider namespace of the
|
||||
// resource to lock. parentResourcePath is the parent resource identity.
|
||||
// resourceType is the resource type of the resource to lock. resourceName is
|
||||
// the name of the resource to lock. lockName is the name of lock. The lock
|
||||
// name can be a maximum of 260 characters. It cannot contain <, > %, &, :, \,
|
||||
// ?, /, or any control characters. parameters is parameters for creating or
|
||||
// updating a management lock.
|
||||
// resourceGroupName is the name of the resource group containing the resource to lock. resourceProviderNamespace is
|
||||
// the resource provider namespace of the resource to lock. parentResourcePath is the parent resource identity.
|
||||
// resourceType is the resource type of the resource to lock. resourceName is the name of the resource to lock.
|
||||
// lockName is the name of lock. The lock name can be a maximum of 260 characters. It cannot contain <, > %, &, :, \,
|
||||
// ?, /, or any control characters. parameters is parameters for creating or updating a management lock.
|
||||
func (client ManagementLocksClient) CreateOrUpdateAtResourceLevel(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, lockName string, parameters ManagementLockObject) (result ManagementLockObject, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -219,15 +209,13 @@ func (client ManagementLocksClient) CreateOrUpdateAtResourceLevelResponder(resp
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdateAtSubscriptionLevel when you apply a lock at a parent scope,
|
||||
// all child resources inherit the same lock. To create management locks, you
|
||||
// must have access to Microsoft.Authorization/* or
|
||||
// Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner
|
||||
// and User Access Administrator are granted those actions.
|
||||
// CreateOrUpdateAtSubscriptionLevel when you apply a lock at a parent scope, all child resources inherit the same
|
||||
// lock. To create management locks, you must have access to Microsoft.Authorization/* or
|
||||
// Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted
|
||||
// those actions.
|
||||
//
|
||||
// lockName is the name of lock. The lock name can be a maximum of 260
|
||||
// characters. It cannot contain <, > %, &, :, \, ?, /, or any control
|
||||
// characters. parameters is the management lock parameters.
|
||||
// lockName is the name of lock. The lock name can be a maximum of 260 characters. It cannot contain <, > %, &, :, \,
|
||||
// ?, /, or any control characters. parameters is the management lock parameters.
|
||||
func (client ManagementLocksClient) CreateOrUpdateAtSubscriptionLevel(lockName string, parameters ManagementLockObject) (result ManagementLockObject, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
@@ -299,13 +287,10 @@ func (client ManagementLocksClient) CreateOrUpdateAtSubscriptionLevelResponder(r
|
||||
|
||||
// CreateOrUpdateByScope create or update a management lock by scope.
|
||||
//
|
||||
// scope is the scope for the lock. When providing a scope for the assignment,
|
||||
// use '/subscriptions/{subscriptionId}' for subscriptions,
|
||||
// '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for
|
||||
// resource groups, and
|
||||
// scope is the scope for the lock. When providing a scope for the assignment, use '/subscriptions/{subscriptionId}'
|
||||
// for subscriptions, '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and
|
||||
// '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}'
|
||||
// for resources. lockName is the name of lock. parameters is create or update
|
||||
// management lock parameters.
|
||||
// for resources. lockName is the name of lock. parameters is create or update management lock parameters.
|
||||
func (client ManagementLocksClient) CreateOrUpdateByScope(scope string, lockName string, parameters ManagementLockObject) (result ManagementLockObject, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
@@ -375,13 +360,11 @@ func (client ManagementLocksClient) CreateOrUpdateByScopeResponder(resp *http.Re
|
||||
return
|
||||
}
|
||||
|
||||
// DeleteAtResourceGroupLevel to delete management locks, you must have access
|
||||
// to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of
|
||||
// the built-in roles, only Owner and User Access Administrator are granted
|
||||
// DeleteAtResourceGroupLevel to delete management locks, you must have access to Microsoft.Authorization/* or
|
||||
// Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted
|
||||
// those actions.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group containing the lock.
|
||||
// lockName is the name of lock to delete.
|
||||
// resourceGroupName is the name of the resource group containing the lock. lockName is the name of lock to delete.
|
||||
func (client ManagementLocksClient) DeleteAtResourceGroupLevel(resourceGroupName string, lockName string) (result autorest.Response, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -451,17 +434,15 @@ func (client ManagementLocksClient) DeleteAtResourceGroupLevelResponder(resp *ht
|
||||
return
|
||||
}
|
||||
|
||||
// DeleteAtResourceLevel to delete management locks, you must have access to
|
||||
// Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the
|
||||
// built-in roles, only Owner and User Access Administrator are granted those
|
||||
// actions.
|
||||
// DeleteAtResourceLevel to delete management locks, you must have access to Microsoft.Authorization/* or
|
||||
// Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted
|
||||
// those actions.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group containing the resource
|
||||
// with the lock to delete. resourceProviderNamespace is the resource provider
|
||||
// namespace of the resource with the lock to delete. parentResourcePath is the
|
||||
// parent resource identity. resourceType is the resource type of the resource
|
||||
// with the lock to delete. resourceName is the name of the resource with the
|
||||
// lock to delete. lockName is the name of the lock to delete.
|
||||
// resourceGroupName is the name of the resource group containing the resource with the lock to delete.
|
||||
// resourceProviderNamespace is the resource provider namespace of the resource with the lock to delete.
|
||||
// parentResourcePath is the parent resource identity. resourceType is the resource type of the resource with the lock
|
||||
// to delete. resourceName is the name of the resource with the lock to delete. lockName is the name of the lock to
|
||||
// delete.
|
||||
func (client ManagementLocksClient) DeleteAtResourceLevel(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, lockName string) (result autorest.Response, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -535,9 +516,8 @@ func (client ManagementLocksClient) DeleteAtResourceLevelResponder(resp *http.Re
|
||||
return
|
||||
}
|
||||
|
||||
// DeleteAtSubscriptionLevel to delete management locks, you must have access
|
||||
// to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of
|
||||
// the built-in roles, only Owner and User Access Administrator are granted
|
||||
// DeleteAtSubscriptionLevel to delete management locks, you must have access to Microsoft.Authorization/* or
|
||||
// Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted
|
||||
// those actions.
|
||||
//
|
||||
// lockName is the name of lock to delete.
|
||||
@@ -666,8 +646,7 @@ func (client ManagementLocksClient) DeleteByScopeResponder(resp *http.Response)
|
||||
|
||||
// GetAtResourceGroupLevel gets a management lock at the resource group level.
|
||||
//
|
||||
// resourceGroupName is the name of the locked resource group. lockName is the
|
||||
// name of the lock to get.
|
||||
// resourceGroupName is the name of the locked resource group. lockName is the name of the lock to get.
|
||||
func (client ManagementLocksClient) GetAtResourceGroupLevel(resourceGroupName string, lockName string) (result ManagementLockObject, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -738,14 +717,11 @@ func (client ManagementLocksClient) GetAtResourceGroupLevelResponder(resp *http.
|
||||
return
|
||||
}
|
||||
|
||||
// GetAtResourceLevel get the management lock of a resource or any level below
|
||||
// resource.
|
||||
// GetAtResourceLevel get the management lock of a resource or any level below resource.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group.
|
||||
// resourceProviderNamespace is the namespace of the resource provider.
|
||||
// parentResourcePath is an extra path parameter needed in some services, like
|
||||
// SQL Databases. resourceType is the type of the resource. resourceName is the
|
||||
// name of the resource. lockName is the name of lock.
|
||||
// resourceGroupName is the name of the resource group. resourceProviderNamespace is the namespace of the resource
|
||||
// provider. parentResourcePath is an extra path parameter needed in some services, like SQL Databases. resourceType is
|
||||
// the type of the resource. resourceName is the name of the resource. lockName is the name of lock.
|
||||
func (client ManagementLocksClient) GetAtResourceLevel(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, lockName string) (result ManagementLockObject, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -950,8 +926,8 @@ func (client ManagementLocksClient) GetByScopeResponder(resp *http.Response) (re
|
||||
|
||||
// ListAtResourceGroupLevel gets all the management locks for a resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group containing the locks to
|
||||
// get. filter is the filter to apply on the operation.
|
||||
// resourceGroupName is the name of the resource group containing the locks to get. filter is the filter to apply on
|
||||
// the operation.
|
||||
func (client ManagementLocksClient) ListAtResourceGroupLevel(resourceGroupName string, filter string) (result ManagementLockListResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -1048,15 +1024,57 @@ func (client ManagementLocksClient) ListAtResourceGroupLevelNextResults(lastResu
|
||||
return
|
||||
}
|
||||
|
||||
// ListAtResourceLevel gets all the management locks for a resource or any
|
||||
// level below resource.
|
||||
// ListAtResourceGroupLevelComplete gets all elements from the list without paging.
|
||||
func (client ManagementLocksClient) ListAtResourceGroupLevelComplete(resourceGroupName string, filter string, cancel <-chan struct{}) (<-chan ManagementLockObject, <-chan error) {
|
||||
resultChan := make(chan ManagementLockObject)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.ListAtResourceGroupLevel(resourceGroupName, filter)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
for list.NextLink != nil {
|
||||
list, err = client.ListAtResourceGroupLevelNextResults(list)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
// ListAtResourceLevel gets all the management locks for a resource or any level below resource.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group containing the locked
|
||||
// resource. The name is case insensitive. resourceProviderNamespace is the
|
||||
// namespace of the resource provider. parentResourcePath is the parent
|
||||
// resource identity. resourceType is the resource type of the locked resource.
|
||||
// resourceName is the name of the locked resource. filter is the filter to
|
||||
// apply on the operation.
|
||||
// resourceGroupName is the name of the resource group containing the locked resource. The name is case insensitive.
|
||||
// resourceProviderNamespace is the namespace of the resource provider. parentResourcePath is the parent resource
|
||||
// identity. resourceType is the resource type of the locked resource. resourceName is the name of the locked resource.
|
||||
// filter is the filter to apply on the operation.
|
||||
func (client ManagementLocksClient) ListAtResourceLevel(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, filter string) (result ManagementLockListResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -1157,6 +1175,51 @@ func (client ManagementLocksClient) ListAtResourceLevelNextResults(lastResults M
|
||||
return
|
||||
}
|
||||
|
||||
// ListAtResourceLevelComplete gets all elements from the list without paging.
|
||||
func (client ManagementLocksClient) ListAtResourceLevelComplete(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, filter string, cancel <-chan struct{}) (<-chan ManagementLockObject, <-chan error) {
|
||||
resultChan := make(chan ManagementLockObject)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.ListAtResourceLevel(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
for list.NextLink != nil {
|
||||
list, err = client.ListAtResourceLevelNextResults(list)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
// ListAtSubscriptionLevel gets all the management locks for a subscription.
|
||||
//
|
||||
// filter is the filter to apply on the operation.
|
||||
@@ -1246,3 +1309,48 @@ func (client ManagementLocksClient) ListAtSubscriptionLevelNextResults(lastResul
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListAtSubscriptionLevelComplete gets all elements from the list without paging.
|
||||
func (client ManagementLocksClient) ListAtSubscriptionLevelComplete(filter string, cancel <-chan struct{}) (<-chan ManagementLockObject, <-chan error) {
|
||||
resultChan := make(chan ManagementLockObject)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.ListAtSubscriptionLevel(filter)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
for list.NextLink != nil {
|
||||
list, err = client.ListAtSubscriptionLevelNextResults(list)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
+2
-3
@@ -14,9 +14,8 @@ package locks
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
|
||||
+4
-5
@@ -14,16 +14,15 @@ package locks
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
// UserAgent returns the UserAgent string to use when sending http.Requests.
|
||||
func UserAgent() string {
|
||||
return "Azure-SDK-For-Go/v10.1.0-beta arm-locks/2016-09-01"
|
||||
return "Azure-SDK-For-Go/v11.0.0-beta arm-locks/2016-09-01"
|
||||
}
|
||||
|
||||
// Version returns the semantic version (see http://semver.org) of the client.
|
||||
func Version() string {
|
||||
return "v10.1.0-beta"
|
||||
return "v11.0.0-beta"
|
||||
}
|
||||
|
||||
Generated
Vendored
+27
-49
@@ -14,9 +14,8 @@ package managedapplications
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.1.0.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
@@ -30,27 +29,21 @@ type ApplianceDefinitionsClient struct {
|
||||
ManagementClient
|
||||
}
|
||||
|
||||
// NewApplianceDefinitionsClient creates an instance of the
|
||||
// ApplianceDefinitionsClient client.
|
||||
// NewApplianceDefinitionsClient creates an instance of the ApplianceDefinitionsClient client.
|
||||
func NewApplianceDefinitionsClient(subscriptionID string) ApplianceDefinitionsClient {
|
||||
return NewApplianceDefinitionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewApplianceDefinitionsClientWithBaseURI creates an instance of the
|
||||
// ApplianceDefinitionsClient client.
|
||||
// NewApplianceDefinitionsClientWithBaseURI creates an instance of the ApplianceDefinitionsClient client.
|
||||
func NewApplianceDefinitionsClientWithBaseURI(baseURI string, subscriptionID string) ApplianceDefinitionsClient {
|
||||
return ApplianceDefinitionsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// CreateOrUpdate creates a new appliance definition. This method may poll for
|
||||
// completion. Polling can be canceled by passing the cancel channel argument.
|
||||
// The channel will be used to cancel polling and any outstanding HTTP
|
||||
// requests.
|
||||
// CreateOrUpdate creates a new appliance definition. This method may poll for completion. Polling can be canceled by
|
||||
// passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. The name is case
|
||||
// insensitive. applianceDefinitionName is the name of the appliance
|
||||
// definition. parameters is parameters supplied to the create or update an
|
||||
// appliance definition.
|
||||
// resourceGroupName is the name of the resource group. The name is case insensitive. applianceDefinitionName is the
|
||||
// name of the appliance definition. parameters is parameters supplied to the create or update an appliance definition.
|
||||
func (client ApplianceDefinitionsClient) CreateOrUpdate(resourceGroupName string, applianceDefinitionName string, parameters ApplianceDefinition, cancel <-chan struct{}) (<-chan ApplianceDefinition, <-chan error) {
|
||||
resultChan := make(chan ApplianceDefinition, 1)
|
||||
errChan := make(chan error, 1)
|
||||
@@ -149,17 +142,14 @@ func (client ApplianceDefinitionsClient) CreateOrUpdateResponder(resp *http.Resp
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdateByID creates a new appliance definition. This method may poll
|
||||
// for completion. Polling can be canceled by passing the cancel channel
|
||||
// argument. The channel will be used to cancel polling and any outstanding
|
||||
// HTTP requests.
|
||||
// CreateOrUpdateByID creates a new appliance definition. This method may poll for completion. Polling can be canceled
|
||||
// by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP
|
||||
// requests.
|
||||
//
|
||||
// applianceDefinitionID is the fully qualified ID of the appliance definition,
|
||||
// including the appliance name and the appliance definition resource type. Use
|
||||
// the format,
|
||||
// applianceDefinitionID is the fully qualified ID of the appliance definition, including the appliance name and the
|
||||
// appliance definition resource type. Use the format,
|
||||
// /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-name}
|
||||
// parameters is parameters supplied to the create or update an appliance
|
||||
// definition.
|
||||
// parameters is parameters supplied to the create or update an appliance definition.
|
||||
func (client ApplianceDefinitionsClient) CreateOrUpdateByID(applianceDefinitionID string, parameters ApplianceDefinition, cancel <-chan struct{}) (<-chan ApplianceDefinition, <-chan error) {
|
||||
resultChan := make(chan ApplianceDefinition, 1)
|
||||
errChan := make(chan error, 1)
|
||||
@@ -211,7 +201,6 @@ func (client ApplianceDefinitionsClient) CreateOrUpdateByID(applianceDefinitionI
|
||||
func (client ApplianceDefinitionsClient) CreateOrUpdateByIDPreparer(applianceDefinitionID string, parameters ApplianceDefinition, cancel <-chan struct{}) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"applianceDefinitionId": applianceDefinitionID,
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01-preview"
|
||||
@@ -250,14 +239,11 @@ func (client ApplianceDefinitionsClient) CreateOrUpdateByIDResponder(resp *http.
|
||||
return
|
||||
}
|
||||
|
||||
// Delete deletes the appliance definition. This method may poll for
|
||||
// completion. Polling can be canceled by passing the cancel channel argument.
|
||||
// The channel will be used to cancel polling and any outstanding HTTP
|
||||
// requests.
|
||||
// Delete deletes the appliance definition. This method may poll for completion. Polling can be canceled by passing the
|
||||
// cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. The name is case
|
||||
// insensitive. applianceDefinitionName is the name of the appliance definition
|
||||
// to delete.
|
||||
// resourceGroupName is the name of the resource group. The name is case insensitive. applianceDefinitionName is the
|
||||
// name of the appliance definition to delete.
|
||||
func (client ApplianceDefinitionsClient) Delete(resourceGroupName string, applianceDefinitionName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) {
|
||||
resultChan := make(chan autorest.Response, 1)
|
||||
errChan := make(chan error, 1)
|
||||
@@ -348,14 +334,11 @@ func (client ApplianceDefinitionsClient) DeleteResponder(resp *http.Response) (r
|
||||
return
|
||||
}
|
||||
|
||||
// DeleteByID deletes the appliance definition. This method may poll for
|
||||
// completion. Polling can be canceled by passing the cancel channel argument.
|
||||
// The channel will be used to cancel polling and any outstanding HTTP
|
||||
// requests.
|
||||
// DeleteByID deletes the appliance definition. This method may poll for completion. Polling can be canceled by passing
|
||||
// the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests.
|
||||
//
|
||||
// applianceDefinitionID is the fully qualified ID of the appliance definition,
|
||||
// including the appliance name and the appliance definition resource type. Use
|
||||
// the format,
|
||||
// applianceDefinitionID is the fully qualified ID of the appliance definition, including the appliance name and the
|
||||
// appliance definition resource type. Use the format,
|
||||
// /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-name}
|
||||
func (client ApplianceDefinitionsClient) DeleteByID(applianceDefinitionID string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) {
|
||||
resultChan := make(chan autorest.Response, 1)
|
||||
@@ -396,7 +379,6 @@ func (client ApplianceDefinitionsClient) DeleteByID(applianceDefinitionID string
|
||||
func (client ApplianceDefinitionsClient) DeleteByIDPreparer(applianceDefinitionID string, cancel <-chan struct{}) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"applianceDefinitionId": applianceDefinitionID,
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01-preview"
|
||||
@@ -434,9 +416,8 @@ func (client ApplianceDefinitionsClient) DeleteByIDResponder(resp *http.Response
|
||||
|
||||
// Get gets the appliance definition.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. The name is case
|
||||
// insensitive. applianceDefinitionName is the name of the appliance
|
||||
// definition.
|
||||
// resourceGroupName is the name of the resource group. The name is case insensitive. applianceDefinitionName is the
|
||||
// name of the appliance definition.
|
||||
func (client ApplianceDefinitionsClient) Get(resourceGroupName string, applianceDefinitionName string) (result ApplianceDefinition, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -512,9 +493,8 @@ func (client ApplianceDefinitionsClient) GetResponder(resp *http.Response) (resu
|
||||
|
||||
// GetByID gets the appliance definition.
|
||||
//
|
||||
// applianceDefinitionID is the fully qualified ID of the appliance definition,
|
||||
// including the appliance name and the appliance definition resource type. Use
|
||||
// the format,
|
||||
// applianceDefinitionID is the fully qualified ID of the appliance definition, including the appliance name and the
|
||||
// appliance definition resource type. Use the format,
|
||||
// /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-name}
|
||||
func (client ApplianceDefinitionsClient) GetByID(applianceDefinitionID string) (result ApplianceDefinition, err error) {
|
||||
req, err := client.GetByIDPreparer(applianceDefinitionID)
|
||||
@@ -542,7 +522,6 @@ func (client ApplianceDefinitionsClient) GetByID(applianceDefinitionID string) (
|
||||
func (client ApplianceDefinitionsClient) GetByIDPreparer(applianceDefinitionID string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"applianceDefinitionId": applianceDefinitionID,
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01-preview"
|
||||
@@ -579,8 +558,7 @@ func (client ApplianceDefinitionsClient) GetByIDResponder(resp *http.Response) (
|
||||
|
||||
// ListByResourceGroup lists the appliance definitions in a resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. The name is case
|
||||
// insensitive.
|
||||
// resourceGroupName is the name of the resource group. The name is case insensitive.
|
||||
func (client ApplianceDefinitionsClient) ListByResourceGroup(resourceGroupName string) (result ApplianceDefinitionListResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
|
||||
Generated
Vendored
+34
-50
@@ -14,9 +14,8 @@ package managedapplications
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.1.0.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
@@ -35,19 +34,16 @@ func NewAppliancesClient(subscriptionID string) AppliancesClient {
|
||||
return NewAppliancesClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewAppliancesClientWithBaseURI creates an instance of the AppliancesClient
|
||||
// client.
|
||||
// NewAppliancesClientWithBaseURI creates an instance of the AppliancesClient client.
|
||||
func NewAppliancesClientWithBaseURI(baseURI string, subscriptionID string) AppliancesClient {
|
||||
return AppliancesClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// CreateOrUpdate creates a new appliance. This method may poll for completion.
|
||||
// Polling can be canceled by passing the cancel channel argument. The channel
|
||||
// will be used to cancel polling and any outstanding HTTP requests.
|
||||
// CreateOrUpdate creates a new appliance. This method may poll for completion. Polling can be canceled by passing the
|
||||
// cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. The name is case
|
||||
// insensitive. applianceName is the name of the appliance. parameters is
|
||||
// parameters supplied to the create or update an appliance.
|
||||
// resourceGroupName is the name of the resource group. The name is case insensitive. applianceName is the name of the
|
||||
// appliance. parameters is parameters supplied to the create or update an appliance.
|
||||
func (client AppliancesClient) CreateOrUpdate(resourceGroupName string, applianceName string, parameters Appliance, cancel <-chan struct{}) (<-chan Appliance, <-chan error) {
|
||||
resultChan := make(chan Appliance, 1)
|
||||
errChan := make(chan error, 1)
|
||||
@@ -152,13 +148,11 @@ func (client AppliancesClient) CreateOrUpdateResponder(resp *http.Response) (res
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdateByID creates a new appliance. This method may poll for
|
||||
// completion. Polling can be canceled by passing the cancel channel argument.
|
||||
// The channel will be used to cancel polling and any outstanding HTTP
|
||||
// requests.
|
||||
// CreateOrUpdateByID creates a new appliance. This method may poll for completion. Polling can be canceled by passing
|
||||
// the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests.
|
||||
//
|
||||
// applianceID is the fully qualified ID of the appliance, including the
|
||||
// appliance name and the appliance resource type. Use the format,
|
||||
// applianceID is the fully qualified ID of the appliance, including the appliance name and the appliance resource
|
||||
// type. Use the format,
|
||||
// /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-name}
|
||||
// parameters is parameters supplied to the create or update an appliance.
|
||||
func (client AppliancesClient) CreateOrUpdateByID(applianceID string, parameters Appliance, cancel <-chan struct{}) (<-chan Appliance, <-chan error) {
|
||||
@@ -217,8 +211,7 @@ func (client AppliancesClient) CreateOrUpdateByID(applianceID string, parameters
|
||||
// CreateOrUpdateByIDPreparer prepares the CreateOrUpdateByID request.
|
||||
func (client AppliancesClient) CreateOrUpdateByIDPreparer(applianceID string, parameters Appliance, cancel <-chan struct{}) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"applianceId": applianceID,
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"applianceId": applianceID,
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01-preview"
|
||||
@@ -257,12 +250,11 @@ func (client AppliancesClient) CreateOrUpdateByIDResponder(resp *http.Response)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete deletes the appliance. This method may poll for completion. Polling
|
||||
// can be canceled by passing the cancel channel argument. The channel will be
|
||||
// used to cancel polling and any outstanding HTTP requests.
|
||||
// Delete deletes the appliance. This method may poll for completion. Polling can be canceled by passing the cancel
|
||||
// channel argument. The channel will be used to cancel polling and any outstanding HTTP requests.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. The name is case
|
||||
// insensitive. applianceName is the name of the appliance.
|
||||
// resourceGroupName is the name of the resource group. The name is case insensitive. applianceName is the name of the
|
||||
// appliance.
|
||||
func (client AppliancesClient) Delete(resourceGroupName string, applianceName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) {
|
||||
resultChan := make(chan autorest.Response, 1)
|
||||
errChan := make(chan error, 1)
|
||||
@@ -353,12 +345,11 @@ func (client AppliancesClient) DeleteResponder(resp *http.Response) (result auto
|
||||
return
|
||||
}
|
||||
|
||||
// DeleteByID deletes the appliance. This method may poll for completion.
|
||||
// Polling can be canceled by passing the cancel channel argument. The channel
|
||||
// will be used to cancel polling and any outstanding HTTP requests.
|
||||
// DeleteByID deletes the appliance. This method may poll for completion. Polling can be canceled by passing the cancel
|
||||
// channel argument. The channel will be used to cancel polling and any outstanding HTTP requests.
|
||||
//
|
||||
// applianceID is the fully qualified ID of the appliance, including the
|
||||
// appliance name and the appliance resource type. Use the format,
|
||||
// applianceID is the fully qualified ID of the appliance, including the appliance name and the appliance resource
|
||||
// type. Use the format,
|
||||
// /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-name}
|
||||
func (client AppliancesClient) DeleteByID(applianceID string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) {
|
||||
resultChan := make(chan autorest.Response, 1)
|
||||
@@ -398,8 +389,7 @@ func (client AppliancesClient) DeleteByID(applianceID string, cancel <-chan stru
|
||||
// DeleteByIDPreparer prepares the DeleteByID request.
|
||||
func (client AppliancesClient) DeleteByIDPreparer(applianceID string, cancel <-chan struct{}) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"applianceId": applianceID,
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"applianceId": applianceID,
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01-preview"
|
||||
@@ -437,8 +427,8 @@ func (client AppliancesClient) DeleteByIDResponder(resp *http.Response) (result
|
||||
|
||||
// Get gets the appliance.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. The name is case
|
||||
// insensitive. applianceName is the name of the appliance.
|
||||
// resourceGroupName is the name of the resource group. The name is case insensitive. applianceName is the name of the
|
||||
// appliance.
|
||||
func (client AppliancesClient) Get(resourceGroupName string, applianceName string) (result Appliance, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -514,8 +504,8 @@ func (client AppliancesClient) GetResponder(resp *http.Response) (result Applian
|
||||
|
||||
// GetByID gets the appliance.
|
||||
//
|
||||
// applianceID is the fully qualified ID of the appliance, including the
|
||||
// appliance name and the appliance resource type. Use the format,
|
||||
// applianceID is the fully qualified ID of the appliance, including the appliance name and the appliance resource
|
||||
// type. Use the format,
|
||||
// /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-name}
|
||||
func (client AppliancesClient) GetByID(applianceID string) (result Appliance, err error) {
|
||||
req, err := client.GetByIDPreparer(applianceID)
|
||||
@@ -542,8 +532,7 @@ func (client AppliancesClient) GetByID(applianceID string) (result Appliance, er
|
||||
// GetByIDPreparer prepares the GetByID request.
|
||||
func (client AppliancesClient) GetByIDPreparer(applianceID string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"applianceId": applianceID,
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"applianceId": applianceID,
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01-preview"
|
||||
@@ -580,8 +569,7 @@ func (client AppliancesClient) GetByIDResponder(resp *http.Response) (result App
|
||||
|
||||
// ListByResourceGroup gets all the appliances within a resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. The name is case
|
||||
// insensitive.
|
||||
// resourceGroupName is the name of the resource group. The name is case insensitive.
|
||||
func (client AppliancesClient) ListByResourceGroup(resourceGroupName string) (result ApplianceListResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -850,12 +838,10 @@ func (client AppliancesClient) ListBySubscriptionComplete(cancel <-chan struct{}
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
// Update updates an existing appliance. The only value that can be updated via
|
||||
// PATCH currently is the tags.
|
||||
// Update updates an existing appliance. The only value that can be updated via PATCH currently is the tags.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. The name is case
|
||||
// insensitive. applianceName is the name of the appliance. parameters is
|
||||
// parameters supplied to update an existing appliance.
|
||||
// resourceGroupName is the name of the resource group. The name is case insensitive. applianceName is the name of the
|
||||
// appliance. parameters is parameters supplied to update an existing appliance.
|
||||
func (client AppliancesClient) Update(resourceGroupName string, applianceName string, parameters *Appliance) (result Appliance, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -934,11 +920,10 @@ func (client AppliancesClient) UpdateResponder(resp *http.Response) (result Appl
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateByID updates an existing appliance. The only value that can be updated
|
||||
// via PATCH currently is the tags.
|
||||
// UpdateByID updates an existing appliance. The only value that can be updated via PATCH currently is the tags.
|
||||
//
|
||||
// applianceID is the fully qualified ID of the appliance, including the
|
||||
// appliance name and the appliance resource type. Use the format,
|
||||
// applianceID is the fully qualified ID of the appliance, including the appliance name and the appliance resource
|
||||
// type. Use the format,
|
||||
// /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-name}
|
||||
// parameters is parameters supplied to update an existing appliance.
|
||||
func (client AppliancesClient) UpdateByID(applianceID string, parameters *Appliance) (result Appliance, err error) {
|
||||
@@ -966,8 +951,7 @@ func (client AppliancesClient) UpdateByID(applianceID string, parameters *Applia
|
||||
// UpdateByIDPreparer prepares the UpdateByID request.
|
||||
func (client AppliancesClient) UpdateByIDPreparer(applianceID string, parameters *Appliance) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"applianceId": applianceID,
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"applianceId": applianceID,
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01-preview"
|
||||
|
||||
Generated
Vendored
+3
-5
@@ -1,5 +1,4 @@
|
||||
// Package managedapplications implements the Azure ARM Managedapplications
|
||||
// service API version 2016-09-01-preview.
|
||||
// Package managedapplications implements the Azure ARM Managedapplications service API version 2016-09-01-preview.
|
||||
//
|
||||
// ARM managed applications (appliances)
|
||||
package managedapplications
|
||||
@@ -18,9 +17,8 @@ package managedapplications
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.1.0.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
|
||||
Generated
Vendored
+6
-9
@@ -14,9 +14,8 @@ package managedapplications
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.1.0.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
@@ -38,8 +37,7 @@ const (
|
||||
type ApplianceLockLevel string
|
||||
|
||||
const (
|
||||
// CanNotDelete specifies the can not delete state for appliance lock
|
||||
// level.
|
||||
// CanNotDelete specifies the can not delete state for appliance lock level.
|
||||
CanNotDelete ApplianceLockLevel = "CanNotDelete"
|
||||
// None specifies the none state for appliance lock level.
|
||||
None ApplianceLockLevel = "None"
|
||||
@@ -79,8 +77,7 @@ const (
|
||||
type ResourceIdentityType string
|
||||
|
||||
const (
|
||||
// SystemAssigned specifies the system assigned state for resource identity
|
||||
// type.
|
||||
// SystemAssigned specifies the system assigned state for resource identity type.
|
||||
SystemAssigned ResourceIdentityType = "SystemAssigned"
|
||||
)
|
||||
|
||||
@@ -210,8 +207,8 @@ type ApplianceProviderAuthorization struct {
|
||||
RoleDefinitionID *string `json:"roleDefinitionId,omitempty"`
|
||||
}
|
||||
|
||||
// ErrorResponse is error reponse indicates ARM appliance is not able to
|
||||
// process the incoming request. The reason is provided in the error message.
|
||||
// ErrorResponse is error reponse indicates ARM appliance is not able to process the incoming request. The reason is
|
||||
// provided in the error message.
|
||||
type ErrorResponse struct {
|
||||
HTTPStatus *string `json:"httpStatus,omitempty"`
|
||||
ErrorCode *string `json:"errorCode,omitempty"`
|
||||
|
||||
Generated
Vendored
+4
-5
@@ -14,16 +14,15 @@ package managedapplications
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.1.0.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
// UserAgent returns the UserAgent string to use when sending http.Requests.
|
||||
func UserAgent() string {
|
||||
return "Azure-SDK-For-Go/v10.1.0-beta arm-managedapplications/2016-09-01-preview"
|
||||
return "Azure-SDK-For-Go/v11.0.0-beta arm-managedapplications/2016-09-01-preview"
|
||||
}
|
||||
|
||||
// Version returns the semantic version (see http://semver.org) of the client.
|
||||
func Version() string {
|
||||
return "v10.1.0-beta"
|
||||
return "v11.0.0-beta"
|
||||
}
|
||||
|
||||
+169
-49
@@ -14,9 +14,8 @@ package policy
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
@@ -25,8 +24,8 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// AssignmentsClient is the to manage and control access to your resources, you
|
||||
// can define customized policies and assign them at a scope.
|
||||
// AssignmentsClient is the to manage and control access to your resources, you can define customized policies and
|
||||
// assign them at a scope.
|
||||
type AssignmentsClient struct {
|
||||
ManagementClient
|
||||
}
|
||||
@@ -36,19 +35,16 @@ func NewAssignmentsClient(subscriptionID string) AssignmentsClient {
|
||||
return NewAssignmentsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewAssignmentsClientWithBaseURI creates an instance of the AssignmentsClient
|
||||
// client.
|
||||
// NewAssignmentsClientWithBaseURI creates an instance of the AssignmentsClient client.
|
||||
func NewAssignmentsClientWithBaseURI(baseURI string, subscriptionID string) AssignmentsClient {
|
||||
return AssignmentsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// Create policy assignments are inherited by child resources. For example,
|
||||
// when you apply a policy to a resource group that policy is assigned to all
|
||||
// resources in the group.
|
||||
// Create policy assignments are inherited by child resources. For example, when you apply a policy to a resource group
|
||||
// that policy is assigned to all resources in the group.
|
||||
//
|
||||
// scope is the scope of the policy assignment. policyAssignmentName is the
|
||||
// name of the policy assignment. parameters is parameters for the policy
|
||||
// assignment.
|
||||
// scope is the scope of the policy assignment. policyAssignmentName is the name of the policy assignment. parameters
|
||||
// is parameters for the policy assignment.
|
||||
func (client AssignmentsClient) Create(scope string, policyAssignmentName string, parameters Assignment) (result Assignment, err error) {
|
||||
req, err := client.CreatePreparer(scope, policyAssignmentName, parameters)
|
||||
if err != nil {
|
||||
@@ -87,7 +83,7 @@ func (client AssignmentsClient) CreatePreparer(scope string, policyAssignmentNam
|
||||
autorest.AsJSON(),
|
||||
autorest.AsPut(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/{scope}/providers/Microsoft.Authorization/policyassignments/{policyAssignmentName}", pathParameters),
|
||||
autorest.WithPathParameters("/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}", pathParameters),
|
||||
autorest.WithJSON(parameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare(&http.Request{})
|
||||
@@ -112,19 +108,16 @@ func (client AssignmentsClient) CreateResponder(resp *http.Response) (result Ass
|
||||
return
|
||||
}
|
||||
|
||||
// CreateByID policy assignments are inherited by child resources. For example,
|
||||
// when you apply a policy to a resource group that policy is assigned to all
|
||||
// resources in the group. When providing a scope for the assigment, use
|
||||
// CreateByID policy assignments are inherited by child resources. For example, when you apply a policy to a resource
|
||||
// group that policy is assigned to all resources in the group. When providing a scope for the assigment, use
|
||||
// '/subscriptions/{subscription-id}/' for subscriptions,
|
||||
// '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for
|
||||
// resource groups, and
|
||||
// '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and
|
||||
// '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}'
|
||||
// for resources.
|
||||
//
|
||||
// policyAssignmentID is the ID of the policy assignment to create. Use the
|
||||
// format
|
||||
// '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
|
||||
// parameters is parameters for policy assignment.
|
||||
// policyAssignmentID is the ID of the policy assignment to create. Use the format
|
||||
// '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. parameters is parameters
|
||||
// for policy assignment.
|
||||
func (client AssignmentsClient) CreateByID(policyAssignmentID string, parameters Assignment) (result Assignment, err error) {
|
||||
req, err := client.CreateByIDPreparer(policyAssignmentID, parameters)
|
||||
if err != nil {
|
||||
@@ -189,8 +182,7 @@ func (client AssignmentsClient) CreateByIDResponder(resp *http.Response) (result
|
||||
|
||||
// Delete deletes a policy assignment.
|
||||
//
|
||||
// scope is the scope of the policy assignment. policyAssignmentName is the
|
||||
// name of the policy assignment to delete.
|
||||
// scope is the scope of the policy assignment. policyAssignmentName is the name of the policy assignment to delete.
|
||||
func (client AssignmentsClient) Delete(scope string, policyAssignmentName string) (result Assignment, err error) {
|
||||
req, err := client.DeletePreparer(scope, policyAssignmentName)
|
||||
if err != nil {
|
||||
@@ -228,7 +220,7 @@ func (client AssignmentsClient) DeletePreparer(scope string, policyAssignmentNam
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsDelete(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/{scope}/providers/Microsoft.Authorization/policyassignments/{policyAssignmentName}", pathParameters),
|
||||
autorest.WithPathParameters("/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare(&http.Request{})
|
||||
}
|
||||
@@ -245,22 +237,19 @@ func (client AssignmentsClient) DeleteResponder(resp *http.Response) (result Ass
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// DeleteByID when providing a scope for the assigment, use
|
||||
// '/subscriptions/{subscription-id}/' for subscriptions,
|
||||
// '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for
|
||||
// resource groups, and
|
||||
// DeleteByID when providing a scope for the assigment, use '/subscriptions/{subscription-id}/' for subscriptions,
|
||||
// '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and
|
||||
// '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}'
|
||||
// for resources.
|
||||
//
|
||||
// policyAssignmentID is the ID of the policy assignment to delete. Use the
|
||||
// format
|
||||
// policyAssignmentID is the ID of the policy assignment to delete. Use the format
|
||||
// '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
|
||||
func (client AssignmentsClient) DeleteByID(policyAssignmentID string) (result Assignment, err error) {
|
||||
req, err := client.DeleteByIDPreparer(policyAssignmentID)
|
||||
@@ -324,8 +313,7 @@ func (client AssignmentsClient) DeleteByIDResponder(resp *http.Response) (result
|
||||
|
||||
// Get gets a policy assignment.
|
||||
//
|
||||
// scope is the scope of the policy assignment. policyAssignmentName is the
|
||||
// name of the policy assignment to get.
|
||||
// scope is the scope of the policy assignment. policyAssignmentName is the name of the policy assignment to get.
|
||||
func (client AssignmentsClient) Get(scope string, policyAssignmentName string) (result Assignment, err error) {
|
||||
req, err := client.GetPreparer(scope, policyAssignmentName)
|
||||
if err != nil {
|
||||
@@ -363,7 +351,7 @@ func (client AssignmentsClient) GetPreparer(scope string, policyAssignmentName s
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/{scope}/providers/Microsoft.Authorization/policyassignments/{policyAssignmentName}", pathParameters),
|
||||
autorest.WithPathParameters("/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare(&http.Request{})
|
||||
}
|
||||
@@ -387,10 +375,8 @@ func (client AssignmentsClient) GetResponder(resp *http.Response) (result Assign
|
||||
return
|
||||
}
|
||||
|
||||
// GetByID when providing a scope for the assigment, use
|
||||
// '/subscriptions/{subscription-id}/' for subscriptions,
|
||||
// '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for
|
||||
// resource groups, and
|
||||
// GetByID when providing a scope for the assigment, use '/subscriptions/{subscription-id}/' for subscriptions,
|
||||
// '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and
|
||||
// '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}'
|
||||
// for resources.
|
||||
//
|
||||
@@ -498,7 +484,7 @@ func (client AssignmentsClient) ListPreparer(filter string) (*http.Request, erro
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyassignments", pathParameters),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyAssignments", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare(&http.Request{})
|
||||
}
|
||||
@@ -546,13 +532,57 @@ func (client AssignmentsClient) ListNextResults(lastResults AssignmentListResult
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete gets all elements from the list without paging.
|
||||
func (client AssignmentsClient) ListComplete(filter string, cancel <-chan struct{}) (<-chan Assignment, <-chan error) {
|
||||
resultChan := make(chan Assignment)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.List(filter)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
for list.NextLink != nil {
|
||||
list, err = client.ListNextResults(list)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
// ListForResource gets policy assignments for a resource.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group containing the resource.
|
||||
// The name is case insensitive. resourceProviderNamespace is the namespace of
|
||||
// the resource provider. parentResourcePath is the parent resource path.
|
||||
// resourceType is the resource type. resourceName is the name of the resource
|
||||
// with policy assignments. filter is the filter to apply on the operation.
|
||||
// resourceGroupName is the name of the resource group containing the resource. The name is case insensitive.
|
||||
// resourceProviderNamespace is the namespace of the resource provider. parentResourcePath is the parent resource path.
|
||||
// resourceType is the resource type. resourceName is the name of the resource with policy assignments. filter is the
|
||||
// filter to apply on the operation.
|
||||
func (client AssignmentsClient) ListForResource(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, filter string) (result AssignmentListResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -605,7 +635,7 @@ func (client AssignmentsClient) ListForResourcePreparer(resourceGroupName string
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/policyassignments", pathParameters),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/policyAssignments", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare(&http.Request{})
|
||||
}
|
||||
@@ -653,10 +683,55 @@ func (client AssignmentsClient) ListForResourceNextResults(lastResults Assignmen
|
||||
return
|
||||
}
|
||||
|
||||
// ListForResourceComplete gets all elements from the list without paging.
|
||||
func (client AssignmentsClient) ListForResourceComplete(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, filter string, cancel <-chan struct{}) (<-chan Assignment, <-chan error) {
|
||||
resultChan := make(chan Assignment)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.ListForResource(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
for list.NextLink != nil {
|
||||
list, err = client.ListForResourceNextResults(list)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
// ListForResourceGroup gets policy assignments for the resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group that contains policy
|
||||
// assignments. filter is the filter to apply on the operation.
|
||||
// resourceGroupName is the name of the resource group that contains policy assignments. filter is the filter to apply
|
||||
// on the operation.
|
||||
func (client AssignmentsClient) ListForResourceGroup(resourceGroupName string, filter string) (result AssignmentListResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -752,3 +827,48 @@ func (client AssignmentsClient) ListForResourceGroupNextResults(lastResults Assi
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListForResourceGroupComplete gets all elements from the list without paging.
|
||||
func (client AssignmentsClient) ListForResourceGroupComplete(resourceGroupName string, filter string, cancel <-chan struct{}) (<-chan Assignment, <-chan error) {
|
||||
resultChan := make(chan Assignment)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.ListForResourceGroup(resourceGroupName, filter)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
for list.NextLink != nil {
|
||||
list, err = client.ListForResourceGroupNextResults(list)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
+4
-7
@@ -1,8 +1,6 @@
|
||||
// Package policy implements the Azure ARM Policy service API version
|
||||
// 2016-12-01.
|
||||
// Package policy implements the Azure ARM Policy service API version 2016-12-01.
|
||||
//
|
||||
// To manage and control access to your resources, you can define customized
|
||||
// policies and assign them at a scope.
|
||||
// To manage and control access to your resources, you can define customized policies and assign them at a scope.
|
||||
package policy
|
||||
|
||||
// Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
@@ -19,9 +17,8 @@ package policy
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
|
||||
+51
-9
@@ -14,9 +14,8 @@ package policy
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
@@ -24,8 +23,8 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// DefinitionsClient is the to manage and control access to your resources, you
|
||||
// can define customized policies and assign them at a scope.
|
||||
// DefinitionsClient is the to manage and control access to your resources, you can define customized policies and
|
||||
// assign them at a scope.
|
||||
type DefinitionsClient struct {
|
||||
ManagementClient
|
||||
}
|
||||
@@ -35,16 +34,14 @@ func NewDefinitionsClient(subscriptionID string) DefinitionsClient {
|
||||
return NewDefinitionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewDefinitionsClientWithBaseURI creates an instance of the DefinitionsClient
|
||||
// client.
|
||||
// NewDefinitionsClientWithBaseURI creates an instance of the DefinitionsClient client.
|
||||
func NewDefinitionsClientWithBaseURI(baseURI string, subscriptionID string) DefinitionsClient {
|
||||
return DefinitionsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// CreateOrUpdate creates or updates a policy definition.
|
||||
//
|
||||
// policyDefinitionName is the name of the policy definition to create.
|
||||
// parameters is the policy definition properties.
|
||||
// policyDefinitionName is the name of the policy definition to create. parameters is the policy definition properties.
|
||||
func (client DefinitionsClient) CreateOrUpdate(policyDefinitionName string, parameters Definition) (result Definition, err error) {
|
||||
req, err := client.CreateOrUpdatePreparer(policyDefinitionName, parameters)
|
||||
if err != nil {
|
||||
@@ -324,3 +321,48 @@ func (client DefinitionsClient) ListNextResults(lastResults DefinitionListResult
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete gets all elements from the list without paging.
|
||||
func (client DefinitionsClient) ListComplete(filter string, cancel <-chan struct{}) (<-chan Definition, <-chan error) {
|
||||
resultChan := make(chan Definition)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.List(filter)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
for list.NextLink != nil {
|
||||
list, err = client.ListNextResults(list)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
+23
-10
@@ -14,9 +14,8 @@ package policy
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
@@ -24,19 +23,31 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// Mode enumerates the values for mode.
|
||||
type Mode string
|
||||
|
||||
const (
|
||||
// All specifies the all state for mode.
|
||||
All Mode = "All"
|
||||
// Indexed specifies the indexed state for mode.
|
||||
Indexed Mode = "Indexed"
|
||||
// NotSpecified specifies the not specified state for mode.
|
||||
NotSpecified Mode = "NotSpecified"
|
||||
)
|
||||
|
||||
// Type enumerates the values for type.
|
||||
type Type string
|
||||
|
||||
const (
|
||||
// BuiltIn specifies the built in state for type.
|
||||
BuiltIn Type = "BuiltIn"
|
||||
// Custom specifies the custom state for type.
|
||||
Custom Type = "Custom"
|
||||
// NotSpecified specifies the not specified state for type.
|
||||
NotSpecified Type = "NotSpecified"
|
||||
// TypeBuiltIn specifies the type built in state for type.
|
||||
TypeBuiltIn Type = "BuiltIn"
|
||||
// TypeCustom specifies the type custom state for type.
|
||||
TypeCustom Type = "Custom"
|
||||
// TypeNotSpecified specifies the type not specified state for type.
|
||||
TypeNotSpecified Type = "NotSpecified"
|
||||
)
|
||||
|
||||
// Assignment is the policy definition.
|
||||
// Assignment is the policy assignment.
|
||||
type Assignment struct {
|
||||
autorest.Response `json:"-"`
|
||||
*AssignmentProperties `json:"properties,omitempty"`
|
||||
@@ -103,8 +114,10 @@ func (client DefinitionListResult) DefinitionListResultPreparer() (*http.Request
|
||||
// DefinitionProperties is the policy definition properties.
|
||||
type DefinitionProperties struct {
|
||||
PolicyType Type `json:"policyType,omitempty"`
|
||||
Mode Mode `json:"mode,omitempty"`
|
||||
DisplayName *string `json:"displayName,omitempty"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
PolicyRule *map[string]interface{} `json:"policyRule,omitempty"`
|
||||
Metadata *map[string]interface{} `json:"metadata,omitempty"`
|
||||
Parameters *map[string]interface{} `json:"parameters,omitempty"`
|
||||
}
|
||||
|
||||
+4
-5
@@ -14,16 +14,15 @@ package policy
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
// UserAgent returns the UserAgent string to use when sending http.Requests.
|
||||
func UserAgent() string {
|
||||
return "Azure-SDK-For-Go/v10.1.0-beta arm-policy/2016-12-01"
|
||||
return "Azure-SDK-For-Go/v11.0.0-beta arm-policy/2016-12-01"
|
||||
}
|
||||
|
||||
// Version returns the semantic version (see http://semver.org) of the client.
|
||||
func Version() string {
|
||||
return "v10.1.0-beta"
|
||||
return "v11.0.0-beta"
|
||||
}
|
||||
|
||||
+3
-5
@@ -1,5 +1,4 @@
|
||||
// Package resources implements the Azure ARM Resources service API version
|
||||
// 2016-09-01.
|
||||
// Package resources implements the Azure ARM Resources service API version 2017-05-10.
|
||||
//
|
||||
// Provides operations for working with resources and resource groups.
|
||||
package resources
|
||||
@@ -18,9 +17,8 @@ package resources
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
|
||||
Generated
Vendored
+56
-17
@@ -14,9 +14,8 @@ package resources
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
@@ -25,29 +24,25 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// DeploymentOperationsClient is the provides operations for working with
|
||||
// resources and resource groups.
|
||||
// DeploymentOperationsClient is the provides operations for working with resources and resource groups.
|
||||
type DeploymentOperationsClient struct {
|
||||
ManagementClient
|
||||
}
|
||||
|
||||
// NewDeploymentOperationsClient creates an instance of the
|
||||
// DeploymentOperationsClient client.
|
||||
// NewDeploymentOperationsClient creates an instance of the DeploymentOperationsClient client.
|
||||
func NewDeploymentOperationsClient(subscriptionID string) DeploymentOperationsClient {
|
||||
return NewDeploymentOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewDeploymentOperationsClientWithBaseURI creates an instance of the
|
||||
// DeploymentOperationsClient client.
|
||||
// NewDeploymentOperationsClientWithBaseURI creates an instance of the DeploymentOperationsClient client.
|
||||
func NewDeploymentOperationsClientWithBaseURI(baseURI string, subscriptionID string) DeploymentOperationsClient {
|
||||
return DeploymentOperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// Get gets a deployments operation.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. The name is case
|
||||
// insensitive. deploymentName is the name of the deployment. operationID is
|
||||
// the ID of the operation to get.
|
||||
// resourceGroupName is the name of the resource group. The name is case insensitive. deploymentName is the name of the
|
||||
// deployment. operationID is the ID of the operation to get.
|
||||
func (client DeploymentOperationsClient) Get(resourceGroupName string, deploymentName string, operationID string) (result DeploymentOperation, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -91,7 +86,7 @@ func (client DeploymentOperationsClient) GetPreparer(resourceGroupName string, d
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -125,9 +120,8 @@ func (client DeploymentOperationsClient) GetResponder(resp *http.Response) (resu
|
||||
|
||||
// List gets all deployments operations for a deployment.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. The name is case
|
||||
// insensitive. deploymentName is the name of the deployment with the operation
|
||||
// to get. top is the number of results to return.
|
||||
// resourceGroupName is the name of the resource group. The name is case insensitive. deploymentName is the name of the
|
||||
// deployment with the operation to get. top is the number of results to return.
|
||||
func (client DeploymentOperationsClient) List(resourceGroupName string, deploymentName string, top *int32) (result DeploymentOperationsListResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -170,7 +164,7 @@ func (client DeploymentOperationsClient) ListPreparer(resourceGroupName string,
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -228,3 +222,48 @@ func (client DeploymentOperationsClient) ListNextResults(lastResults DeploymentO
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete gets all elements from the list without paging.
|
||||
func (client DeploymentOperationsClient) ListComplete(resourceGroupName string, deploymentName string, top *int32, cancel <-chan struct{}) (<-chan DeploymentOperation, <-chan error) {
|
||||
resultChan := make(chan DeploymentOperation)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.List(resourceGroupName, deploymentName, top)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
for list.NextLink != nil {
|
||||
list, err = client.ListNextResults(list)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
+117
-85
@@ -14,9 +14,8 @@ package resources
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
@@ -25,8 +24,7 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// DeploymentsClient is the provides operations for working with resources and
|
||||
// resource groups.
|
||||
// DeploymentsClient is the provides operations for working with resources and resource groups.
|
||||
type DeploymentsClient struct {
|
||||
ManagementClient
|
||||
}
|
||||
@@ -36,19 +34,17 @@ func NewDeploymentsClient(subscriptionID string) DeploymentsClient {
|
||||
return NewDeploymentsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewDeploymentsClientWithBaseURI creates an instance of the DeploymentsClient
|
||||
// client.
|
||||
// NewDeploymentsClientWithBaseURI creates an instance of the DeploymentsClient client.
|
||||
func NewDeploymentsClientWithBaseURI(baseURI string, subscriptionID string) DeploymentsClient {
|
||||
return DeploymentsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// Cancel you can cancel a deployment only if the provisioningState is Accepted
|
||||
// or Running. After the deployment is canceled, the provisioningState is set
|
||||
// to Canceled. Canceling a template deployment stops the currently running
|
||||
// Cancel you can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is
|
||||
// canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running
|
||||
// template deployment and leaves the resource group partially deployed.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. The name is case
|
||||
// insensitive. deploymentName is the name of the deployment to cancel.
|
||||
// resourceGroupName is the name of the resource group. The name is case insensitive. deploymentName is the name of the
|
||||
// deployment to cancel.
|
||||
func (client DeploymentsClient) Cancel(resourceGroupName string, deploymentName string) (result autorest.Response, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -91,7 +87,7 @@ func (client DeploymentsClient) CancelPreparer(resourceGroupName string, deploym
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -124,9 +120,8 @@ func (client DeploymentsClient) CancelResponder(resp *http.Response) (result aut
|
||||
|
||||
// CheckExistence checks whether the deployment exists.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group with the deployment to
|
||||
// check. The name is case insensitive. deploymentName is the name of the
|
||||
// deployment to check.
|
||||
// resourceGroupName is the name of the resource group with the deployment to check. The name is case insensitive.
|
||||
// deploymentName is the name of the deployment to check.
|
||||
func (client DeploymentsClient) CheckExistence(resourceGroupName string, deploymentName string) (result autorest.Response, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -169,7 +164,7 @@ func (client DeploymentsClient) CheckExistencePreparer(resourceGroupName string,
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -200,15 +195,13 @@ func (client DeploymentsClient) CheckExistenceResponder(resp *http.Response) (re
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdate you can provide the template and parameters directly in the
|
||||
// request or link to JSON files. This method may poll for completion. Polling
|
||||
// can be canceled by passing the cancel channel argument. The channel will be
|
||||
// CreateOrUpdate you can provide the template and parameters directly in the request or link to JSON files. This
|
||||
// method may poll for completion. Polling can be canceled by passing the cancel channel argument. The channel will be
|
||||
// used to cancel polling and any outstanding HTTP requests.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to deploy the resources
|
||||
// to. The name is case insensitive. The resource group must already exist.
|
||||
// deploymentName is the name of the deployment. parameters is additional
|
||||
// parameters supplied to the operation.
|
||||
// resourceGroupName is the name of the resource group to deploy the resources to. The name is case insensitive. The
|
||||
// resource group must already exist. deploymentName is the name of the deployment. parameters is additional parameters
|
||||
// supplied to the operation.
|
||||
func (client DeploymentsClient) CreateOrUpdate(resourceGroupName string, deploymentName string, parameters Deployment, cancel <-chan struct{}) (<-chan DeploymentExtended, <-chan error) {
|
||||
resultChan := make(chan DeploymentExtended, 1)
|
||||
errChan := make(chan error, 1)
|
||||
@@ -238,8 +231,10 @@ func (client DeploymentsClient) CreateOrUpdate(resourceGroupName string, deploym
|
||||
var err error
|
||||
var result DeploymentExtended
|
||||
defer func() {
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
}
|
||||
resultChan <- result
|
||||
errChan <- err
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
@@ -272,7 +267,7 @@ func (client DeploymentsClient) CreateOrUpdatePreparer(resourceGroupName string,
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -308,23 +303,17 @@ func (client DeploymentsClient) CreateOrUpdateResponder(resp *http.Response) (re
|
||||
return
|
||||
}
|
||||
|
||||
// Delete a template deployment that is currently running cannot be deleted.
|
||||
// Deleting a template deployment removes the associated deployment operations.
|
||||
// Deleting a template deployment does not affect the state of the resource
|
||||
// group. This is an asynchronous operation that returns a status of 202 until
|
||||
// the template deployment is successfully deleted. The Location response
|
||||
// header contains the URI that is used to obtain the status of the process.
|
||||
// While the process is running, a call to the URI in the Location header
|
||||
// returns a status of 202. When the process finishes, the URI in the Location
|
||||
// header returns a status of 204 on success. If the asynchronous request
|
||||
// failed, the URI in the Location header returns an error-level status code.
|
||||
// This method may poll for completion. Polling can be canceled by passing the
|
||||
// cancel channel argument. The channel will be used to cancel polling and any
|
||||
// outstanding HTTP requests.
|
||||
// Delete a template deployment that is currently running cannot be deleted. Deleting a template deployment removes the
|
||||
// associated deployment operations. Deleting a template deployment does not affect the state of the resource group.
|
||||
// This is an asynchronous operation that returns a status of 202 until the template deployment is successfully
|
||||
// deleted. The Location response header contains the URI that is used to obtain the status of the process. While the
|
||||
// process is running, a call to the URI in the Location header returns a status of 202. When the process finishes, the
|
||||
// URI in the Location header returns a status of 204 on success. If the asynchronous request failed, the URI in the
|
||||
// Location header returns an error-level status code. This method may poll for completion. Polling can be canceled by
|
||||
// passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group with the deployment to
|
||||
// delete. The name is case insensitive. deploymentName is the name of the
|
||||
// deployment to delete.
|
||||
// resourceGroupName is the name of the resource group with the deployment to delete. The name is case insensitive.
|
||||
// deploymentName is the name of the deployment to delete.
|
||||
func (client DeploymentsClient) Delete(resourceGroupName string, deploymentName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) {
|
||||
resultChan := make(chan autorest.Response, 1)
|
||||
errChan := make(chan error, 1)
|
||||
@@ -347,8 +336,10 @@ func (client DeploymentsClient) Delete(resourceGroupName string, deploymentName
|
||||
var err error
|
||||
var result autorest.Response
|
||||
defer func() {
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
}
|
||||
resultChan <- result
|
||||
errChan <- err
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
@@ -381,7 +372,7 @@ func (client DeploymentsClient) DeletePreparer(resourceGroupName string, deploym
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -416,9 +407,8 @@ func (client DeploymentsClient) DeleteResponder(resp *http.Response) (result aut
|
||||
|
||||
// ExportTemplate exports the template used for specified deployment.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. The name is case
|
||||
// insensitive. deploymentName is the name of the deployment from which to get
|
||||
// the template.
|
||||
// resourceGroupName is the name of the resource group. The name is case insensitive. deploymentName is the name of the
|
||||
// deployment from which to get the template.
|
||||
func (client DeploymentsClient) ExportTemplate(resourceGroupName string, deploymentName string) (result DeploymentExportResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -461,7 +451,7 @@ func (client DeploymentsClient) ExportTemplatePreparer(resourceGroupName string,
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -495,8 +485,8 @@ func (client DeploymentsClient) ExportTemplateResponder(resp *http.Response) (re
|
||||
|
||||
// Get gets a deployment.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. The name is case
|
||||
// insensitive. deploymentName is the name of the deployment to get.
|
||||
// resourceGroupName is the name of the resource group. The name is case insensitive. deploymentName is the name of the
|
||||
// deployment to get.
|
||||
func (client DeploymentsClient) Get(resourceGroupName string, deploymentName string) (result DeploymentExtended, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -539,7 +529,7 @@ func (client DeploymentsClient) GetPreparer(resourceGroupName string, deployment
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -571,51 +561,49 @@ func (client DeploymentsClient) GetResponder(resp *http.Response) (result Deploy
|
||||
return
|
||||
}
|
||||
|
||||
// List get all the deployments for a resource group.
|
||||
// ListByResourceGroup get all the deployments for a resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group with the deployments to
|
||||
// get. The name is case insensitive. filter is the filter to apply on the
|
||||
// operation. For example, you can use $filter=provisioningState eq '{state}'.
|
||||
// top is the number of results to get. If null is passed, returns all
|
||||
// deployments.
|
||||
func (client DeploymentsClient) List(resourceGroupName string, filter string, top *int32) (result DeploymentListResult, err error) {
|
||||
// resourceGroupName is the name of the resource group with the deployments to get. The name is case insensitive.
|
||||
// filter is the filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'. top
|
||||
// is the number of results to get. If null is passed, returns all deployments.
|
||||
func (client DeploymentsClient) ListByResourceGroup(resourceGroupName string, filter string, top *int32) (result DeploymentListResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "resources.DeploymentsClient", "List")
|
||||
return result, validation.NewErrorWithValidationError(err, "resources.DeploymentsClient", "ListByResourceGroup")
|
||||
}
|
||||
|
||||
req, err := client.ListPreparer(resourceGroupName, filter, top)
|
||||
req, err := client.ListByResourceGroupPreparer(resourceGroupName, filter, top)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "List", nil, "Failure preparing request")
|
||||
err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ListByResourceGroup", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
resp, err := client.ListByResourceGroupSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "List", resp, "Failure sending request")
|
||||
err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ListByResourceGroup", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListResponder(resp)
|
||||
result, err = client.ListByResourceGroupResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "List", resp, "Failure responding to request")
|
||||
err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ListByResourceGroup", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client DeploymentsClient) ListPreparer(resourceGroupName string, filter string, top *int32) (*http.Request, error) {
|
||||
// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
|
||||
func (client DeploymentsClient) ListByResourceGroupPreparer(resourceGroupName string, filter string, top *int32) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -634,15 +622,15 @@ func (client DeploymentsClient) ListPreparer(resourceGroupName string, filter st
|
||||
return preparer.Prepare(&http.Request{})
|
||||
}
|
||||
|
||||
// ListSender sends the List request. The method will close the
|
||||
// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client DeploymentsClient) ListSender(req *http.Request) (*http.Response, error) {
|
||||
func (client DeploymentsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req)
|
||||
}
|
||||
|
||||
// ListResponder handles the response to the List request. The method always
|
||||
// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client DeploymentsClient) ListResponder(resp *http.Response) (result DeploymentListResult, err error) {
|
||||
func (client DeploymentsClient) ListByResourceGroupResponder(resp *http.Response) (result DeploymentListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -653,36 +641,80 @@ func (client DeploymentsClient) ListResponder(resp *http.Response) (result Deplo
|
||||
return
|
||||
}
|
||||
|
||||
// ListNextResults retrieves the next set of results, if any.
|
||||
func (client DeploymentsClient) ListNextResults(lastResults DeploymentListResult) (result DeploymentListResult, err error) {
|
||||
// ListByResourceGroupNextResults retrieves the next set of results, if any.
|
||||
func (client DeploymentsClient) ListByResourceGroupNextResults(lastResults DeploymentListResult) (result DeploymentListResult, err error) {
|
||||
req, err := lastResults.DeploymentListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "resources.DeploymentsClient", "List", nil, "Failure preparing next results request")
|
||||
return result, autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ListByResourceGroup", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
resp, err := client.ListByResourceGroupSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "resources.DeploymentsClient", "List", resp, "Failure sending next results request")
|
||||
return result, autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ListByResourceGroup", resp, "Failure sending next results request")
|
||||
}
|
||||
|
||||
result, err = client.ListResponder(resp)
|
||||
result, err = client.ListByResourceGroupResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "List", resp, "Failure responding to next results request")
|
||||
err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ListByResourceGroup", resp, "Failure responding to next results request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// Validate validates whether the specified template is syntactically correct
|
||||
// and will be accepted by Azure Resource Manager..
|
||||
// ListByResourceGroupComplete gets all elements from the list without paging.
|
||||
func (client DeploymentsClient) ListByResourceGroupComplete(resourceGroupName string, filter string, top *int32, cancel <-chan struct{}) (<-chan DeploymentExtended, <-chan error) {
|
||||
resultChan := make(chan DeploymentExtended)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.ListByResourceGroup(resourceGroupName, filter, top)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
for list.NextLink != nil {
|
||||
list, err = client.ListByResourceGroupNextResults(list)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
// Validate validates whether the specified template is syntactically correct and will be accepted by Azure Resource
|
||||
// Manager..
|
||||
//
|
||||
// resourceGroupName is the name of the resource group the template will be
|
||||
// deployed to. The name is case insensitive. deploymentName is the name of the
|
||||
// deployment. parameters is parameters to validate.
|
||||
// resourceGroupName is the name of the resource group the template will be deployed to. The name is case insensitive.
|
||||
// deploymentName is the name of the deployment. parameters is parameters to validate.
|
||||
func (client DeploymentsClient) Validate(resourceGroupName string, deploymentName string, parameters Deployment) (result DeploymentValidateResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -732,7 +764,7 @@ func (client DeploymentsClient) ValidatePreparer(resourceGroupName string, deplo
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
Generated
Vendored
Executable → Regular
+357
-74
@@ -14,9 +14,8 @@ package resources
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
@@ -25,8 +24,7 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// GroupClient is the provides operations for working with resources and
|
||||
// resource groups.
|
||||
// GroupClient is the provides operations for working with resources and resource groups.
|
||||
type GroupClient struct {
|
||||
ManagementClient
|
||||
}
|
||||
@@ -43,11 +41,10 @@ func NewGroupClientWithBaseURI(baseURI string, subscriptionID string) GroupClien
|
||||
|
||||
// CheckExistence checks whether a resource exists.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group containing the resource
|
||||
// to check. The name is case insensitive. resourceProviderNamespace is the
|
||||
// resource provider of the resource to check. parentResourcePath is the parent
|
||||
// resource identity. resourceType is the resource type. resourceName is the
|
||||
// name of the resource to check whether it exists.
|
||||
// resourceGroupName is the name of the resource group containing the resource to check. The name is case insensitive.
|
||||
// resourceProviderNamespace is the resource provider of the resource to check. parentResourcePath is the parent
|
||||
// resource identity. resourceType is the resource type. resourceName is the name of the resource to check whether it
|
||||
// exists.
|
||||
func (client GroupClient) CheckExistence(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -89,7 +86,7 @@ func (client GroupClient) CheckExistencePreparer(resourceGroupName string, resou
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -122,8 +119,7 @@ func (client GroupClient) CheckExistenceResponder(resp *http.Response) (result a
|
||||
|
||||
// CheckExistenceByID checks by ID whether a resource exists.
|
||||
//
|
||||
// resourceID is the fully qualified ID of the resource, including the resource
|
||||
// name and resource type. Use the format,
|
||||
// resourceID is the fully qualified ID of the resource, including the resource name and resource type. Use the format,
|
||||
// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
|
||||
func (client GroupClient) CheckExistenceByID(resourceID string) (result autorest.Response, err error) {
|
||||
req, err := client.CheckExistenceByIDPreparer(resourceID)
|
||||
@@ -153,7 +149,7 @@ func (client GroupClient) CheckExistenceByIDPreparer(resourceID string) (*http.R
|
||||
"resourceId": resourceID,
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -184,16 +180,13 @@ func (client GroupClient) CheckExistenceByIDResponder(resp *http.Response) (resu
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdate creates a resource. This method may poll for completion.
|
||||
// Polling can be canceled by passing the cancel channel argument. The channel
|
||||
// will be used to cancel polling and any outstanding HTTP requests.
|
||||
// CreateOrUpdate creates a resource. This method may poll for completion. Polling can be canceled by passing the
|
||||
// cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group for the resource. The
|
||||
// name is case insensitive. resourceProviderNamespace is the namespace of the
|
||||
// resource provider. parentResourcePath is the parent resource identity.
|
||||
// resourceType is the resource type of the resource to create. resourceName is
|
||||
// the name of the resource to create. parameters is parameters for creating or
|
||||
// updating the resource.
|
||||
// resourceGroupName is the name of the resource group for the resource. The name is case insensitive.
|
||||
// resourceProviderNamespace is the namespace of the resource provider. parentResourcePath is the parent resource
|
||||
// identity. resourceType is the resource type of the resource to create. resourceName is the name of the resource to
|
||||
// create. parameters is parameters for creating or updating the resource.
|
||||
func (client GroupClient) CreateOrUpdate(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource, cancel <-chan struct{}) (<-chan GenericResource, <-chan error) {
|
||||
resultChan := make(chan GenericResource, 1)
|
||||
errChan := make(chan error, 1)
|
||||
@@ -215,8 +208,10 @@ func (client GroupClient) CreateOrUpdate(resourceGroupName string, resourceProvi
|
||||
var err error
|
||||
var result GenericResource
|
||||
defer func() {
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
}
|
||||
resultChan <- result
|
||||
errChan <- err
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
@@ -252,7 +247,7 @@ func (client GroupClient) CreateOrUpdatePreparer(resourceGroupName string, resou
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -288,13 +283,10 @@ func (client GroupClient) CreateOrUpdateResponder(resp *http.Response) (result G
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdateByID create a resource by ID. This method may poll for
|
||||
// completion. Polling can be canceled by passing the cancel channel argument.
|
||||
// The channel will be used to cancel polling and any outstanding HTTP
|
||||
// requests.
|
||||
// CreateOrUpdateByID create a resource by ID. This method may poll for completion. Polling can be canceled by passing
|
||||
// the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests.
|
||||
//
|
||||
// resourceID is the fully qualified ID of the resource, including the resource
|
||||
// name and resource type. Use the format,
|
||||
// resourceID is the fully qualified ID of the resource, including the resource name and resource type. Use the format,
|
||||
// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
|
||||
// parameters is create or update resource parameters.
|
||||
func (client GroupClient) CreateOrUpdateByID(resourceID string, parameters GenericResource, cancel <-chan struct{}) (<-chan GenericResource, <-chan error) {
|
||||
@@ -314,8 +306,10 @@ func (client GroupClient) CreateOrUpdateByID(resourceID string, parameters Gener
|
||||
var err error
|
||||
var result GenericResource
|
||||
defer func() {
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
}
|
||||
resultChan <- result
|
||||
errChan <- err
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
@@ -346,7 +340,7 @@ func (client GroupClient) CreateOrUpdateByIDPreparer(resourceID string, paramete
|
||||
"resourceId": resourceID,
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -382,15 +376,12 @@ func (client GroupClient) CreateOrUpdateByIDResponder(resp *http.Response) (resu
|
||||
return
|
||||
}
|
||||
|
||||
// Delete deletes a resource. This method may poll for completion. Polling can
|
||||
// be canceled by passing the cancel channel argument. The channel will be used
|
||||
// to cancel polling and any outstanding HTTP requests.
|
||||
// Delete deletes a resource. This method may poll for completion. Polling can be canceled by passing the cancel
|
||||
// channel argument. The channel will be used to cancel polling and any outstanding HTTP requests.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group that contains the
|
||||
// resource to delete. The name is case insensitive. resourceProviderNamespace
|
||||
// is the namespace of the resource provider. parentResourcePath is the parent
|
||||
// resource identity. resourceType is the resource type. resourceName is the
|
||||
// name of the resource to delete.
|
||||
// resourceGroupName is the name of the resource group that contains the resource to delete. The name is case
|
||||
// insensitive. resourceProviderNamespace is the namespace of the resource provider. parentResourcePath is the parent
|
||||
// resource identity. resourceType is the resource type. resourceName is the name of the resource to delete.
|
||||
func (client GroupClient) Delete(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) {
|
||||
resultChan := make(chan autorest.Response, 1)
|
||||
errChan := make(chan error, 1)
|
||||
@@ -409,8 +400,10 @@ func (client GroupClient) Delete(resourceGroupName string, resourceProviderNames
|
||||
var err error
|
||||
var result autorest.Response
|
||||
defer func() {
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
}
|
||||
resultChan <- result
|
||||
errChan <- err
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
@@ -446,7 +439,7 @@ func (client GroupClient) DeletePreparer(resourceGroupName string, resourceProvi
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -479,12 +472,10 @@ func (client GroupClient) DeleteResponder(resp *http.Response) (result autorest.
|
||||
return
|
||||
}
|
||||
|
||||
// DeleteByID deletes a resource by ID. This method may poll for completion.
|
||||
// Polling can be canceled by passing the cancel channel argument. The channel
|
||||
// will be used to cancel polling and any outstanding HTTP requests.
|
||||
// DeleteByID deletes a resource by ID. This method may poll for completion. Polling can be canceled by passing the
|
||||
// cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests.
|
||||
//
|
||||
// resourceID is the fully qualified ID of the resource, including the resource
|
||||
// name and resource type. Use the format,
|
||||
// resourceID is the fully qualified ID of the resource, including the resource name and resource type. Use the format,
|
||||
// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
|
||||
func (client GroupClient) DeleteByID(resourceID string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) {
|
||||
resultChan := make(chan autorest.Response, 1)
|
||||
@@ -493,8 +484,10 @@ func (client GroupClient) DeleteByID(resourceID string, cancel <-chan struct{})
|
||||
var err error
|
||||
var result autorest.Response
|
||||
defer func() {
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
}
|
||||
resultChan <- result
|
||||
errChan <- err
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
@@ -525,7 +518,7 @@ func (client GroupClient) DeleteByIDPreparer(resourceID string, cancel <-chan st
|
||||
"resourceId": resourceID,
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -560,11 +553,9 @@ func (client GroupClient) DeleteByIDResponder(resp *http.Response) (result autor
|
||||
|
||||
// Get gets a resource.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group containing the resource
|
||||
// to get. The name is case insensitive. resourceProviderNamespace is the
|
||||
// namespace of the resource provider. parentResourcePath is the parent
|
||||
// resource identity. resourceType is the resource type of the resource.
|
||||
// resourceName is the name of the resource to get.
|
||||
// resourceGroupName is the name of the resource group containing the resource to get. The name is case insensitive.
|
||||
// resourceProviderNamespace is the namespace of the resource provider. parentResourcePath is the parent resource
|
||||
// identity. resourceType is the resource type of the resource. resourceName is the name of the resource to get.
|
||||
func (client GroupClient) Get(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result GenericResource, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -606,7 +597,7 @@ func (client GroupClient) GetPreparer(resourceGroupName string, resourceProvider
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -640,8 +631,7 @@ func (client GroupClient) GetResponder(resp *http.Response) (result GenericResou
|
||||
|
||||
// GetByID gets a resource by ID.
|
||||
//
|
||||
// resourceID is the fully qualified ID of the resource, including the resource
|
||||
// name and resource type. Use the format,
|
||||
// resourceID is the fully qualified ID of the resource, including the resource name and resource type. Use the format,
|
||||
// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
|
||||
func (client GroupClient) GetByID(resourceID string) (result GenericResource, err error) {
|
||||
req, err := client.GetByIDPreparer(resourceID)
|
||||
@@ -671,7 +661,7 @@ func (client GroupClient) GetByIDPreparer(resourceID string) (*http.Request, err
|
||||
"resourceId": resourceID,
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -705,9 +695,8 @@ func (client GroupClient) GetByIDResponder(resp *http.Response) (result GenericR
|
||||
|
||||
// List get all the resources in a subscription.
|
||||
//
|
||||
// filter is the filter to apply on the operation. expand is the $expand query
|
||||
// parameter. top is the number of results to return. If null is passed,
|
||||
// returns all resource groups.
|
||||
// filter is the filter to apply on the operation. expand is the $expand query parameter. top is the number of results
|
||||
// to return. If null is passed, returns all resource groups.
|
||||
func (client GroupClient) List(filter string, expand string, top *int32) (result ListResult, err error) {
|
||||
req, err := client.ListPreparer(filter, expand, top)
|
||||
if err != nil {
|
||||
@@ -736,7 +725,7 @@ func (client GroupClient) ListPreparer(filter string, expand string, top *int32)
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -801,16 +790,211 @@ func (client GroupClient) ListNextResults(lastResults ListResult) (result ListRe
|
||||
return
|
||||
}
|
||||
|
||||
// MoveResources the resources to move must be in the same source resource
|
||||
// group. The target resource group may be in a different subscription. When
|
||||
// moving resources, both the source group and the target group are locked for
|
||||
// the duration of the operation. Write and delete operations are blocked on
|
||||
// the groups until the move completes. This method may poll for completion.
|
||||
// Polling can be canceled by passing the cancel channel argument. The channel
|
||||
// will be used to cancel polling and any outstanding HTTP requests.
|
||||
// ListComplete gets all elements from the list without paging.
|
||||
func (client GroupClient) ListComplete(filter string, expand string, top *int32, cancel <-chan struct{}) (<-chan GenericResource, <-chan error) {
|
||||
resultChan := make(chan GenericResource)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.List(filter, expand, top)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
for list.NextLink != nil {
|
||||
list, err = client.ListNextResults(list)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
// ListByResourceGroup get all the resources for a resource group.
|
||||
//
|
||||
// sourceResourceGroupName is the name of the resource group containing the
|
||||
// rsources to move. parameters is parameters for moving resources.
|
||||
// resourceGroupName is the resource group with the resources to get. filter is the filter to apply on the operation.
|
||||
// expand is the $expand query parameter top is the number of results to return. If null is passed, returns all
|
||||
// resources.
|
||||
func (client GroupClient) ListByResourceGroup(resourceGroupName string, filter string, expand string, top *int32) (result ListResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "resources.GroupClient", "ListByResourceGroup")
|
||||
}
|
||||
|
||||
req, err := client.ListByResourceGroupPreparer(resourceGroupName, filter, expand, top)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.GroupClient", "ListByResourceGroup", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListByResourceGroupSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "resources.GroupClient", "ListByResourceGroup", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListByResourceGroupResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.GroupClient", "ListByResourceGroup", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
|
||||
func (client GroupClient) ListByResourceGroupPreparer(resourceGroupName string, filter string, expand string, top *int32) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
if len(filter) > 0 {
|
||||
queryParameters["$filter"] = autorest.Encode("query", filter)
|
||||
}
|
||||
if len(expand) > 0 {
|
||||
queryParameters["$expand"] = autorest.Encode("query", expand)
|
||||
}
|
||||
if top != nil {
|
||||
queryParameters["$top"] = autorest.Encode("query", *top)
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare(&http.Request{})
|
||||
}
|
||||
|
||||
// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client GroupClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req)
|
||||
}
|
||||
|
||||
// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client GroupClient) ListByResourceGroupResponder(resp *http.Response) (result ListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroupNextResults retrieves the next set of results, if any.
|
||||
func (client GroupClient) ListByResourceGroupNextResults(lastResults ListResult) (result ListResult, err error) {
|
||||
req, err := lastResults.ListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "resources.GroupClient", "ListByResourceGroup", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListByResourceGroupSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "resources.GroupClient", "ListByResourceGroup", resp, "Failure sending next results request")
|
||||
}
|
||||
|
||||
result, err = client.ListByResourceGroupResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.GroupClient", "ListByResourceGroup", resp, "Failure responding to next results request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroupComplete gets all elements from the list without paging.
|
||||
func (client GroupClient) ListByResourceGroupComplete(resourceGroupName string, filter string, expand string, top *int32, cancel <-chan struct{}) (<-chan GenericResource, <-chan error) {
|
||||
resultChan := make(chan GenericResource)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.ListByResourceGroup(resourceGroupName, filter, expand, top)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
for list.NextLink != nil {
|
||||
list, err = client.ListByResourceGroupNextResults(list)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
// MoveResources the resources to move must be in the same source resource group. The target resource group may be in a
|
||||
// different subscription. When moving resources, both the source group and the target group are locked for the
|
||||
// duration of the operation. Write and delete operations are blocked on the groups until the move completes. This
|
||||
// method may poll for completion. Polling can be canceled by passing the cancel channel argument. The channel will be
|
||||
// used to cancel polling and any outstanding HTTP requests.
|
||||
//
|
||||
// sourceResourceGroupName is the name of the resource group containing the resources to move. parameters is parameters
|
||||
// for moving resources.
|
||||
func (client GroupClient) MoveResources(sourceResourceGroupName string, parameters MoveInfo, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) {
|
||||
resultChan := make(chan autorest.Response, 1)
|
||||
errChan := make(chan error, 1)
|
||||
@@ -829,8 +1013,10 @@ func (client GroupClient) MoveResources(sourceResourceGroupName string, paramete
|
||||
var err error
|
||||
var result autorest.Response
|
||||
defer func() {
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
}
|
||||
resultChan <- result
|
||||
errChan <- err
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
@@ -862,7 +1048,7 @@ func (client GroupClient) MoveResourcesPreparer(sourceResourceGroupName string,
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -896,3 +1082,100 @@ func (client GroupClient) MoveResourcesResponder(resp *http.Response) (result au
|
||||
result.Response = resp
|
||||
return
|
||||
}
|
||||
|
||||
// ValidateMoveResources this operation checks whether the specified resources can be moved to the target. The
|
||||
// resources to move must be in the same source resource group. The target resource group may be in a different
|
||||
// subscription. If validation succeeds, it returns HTTP response code 204 (no content). If validation fails, it
|
||||
// returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location header value to
|
||||
// check the result of the long-running operation. This method may poll for completion. Polling can be canceled by
|
||||
// passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests.
|
||||
//
|
||||
// sourceResourceGroupName is the name of the resource group containing the resources to validate for move. parameters
|
||||
// is parameters for moving resources.
|
||||
func (client GroupClient) ValidateMoveResources(sourceResourceGroupName string, parameters MoveInfo, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) {
|
||||
resultChan := make(chan autorest.Response, 1)
|
||||
errChan := make(chan error, 1)
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: sourceResourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "sourceResourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "sourceResourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "sourceResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
|
||||
errChan <- validation.NewErrorWithValidationError(err, "resources.GroupClient", "ValidateMoveResources")
|
||||
close(errChan)
|
||||
close(resultChan)
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
go func() {
|
||||
var err error
|
||||
var result autorest.Response
|
||||
defer func() {
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
}
|
||||
resultChan <- result
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
req, err := client.ValidateMoveResourcesPreparer(sourceResourceGroupName, parameters, cancel)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.GroupClient", "ValidateMoveResources", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ValidateMoveResourcesSender(req)
|
||||
if err != nil {
|
||||
result.Response = resp
|
||||
err = autorest.NewErrorWithError(err, "resources.GroupClient", "ValidateMoveResources", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ValidateMoveResourcesResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.GroupClient", "ValidateMoveResources", resp, "Failure responding to request")
|
||||
}
|
||||
}()
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
// ValidateMoveResourcesPreparer prepares the ValidateMoveResources request.
|
||||
func (client GroupClient) ValidateMoveResourcesPreparer(sourceResourceGroupName string, parameters MoveInfo, cancel <-chan struct{}) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"sourceResourceGroupName": autorest.Encode("path", sourceResourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsJSON(),
|
||||
autorest.AsPost(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/validateMoveResources", pathParameters),
|
||||
autorest.WithJSON(parameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare(&http.Request{Cancel: cancel})
|
||||
}
|
||||
|
||||
// ValidateMoveResourcesSender sends the ValidateMoveResources request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client GroupClient) ValidateMoveResourcesSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client,
|
||||
req,
|
||||
azure.DoPollForAsynchronous(client.PollingDelay))
|
||||
}
|
||||
|
||||
// ValidateMoveResourcesResponder handles the response to the ValidateMoveResources request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client GroupClient) ValidateMoveResourcesResponder(resp *http.Response) (result autorest.Response, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent, http.StatusConflict),
|
||||
autorest.ByClosing())
|
||||
result.Response = resp
|
||||
return
|
||||
}
|
||||
+90
-159
@@ -14,9 +14,8 @@ package resources
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
@@ -25,8 +24,7 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// GroupsClient is the provides operations for working with resources and
|
||||
// resource groups.
|
||||
// GroupsClient is the provides operations for working with resources and resource groups.
|
||||
type GroupsClient struct {
|
||||
ManagementClient
|
||||
}
|
||||
@@ -43,8 +41,7 @@ func NewGroupsClientWithBaseURI(baseURI string, subscriptionID string) GroupsCli
|
||||
|
||||
// CheckExistence checks whether a resource group exists.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to check. The name is
|
||||
// case insensitive.
|
||||
// resourceGroupName is the name of the resource group to check. The name is case insensitive.
|
||||
func (client GroupsClient) CheckExistence(resourceGroupName string) (result autorest.Response, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -82,7 +79,7 @@ func (client GroupsClient) CheckExistencePreparer(resourceGroupName string) (*ht
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -113,10 +110,10 @@ func (client GroupsClient) CheckExistenceResponder(resp *http.Response) (result
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdate creates a resource group.
|
||||
// CreateOrUpdate creates or updates a resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to create or update.
|
||||
// parameters is parameters supplied to the create or update a resource group.
|
||||
// resourceGroupName is the name of the resource group to create or update. parameters is parameters supplied to the
|
||||
// create or update a resource group.
|
||||
func (client GroupsClient) CreateOrUpdate(resourceGroupName string, parameters Group) (result Group, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -156,7 +153,7 @@ func (client GroupsClient) CreateOrUpdatePreparer(resourceGroupName string, para
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -190,14 +187,12 @@ func (client GroupsClient) CreateOrUpdateResponder(resp *http.Response) (result
|
||||
return
|
||||
}
|
||||
|
||||
// Delete when you delete a resource group, all of its resources are also
|
||||
// deleted. Deleting a resource group deletes all of its template deployments
|
||||
// and currently stored operations. This method may poll for completion.
|
||||
// Polling can be canceled by passing the cancel channel argument. The channel
|
||||
// will be used to cancel polling and any outstanding HTTP requests.
|
||||
// Delete when you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes
|
||||
// all of its template deployments and currently stored operations. This method may poll for completion. Polling can be
|
||||
// canceled by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP
|
||||
// requests.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to delete. The name is
|
||||
// case insensitive.
|
||||
// resourceGroupName is the name of the resource group to delete. The name is case insensitive.
|
||||
func (client GroupsClient) Delete(resourceGroupName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) {
|
||||
resultChan := make(chan autorest.Response, 1)
|
||||
errChan := make(chan error, 1)
|
||||
@@ -216,8 +211,10 @@ func (client GroupsClient) Delete(resourceGroupName string, cancel <-chan struct
|
||||
var err error
|
||||
var result autorest.Response
|
||||
defer func() {
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
}
|
||||
resultChan <- result
|
||||
errChan <- err
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
@@ -249,7 +246,7 @@ func (client GroupsClient) DeletePreparer(resourceGroupName string, cancel <-cha
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -284,8 +281,8 @@ func (client GroupsClient) DeleteResponder(resp *http.Response) (result autorest
|
||||
|
||||
// ExportTemplate captures the specified resource group as a template.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to export as a template.
|
||||
// parameters is parameters for exporting the template.
|
||||
// resourceGroupName is the name of the resource group to export as a template. parameters is parameters for exporting
|
||||
// the template.
|
||||
func (client GroupsClient) ExportTemplate(resourceGroupName string, parameters ExportTemplateRequest) (result GroupExportResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -323,7 +320,7 @@ func (client GroupsClient) ExportTemplatePreparer(resourceGroupName string, para
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -359,8 +356,7 @@ func (client GroupsClient) ExportTemplateResponder(resp *http.Response) (result
|
||||
|
||||
// Get gets a resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to get. The name is case
|
||||
// insensitive.
|
||||
// resourceGroupName is the name of the resource group to get. The name is case insensitive.
|
||||
func (client GroupsClient) Get(resourceGroupName string) (result Group, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -398,7 +394,7 @@ func (client GroupsClient) GetPreparer(resourceGroupName string) (*http.Request,
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -432,8 +428,8 @@ func (client GroupsClient) GetResponder(resp *http.Response) (result Group, err
|
||||
|
||||
// List gets all the resource groups for a subscription.
|
||||
//
|
||||
// filter is the filter to apply on the operation. top is the number of results
|
||||
// to return. If null is passed, returns all resource groups.
|
||||
// filter is the filter to apply on the operation. top is the number of results to return. If null is passed, returns
|
||||
// all resource groups.
|
||||
func (client GroupsClient) List(filter string, top *int32) (result GroupListResult, err error) {
|
||||
req, err := client.ListPreparer(filter, top)
|
||||
if err != nil {
|
||||
@@ -462,7 +458,7 @@ func (client GroupsClient) ListPreparer(filter string, top *int32) (*http.Reques
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -524,159 +520,94 @@ func (client GroupsClient) ListNextResults(lastResults GroupListResult) (result
|
||||
return
|
||||
}
|
||||
|
||||
// ListResources get all the resources for a resource group.
|
||||
// ListComplete gets all elements from the list without paging.
|
||||
func (client GroupsClient) ListComplete(filter string, top *int32, cancel <-chan struct{}) (<-chan Group, <-chan error) {
|
||||
resultChan := make(chan Group)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.List(filter, top)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
for list.NextLink != nil {
|
||||
list, err = client.ListNextResults(list)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
// Update resource groups can be updated through a simple PATCH operation to a group address. The format of the request
|
||||
// is the same as that for creating a resource group. If a field is unspecified, the current value is retained.
|
||||
//
|
||||
// resourceGroupName is the resource group with the resources to get. filter is
|
||||
// the filter to apply on the operation. expand is the $expand query parameter
|
||||
// top is the number of results to return. If null is passed, returns all
|
||||
// resources.
|
||||
func (client GroupsClient) ListResources(resourceGroupName string, filter string, expand string, top *int32) (result ListResult, err error) {
|
||||
// resourceGroupName is the name of the resource group to update. The name is case insensitive. parameters is
|
||||
// parameters supplied to update a resource group.
|
||||
func (client GroupsClient) Update(resourceGroupName string, parameters GroupPatchable) (result Group, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "resources.GroupsClient", "ListResources")
|
||||
return result, validation.NewErrorWithValidationError(err, "resources.GroupsClient", "Update")
|
||||
}
|
||||
|
||||
req, err := client.ListResourcesPreparer(resourceGroupName, filter, expand, top)
|
||||
req, err := client.UpdatePreparer(resourceGroupName, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.GroupsClient", "ListResources", nil, "Failure preparing request")
|
||||
err = autorest.NewErrorWithError(err, "resources.GroupsClient", "Update", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListResourcesSender(req)
|
||||
resp, err := client.UpdateSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "resources.GroupsClient", "ListResources", resp, "Failure sending request")
|
||||
err = autorest.NewErrorWithError(err, "resources.GroupsClient", "Update", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListResourcesResponder(resp)
|
||||
result, err = client.UpdateResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.GroupsClient", "ListResources", resp, "Failure responding to request")
|
||||
err = autorest.NewErrorWithError(err, "resources.GroupsClient", "Update", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListResourcesPreparer prepares the ListResources request.
|
||||
func (client GroupsClient) ListResourcesPreparer(resourceGroupName string, filter string, expand string, top *int32) (*http.Request, error) {
|
||||
// UpdatePreparer prepares the Update request.
|
||||
func (client GroupsClient) UpdatePreparer(resourceGroupName string, parameters GroupPatchable) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
if len(filter) > 0 {
|
||||
queryParameters["$filter"] = autorest.Encode("query", filter)
|
||||
}
|
||||
if len(expand) > 0 {
|
||||
queryParameters["$expand"] = autorest.Encode("query", expand)
|
||||
}
|
||||
if top != nil {
|
||||
queryParameters["$top"] = autorest.Encode("query", *top)
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare(&http.Request{})
|
||||
}
|
||||
|
||||
// ListResourcesSender sends the ListResources request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client GroupsClient) ListResourcesSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req)
|
||||
}
|
||||
|
||||
// ListResourcesResponder handles the response to the ListResources request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client GroupsClient) ListResourcesResponder(resp *http.Response) (result ListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// ListResourcesNextResults retrieves the next set of results, if any.
|
||||
func (client GroupsClient) ListResourcesNextResults(lastResults ListResult) (result ListResult, err error) {
|
||||
req, err := lastResults.ListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "resources.GroupsClient", "ListResources", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListResourcesSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "resources.GroupsClient", "ListResources", resp, "Failure sending next results request")
|
||||
}
|
||||
|
||||
result, err = client.ListResourcesResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.GroupsClient", "ListResources", resp, "Failure responding to next results request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// Patch resource groups can be updated through a simple PATCH operation to a
|
||||
// group address. The format of the request is the same as that for creating a
|
||||
// resource group. If a field is unspecified, the current value is retained.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to update. The name is
|
||||
// case insensitive. parameters is parameters supplied to update a resource
|
||||
// group.
|
||||
func (client GroupsClient) Patch(resourceGroupName string, parameters Group) (result Group, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "resources.GroupsClient", "Patch")
|
||||
}
|
||||
|
||||
req, err := client.PatchPreparer(resourceGroupName, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.GroupsClient", "Patch", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.PatchSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "resources.GroupsClient", "Patch", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.PatchResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.GroupsClient", "Patch", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// PatchPreparer prepares the Patch request.
|
||||
func (client GroupsClient) PatchPreparer(resourceGroupName string, parameters Group) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -691,15 +622,15 @@ func (client GroupsClient) PatchPreparer(resourceGroupName string, parameters Gr
|
||||
return preparer.Prepare(&http.Request{})
|
||||
}
|
||||
|
||||
// PatchSender sends the Patch request. The method will close the
|
||||
// UpdateSender sends the Update request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client GroupsClient) PatchSender(req *http.Request) (*http.Response, error) {
|
||||
func (client GroupsClient) UpdateSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req)
|
||||
}
|
||||
|
||||
// PatchResponder handles the response to the Patch request. The method always
|
||||
// UpdateResponder handles the response to the Update request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client GroupsClient) PatchResponder(resp *http.Response) (result Group, err error) {
|
||||
func (client GroupsClient) UpdateResponder(resp *http.Response) (result Group, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
|
||||
+21
-19
@@ -14,9 +14,8 @@ package resources
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
@@ -39,8 +38,7 @@ const (
|
||||
type ResourceIdentityType string
|
||||
|
||||
const (
|
||||
// SystemAssigned specifies the system assigned state for resource identity
|
||||
// type.
|
||||
// SystemAssigned specifies the system assigned state for resource identity type.
|
||||
SystemAssigned ResourceIdentityType = "SystemAssigned"
|
||||
)
|
||||
|
||||
@@ -168,8 +166,7 @@ type DeploymentProperties struct {
|
||||
DebugSetting *DebugSetting `json:"debugSetting,omitempty"`
|
||||
}
|
||||
|
||||
// DeploymentPropertiesExtended is deployment properties with additional
|
||||
// details.
|
||||
// DeploymentPropertiesExtended is deployment properties with additional details.
|
||||
type DeploymentPropertiesExtended struct {
|
||||
ProvisioningState *string `json:"provisioningState,omitempty"`
|
||||
CorrelationID *string `json:"correlationId,omitempty"`
|
||||
@@ -185,8 +182,7 @@ type DeploymentPropertiesExtended struct {
|
||||
DebugSetting *DebugSetting `json:"debugSetting,omitempty"`
|
||||
}
|
||||
|
||||
// DeploymentValidateResult is information from validate template deployment
|
||||
// response.
|
||||
// DeploymentValidateResult is information from validate template deployment response.
|
||||
type DeploymentValidateResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
Error *ManagementErrorWithDetails `json:"error,omitempty"`
|
||||
@@ -233,7 +229,7 @@ type Group struct {
|
||||
Tags *map[string]*string `json:"tags,omitempty"`
|
||||
}
|
||||
|
||||
// GroupExportResult is
|
||||
// GroupExportResult is resource group export result.
|
||||
type GroupExportResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
Template *map[string]interface{} `json:"template,omitempty"`
|
||||
@@ -265,12 +261,20 @@ func (client GroupListResult) GroupListResultPreparer() (*http.Request, error) {
|
||||
autorest.WithBaseURL(to.String(client.NextLink)))
|
||||
}
|
||||
|
||||
// GroupPatchable is resource group information.
|
||||
type GroupPatchable struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
Properties *GroupProperties `json:"properties,omitempty"`
|
||||
ManagedBy *string `json:"managedBy,omitempty"`
|
||||
Tags *map[string]*string `json:"tags,omitempty"`
|
||||
}
|
||||
|
||||
// GroupProperties is the resource group properties.
|
||||
type GroupProperties struct {
|
||||
ProvisioningState *string `json:"provisioningState,omitempty"`
|
||||
}
|
||||
|
||||
// HTTPMessage is
|
||||
// HTTPMessage is HTTP message.
|
||||
type HTTPMessage struct {
|
||||
Content *map[string]interface{} `json:"content,omitempty"`
|
||||
}
|
||||
@@ -301,7 +305,7 @@ func (client ListResult) ListResultPreparer() (*http.Request, error) {
|
||||
autorest.WithBaseURL(to.String(client.NextLink)))
|
||||
}
|
||||
|
||||
// ManagementErrorWithDetails is
|
||||
// ManagementErrorWithDetails is the detailed error message of resource management.
|
||||
type ManagementErrorWithDetails struct {
|
||||
Code *string `json:"code,omitempty"`
|
||||
Message *string `json:"message,omitempty"`
|
||||
@@ -315,8 +319,7 @@ type MoveInfo struct {
|
||||
TargetResourceGroup *string `json:"targetResourceGroup,omitempty"`
|
||||
}
|
||||
|
||||
// ParametersLink is entity representing the reference to the deployment
|
||||
// paramaters.
|
||||
// ParametersLink is entity representing the reference to the deployment paramaters.
|
||||
type ParametersLink struct {
|
||||
URI *string `json:"uri,omitempty"`
|
||||
ContentVersion *string `json:"contentVersion,omitempty"`
|
||||
@@ -358,8 +361,7 @@ func (client ProviderListResult) ProviderListResultPreparer() (*http.Request, er
|
||||
autorest.WithBaseURL(to.String(client.NextLink)))
|
||||
}
|
||||
|
||||
// ProviderOperationDisplayProperties is resource provider operation's display
|
||||
// properties.
|
||||
// ProviderOperationDisplayProperties is resource provider operation's display properties.
|
||||
type ProviderOperationDisplayProperties struct {
|
||||
Publisher *string `json:"publisher,omitempty"`
|
||||
Provider *string `json:"provider,omitempty"`
|
||||
@@ -377,7 +379,7 @@ type ProviderResourceType struct {
|
||||
Properties *map[string]*string `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// Resource is
|
||||
// Resource is resource.
|
||||
type Resource struct {
|
||||
ID *string `json:"id,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
@@ -386,7 +388,7 @@ type Resource struct {
|
||||
Tags *map[string]*string `json:"tags,omitempty"`
|
||||
}
|
||||
|
||||
// Sku is sKU for the resource.
|
||||
// Sku is SKU for the resource.
|
||||
type Sku struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
Tier *string `json:"tier,omitempty"`
|
||||
@@ -396,7 +398,7 @@ type Sku struct {
|
||||
Capacity *int32 `json:"capacity,omitempty"`
|
||||
}
|
||||
|
||||
// SubResource is
|
||||
// SubResource is sub-resource.
|
||||
type SubResource struct {
|
||||
ID *string `json:"id,omitempty"`
|
||||
}
|
||||
|
||||
+60
-23
@@ -14,9 +14,8 @@ package resources
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
@@ -24,8 +23,7 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// ProvidersClient is the provides operations for working with resources and
|
||||
// resource groups.
|
||||
// ProvidersClient is the provides operations for working with resources and resource groups.
|
||||
type ProvidersClient struct {
|
||||
ManagementClient
|
||||
}
|
||||
@@ -35,17 +33,15 @@ func NewProvidersClient(subscriptionID string) ProvidersClient {
|
||||
return NewProvidersClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewProvidersClientWithBaseURI creates an instance of the ProvidersClient
|
||||
// client.
|
||||
// NewProvidersClientWithBaseURI creates an instance of the ProvidersClient client.
|
||||
func NewProvidersClientWithBaseURI(baseURI string, subscriptionID string) ProvidersClient {
|
||||
return ProvidersClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// Get gets the specified resource provider.
|
||||
//
|
||||
// resourceProviderNamespace is the namespace of the resource provider. expand
|
||||
// is the $expand query parameter. For example, to include property aliases in
|
||||
// response, use $expand=resourceTypes/aliases.
|
||||
// resourceProviderNamespace is the namespace of the resource provider. expand is the $expand query parameter. For
|
||||
// example, to include property aliases in response, use $expand=resourceTypes/aliases.
|
||||
func (client ProvidersClient) Get(resourceProviderNamespace string, expand string) (result Provider, err error) {
|
||||
req, err := client.GetPreparer(resourceProviderNamespace, expand)
|
||||
if err != nil {
|
||||
@@ -75,7 +71,7 @@ func (client ProvidersClient) GetPreparer(resourceProviderNamespace string, expa
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -112,11 +108,9 @@ func (client ProvidersClient) GetResponder(resp *http.Response) (result Provider
|
||||
|
||||
// List gets all resource providers for a subscription.
|
||||
//
|
||||
// top is the number of results to return. If null is passed returns all
|
||||
// deployments. expand is the properties to include in the results. For
|
||||
// example, use &$expand=metadata in the query string to retrieve resource
|
||||
// provider metadata. To include property aliases in response, use
|
||||
// $expand=resourceTypes/aliases.
|
||||
// top is the number of results to return. If null is passed returns all deployments. expand is the properties to
|
||||
// include in the results. For example, use &$expand=metadata in the query string to retrieve resource provider
|
||||
// metadata. To include property aliases in response, use $expand=resourceTypes/aliases.
|
||||
func (client ProvidersClient) List(top *int32, expand string) (result ProviderListResult, err error) {
|
||||
req, err := client.ListPreparer(top, expand)
|
||||
if err != nil {
|
||||
@@ -145,7 +139,7 @@ func (client ProvidersClient) ListPreparer(top *int32, expand string) (*http.Req
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -207,10 +201,54 @@ func (client ProvidersClient) ListNextResults(lastResults ProviderListResult) (r
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete gets all elements from the list without paging.
|
||||
func (client ProvidersClient) ListComplete(top *int32, expand string, cancel <-chan struct{}) (<-chan Provider, <-chan error) {
|
||||
resultChan := make(chan Provider)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.List(top, expand)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
for list.NextLink != nil {
|
||||
list, err = client.ListNextResults(list)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
// Register registers a subscription with a resource provider.
|
||||
//
|
||||
// resourceProviderNamespace is the namespace of the resource provider to
|
||||
// register.
|
||||
// resourceProviderNamespace is the namespace of the resource provider to register.
|
||||
func (client ProvidersClient) Register(resourceProviderNamespace string) (result Provider, err error) {
|
||||
req, err := client.RegisterPreparer(resourceProviderNamespace)
|
||||
if err != nil {
|
||||
@@ -240,7 +278,7 @@ func (client ProvidersClient) RegisterPreparer(resourceProviderNamespace string)
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -274,8 +312,7 @@ func (client ProvidersClient) RegisterResponder(resp *http.Response) (result Pro
|
||||
|
||||
// Unregister unregisters a subscription from a resource provider.
|
||||
//
|
||||
// resourceProviderNamespace is the namespace of the resource provider to
|
||||
// unregister.
|
||||
// resourceProviderNamespace is the namespace of the resource provider to unregister.
|
||||
func (client ProvidersClient) Unregister(resourceProviderNamespace string) (result Provider, err error) {
|
||||
req, err := client.UnregisterPreparer(resourceProviderNamespace)
|
||||
if err != nil {
|
||||
@@ -305,7 +342,7 @@ func (client ProvidersClient) UnregisterPreparer(resourceProviderNamespace strin
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
+58
-19
@@ -14,9 +14,8 @@ package resources
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
@@ -24,8 +23,7 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// TagsClient is the provides operations for working with resources and
|
||||
// resource groups.
|
||||
// TagsClient is the provides operations for working with resources and resource groups.
|
||||
type TagsClient struct {
|
||||
ManagementClient
|
||||
}
|
||||
@@ -40,9 +38,8 @@ func NewTagsClientWithBaseURI(baseURI string, subscriptionID string) TagsClient
|
||||
return TagsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// CreateOrUpdate the tag name can have a maximum of 512 characters and is case
|
||||
// insensitive. Tag names created by Azure have prefixes of microsoft, azure,
|
||||
// or windows. You cannot create tags with one of these prefixes.
|
||||
// CreateOrUpdate the tag name can have a maximum of 512 characters and is case insensitive. Tag names created by Azure
|
||||
// have prefixes of microsoft, azure, or windows. You cannot create tags with one of these prefixes.
|
||||
//
|
||||
// tagName is the name of the tag to create.
|
||||
func (client TagsClient) CreateOrUpdate(tagName string) (result TagDetails, err error) {
|
||||
@@ -74,7 +71,7 @@ func (client TagsClient) CreateOrUpdatePreparer(tagName string) (*http.Request,
|
||||
"tagName": autorest.Encode("path", tagName),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -106,8 +103,7 @@ func (client TagsClient) CreateOrUpdateResponder(resp *http.Response) (result Ta
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdateValue creates a tag value. The name of the tag must already
|
||||
// exist.
|
||||
// CreateOrUpdateValue creates a tag value. The name of the tag must already exist.
|
||||
//
|
||||
// tagName is the name of the tag. tagValue is the value of the tag to create.
|
||||
func (client TagsClient) CreateOrUpdateValue(tagName string, tagValue string) (result TagValue, err error) {
|
||||
@@ -140,7 +136,7 @@ func (client TagsClient) CreateOrUpdateValuePreparer(tagName string, tagValue st
|
||||
"tagValue": autorest.Encode("path", tagValue),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -172,8 +168,7 @@ func (client TagsClient) CreateOrUpdateValueResponder(resp *http.Response) (resu
|
||||
return
|
||||
}
|
||||
|
||||
// Delete you must remove all values from a resource tag before you can delete
|
||||
// it.
|
||||
// Delete you must remove all values from a resource tag before you can delete it.
|
||||
//
|
||||
// tagName is the name of the tag.
|
||||
func (client TagsClient) Delete(tagName string) (result autorest.Response, err error) {
|
||||
@@ -205,7 +200,7 @@ func (client TagsClient) DeletePreparer(tagName string) (*http.Request, error) {
|
||||
"tagName": autorest.Encode("path", tagName),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -269,7 +264,7 @@ func (client TagsClient) DeleteValuePreparer(tagName string, tagValue string) (*
|
||||
"tagValue": autorest.Encode("path", tagValue),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -300,8 +295,7 @@ func (client TagsClient) DeleteValueResponder(resp *http.Response) (result autor
|
||||
return
|
||||
}
|
||||
|
||||
// List gets the names and values of all resource tags that are defined in a
|
||||
// subscription.
|
||||
// List gets the names and values of all resource tags that are defined in a subscription.
|
||||
func (client TagsClient) List() (result TagsListResult, err error) {
|
||||
req, err := client.ListPreparer()
|
||||
if err != nil {
|
||||
@@ -330,7 +324,7 @@ func (client TagsClient) ListPreparer() (*http.Request, error) {
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2016-09-01"
|
||||
const APIVersion = "2017-05-10"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -385,3 +379,48 @@ func (client TagsClient) ListNextResults(lastResults TagsListResult) (result Tag
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete gets all elements from the list without paging.
|
||||
func (client TagsClient) ListComplete(cancel <-chan struct{}) (<-chan TagDetails, <-chan error) {
|
||||
resultChan := make(chan TagDetails)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.List()
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
for list.NextLink != nil {
|
||||
list, err = client.ListNextResults(list)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
+4
-5
@@ -14,16 +14,15 @@ package resources
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
// UserAgent returns the UserAgent string to use when sending http.Requests.
|
||||
func UserAgent() string {
|
||||
return "Azure-SDK-For-Go/v10.1.0-beta arm-resources/2016-09-01"
|
||||
return "Azure-SDK-For-Go/v11.0.0-beta arm-resources/2017-05-10"
|
||||
}
|
||||
|
||||
// Version returns the semantic version (see http://semver.org) of the client.
|
||||
func Version() string {
|
||||
return "v10.1.0-beta"
|
||||
return "v11.0.0-beta"
|
||||
}
|
||||
|
||||
+5
-8
@@ -1,9 +1,7 @@
|
||||
// Package subscriptions implements the Azure ARM Subscriptions service API
|
||||
// version 2016-06-01.
|
||||
// Package subscriptions implements the Azure ARM Subscriptions service API version 2016-06-01.
|
||||
//
|
||||
// All resource groups and resources exist within subscriptions. These
|
||||
// operation enable you get information about your subscriptions and tenants. A
|
||||
// tenant is a dedicated instance of Azure Active Directory (Azure AD) for your
|
||||
// All resource groups and resources exist within subscriptions. These operation enable you get information about your
|
||||
// subscriptions and tenants. A tenant is a dedicated instance of Azure Active Directory (Azure AD) for your
|
||||
// organization.
|
||||
package subscriptions
|
||||
|
||||
@@ -21,9 +19,8 @@ package subscriptions
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
|
||||
Generated
Vendored
Executable → Regular
+52
-10
@@ -14,9 +14,8 @@ package subscriptions
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
@@ -24,10 +23,9 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// GroupClient is the all resource groups and resources exist within
|
||||
// subscriptions. These operation enable you get information about your
|
||||
// subscriptions and tenants. A tenant is a dedicated instance of Azure Active
|
||||
// Directory (Azure AD) for your organization.
|
||||
// GroupClient is the all resource groups and resources exist within subscriptions. These operation enable you get
|
||||
// information about your subscriptions and tenants. A tenant is a dedicated instance of Azure Active Directory (Azure
|
||||
// AD) for your organization.
|
||||
type GroupClient struct {
|
||||
ManagementClient
|
||||
}
|
||||
@@ -186,9 +184,53 @@ func (client GroupClient) ListNextResults(lastResults ListResult) (result ListRe
|
||||
return
|
||||
}
|
||||
|
||||
// ListLocations this operation provides all the locations that are available
|
||||
// for resource providers; however, each resource provider may support a subset
|
||||
// of this list.
|
||||
// ListComplete gets all elements from the list without paging.
|
||||
func (client GroupClient) ListComplete(cancel <-chan struct{}) (<-chan Subscription, <-chan error) {
|
||||
resultChan := make(chan Subscription)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.List()
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
for list.NextLink != nil {
|
||||
list, err = client.ListNextResults(list)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
// ListLocations this operation provides all the locations that are available for resource providers; however, each
|
||||
// resource provider may support a subset of this list.
|
||||
//
|
||||
// subscriptionID is the ID of the target subscription.
|
||||
func (client GroupClient) ListLocations(subscriptionID string) (result LocationListResult, err error) {
|
||||
+3
-5
@@ -14,9 +14,8 @@ package subscriptions
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
@@ -28,8 +27,7 @@ import (
|
||||
type SpendingLimit string
|
||||
|
||||
const (
|
||||
// CurrentPeriodOff specifies the current period off state for spending
|
||||
// limit.
|
||||
// CurrentPeriodOff specifies the current period off state for spending limit.
|
||||
CurrentPeriodOff SpendingLimit = "CurrentPeriodOff"
|
||||
// Off specifies the off state for spending limit.
|
||||
Off SpendingLimit = "Off"
|
||||
|
||||
+50
-7
@@ -14,9 +14,8 @@ package subscriptions
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
@@ -24,10 +23,9 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// TenantsClient is the all resource groups and resources exist within
|
||||
// subscriptions. These operation enable you get information about your
|
||||
// subscriptions and tenants. A tenant is a dedicated instance of Azure Active
|
||||
// Directory (Azure AD) for your organization.
|
||||
// TenantsClient is the all resource groups and resources exist within subscriptions. These operation enable you get
|
||||
// information about your subscriptions and tenants. A tenant is a dedicated instance of Azure Active Directory (Azure
|
||||
// AD) for your organization.
|
||||
type TenantsClient struct {
|
||||
ManagementClient
|
||||
}
|
||||
@@ -122,3 +120,48 @@ func (client TenantsClient) ListNextResults(lastResults TenantListResult) (resul
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete gets all elements from the list without paging.
|
||||
func (client TenantsClient) ListComplete(cancel <-chan struct{}) (<-chan TenantIDDescription, <-chan error) {
|
||||
resultChan := make(chan TenantIDDescription)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.List()
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
for list.NextLink != nil {
|
||||
list, err = client.ListNextResults(list)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
+4
-5
@@ -14,16 +14,15 @@ package subscriptions
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
// UserAgent returns the UserAgent string to use when sending http.Requests.
|
||||
func UserAgent() string {
|
||||
return "Azure-SDK-For-Go/v10.1.0-beta arm-subscriptions/2016-06-01"
|
||||
return "Azure-SDK-For-Go/v11.0.0-beta arm-subscriptions/2016-06-01"
|
||||
}
|
||||
|
||||
// Version returns the semantic version (see http://semver.org) of the client.
|
||||
func Version() string {
|
||||
return "v10.1.0-beta"
|
||||
return "v11.0.0-beta"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user