vendor: update all dependencies to latest versions

This commit is contained in:
Nick Craig-Wood
2017-09-30 15:27:27 +01:00
parent 911d121bb9
commit b017fcfe9a
3048 changed files with 537055 additions and 189679 deletions
+145 -65
View File
@@ -14,9 +14,8 @@ package batch
// 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"
@@ -40,20 +39,16 @@ func NewAccountClientWithBaseURI(baseURI string, subscriptionID string) AccountC
return AccountClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// Create creates a new Batch account with the specified parameters. Existing
// accounts cannot be updated with this API and should instead be updated with
// the Update Batch Account API. 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.
// Create creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API
// and should instead be updated with the Update Batch Account API. 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 new
// Batch account. accountName is a name for the Batch account which must be
// unique within the region. Batch account names must be between 3 and 24
// characters in length and must use only numbers and lowercase letters. This
// name is used as part of the DNS name that is used to access the Batch
// service in the region in which the account is created. For example:
// http://accountname.region.batch.azure.com/. parameters is additional
// parameters for account creation.
// resourceGroupName is the name of the resource group that contains the Batch account. accountName is a name for the
// Batch account which must be unique within the region. Batch account names must be between 3 and 24 characters in
// length and must use only numbers and lowercase letters. This name is used as part of the DNS name that is used to
// access the Batch service in the region in which the account is created. For example:
// http://accountname.region.batch.azure.com/. parameters is additional parameters for account creation.
func (client AccountClient) Create(resourceGroupName string, accountName string, parameters AccountCreateParameters, cancel <-chan struct{}) (<-chan Account, <-chan error) {
resultChan := make(chan Account, 1)
errChan := make(chan error, 1)
@@ -66,12 +61,12 @@ func (client AccountClient) Create(resourceGroupName string, accountName string,
{Target: "accountName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}},
{TargetValue: parameters,
Constraints: []validation.Constraint{{Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil},
{Target: "parameters.AccountBaseProperties", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.AccountBaseProperties.AutoStorage", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.AccountBaseProperties.AutoStorage.StorageAccountID", Name: validation.Null, Rule: true, Chain: nil}}},
{Target: "parameters.AccountBaseProperties.KeyVaultReference", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.AccountBaseProperties.KeyVaultReference.ID", Name: validation.Null, Rule: true, Chain: nil},
{Target: "parameters.AccountBaseProperties.KeyVaultReference.URL", Name: validation.Null, Rule: true, Chain: nil},
{Target: "parameters.AccountCreateProperties", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.AccountCreateProperties.AutoStorage", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.AccountCreateProperties.AutoStorage.StorageAccountID", Name: validation.Null, Rule: true, Chain: nil}}},
{Target: "parameters.AccountCreateProperties.KeyVaultReference", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.AccountCreateProperties.KeyVaultReference.ID", Name: validation.Null, Rule: true, Chain: nil},
{Target: "parameters.AccountCreateProperties.KeyVaultReference.URL", Name: validation.Null, Rule: true, Chain: nil},
}},
}}}}}); err != nil {
errChan <- validation.NewErrorWithValidationError(err, "batch.AccountClient", "Create")
@@ -84,8 +79,10 @@ func (client AccountClient) Create(resourceGroupName string, accountName string,
var err error
var result Account
defer func() {
if err != nil {
errChan <- err
}
resultChan <- result
errChan <- err
close(resultChan)
close(errChan)
}()
@@ -118,7 +115,7 @@ func (client AccountClient) CreatePreparer(resourceGroupName string, accountName
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2017-01-01"
const APIVersion = "2017-05-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -154,13 +151,11 @@ func (client AccountClient) CreateResponder(resp *http.Response) (result Account
return
}
// Delete deletes the specified Batch account. 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 specified Batch account. 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 Batch
// account to be deleted. accountName is the name of the account to be deleted.
// resourceGroupName is the name of the resource group that contains the Batch account. accountName is the name of the
// Batch account.
func (client AccountClient) Delete(resourceGroupName string, accountName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) {
resultChan := make(chan autorest.Response, 1)
errChan := make(chan error, 1)
@@ -181,8 +176,10 @@ func (client AccountClient) Delete(resourceGroupName string, accountName string,
var err error
var result autorest.Response
defer func() {
if err != nil {
errChan <- err
}
resultChan <- result
errChan <- err
close(resultChan)
close(errChan)
}()
@@ -215,7 +212,7 @@ func (client AccountClient) DeletePreparer(resourceGroupName string, accountName
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2017-01-01"
const APIVersion = "2017-05-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -242,7 +239,7 @@ func (client AccountClient) DeleteResponder(resp *http.Response) (result autores
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
@@ -250,8 +247,8 @@ func (client AccountClient) DeleteResponder(resp *http.Response) (result autores
// Get gets information about the specified Batch account.
//
// resourceGroupName is the name of the resource group that contains the Batch
// account. accountName is the name of the account.
// resourceGroupName is the name of the resource group that contains the Batch account. accountName is the name of the
// Batch account.
func (client AccountClient) Get(resourceGroupName string, accountName string) (result Account, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
@@ -292,7 +289,7 @@ func (client AccountClient) GetPreparer(resourceGroupName string, accountName st
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2017-01-01"
const APIVersion = "2017-05-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -324,14 +321,12 @@ func (client AccountClient) GetResponder(resp *http.Response) (result Account, e
return
}
// GetKeys this operation applies only to Batch accounts created with a
// poolAllocationMode of 'BatchService'. If the Batch account was created with
// a poolAllocationMode of 'UserSubscription', clients cannot use access to
// keys to authenticate, and must use Azure Active Directory instead. In this
// case, getting the keys will fail.
// GetKeys this operation applies only to Batch accounts created with a poolAllocationMode of 'BatchService'. If the
// Batch account was created with a poolAllocationMode of 'UserSubscription', clients cannot use access to keys to
// authenticate, and must use Azure Active Directory instead. In this case, getting the keys will fail.
//
// resourceGroupName is the name of the resource group that contains the Batch
// account. accountName is the name of the account.
// resourceGroupName is the name of the resource group that contains the Batch account. accountName is the name of the
// Batch account.
func (client AccountClient) GetKeys(resourceGroupName string, accountName string) (result AccountKeys, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
@@ -372,7 +367,7 @@ func (client AccountClient) GetKeysPreparer(resourceGroupName string, accountNam
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2017-01-01"
const APIVersion = "2017-05-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -404,8 +399,7 @@ func (client AccountClient) GetKeysResponder(resp *http.Response) (result Accoun
return
}
// List gets information about the Batch accounts associated with the
// subscription.
// List gets information about the Batch accounts associated with the subscription.
func (client AccountClient) List() (result AccountListResult, err error) {
req, err := client.ListPreparer()
if err != nil {
@@ -434,7 +428,7 @@ func (client AccountClient) ListPreparer() (*http.Request, error) {
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2017-01-01"
const APIVersion = "2017-05-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -490,11 +484,54 @@ func (client AccountClient) ListNextResults(lastResults AccountListResult) (resu
return
}
// ListByResourceGroup gets information about the Batch accounts associated
// within the specified resource group.
// ListComplete gets all elements from the list without paging.
func (client AccountClient) ListComplete(cancel <-chan struct{}) (<-chan Account, <-chan error) {
resultChan := make(chan Account)
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
}
// ListByResourceGroup gets information about the Batch accounts associated with the specified resource group.
//
// resourceGroupName is the name of the resource group whose Batch accounts to
// list.
// resourceGroupName is the name of the resource group that contains the Batch account.
func (client AccountClient) ListByResourceGroup(resourceGroupName string) (result AccountListResult, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
@@ -530,7 +567,7 @@ func (client AccountClient) ListByResourceGroupPreparer(resourceGroupName string
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2017-01-01"
const APIVersion = "2017-05-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -586,11 +623,55 @@ func (client AccountClient) ListByResourceGroupNextResults(lastResults AccountLi
return
}
// ListByResourceGroupComplete gets all elements from the list without paging.
func (client AccountClient) ListByResourceGroupComplete(resourceGroupName string, cancel <-chan struct{}) (<-chan Account, <-chan error) {
resultChan := make(chan Account)
errChan := make(chan error, 1)
go func() {
defer func() {
close(resultChan)
close(errChan)
}()
list, err := client.ListByResourceGroup(resourceGroupName)
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
}
// RegenerateKey regenerates the specified account key for the Batch account.
//
// resourceGroupName is the name of the resource group that contains the Batch
// account. accountName is the name of the account. parameters is the type of
// key to regenerate.
// resourceGroupName is the name of the resource group that contains the Batch account. accountName is the name of the
// Batch account. parameters is the type of key to regenerate.
func (client AccountClient) RegenerateKey(resourceGroupName string, accountName string, parameters AccountRegenerateKeyParameters) (result AccountKeys, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
@@ -631,7 +712,7 @@ func (client AccountClient) RegenerateKeyPreparer(resourceGroupName string, acco
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2017-01-01"
const APIVersion = "2017-05-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -665,11 +746,11 @@ func (client AccountClient) RegenerateKeyResponder(resp *http.Response) (result
return
}
// SynchronizeAutoStorageKeys synchronizes access keys for the auto storage
// account configured for the specified Batch account.
// SynchronizeAutoStorageKeys synchronizes access keys for the auto-storage account configured for the specified Batch
// account.
//
// resourceGroupName is the name of the resource group that contains the Batch
// account. accountName is the name of the Batch account.
// resourceGroupName is the name of the resource group that contains the Batch account. accountName is the name of the
// Batch account.
func (client AccountClient) SynchronizeAutoStorageKeys(resourceGroupName string, accountName string) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
@@ -710,7 +791,7 @@ func (client AccountClient) SynchronizeAutoStorageKeysPreparer(resourceGroupName
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2017-01-01"
const APIVersion = "2017-05-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -743,9 +824,8 @@ func (client AccountClient) SynchronizeAutoStorageKeysResponder(resp *http.Respo
// Update updates the properties of an existing Batch account.
//
// resourceGroupName is the name of the resource group that contains the Batch
// account. accountName is the name of the account. parameters is additional
// parameters for account update.
// resourceGroupName is the name of the resource group that contains the Batch account. accountName is the name of the
// Batch account. parameters is additional parameters for account update.
func (client AccountClient) Update(resourceGroupName string, accountName string, parameters AccountUpdateParameters) (result Account, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
@@ -786,7 +866,7 @@ func (client AccountClient) UpdatePreparer(resourceGroupName string, accountName
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2017-01-01"
const APIVersion = "2017-05-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
+68 -31
View File
@@ -14,9 +14,8 @@ package batch
// 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"
)
// ApplicationClient is the client for the Application methods of the Batch
// service.
// ApplicationClient is the client for the Application methods of the Batch service.
type ApplicationClient struct {
ManagementClient
}
@@ -36,18 +34,16 @@ func NewApplicationClient(subscriptionID string) ApplicationClient {
return NewApplicationClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewApplicationClientWithBaseURI creates an instance of the ApplicationClient
// client.
// NewApplicationClientWithBaseURI creates an instance of the ApplicationClient client.
func NewApplicationClientWithBaseURI(baseURI string, subscriptionID string) ApplicationClient {
return ApplicationClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// Create adds an application to the specified Batch account.
//
// resourceGroupName is the name of the resource group that contains the Batch
// account. accountName is the name of the Batch account. applicationID is the
// ID of the application. parameters is the parameters for the request.
func (client ApplicationClient) Create(resourceGroupName string, accountName string, applicationID string, parameters *AddApplicationParameters) (result Application, err error) {
// resourceGroupName is the name of the resource group that contains the Batch account. accountName is the name of the
// Batch account. applicationID is the ID of the application. parameters is the parameters for the request.
func (client ApplicationClient) Create(resourceGroupName string, accountName string, applicationID string, parameters *ApplicationCreateParameters) (result Application, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}},
@@ -80,7 +76,7 @@ func (client ApplicationClient) Create(resourceGroupName string, accountName str
}
// CreatePreparer prepares the Create request.
func (client ApplicationClient) CreatePreparer(resourceGroupName string, accountName string, applicationID string, parameters *AddApplicationParameters) (*http.Request, error) {
func (client ApplicationClient) CreatePreparer(resourceGroupName string, accountName string, applicationID string, parameters *ApplicationCreateParameters) (*http.Request, error) {
pathParameters := map[string]interface{}{
"accountName": autorest.Encode("path", accountName),
"applicationId": autorest.Encode("path", applicationID),
@@ -88,7 +84,7 @@ func (client ApplicationClient) CreatePreparer(resourceGroupName string, account
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2017-01-01"
const APIVersion = "2017-05-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -127,9 +123,8 @@ func (client ApplicationClient) CreateResponder(resp *http.Response) (result App
// Delete deletes an application.
//
// resourceGroupName is the name of the resource group that contains the Batch
// account. accountName is the name of the Batch account. applicationID is the
// ID of the application.
// resourceGroupName is the name of the resource group that contains the Batch account. accountName is the name of the
// Batch account. applicationID is the ID of the application.
func (client ApplicationClient) Delete(resourceGroupName string, accountName string, applicationID string) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
@@ -171,7 +166,7 @@ func (client ApplicationClient) DeletePreparer(resourceGroupName string, account
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2017-01-01"
const APIVersion = "2017-05-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -204,9 +199,8 @@ func (client ApplicationClient) DeleteResponder(resp *http.Response) (result aut
// Get gets information about the specified application.
//
// resourceGroupName is the name of the resource group that contains the Batch
// account. accountName is the name of the Batch account. applicationID is the
// ID of the application.
// resourceGroupName is the name of the resource group that contains the Batch account. accountName is the name of the
// Batch account. applicationID is the ID of the application.
func (client ApplicationClient) Get(resourceGroupName string, accountName string, applicationID string) (result Application, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
@@ -248,7 +242,7 @@ func (client ApplicationClient) GetPreparer(resourceGroupName string, accountNam
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2017-01-01"
const APIVersion = "2017-05-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -282,9 +276,8 @@ func (client ApplicationClient) GetResponder(resp *http.Response) (result Applic
// List lists all of the applications in the specified account.
//
// resourceGroupName is the name of the resource group that contains the Batch
// account. accountName is the name of the Batch account. maxresults is the
// maximum number of items to return in the response.
// resourceGroupName is the name of the resource group that contains the Batch account. accountName is the name of the
// Batch account. maxresults is the maximum number of items to return in the response.
func (client ApplicationClient) List(resourceGroupName string, accountName string, maxresults *int32) (result ListApplicationsResult, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
@@ -325,7 +318,7 @@ func (client ApplicationClient) ListPreparer(resourceGroupName string, accountNa
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2017-01-01"
const APIVersion = "2017-05-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -384,12 +377,56 @@ func (client ApplicationClient) ListNextResults(lastResults ListApplicationsResu
return
}
// ListComplete gets all elements from the list without paging.
func (client ApplicationClient) ListComplete(resourceGroupName string, accountName string, maxresults *int32, cancel <-chan struct{}) (<-chan Application, <-chan error) {
resultChan := make(chan Application)
errChan := make(chan error, 1)
go func() {
defer func() {
close(resultChan)
close(errChan)
}()
list, err := client.List(resourceGroupName, accountName, maxresults)
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 updates settings for the specified application.
//
// resourceGroupName is the name of the resource group that contains the Batch
// account. accountName is the name of the Batch account. applicationID is the
// ID of the application. parameters is the parameters for the request.
func (client ApplicationClient) Update(resourceGroupName string, accountName string, applicationID string, parameters UpdateApplicationParameters) (result autorest.Response, err error) {
// resourceGroupName is the name of the resource group that contains the Batch account. accountName is the name of the
// Batch account. applicationID is the ID of the application. parameters is the parameters for the request.
func (client ApplicationClient) Update(resourceGroupName string, accountName string, applicationID string, parameters ApplicationUpdateParameters) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}},
@@ -422,7 +459,7 @@ func (client ApplicationClient) Update(resourceGroupName string, accountName str
}
// UpdatePreparer prepares the Update request.
func (client ApplicationClient) UpdatePreparer(resourceGroupName string, accountName string, applicationID string, parameters UpdateApplicationParameters) (*http.Request, error) {
func (client ApplicationClient) UpdatePreparer(resourceGroupName string, accountName string, applicationID string, parameters ApplicationUpdateParameters) (*http.Request, error) {
pathParameters := map[string]interface{}{
"accountName": autorest.Encode("path", accountName),
"applicationId": autorest.Encode("path", applicationID),
@@ -430,7 +467,7 @@ func (client ApplicationClient) UpdatePreparer(resourceGroupName string, account
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2017-01-01"
const APIVersion = "2017-05-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
+18 -26
View File
@@ -14,9 +14,8 @@ package batch
// 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,26 @@ import (
"net/http"
)
// ApplicationPackageClient is the client for the ApplicationPackage methods of
// the Batch service.
// ApplicationPackageClient is the client for the ApplicationPackage methods of the Batch service.
type ApplicationPackageClient struct {
ManagementClient
}
// NewApplicationPackageClient creates an instance of the
// ApplicationPackageClient client.
// NewApplicationPackageClient creates an instance of the ApplicationPackageClient client.
func NewApplicationPackageClient(subscriptionID string) ApplicationPackageClient {
return NewApplicationPackageClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewApplicationPackageClientWithBaseURI creates an instance of the
// ApplicationPackageClient client.
// NewApplicationPackageClientWithBaseURI creates an instance of the ApplicationPackageClient client.
func NewApplicationPackageClientWithBaseURI(baseURI string, subscriptionID string) ApplicationPackageClient {
return ApplicationPackageClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// Activate activates the specified application package.
//
// resourceGroupName is the name of the resource group that contains the Batch
// account. accountName is the name of the Batch account. applicationID is the
// ID of the application. version is the version of the application to
// activate. parameters is the parameters for the request.
// resourceGroupName is the name of the resource group that contains the Batch account. accountName is the name of the
// Batch account. applicationID is the ID of the application. version is the version of the application to activate.
// parameters is the parameters for the request.
func (client ApplicationPackageClient) Activate(resourceGroupName string, accountName string, applicationID string, version string, parameters ActivateApplicationPackageParameters) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
@@ -93,7 +88,7 @@ func (client ApplicationPackageClient) ActivatePreparer(resourceGroupName string
"version": autorest.Encode("path", version),
}
const APIVersion = "2017-01-01"
const APIVersion = "2017-05-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -128,9 +123,8 @@ func (client ApplicationPackageClient) ActivateResponder(resp *http.Response) (r
// Create creates an application package record.
//
// resourceGroupName is the name of the resource group that contains the Batch
// account. accountName is the name of the Batch account. applicationID is the
// ID of the application. version is the version of the application.
// resourceGroupName is the name of the resource group that contains the Batch account. accountName is the name of the
// Batch account. applicationID is the ID of the application. version is the version of the application.
func (client ApplicationPackageClient) Create(resourceGroupName string, accountName string, applicationID string, version string) (result ApplicationPackage, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
@@ -173,7 +167,7 @@ func (client ApplicationPackageClient) CreatePreparer(resourceGroupName string,
"version": autorest.Encode("path", version),
}
const APIVersion = "2017-01-01"
const APIVersion = "2017-05-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -207,9 +201,8 @@ func (client ApplicationPackageClient) CreateResponder(resp *http.Response) (res
// Delete deletes an application package record and its associated binary file.
//
// resourceGroupName is the name of the resource group that contains the Batch
// account. accountName is the name of the Batch account. applicationID is the
// ID of the application. version is the version of the application to delete.
// resourceGroupName is the name of the resource group that contains the Batch account. accountName is the name of the
// Batch account. applicationID is the ID of the application. version is the version of the application to delete.
func (client ApplicationPackageClient) Delete(resourceGroupName string, accountName string, applicationID string, version string) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
@@ -252,7 +245,7 @@ func (client ApplicationPackageClient) DeletePreparer(resourceGroupName string,
"version": autorest.Encode("path", version),
}
const APIVersion = "2017-01-01"
const APIVersion = "2017-05-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -285,9 +278,8 @@ func (client ApplicationPackageClient) DeleteResponder(resp *http.Response) (res
// Get gets information about the specified application package.
//
// resourceGroupName is the name of the resource group that contains the Batch
// account. accountName is the name of the Batch account. applicationID is the
// ID of the application. version is the version of the application.
// resourceGroupName is the name of the resource group that contains the Batch account. accountName is the name of the
// Batch account. applicationID is the ID of the application. version is the version of the application.
func (client ApplicationPackageClient) Get(resourceGroupName string, accountName string, applicationID string, version string) (result ApplicationPackage, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
@@ -330,7 +322,7 @@ func (client ApplicationPackageClient) GetPreparer(resourceGroupName string, acc
"version": autorest.Encode("path", version),
}
const APIVersion = "2017-01-01"
const APIVersion = "2017-05-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
+3 -4
View File
@@ -1,4 +1,4 @@
// Package batch implements the Azure ARM Batch service API version 2017-01-01.
// Package batch implements the Azure ARM Batch service API version 2017-05-01.
//
//
package batch
@@ -17,9 +17,8 @@ package batch
// 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"
+81 -9
View File
@@ -14,13 +14,13 @@ package batch
// 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"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/validation"
"net/http"
)
@@ -34,16 +34,88 @@ func NewLocationClient(subscriptionID string) LocationClient {
return NewLocationClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewLocationClientWithBaseURI creates an instance of the LocationClient
// client.
// NewLocationClientWithBaseURI creates an instance of the LocationClient client.
func NewLocationClientWithBaseURI(baseURI string, subscriptionID string) LocationClient {
return LocationClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// GetQuotas gets the Batch service quotas for the specified subscription at
// the given location.
// CheckNameAvailability checks whether the Batch account name is available in the specified region.
//
// locationName is the desired region for the quotas.
// locationName is the desired region for the name check. parameters is properties needed to check the availability of
// a name.
func (client LocationClient) CheckNameAvailability(locationName string, parameters CheckNameAvailabilityParameters) (result CheckNameAvailabilityResult, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: parameters,
Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil},
{Target: "parameters.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "batch.LocationClient", "CheckNameAvailability")
}
req, err := client.CheckNameAvailabilityPreparer(locationName, parameters)
if err != nil {
err = autorest.NewErrorWithError(err, "batch.LocationClient", "CheckNameAvailability", nil, "Failure preparing request")
return
}
resp, err := client.CheckNameAvailabilitySender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "batch.LocationClient", "CheckNameAvailability", resp, "Failure sending request")
return
}
result, err = client.CheckNameAvailabilityResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "batch.LocationClient", "CheckNameAvailability", resp, "Failure responding to request")
}
return
}
// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request.
func (client LocationClient) CheckNameAvailabilityPreparer(locationName string, parameters CheckNameAvailabilityParameters) (*http.Request, error) {
pathParameters := map[string]interface{}{
"locationName": autorest.Encode("path", locationName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2017-05-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Batch/locations/{locationName}/checkNameAvailability", pathParameters),
autorest.WithJSON(parameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the
// http.Response Body if it receives an error.
func (client LocationClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always
// closes the http.Response Body.
func (client LocationClient) CheckNameAvailabilityResponder(resp *http.Response) (result CheckNameAvailabilityResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// GetQuotas gets the Batch service quotas for the specified subscription at the given location.
//
// locationName is the region for which to retrieve Batch service quotas.
func (client LocationClient) GetQuotas(locationName string) (result LocationQuota, err error) {
req, err := client.GetQuotasPreparer(locationName)
if err != nil {
@@ -73,7 +145,7 @@ func (client LocationClient) GetQuotasPreparer(locationName string) (*http.Reque
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2017-01-01"
const APIVersion = "2017-05-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
+126 -71
View File
@@ -14,9 +14,8 @@ package batch
// 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"
@@ -35,6 +34,16 @@ const (
Secondary AccountKeyType = "Secondary"
)
// NameAvailabilityReason enumerates the values for name availability reason.
type NameAvailabilityReason string
const (
// AlreadyExists specifies the already exists state for name availability reason.
AlreadyExists NameAvailabilityReason = "AlreadyExists"
// Invalid specifies the invalid state for name availability reason.
Invalid NameAvailabilityReason = "Invalid"
)
// PackageState enumerates the values for package state.
type PackageState string
@@ -53,8 +62,7 @@ type PoolAllocationMode string
const (
// BatchService specifies the batch service state for pool allocation mode.
BatchService PoolAllocationMode = "BatchService"
// UserSubscription specifies the user subscription state for pool
// allocation mode.
// UserSubscription specifies the user subscription state for pool allocation mode.
UserSubscription PoolAllocationMode = "UserSubscription"
)
@@ -62,18 +70,18 @@ const (
type ProvisioningState string
const (
// Cancelled specifies the cancelled state for provisioning state.
Cancelled ProvisioningState = "Cancelled"
// Creating specifies the creating state for provisioning state.
Creating ProvisioningState = "Creating"
// Deleting specifies the deleting state for provisioning state.
Deleting ProvisioningState = "Deleting"
// Failed specifies the failed state for provisioning state.
Failed ProvisioningState = "Failed"
// Invalid specifies the invalid state for provisioning state.
Invalid ProvisioningState = "Invalid"
// Succeeded specifies the succeeded state for provisioning state.
Succeeded ProvisioningState = "Succeeded"
// ProvisioningStateCancelled specifies the provisioning state cancelled state for provisioning state.
ProvisioningStateCancelled ProvisioningState = "Cancelled"
// ProvisioningStateCreating specifies the provisioning state creating state for provisioning state.
ProvisioningStateCreating ProvisioningState = "Creating"
// ProvisioningStateDeleting specifies the provisioning state deleting state for provisioning state.
ProvisioningStateDeleting ProvisioningState = "Deleting"
// ProvisioningStateFailed specifies the provisioning state failed state for provisioning state.
ProvisioningStateFailed ProvisioningState = "Failed"
// ProvisioningStateInvalid specifies the provisioning state invalid state for provisioning state.
ProvisioningStateInvalid ProvisioningState = "Invalid"
// ProvisioningStateSucceeded specifies the provisioning state succeeded state for provisioning state.
ProvisioningStateSucceeded ProvisioningState = "Succeeded"
)
// Account is contains information about an Azure Batch account.
@@ -87,23 +95,24 @@ type Account struct {
*AccountProperties `json:"properties,omitempty"`
}
// AccountBaseProperties is the properties of a Batch account.
type AccountBaseProperties struct {
// AccountCreateParameters is parameters supplied to the Create operation.
type AccountCreateParameters struct {
Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
*AccountCreateProperties `json:"properties,omitempty"`
}
// AccountCreateProperties is the properties of a Batch account.
type AccountCreateProperties struct {
AutoStorage *AutoStorageBaseProperties `json:"autoStorage,omitempty"`
PoolAllocationMode PoolAllocationMode `json:"poolAllocationMode,omitempty"`
KeyVaultReference *KeyVaultReference `json:"keyVaultReference,omitempty"`
}
// AccountCreateParameters is parameters supplied to the Create operation.
type AccountCreateParameters struct {
Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
*AccountBaseProperties `json:"properties,omitempty"`
}
// AccountKeys is a set of Azure Batch account keys.
type AccountKeys struct {
autorest.Response `json:"-"`
AccountName *string `json:"accountName,omitempty"`
Primary *string `json:"primary,omitempty"`
Secondary *string `json:"secondary,omitempty"`
}
@@ -134,41 +143,33 @@ type AccountProperties struct {
PoolAllocationMode PoolAllocationMode `json:"poolAllocationMode,omitempty"`
KeyVaultReference *KeyVaultReference `json:"keyVaultReference,omitempty"`
AutoStorage *AutoStorageProperties `json:"autoStorage,omitempty"`
CoreQuota *int32 `json:"coreQuota,omitempty"`
DedicatedCoreQuota *int32 `json:"dedicatedCoreQuota,omitempty"`
LowPriorityCoreQuota *int32 `json:"lowPriorityCoreQuota,omitempty"`
PoolQuota *int32 `json:"poolQuota,omitempty"`
ActiveJobAndJobScheduleQuota *int32 `json:"activeJobAndJobScheduleQuota,omitempty"`
}
// AccountRegenerateKeyParameters is parameters supplied to the RegenerateKey
// operation.
// AccountRegenerateKeyParameters is parameters supplied to the RegenerateKey operation.
type AccountRegenerateKeyParameters struct {
KeyName AccountKeyType `json:"keyName,omitempty"`
}
// AccountUpdateBaseProperties is the properties for a Batch account update.
type AccountUpdateBaseProperties struct {
// AccountUpdateParameters is parameters for updating an Azure Batch account.
type AccountUpdateParameters struct {
Tags *map[string]*string `json:"tags,omitempty"`
*AccountUpdateProperties `json:"properties,omitempty"`
}
// AccountUpdateProperties is the properties of a Batch account.
type AccountUpdateProperties struct {
AutoStorage *AutoStorageBaseProperties `json:"autoStorage,omitempty"`
}
// AccountUpdateParameters is parameters supplied to the Update operation.
type AccountUpdateParameters struct {
Tags *map[string]*string `json:"tags,omitempty"`
*AccountUpdateBaseProperties `json:"properties,omitempty"`
}
// ActivateApplicationPackageParameters is parameters for an
// ApplicationOperations.ActivateApplicationPackage request.
// ActivateApplicationPackageParameters is parameters for an activating an application package.
type ActivateApplicationPackageParameters struct {
Format *string `json:"format,omitempty"`
}
// AddApplicationParameters is parameters for an
// ApplicationOperations.AddApplication request.
type AddApplicationParameters struct {
AllowUpdates *bool `json:"allowUpdates,omitempty"`
DisplayName *string `json:"displayName,omitempty"`
}
// Application is contains information about an application in a Batch account.
type Application struct {
autorest.Response `json:"-"`
@@ -179,8 +180,13 @@ type Application struct {
DefaultVersion *string `json:"defaultVersion,omitempty"`
}
// ApplicationPackage is an application package which represents a particular
// version of an application.
// ApplicationCreateParameters is parameters for adding an Application.
type ApplicationCreateParameters struct {
AllowUpdates *bool `json:"allowUpdates,omitempty"`
DisplayName *string `json:"displayName,omitempty"`
}
// ApplicationPackage is an application package which represents a particular version of an application.
type ApplicationPackage struct {
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
@@ -192,35 +198,58 @@ type ApplicationPackage struct {
LastActivationTime *date.Time `json:"lastActivationTime,omitempty"`
}
// AutoStorageBaseProperties is the properties related to auto storage account.
// ApplicationUpdateParameters is parameters for an update application request.
type ApplicationUpdateParameters struct {
AllowUpdates *bool `json:"allowUpdates,omitempty"`
DefaultVersion *string `json:"defaultVersion,omitempty"`
DisplayName *string `json:"displayName,omitempty"`
}
// AutoStorageBaseProperties is the properties related to the auto-storage account.
type AutoStorageBaseProperties struct {
StorageAccountID *string `json:"storageAccountId,omitempty"`
}
// AutoStorageProperties is contains information about the auto storage account
// associated with a Batch account.
// AutoStorageProperties is contains information about the auto-storage account associated with a Batch account.
type AutoStorageProperties struct {
StorageAccountID *string `json:"storageAccountId,omitempty"`
LastKeySync *date.Time `json:"lastKeySync,omitempty"`
}
// CloudError is an error response from the Batch service.
type CloudError struct {
Code *string `json:"code,omitempty"`
Message *string `json:"message,omitempty"`
Target *string `json:"target,omitempty"`
Details *[]CloudError `json:"details,omitempty"`
// CheckNameAvailabilityParameters is parameters for a check name availability request.
type CheckNameAvailabilityParameters struct {
Name *string `json:"name,omitempty"`
Type *string `json:"type,omitempty"`
}
// KeyVaultReference is identifies the Azure key vault associated with a Batch
// account.
// CheckNameAvailabilityResult is the CheckNameAvailability operation response.
type CheckNameAvailabilityResult struct {
autorest.Response `json:"-"`
NameAvailable *bool `json:"nameAvailable,omitempty"`
Reason NameAvailabilityReason `json:"reason,omitempty"`
Message *string `json:"message,omitempty"`
}
// CloudError is an error response from the Batch service.
type CloudError struct {
Error *CloudErrorBody `json:"error,omitempty"`
}
// CloudErrorBody is an error response from the Batch service.
type CloudErrorBody struct {
Code *string `json:"code,omitempty"`
Message *string `json:"message,omitempty"`
Target *string `json:"target,omitempty"`
Details *[]CloudErrorBody `json:"details,omitempty"`
}
// KeyVaultReference is identifies the Azure key vault associated with a Batch account.
type KeyVaultReference struct {
ID *string `json:"id,omitempty"`
URL *string `json:"url,omitempty"`
}
// ListApplicationsResult is response to an
// ApplicationOperations.ListApplications request.
// ListApplicationsResult is the result of performing list applications.
type ListApplicationsResult struct {
autorest.Response `json:"-"`
Value *[]Application `json:"value,omitempty"`
@@ -239,13 +268,47 @@ func (client ListApplicationsResult) ListApplicationsResultPreparer() (*http.Req
autorest.WithBaseURL(to.String(client.NextLink)))
}
// LocationQuota is quotas associated with a Batch region for a particular
// subscription.
// LocationQuota is quotas associated with a Batch region for a particular subscription.
type LocationQuota struct {
autorest.Response `json:"-"`
AccountQuota *int32 `json:"accountQuota,omitempty"`
}
// Operation is
type Operation struct {
Name *string `json:"name,omitempty"`
Display *OperationDisplay `json:"display,omitempty"`
Origin *string `json:"origin,omitempty"`
Properties *map[string]interface{} `json:"properties,omitempty"`
}
// OperationDisplay is
type OperationDisplay struct {
Provider *string `json:"provider,omitempty"`
Operation *string `json:"operation,omitempty"`
Resource *string `json:"resource,omitempty"`
Description *string `json:"description,omitempty"`
}
// OperationListResult is
type OperationListResult struct {
autorest.Response `json:"-"`
Value *[]Operation `json:"value,omitempty"`
NextLink *string `json:"nextLink,omitempty"`
}
// OperationListResultPreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
func (client OperationListResult) OperationListResultPreparer() (*http.Request, error) {
if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
return nil, nil
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(client.NextLink)))
}
// Resource is a definition of an Azure resource.
type Resource struct {
ID *string `json:"id,omitempty"`
@@ -254,11 +317,3 @@ type Resource struct {
Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
}
// UpdateApplicationParameters is parameters for an
// ApplicationOperations.UpdateApplication request.
type UpdateApplicationParameters struct {
AllowUpdates *bool `json:"allowUpdates,omitempty"`
DefaultVersion *string `json:"defaultVersion,omitempty"`
DisplayName *string `json:"displayName,omitempty"`
}
+165
View File
@@ -0,0 +1,165 @@
package batch
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// 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"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
)
// OperationsClient is the client for the Operations methods of the Batch service.
type OperationsClient struct {
ManagementClient
}
// NewOperationsClient creates an instance of the OperationsClient client.
func NewOperationsClient(subscriptionID string) OperationsClient {
return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client.
func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient {
return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// List lists available operations for the Microsoft.Batch provider
func (client OperationsClient) List() (result OperationListResult, err error) {
req, err := client.ListPreparer()
if err != nil {
err = autorest.NewErrorWithError(err, "batch.OperationsClient", "List", nil, "Failure preparing request")
return
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "batch.OperationsClient", "List", resp, "Failure sending request")
return
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "batch.OperationsClient", "List", resp, "Failure responding to request")
}
return
}
// ListPreparer prepares the List request.
func (client OperationsClient) ListPreparer() (*http.Request, error) {
const APIVersion = "2017-05-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/providers/Microsoft.Batch/operations"),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
// closes the http.Response Body.
func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// ListNextResults retrieves the next set of results, if any.
func (client OperationsClient) ListNextResults(lastResults OperationListResult) (result OperationListResult, err error) {
req, err := lastResults.OperationListResultPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "batch.OperationsClient", "List", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "batch.OperationsClient", "List", resp, "Failure sending next results request")
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "batch.OperationsClient", "List", resp, "Failure responding to next results request")
}
return
}
// ListComplete gets all elements from the list without paging.
func (client OperationsClient) ListComplete(cancel <-chan struct{}) (<-chan Operation, <-chan error) {
resultChan := make(chan Operation)
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
View File
@@ -14,16 +14,15 @@ package batch
// 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-batch/2017-01-01"
return "Azure-SDK-For-Go/v11.0.0-beta arm-batch/2017-05-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"
}