diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5b4cf36bc9b0..bf90ecb15339 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,86 @@
# CHANGELOG
+## `v34.0.0`
+
+### New Packages
+| Package Name | API Version |
+| -----------: | :---------: |
+| databox | 2019-09-01 |
+| databoxedge | 2019-03-01 2019-07-01 |
+| frontdoor | 2019-04-01 2019-05-01 |
+| healthcareapis | 2019-09-16 |
+| kusto | 2019-09-07 |
+| logic | 2019-05-01 |
+| maintenance | 2018-06-01-preview |
+| storagedatalake | 2019-10-31 |
+| subscriptions | 2019-06-01 |
+
+### Updated Packages
+
+| Package Name | API Version |
+| -----------: | :---------: |
+| appconfiguration | 2019-02-01-preview |
+| datashare | 2018-11-01-preview |
+| eventgrid | 2018-01-01 |
+| eventhub | 2017-04-01 |
+| kusto | 2019-05-15 |
+| network | 2018-07-01 2018-08-01 2018-10-01 2018-11-01 2018-12-01 2019-02-01 |
+| servicebus | 2017-04-01 |
+| sql | 2015-05-01-preview 2017-03-01-preview |
+
+### BreakingChanges
+
+| Package Name | API Version |
+| -----------: | :---------: |
+| apimanagement | 2019-01-01 |
+| compute | 2016-03-30 2017-03-30 2017-12-01 2018-04-01 2018-06-01 2018-10-01 2019-03-01 2019-07-01 |
+| containerregistry | 2019-05-01-preview 2019-06-01-preview |
+| containerservice | 2019-06-01 2019-08-01 |
+| datafactory | 2018-06-01 |
+| datamigration | 2018-03-31-preview 2018-04-19 2018-07-15-preview |
+| documentdb | 2015-04-08 |
+| frontdoor | 2018-08-01-preview |
+| machinelearningservices | 2019-06-01 |
+| managednetwork | 2019-06-01-preview |
+| network | 2019-04-01 |
+| reservations | 2019-04-01 |
+| security | v1.0 v2.0 v3.0 |
+| securityinsight | 2017-08-01-preview |
+| storage | 2019-04-01 |
+
+### Removed Packages
+
+| Package Name | API Version |
+| -----------: | :---------: |
+| affinitygroup | management |
+| anomalyfinder | v2.0 |
+| auth | keyvault |
+| batch | 2015-12-01.2.2 2016-02-01.3.0 2016-07-01.3.1 2017-01-01.4.0 2017-06-01.5.1 2017-09-01.6.0 |
+| computervision | v1.0 |
+| devspaces | 2018-06-01-preview 2019-01-01-preview |
+| edgegateway | 2019-03-01 |
+| frontdoor | preview/2019-04-01 preview/2019-05-01 |
+| hostedservice | management |
+| insights | v1 |
+| location | management |
+| mobileengagement | 2014-12-01 |
+| mongodb | cosmos-db |
+| networksecuritygroup | management |
+| osimage | management |
+| peering | 2019-03-01-preview |
+| portal | 2015-11-01-preview |
+| programmatic | luis |
+| servicefabric | 2019-03-01 |
+| services | 2018-03-01-preview |
+| sql | management |
+| storageservice | management |
+| testutils | management |
+| virtualmachine | management |
+| virtualmachinedisk | management |
+| virtualmachineimage | management |
+| virtualnetwork | management |
+| vmutils | management |
+
## `v33.4.0`
### New Packages
diff --git a/Gopkg.lock b/Gopkg.lock
index 35f84af43876..e41cfb92d3a2 100644
--- a/Gopkg.lock
+++ b/Gopkg.lock
@@ -2,14 +2,12 @@
[[projects]]
- digest = "1:c39603b93cda6859fa04dc23bffee64dc5db6f6f4fec93539ddef9d7e628a5da"
+ digest = "1:78df7dcd6d2a3e38b9fc52a47129135bdfaf1f89e8dd07001968455459666b11"
name = "github.com/Azure/go-autorest"
packages = [
"autorest",
"autorest/adal",
"autorest/azure",
- "autorest/azure/auth",
- "autorest/azure/cli",
"autorest/date",
"autorest/to",
"autorest/validation",
@@ -17,16 +15,16 @@
"tracing",
]
pruneopts = "UT"
- revision = "5e7a399d8bbf4953ab0c8e3167d7fd535fd74ce1"
- version = "v13.0.0"
+ revision = "69b4126ece6b5257e2f9b0017007d2334153655f"
+ version = "v13.0.1"
[[projects]]
- digest = "1:55388fd080150b9a072912f97b1f5891eb0b50df43401f8b75fb4273d3fec9fc"
+ digest = "1:d37f34e1e231ee4b8657d1b6153e2696b1d7341850f648f5d78151d3bc1f677b"
name = "github.com/Masterminds/semver"
packages = ["."]
pruneopts = "UT"
- revision = "c7af12943936e8c39859482e61f0574c2fd7fc75"
- version = "v1.4.2"
+ revision = "fe7c21038085e01e67044ec1efe3afb1eaa59f75"
+ version = "v3.0.1"
[[projects]]
digest = "1:76dc72490af7174349349838f2fe118996381b31ea83243812a97e5a0fd5ed55"
@@ -36,14 +34,6 @@
revision = "06ea1031745cb8b3dab3f6a236daf2b0aa468b7e"
version = "v3.2.0"
-[[projects]]
- digest = "1:cf0d2e435fd4ce45b789e93ef24b5f08e86be0e9807a16beb3694e2d8c9af965"
- name = "github.com/dimchansky/utfbom"
- packages = ["."]
- pruneopts = "UT"
- revision = "d2133a1ce379ef6fa992b0514a77146c60db9d1c"
- version = "v1.1.0"
-
[[projects]]
branch = "master"
digest = "1:052aa482c25b2d76f432c16c4b404a6a3cb9cc205a95818c7680fcec501a43b7"
@@ -55,20 +45,6 @@
pruneopts = "UT"
revision = "ac8906116758e03208f043a52754f16f2982f26d"
-[[projects]]
- branch = "master"
- digest = "1:78102ee4d536347316bc42e818340cc50902e45dbd7fdd524c5a1fc0cb07b588"
- name = "github.com/globalsign/mgo"
- packages = [
- ".",
- "bson",
- "internal/json",
- "internal/sasl",
- "internal/scram",
- ]
- pruneopts = "UT"
- revision = "eeefdecb41b842af6dc652aaea4026e8403e62df"
-
[[projects]]
digest = "1:870d441fe217b8e689d7949fef6e43efbc787e50f200cb1e70dbca9204a1d6be"
name = "github.com/inconshreveable/mousetrap"
@@ -93,14 +69,6 @@
revision = "e2ffdb16a802fe2bb95e2e35ff34f0e53aeef34f"
version = "v0.1.0"
-[[projects]]
- digest = "1:5d231480e1c64a726869bc4142d270184c419749d34f167646baa21008eb0a79"
- name = "github.com/mitchellh/go-homedir"
- packages = ["."]
- pruneopts = "UT"
- revision = "af06845cf3004701891bf4fdb884bfe4920b3727"
- version = "v1.1.0"
-
[[projects]]
digest = "1:cf31692c14422fa27c83a05292eb5cbe0fb2775972e8f1f8446a71549bd8980b"
name = "github.com/pkg/errors"
@@ -134,27 +102,16 @@
version = "v0.0.5"
[[projects]]
- digest = "1:c1b1102241e7f645bc8e0c22ae352e8f0dc6484b6cb4d132fa9f24174e0119e2"
+ digest = "1:524b71991fc7d9246cc7dc2d9e0886ccb97648091c63e30eef619e6862c955dd"
name = "github.com/spf13/pflag"
packages = ["."]
pruneopts = "UT"
- revision = "298182f68c66c05229eb03ac171abe6e309ee79a"
- version = "v1.0.3"
-
-[[projects]]
- branch = "master"
- digest = "1:994c4915a59f821705d08ea77b117ec7a3e6a46cc867fd194d887500dac1c3c2"
- name = "golang.org/x/crypto"
- packages = [
- "pkcs12",
- "pkcs12/internal/rc2",
- ]
- pruneopts = "UT"
- revision = "9756ffdc24725223350eb3266ffb92590d28f278"
+ revision = "2e9d26c8c37aae03e3f9d4e90b7116f5accb7cab"
+ version = "v1.0.5"
[[projects]]
branch = "master"
- digest = "1:5929f6d40b149acf2a65717d276ff4a2735e5b1ce13d2c68878b4a834625228e"
+ digest = "1:18c7b936326b4919be6de0a20be857fdd3112036cdb3febfa9a5b332a4f54e27"
name = "golang.org/x/tools"
packages = [
"go/ast/astutil",
@@ -171,15 +128,15 @@
"internal/semver",
]
pruneopts = "UT"
- revision = "42f498d34c4d67145e3950193a8f23db9328e7f3"
+ revision = "e461004dd03ddc1b89596568ce4119c0e8152ce6"
[[projects]]
branch = "v1"
- digest = "1:af715ae33cc1f5695c4b2a4e4b21d008add8802a99e15bb467ac7c32edb5000d"
+ digest = "1:bc88591477b5fee4520dcd3d8fa8fd26f5d78b83193ed0102a7e83552652daa4"
name = "gopkg.in/check.v1"
packages = ["."]
pruneopts = "UT"
- revision = "788fd78401277ebd861206a03c884797c6ec5541"
+ revision = "41f04d3bba152ddec2103e299fed053415705330"
[[projects]]
digest = "1:4d2e5a73dc1500038e504a8d78b986630e3626dc027bc030ba5c75da257cdb96"
@@ -194,9 +151,7 @@
analyzer-version = 1
input-imports = [
"github.com/Azure/go-autorest/autorest",
- "github.com/Azure/go-autorest/autorest/adal",
"github.com/Azure/go-autorest/autorest/azure",
- "github.com/Azure/go-autorest/autorest/azure/auth",
"github.com/Azure/go-autorest/autorest/date",
"github.com/Azure/go-autorest/autorest/to",
"github.com/Azure/go-autorest/autorest/validation",
@@ -204,12 +159,10 @@
"github.com/Masterminds/semver",
"github.com/dnaeon/go-vcr/cassette",
"github.com/dnaeon/go-vcr/recorder",
- "github.com/globalsign/mgo",
"github.com/pkg/errors",
"github.com/satori/go.uuid",
"github.com/shopspring/decimal",
"github.com/spf13/cobra",
- "golang.org/x/crypto/pkcs12",
"golang.org/x/tools/imports",
"gopkg.in/check.v1",
]
diff --git a/README.md b/README.md
index 3e6836c6b859..c320ac68e5c2 100644
--- a/README.md
+++ b/README.md
@@ -89,12 +89,12 @@ Apply the following general steps to use packages in this repo. For more on
authentication and the `Authorizer` interface see [the next
section](#authentication).
-1. Import a package from the [services][services_dir] directory.
-2. Create and authenticate a client with a `New*Client` func, e.g.
- `c := compute.NewVirtualMachinesClient(...)`.
-3. Invoke API methods using the client, e.g.
- `res, err := c.CreateOrUpdate(...)`.
-4. Handle responses and errors.
+1. Import a package from the [services][services_dir] directory.
+2. Create and authenticate a client with a `New*Client` func, e.g.
+ `c := compute.NewVirtualMachinesClient(...)`.
+3. Invoke API methods using the client, e.g.
+ `res, err := c.CreateOrUpdate(...)`.
+4. Handle responses and errors.
[services_dir]: https://github.com/Azure/azure-sdk-for-go/tree/master/services
@@ -514,14 +514,25 @@ Changing one or more values will affect all subsequet API calls.
The default policy is to call `autorest.DoRetryForStatusCodes()` from an API's `Sender` method. Example:
```go
func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ return autorest.SendWithSender(client, req, sd...)
}
```
Details on how `autorest.DoRetryforStatusCodes()` works can be found in the [documentation](https://godoc.org/github.com/Azure/go-autorest/autorest#DoRetryForStatusCodes).
-It is not possible to change the invoked retry policy without writing a custom `Sender` and its calling code.
+The slice of `SendDecorators` used in a `Sender` method can be customized per API call by smuggling them in the context. Here's an example.
+
+```go
+ctx := context.Background()
+autorest.WithSendDecorators(ctx, []autorest.SendDecorator{
+ autorest.DoRetryForStatusCodesWithCap(client.RetryAttempts,
+ client.RetryDuration, time.Duration(0),
+ autorest.StatusCodesForRetry...)})
+client.List(ctx)
+```
+
+This will replace the default slice of `SendDecorators` with the provided slice.
The `PollingDelay` and `PollingDuration` values are used exclusively by [WaitForCompletionRef()](https://godoc.org/github.com/Azure/go-autorest/autorest/azure#Future.WaitForCompletionRef) when blocking on an async call until it completes.
diff --git a/profiles/latest/appinsights/insights/models.go b/profiles/latest/appinsights/insights/models.go
deleted file mode 100644
index af0714dbc2bb..000000000000
--- a/profiles/latest/appinsights/insights/models.go
+++ /dev/null
@@ -1,229 +0,0 @@
-// +build go1.9
-
-// Copyright 2019 Microsoft Corporation
-//
-// 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.
-
-// This code was auto-generated by:
-// github.com/Azure/azure-sdk-for-go/tools/profileBuilder
-
-package insights
-
-import original "github.com/Azure/azure-sdk-for-go/services/appinsights/v1/insights"
-
-const (
- DefaultBaseURI = original.DefaultBaseURI
-)
-
-type EventType = original.EventType
-
-const (
- All EventType = original.All
- AvailabilityResults EventType = original.AvailabilityResults
- BrowserTimings EventType = original.BrowserTimings
- CustomEvents EventType = original.CustomEvents
- CustomMetrics EventType = original.CustomMetrics
- Dependencies EventType = original.Dependencies
- Exceptions EventType = original.Exceptions
- PageViews EventType = original.PageViews
- PerformanceCounters EventType = original.PerformanceCounters
- Requests EventType = original.Requests
- Traces EventType = original.Traces
-)
-
-type MetricID = original.MetricID
-
-const (
- AvailabilityResultsavailabilityPercentage MetricID = original.AvailabilityResultsavailabilityPercentage
- AvailabilityResultsduration MetricID = original.AvailabilityResultsduration
- BillingtelemetryCount MetricID = original.BillingtelemetryCount
- ClientnetworkDuration MetricID = original.ClientnetworkDuration
- ClientprocessingDuration MetricID = original.ClientprocessingDuration
- ClientreceiveDuration MetricID = original.ClientreceiveDuration
- ClientsendDuration MetricID = original.ClientsendDuration
- ClienttotalDuration MetricID = original.ClienttotalDuration
- CustomEventscount MetricID = original.CustomEventscount
- Dependenciescount MetricID = original.Dependenciescount
- Dependenciesduration MetricID = original.Dependenciesduration
- Dependenciesfailed MetricID = original.Dependenciesfailed
- Exceptionsbrowser MetricID = original.Exceptionsbrowser
- Exceptionscount MetricID = original.Exceptionscount
- Exceptionsserver MetricID = original.Exceptionsserver
- PageViewscount MetricID = original.PageViewscount
- PageViewsduration MetricID = original.PageViewsduration
- PerformanceCountersexceptionsPerSecond MetricID = original.PerformanceCountersexceptionsPerSecond
- PerformanceCountersmemoryAvailableBytes MetricID = original.PerformanceCountersmemoryAvailableBytes
- PerformanceCountersprocessCPUPercentage MetricID = original.PerformanceCountersprocessCPUPercentage
- PerformanceCountersprocessIOBytesPerSecond MetricID = original.PerformanceCountersprocessIOBytesPerSecond
- PerformanceCountersprocessorCPUPercentage MetricID = original.PerformanceCountersprocessorCPUPercentage
- PerformanceCountersprocessPrivateBytes MetricID = original.PerformanceCountersprocessPrivateBytes
- PerformanceCountersrequestExecutionTime MetricID = original.PerformanceCountersrequestExecutionTime
- PerformanceCountersrequestsInQueue MetricID = original.PerformanceCountersrequestsInQueue
- PerformanceCountersrequestsPerSecond MetricID = original.PerformanceCountersrequestsPerSecond
- Requestscount MetricID = original.Requestscount
- Requestsduration MetricID = original.Requestsduration
- Requestsfailed MetricID = original.Requestsfailed
- Sessionscount MetricID = original.Sessionscount
- Usersauthenticated MetricID = original.Usersauthenticated
- Userscount MetricID = original.Userscount
-)
-
-type MetricsAggregation = original.MetricsAggregation
-
-const (
- Avg MetricsAggregation = original.Avg
- Count MetricsAggregation = original.Count
- Max MetricsAggregation = original.Max
- Min MetricsAggregation = original.Min
- Sum MetricsAggregation = original.Sum
- Unique MetricsAggregation = original.Unique
-)
-
-type MetricsSegment = original.MetricsSegment
-
-const (
- ApplicationBuild MetricsSegment = original.ApplicationBuild
- ApplicationVersion MetricsSegment = original.ApplicationVersion
- AuthenticatedOrAnonymousTraffic MetricsSegment = original.AuthenticatedOrAnonymousTraffic
- Browser MetricsSegment = original.Browser
- BrowserVersion MetricsSegment = original.BrowserVersion
- City MetricsSegment = original.City
- CloudRoleName MetricsSegment = original.CloudRoleName
- CloudServiceName MetricsSegment = original.CloudServiceName
- Continent MetricsSegment = original.Continent
- CountryOrRegion MetricsSegment = original.CountryOrRegion
- DeploymentID MetricsSegment = original.DeploymentID
- DeploymentUnit MetricsSegment = original.DeploymentUnit
- DeviceType MetricsSegment = original.DeviceType
- Environment MetricsSegment = original.Environment
- HostingLocation MetricsSegment = original.HostingLocation
- InstanceName MetricsSegment = original.InstanceName
-)
-
-type Type = original.Type
-
-const (
- TypeAvailabilityResult Type = original.TypeAvailabilityResult
- TypeBrowserTiming Type = original.TypeBrowserTiming
- TypeCustomEvent Type = original.TypeCustomEvent
- TypeCustomMetric Type = original.TypeCustomMetric
- TypeDependency Type = original.TypeDependency
- TypeEventsResultData Type = original.TypeEventsResultData
- TypeException Type = original.TypeException
- TypePageView Type = original.TypePageView
- TypePerformanceCounter Type = original.TypePerformanceCounter
- TypeRequest Type = original.TypeRequest
- TypeTrace Type = original.TypeTrace
-)
-
-type BaseClient = original.BaseClient
-type BasicEventsResultData = original.BasicEventsResultData
-type Column = original.Column
-type ErrorDetail = original.ErrorDetail
-type ErrorInfo = original.ErrorInfo
-type ErrorResponse = original.ErrorResponse
-type EventsAiInfo = original.EventsAiInfo
-type EventsApplicationInfo = original.EventsApplicationInfo
-type EventsAvailabilityResultInfo = original.EventsAvailabilityResultInfo
-type EventsAvailabilityResultResult = original.EventsAvailabilityResultResult
-type EventsBrowserTimingInfo = original.EventsBrowserTimingInfo
-type EventsBrowserTimingResult = original.EventsBrowserTimingResult
-type EventsClient = original.EventsClient
-type EventsClientInfo = original.EventsClientInfo
-type EventsClientPerformanceInfo = original.EventsClientPerformanceInfo
-type EventsCloudInfo = original.EventsCloudInfo
-type EventsCustomEventInfo = original.EventsCustomEventInfo
-type EventsCustomEventResult = original.EventsCustomEventResult
-type EventsCustomMetricInfo = original.EventsCustomMetricInfo
-type EventsCustomMetricResult = original.EventsCustomMetricResult
-type EventsDependencyInfo = original.EventsDependencyInfo
-type EventsDependencyResult = original.EventsDependencyResult
-type EventsExceptionDetail = original.EventsExceptionDetail
-type EventsExceptionDetailsParsedStack = original.EventsExceptionDetailsParsedStack
-type EventsExceptionInfo = original.EventsExceptionInfo
-type EventsExceptionResult = original.EventsExceptionResult
-type EventsOperationInfo = original.EventsOperationInfo
-type EventsPageViewInfo = original.EventsPageViewInfo
-type EventsPageViewResult = original.EventsPageViewResult
-type EventsPerformanceCounterInfo = original.EventsPerformanceCounterInfo
-type EventsPerformanceCounterResult = original.EventsPerformanceCounterResult
-type EventsRequestInfo = original.EventsRequestInfo
-type EventsRequestResult = original.EventsRequestResult
-type EventsResult = original.EventsResult
-type EventsResultData = original.EventsResultData
-type EventsResultDataCustomDimensions = original.EventsResultDataCustomDimensions
-type EventsResultDataCustomMeasurements = original.EventsResultDataCustomMeasurements
-type EventsResults = original.EventsResults
-type EventsSessionInfo = original.EventsSessionInfo
-type EventsTraceInfo = original.EventsTraceInfo
-type EventsTraceResult = original.EventsTraceResult
-type EventsUserInfo = original.EventsUserInfo
-type ListMetricsResultsItem = original.ListMetricsResultsItem
-type MetricsClient = original.MetricsClient
-type MetricsPostBodySchema = original.MetricsPostBodySchema
-type MetricsPostBodySchemaParameters = original.MetricsPostBodySchemaParameters
-type MetricsResult = original.MetricsResult
-type MetricsResultInfo = original.MetricsResultInfo
-type MetricsResultsItem = original.MetricsResultsItem
-type MetricsSegmentInfo = original.MetricsSegmentInfo
-type QueryBody = original.QueryBody
-type QueryClient = original.QueryClient
-type QueryResults = original.QueryResults
-type SetObject = original.SetObject
-type Table = original.Table
-
-func New() BaseClient {
- return original.New()
-}
-func NewEventsClient() EventsClient {
- return original.NewEventsClient()
-}
-func NewEventsClientWithBaseURI(baseURI string) EventsClient {
- return original.NewEventsClientWithBaseURI(baseURI)
-}
-func NewMetricsClient() MetricsClient {
- return original.NewMetricsClient()
-}
-func NewMetricsClientWithBaseURI(baseURI string) MetricsClient {
- return original.NewMetricsClientWithBaseURI(baseURI)
-}
-func NewQueryClient() QueryClient {
- return original.NewQueryClient()
-}
-func NewQueryClientWithBaseURI(baseURI string) QueryClient {
- return original.NewQueryClientWithBaseURI(baseURI)
-}
-func NewWithBaseURI(baseURI string) BaseClient {
- return original.NewWithBaseURI(baseURI)
-}
-func PossibleEventTypeValues() []EventType {
- return original.PossibleEventTypeValues()
-}
-func PossibleMetricIDValues() []MetricID {
- return original.PossibleMetricIDValues()
-}
-func PossibleMetricsAggregationValues() []MetricsAggregation {
- return original.PossibleMetricsAggregationValues()
-}
-func PossibleMetricsSegmentValues() []MetricsSegment {
- return original.PossibleMetricsSegmentValues()
-}
-func PossibleTypeValues() []Type {
- return original.PossibleTypeValues()
-}
-func UserAgent() string {
- return original.UserAgent() + " profiles/latest"
-}
-func Version() string {
- return original.Version()
-}
diff --git a/profiles/latest/cognitiveservices/anomalyfinder/models.go b/profiles/latest/cognitiveservices/anomalyfinder/models.go
deleted file mode 100644
index 13cea3644e49..000000000000
--- a/profiles/latest/cognitiveservices/anomalyfinder/models.go
+++ /dev/null
@@ -1,56 +0,0 @@
-// +build go1.9
-
-// Copyright 2019 Microsoft Corporation
-//
-// 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.
-
-// This code was auto-generated by:
-// github.com/Azure/azure-sdk-for-go/tools/profileBuilder
-
-package anomalyfinder
-
-import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/anomalyfinder"
-
-type Granularity = original.Granularity
-
-const (
- Daily Granularity = original.Daily
- Hourly Granularity = original.Hourly
- Minutely Granularity = original.Minutely
- Monthly Granularity = original.Monthly
- Weekly Granularity = original.Weekly
- Yearly Granularity = original.Yearly
-)
-
-type APIError = original.APIError
-type BaseClient = original.BaseClient
-type EntireDetectResponse = original.EntireDetectResponse
-type LastDetectResponse = original.LastDetectResponse
-type Point = original.Point
-type Request = original.Request
-
-func New(endpoint string) BaseClient {
- return original.New(endpoint)
-}
-func NewWithoutDefaults(endpoint string) BaseClient {
- return original.NewWithoutDefaults(endpoint)
-}
-func PossibleGranularityValues() []Granularity {
- return original.PossibleGranularityValues()
-}
-func UserAgent() string {
- return original.UserAgent() + " profiles/latest"
-}
-func Version() string {
- return original.Version()
-}
diff --git a/profiles/latest/cognitiveservices/luis/programmatic/models.go b/profiles/latest/cognitiveservices/luis/programmatic/models.go
deleted file mode 100644
index 7cb4f4e642ef..000000000000
--- a/profiles/latest/cognitiveservices/luis/programmatic/models.go
+++ /dev/null
@@ -1,453 +0,0 @@
-// +build go1.9
-
-// Copyright 2019 Microsoft Corporation
-//
-// 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.
-
-// This code was auto-generated by:
-// github.com/Azure/azure-sdk-for-go/tools/profileBuilder
-
-package programmatic
-
-import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/programmatic"
-
-type AzureRegions = original.AzureRegions
-
-const (
- Australiaeast AzureRegions = original.Australiaeast
- Brazilsouth AzureRegions = original.Brazilsouth
- Eastasia AzureRegions = original.Eastasia
- Eastus AzureRegions = original.Eastus
- Eastus2 AzureRegions = original.Eastus2
- Northeurope AzureRegions = original.Northeurope
- Southcentralus AzureRegions = original.Southcentralus
- Southeastasia AzureRegions = original.Southeastasia
- Westcentralus AzureRegions = original.Westcentralus
- Westeurope AzureRegions = original.Westeurope
- Westus AzureRegions = original.Westus
- Westus2 AzureRegions = original.Westus2
-)
-
-type OperationStatusType = original.OperationStatusType
-
-const (
- Failed OperationStatusType = original.Failed
- FAILED OperationStatusType = original.FAILED
- Success OperationStatusType = original.Success
-)
-
-type ReadableType = original.ReadableType
-
-const (
- ReadableTypeClosedListEntityExtractor ReadableType = original.ReadableTypeClosedListEntityExtractor
- ReadableTypeCompositeEntityExtractor ReadableType = original.ReadableTypeCompositeEntityExtractor
- ReadableTypeEntityExtractor ReadableType = original.ReadableTypeEntityExtractor
- ReadableTypeHierarchicalChildEntityExtractor ReadableType = original.ReadableTypeHierarchicalChildEntityExtractor
- ReadableTypeHierarchicalEntityExtractor ReadableType = original.ReadableTypeHierarchicalEntityExtractor
- ReadableTypeIntentClassifier ReadableType = original.ReadableTypeIntentClassifier
- ReadableTypePatternAnyEntityExtractor ReadableType = original.ReadableTypePatternAnyEntityExtractor
- ReadableTypePrebuiltEntityExtractor ReadableType = original.ReadableTypePrebuiltEntityExtractor
- ReadableTypeRegexEntityExtractor ReadableType = original.ReadableTypeRegexEntityExtractor
-)
-
-type ReadableType1 = original.ReadableType1
-
-const (
- ReadableType1ClosedListEntityExtractor ReadableType1 = original.ReadableType1ClosedListEntityExtractor
- ReadableType1CompositeEntityExtractor ReadableType1 = original.ReadableType1CompositeEntityExtractor
- ReadableType1EntityExtractor ReadableType1 = original.ReadableType1EntityExtractor
- ReadableType1HierarchicalChildEntityExtractor ReadableType1 = original.ReadableType1HierarchicalChildEntityExtractor
- ReadableType1HierarchicalEntityExtractor ReadableType1 = original.ReadableType1HierarchicalEntityExtractor
- ReadableType1IntentClassifier ReadableType1 = original.ReadableType1IntentClassifier
- ReadableType1PatternAnyEntityExtractor ReadableType1 = original.ReadableType1PatternAnyEntityExtractor
- ReadableType1PrebuiltEntityExtractor ReadableType1 = original.ReadableType1PrebuiltEntityExtractor
- ReadableType1RegexEntityExtractor ReadableType1 = original.ReadableType1RegexEntityExtractor
-)
-
-type ReadableType10 = original.ReadableType10
-
-const (
- ReadableType10ClosedListEntityExtractor ReadableType10 = original.ReadableType10ClosedListEntityExtractor
- ReadableType10CompositeEntityExtractor ReadableType10 = original.ReadableType10CompositeEntityExtractor
- ReadableType10EntityExtractor ReadableType10 = original.ReadableType10EntityExtractor
- ReadableType10HierarchicalChildEntityExtractor ReadableType10 = original.ReadableType10HierarchicalChildEntityExtractor
- ReadableType10HierarchicalEntityExtractor ReadableType10 = original.ReadableType10HierarchicalEntityExtractor
- ReadableType10IntentClassifier ReadableType10 = original.ReadableType10IntentClassifier
- ReadableType10PatternAnyEntityExtractor ReadableType10 = original.ReadableType10PatternAnyEntityExtractor
- ReadableType10PrebuiltEntityExtractor ReadableType10 = original.ReadableType10PrebuiltEntityExtractor
- ReadableType10RegexEntityExtractor ReadableType10 = original.ReadableType10RegexEntityExtractor
-)
-
-type ReadableType2 = original.ReadableType2
-
-const (
- ReadableType2ClosedListEntityExtractor ReadableType2 = original.ReadableType2ClosedListEntityExtractor
- ReadableType2CompositeEntityExtractor ReadableType2 = original.ReadableType2CompositeEntityExtractor
- ReadableType2EntityExtractor ReadableType2 = original.ReadableType2EntityExtractor
- ReadableType2HierarchicalChildEntityExtractor ReadableType2 = original.ReadableType2HierarchicalChildEntityExtractor
- ReadableType2HierarchicalEntityExtractor ReadableType2 = original.ReadableType2HierarchicalEntityExtractor
- ReadableType2IntentClassifier ReadableType2 = original.ReadableType2IntentClassifier
- ReadableType2PatternAnyEntityExtractor ReadableType2 = original.ReadableType2PatternAnyEntityExtractor
- ReadableType2PrebuiltEntityExtractor ReadableType2 = original.ReadableType2PrebuiltEntityExtractor
- ReadableType2RegexEntityExtractor ReadableType2 = original.ReadableType2RegexEntityExtractor
-)
-
-type ReadableType3 = original.ReadableType3
-
-const (
- ReadableType3ClosedListEntityExtractor ReadableType3 = original.ReadableType3ClosedListEntityExtractor
- ReadableType3CompositeEntityExtractor ReadableType3 = original.ReadableType3CompositeEntityExtractor
- ReadableType3EntityExtractor ReadableType3 = original.ReadableType3EntityExtractor
- ReadableType3HierarchicalChildEntityExtractor ReadableType3 = original.ReadableType3HierarchicalChildEntityExtractor
- ReadableType3HierarchicalEntityExtractor ReadableType3 = original.ReadableType3HierarchicalEntityExtractor
- ReadableType3IntentClassifier ReadableType3 = original.ReadableType3IntentClassifier
- ReadableType3PatternAnyEntityExtractor ReadableType3 = original.ReadableType3PatternAnyEntityExtractor
- ReadableType3PrebuiltEntityExtractor ReadableType3 = original.ReadableType3PrebuiltEntityExtractor
- ReadableType3RegexEntityExtractor ReadableType3 = original.ReadableType3RegexEntityExtractor
-)
-
-type ReadableType4 = original.ReadableType4
-
-const (
- ReadableType4ClosedListEntityExtractor ReadableType4 = original.ReadableType4ClosedListEntityExtractor
- ReadableType4CompositeEntityExtractor ReadableType4 = original.ReadableType4CompositeEntityExtractor
- ReadableType4EntityExtractor ReadableType4 = original.ReadableType4EntityExtractor
- ReadableType4HierarchicalChildEntityExtractor ReadableType4 = original.ReadableType4HierarchicalChildEntityExtractor
- ReadableType4HierarchicalEntityExtractor ReadableType4 = original.ReadableType4HierarchicalEntityExtractor
- ReadableType4IntentClassifier ReadableType4 = original.ReadableType4IntentClassifier
- ReadableType4PatternAnyEntityExtractor ReadableType4 = original.ReadableType4PatternAnyEntityExtractor
- ReadableType4PrebuiltEntityExtractor ReadableType4 = original.ReadableType4PrebuiltEntityExtractor
- ReadableType4RegexEntityExtractor ReadableType4 = original.ReadableType4RegexEntityExtractor
-)
-
-type ReadableType5 = original.ReadableType5
-
-const (
- ReadableType5ClosedListEntityExtractor ReadableType5 = original.ReadableType5ClosedListEntityExtractor
- ReadableType5CompositeEntityExtractor ReadableType5 = original.ReadableType5CompositeEntityExtractor
- ReadableType5EntityExtractor ReadableType5 = original.ReadableType5EntityExtractor
- ReadableType5HierarchicalChildEntityExtractor ReadableType5 = original.ReadableType5HierarchicalChildEntityExtractor
- ReadableType5HierarchicalEntityExtractor ReadableType5 = original.ReadableType5HierarchicalEntityExtractor
- ReadableType5IntentClassifier ReadableType5 = original.ReadableType5IntentClassifier
- ReadableType5PatternAnyEntityExtractor ReadableType5 = original.ReadableType5PatternAnyEntityExtractor
- ReadableType5PrebuiltEntityExtractor ReadableType5 = original.ReadableType5PrebuiltEntityExtractor
- ReadableType5RegexEntityExtractor ReadableType5 = original.ReadableType5RegexEntityExtractor
-)
-
-type ReadableType6 = original.ReadableType6
-
-const (
- ReadableType6ClosedListEntityExtractor ReadableType6 = original.ReadableType6ClosedListEntityExtractor
- ReadableType6CompositeEntityExtractor ReadableType6 = original.ReadableType6CompositeEntityExtractor
- ReadableType6EntityExtractor ReadableType6 = original.ReadableType6EntityExtractor
- ReadableType6HierarchicalChildEntityExtractor ReadableType6 = original.ReadableType6HierarchicalChildEntityExtractor
- ReadableType6HierarchicalEntityExtractor ReadableType6 = original.ReadableType6HierarchicalEntityExtractor
- ReadableType6IntentClassifier ReadableType6 = original.ReadableType6IntentClassifier
- ReadableType6PatternAnyEntityExtractor ReadableType6 = original.ReadableType6PatternAnyEntityExtractor
- ReadableType6PrebuiltEntityExtractor ReadableType6 = original.ReadableType6PrebuiltEntityExtractor
- ReadableType6RegexEntityExtractor ReadableType6 = original.ReadableType6RegexEntityExtractor
-)
-
-type ReadableType7 = original.ReadableType7
-
-const (
- ReadableType7ClosedListEntityExtractor ReadableType7 = original.ReadableType7ClosedListEntityExtractor
- ReadableType7CompositeEntityExtractor ReadableType7 = original.ReadableType7CompositeEntityExtractor
- ReadableType7EntityExtractor ReadableType7 = original.ReadableType7EntityExtractor
- ReadableType7HierarchicalChildEntityExtractor ReadableType7 = original.ReadableType7HierarchicalChildEntityExtractor
- ReadableType7HierarchicalEntityExtractor ReadableType7 = original.ReadableType7HierarchicalEntityExtractor
- ReadableType7IntentClassifier ReadableType7 = original.ReadableType7IntentClassifier
- ReadableType7PatternAnyEntityExtractor ReadableType7 = original.ReadableType7PatternAnyEntityExtractor
- ReadableType7PrebuiltEntityExtractor ReadableType7 = original.ReadableType7PrebuiltEntityExtractor
- ReadableType7RegexEntityExtractor ReadableType7 = original.ReadableType7RegexEntityExtractor
-)
-
-type ReadableType8 = original.ReadableType8
-
-const (
- ReadableType8ClosedListEntityExtractor ReadableType8 = original.ReadableType8ClosedListEntityExtractor
- ReadableType8CompositeEntityExtractor ReadableType8 = original.ReadableType8CompositeEntityExtractor
- ReadableType8EntityExtractor ReadableType8 = original.ReadableType8EntityExtractor
- ReadableType8HierarchicalChildEntityExtractor ReadableType8 = original.ReadableType8HierarchicalChildEntityExtractor
- ReadableType8HierarchicalEntityExtractor ReadableType8 = original.ReadableType8HierarchicalEntityExtractor
- ReadableType8IntentClassifier ReadableType8 = original.ReadableType8IntentClassifier
- ReadableType8PatternAnyEntityExtractor ReadableType8 = original.ReadableType8PatternAnyEntityExtractor
- ReadableType8PrebuiltEntityExtractor ReadableType8 = original.ReadableType8PrebuiltEntityExtractor
- ReadableType8RegexEntityExtractor ReadableType8 = original.ReadableType8RegexEntityExtractor
-)
-
-type ReadableType9 = original.ReadableType9
-
-const (
- ReadableType9ClosedListEntityExtractor ReadableType9 = original.ReadableType9ClosedListEntityExtractor
- ReadableType9CompositeEntityExtractor ReadableType9 = original.ReadableType9CompositeEntityExtractor
- ReadableType9EntityExtractor ReadableType9 = original.ReadableType9EntityExtractor
- ReadableType9HierarchicalChildEntityExtractor ReadableType9 = original.ReadableType9HierarchicalChildEntityExtractor
- ReadableType9HierarchicalEntityExtractor ReadableType9 = original.ReadableType9HierarchicalEntityExtractor
- ReadableType9IntentClassifier ReadableType9 = original.ReadableType9IntentClassifier
- ReadableType9PatternAnyEntityExtractor ReadableType9 = original.ReadableType9PatternAnyEntityExtractor
- ReadableType9PrebuiltEntityExtractor ReadableType9 = original.ReadableType9PrebuiltEntityExtractor
- ReadableType9RegexEntityExtractor ReadableType9 = original.ReadableType9RegexEntityExtractor
-)
-
-type Status = original.Status
-
-const (
- StatusFail Status = original.StatusFail
- StatusInProgress Status = original.StatusInProgress
- StatusQueued Status = original.StatusQueued
- StatusSuccess Status = original.StatusSuccess
- StatusUpToDate Status = original.StatusUpToDate
-)
-
-type Status1 = original.Status1
-
-const (
- Status1Fail Status1 = original.Status1Fail
- Status1InProgress Status1 = original.Status1InProgress
- Status1Queued Status1 = original.Status1Queued
- Status1Success Status1 = original.Status1Success
- Status1UpToDate Status1 = original.Status1UpToDate
-)
-
-type TrainingStatus = original.TrainingStatus
-
-const (
- InProgress TrainingStatus = original.InProgress
- NeedsTraining TrainingStatus = original.NeedsTraining
- Trained TrainingStatus = original.Trained
-)
-
-type ApplicationCreateObject = original.ApplicationCreateObject
-type ApplicationInfoResponse = original.ApplicationInfoResponse
-type ApplicationPublishObject = original.ApplicationPublishObject
-type ApplicationSettingUpdateObject = original.ApplicationSettingUpdateObject
-type ApplicationSettings = original.ApplicationSettings
-type ApplicationUpdateObject = original.ApplicationUpdateObject
-type AppsClient = original.AppsClient
-type AvailableCulture = original.AvailableCulture
-type AvailablePrebuiltEntityModel = original.AvailablePrebuiltEntityModel
-type BaseClient = original.BaseClient
-type BatchLabelExample = original.BatchLabelExample
-type ChildEntity = original.ChildEntity
-type ClosedList = original.ClosedList
-type ClosedListEntityExtractor = original.ClosedListEntityExtractor
-type ClosedListModelCreateObject = original.ClosedListModelCreateObject
-type ClosedListModelPatchObject = original.ClosedListModelPatchObject
-type ClosedListModelUpdateObject = original.ClosedListModelUpdateObject
-type CollaboratorsArray = original.CollaboratorsArray
-type CompositeChildModelCreateObject = original.CompositeChildModelCreateObject
-type CompositeEntityExtractor = original.CompositeEntityExtractor
-type CompositeEntityModel = original.CompositeEntityModel
-type CustomPrebuiltModel = original.CustomPrebuiltModel
-type EndpointInfo = original.EndpointInfo
-type EnqueueTrainingResponse = original.EnqueueTrainingResponse
-type EntitiesSuggestionExample = original.EntitiesSuggestionExample
-type EntityExtractor = original.EntityExtractor
-type EntityLabel = original.EntityLabel
-type EntityLabelObject = original.EntityLabelObject
-type EntityModelInfo = original.EntityModelInfo
-type EntityPrediction = original.EntityPrediction
-type EntityRole = original.EntityRole
-type EntityRoleCreateObject = original.EntityRoleCreateObject
-type EntityRoleUpdateObject = original.EntityRoleUpdateObject
-type ErrorResponse = original.ErrorResponse
-type ExampleLabelObject = original.ExampleLabelObject
-type ExamplesClient = original.ExamplesClient
-type ExplicitListItem = original.ExplicitListItem
-type ExplicitListItemCreateObject = original.ExplicitListItemCreateObject
-type ExplicitListItemUpdateObject = original.ExplicitListItemUpdateObject
-type FeatureInfoObject = original.FeatureInfoObject
-type FeaturesClient = original.FeaturesClient
-type FeaturesResponseObject = original.FeaturesResponseObject
-type HierarchicalChildEntity = original.HierarchicalChildEntity
-type HierarchicalChildModelCreateObject = original.HierarchicalChildModelCreateObject
-type HierarchicalChildModelUpdateObject = original.HierarchicalChildModelUpdateObject
-type HierarchicalEntityExtractor = original.HierarchicalEntityExtractor
-type HierarchicalEntityModel = original.HierarchicalEntityModel
-type HierarchicalModel = original.HierarchicalModel
-type Int32 = original.Int32
-type IntentClassifier = original.IntentClassifier
-type IntentPrediction = original.IntentPrediction
-type IntentsSuggestionExample = original.IntentsSuggestionExample
-type JSONEntity = original.JSONEntity
-type JSONModelFeature = original.JSONModelFeature
-type JSONRegexFeature = original.JSONRegexFeature
-type JSONUtterance = original.JSONUtterance
-type LabelExampleResponse = original.LabelExampleResponse
-type LabeledUtterance = original.LabeledUtterance
-type ListApplicationInfoResponse = original.ListApplicationInfoResponse
-type ListAvailableCulture = original.ListAvailableCulture
-type ListAvailablePrebuiltEntityModel = original.ListAvailablePrebuiltEntityModel
-type ListBatchLabelExample = original.ListBatchLabelExample
-type ListClosedListEntityExtractor = original.ListClosedListEntityExtractor
-type ListCompositeEntityExtractor = original.ListCompositeEntityExtractor
-type ListCustomPrebuiltModel = original.ListCustomPrebuiltModel
-type ListEntitiesSuggestionExample = original.ListEntitiesSuggestionExample
-type ListEntityExtractor = original.ListEntityExtractor
-type ListEntityRole = original.ListEntityRole
-type ListExplicitListItem = original.ListExplicitListItem
-type ListHierarchicalEntityExtractor = original.ListHierarchicalEntityExtractor
-type ListIntentClassifier = original.ListIntentClassifier
-type ListIntentsSuggestionExample = original.ListIntentsSuggestionExample
-type ListLabeledUtterance = original.ListLabeledUtterance
-type ListModelInfoResponse = original.ListModelInfoResponse
-type ListModelTrainingInfo = original.ListModelTrainingInfo
-type ListPatternAnyEntityExtractor = original.ListPatternAnyEntityExtractor
-type ListPatternRuleInfo = original.ListPatternRuleInfo
-type ListPhraseListFeatureInfo = original.ListPhraseListFeatureInfo
-type ListPrebuiltDomain = original.ListPrebuiltDomain
-type ListPrebuiltEntityExtractor = original.ListPrebuiltEntityExtractor
-type ListRegexEntityExtractor = original.ListRegexEntityExtractor
-type ListString = original.ListString
-type ListUUID = original.ListUUID
-type ListVersionInfo = original.ListVersionInfo
-type LuisApp = original.LuisApp
-type ModelClient = original.ModelClient
-type ModelCreateObject = original.ModelCreateObject
-type ModelInfo = original.ModelInfo
-type ModelInfoResponse = original.ModelInfoResponse
-type ModelTrainingDetails = original.ModelTrainingDetails
-type ModelTrainingInfo = original.ModelTrainingInfo
-type ModelUpdateObject = original.ModelUpdateObject
-type OperationError = original.OperationError
-type OperationStatus = original.OperationStatus
-type PatternAny = original.PatternAny
-type PatternAnyEntityExtractor = original.PatternAnyEntityExtractor
-type PatternAnyModelCreateObject = original.PatternAnyModelCreateObject
-type PatternAnyModelUpdateObject = original.PatternAnyModelUpdateObject
-type PatternClient = original.PatternClient
-type PatternCreateObject = original.PatternCreateObject
-type PatternFeatureInfo = original.PatternFeatureInfo
-type PatternRule = original.PatternRule
-type PatternRuleCreateObject = original.PatternRuleCreateObject
-type PatternRuleInfo = original.PatternRuleInfo
-type PatternRuleUpdateObject = original.PatternRuleUpdateObject
-type PatternUpdateObject = original.PatternUpdateObject
-type PermissionsClient = original.PermissionsClient
-type PersonalAssistantsResponse = original.PersonalAssistantsResponse
-type PhraseListFeatureInfo = original.PhraseListFeatureInfo
-type PhraselistCreateObject = original.PhraselistCreateObject
-type PhraselistUpdateObject = original.PhraselistUpdateObject
-type PrebuiltDomain = original.PrebuiltDomain
-type PrebuiltDomainCreateBaseObject = original.PrebuiltDomainCreateBaseObject
-type PrebuiltDomainCreateObject = original.PrebuiltDomainCreateObject
-type PrebuiltDomainItem = original.PrebuiltDomainItem
-type PrebuiltDomainModelCreateObject = original.PrebuiltDomainModelCreateObject
-type PrebuiltDomainObject = original.PrebuiltDomainObject
-type PrebuiltEntity = original.PrebuiltEntity
-type PrebuiltEntityExtractor = original.PrebuiltEntityExtractor
-type ProductionOrStagingEndpointInfo = original.ProductionOrStagingEndpointInfo
-type ReadCloser = original.ReadCloser
-type RegexEntity = original.RegexEntity
-type RegexEntityExtractor = original.RegexEntityExtractor
-type RegexModelCreateObject = original.RegexModelCreateObject
-type RegexModelUpdateObject = original.RegexModelUpdateObject
-type SetString = original.SetString
-type String = original.String
-type SubClosedList = original.SubClosedList
-type SubClosedListResponse = original.SubClosedListResponse
-type TaskUpdateObject = original.TaskUpdateObject
-type TrainClient = original.TrainClient
-type UUID = original.UUID
-type UserAccessList = original.UserAccessList
-type UserCollaborator = original.UserCollaborator
-type VersionInfo = original.VersionInfo
-type VersionsClient = original.VersionsClient
-type WordListBaseUpdateObject = original.WordListBaseUpdateObject
-type WordListObject = original.WordListObject
-
-func New(azureRegion AzureRegions) BaseClient {
- return original.New(azureRegion)
-}
-func NewAppsClient(azureRegion AzureRegions) AppsClient {
- return original.NewAppsClient(azureRegion)
-}
-func NewExamplesClient(azureRegion AzureRegions) ExamplesClient {
- return original.NewExamplesClient(azureRegion)
-}
-func NewFeaturesClient(azureRegion AzureRegions) FeaturesClient {
- return original.NewFeaturesClient(azureRegion)
-}
-func NewModelClient(azureRegion AzureRegions) ModelClient {
- return original.NewModelClient(azureRegion)
-}
-func NewPatternClient(azureRegion AzureRegions) PatternClient {
- return original.NewPatternClient(azureRegion)
-}
-func NewPermissionsClient(azureRegion AzureRegions) PermissionsClient {
- return original.NewPermissionsClient(azureRegion)
-}
-func NewTrainClient(azureRegion AzureRegions) TrainClient {
- return original.NewTrainClient(azureRegion)
-}
-func NewVersionsClient(azureRegion AzureRegions) VersionsClient {
- return original.NewVersionsClient(azureRegion)
-}
-func NewWithoutDefaults(azureRegion AzureRegions) BaseClient {
- return original.NewWithoutDefaults(azureRegion)
-}
-func PossibleAzureRegionsValues() []AzureRegions {
- return original.PossibleAzureRegionsValues()
-}
-func PossibleOperationStatusTypeValues() []OperationStatusType {
- return original.PossibleOperationStatusTypeValues()
-}
-func PossibleReadableType10Values() []ReadableType10 {
- return original.PossibleReadableType10Values()
-}
-func PossibleReadableType1Values() []ReadableType1 {
- return original.PossibleReadableType1Values()
-}
-func PossibleReadableType2Values() []ReadableType2 {
- return original.PossibleReadableType2Values()
-}
-func PossibleReadableType3Values() []ReadableType3 {
- return original.PossibleReadableType3Values()
-}
-func PossibleReadableType4Values() []ReadableType4 {
- return original.PossibleReadableType4Values()
-}
-func PossibleReadableType5Values() []ReadableType5 {
- return original.PossibleReadableType5Values()
-}
-func PossibleReadableType6Values() []ReadableType6 {
- return original.PossibleReadableType6Values()
-}
-func PossibleReadableType7Values() []ReadableType7 {
- return original.PossibleReadableType7Values()
-}
-func PossibleReadableType8Values() []ReadableType8 {
- return original.PossibleReadableType8Values()
-}
-func PossibleReadableType9Values() []ReadableType9 {
- return original.PossibleReadableType9Values()
-}
-func PossibleReadableTypeValues() []ReadableType {
- return original.PossibleReadableTypeValues()
-}
-func PossibleStatus1Values() []Status1 {
- return original.PossibleStatus1Values()
-}
-func PossibleStatusValues() []Status {
- return original.PossibleStatusValues()
-}
-func PossibleTrainingStatusValues() []TrainingStatus {
- return original.PossibleTrainingStatusValues()
-}
-func UserAgent() string {
- return original.UserAgent() + " profiles/latest"
-}
-func Version() string {
- return original.Version()
-}
diff --git a/profiles/latest/compute/mgmt/compute/models.go b/profiles/latest/compute/mgmt/compute/models.go
index 8bafe939394d..c0d6c7644bad 100644
--- a/profiles/latest/compute/mgmt/compute/models.go
+++ b/profiles/latest/compute/mgmt/compute/models.go
@@ -460,6 +460,14 @@ const (
Regular VirtualMachinePriorityTypes = original.Regular
)
+type VirtualMachineScaleSetScaleInRules = original.VirtualMachineScaleSetScaleInRules
+
+const (
+ Default VirtualMachineScaleSetScaleInRules = original.Default
+ NewestVM VirtualMachineScaleSetScaleInRules = original.NewestVM
+ OldestVM VirtualMachineScaleSetScaleInRules = original.OldestVM
+)
+
type VirtualMachineScaleSetSkuScaleType = original.VirtualMachineScaleSetSkuScaleType
const (
@@ -866,6 +874,7 @@ type RunCommandParameterDefinition = original.RunCommandParameterDefinition
type RunCommandResult = original.RunCommandResult
type SSHConfiguration = original.SSHConfiguration
type SSHPublicKey = original.SSHPublicKey
+type ScaleInPolicy = original.ScaleInPolicy
type ScheduledEventsProfile = original.ScheduledEventsProfile
type Sku = original.Sku
type Snapshot = original.Snapshot
@@ -1508,6 +1517,9 @@ func PossibleVirtualMachineEvictionPolicyTypesValues() []VirtualMachineEvictionP
func PossibleVirtualMachinePriorityTypesValues() []VirtualMachinePriorityTypes {
return original.PossibleVirtualMachinePriorityTypesValues()
}
+func PossibleVirtualMachineScaleSetScaleInRulesValues() []VirtualMachineScaleSetScaleInRules {
+ return original.PossibleVirtualMachineScaleSetScaleInRulesValues()
+}
func PossibleVirtualMachineScaleSetSkuScaleTypeValues() []VirtualMachineScaleSetSkuScaleType {
return original.PossibleVirtualMachineScaleSetSkuScaleTypeValues()
}
diff --git a/profiles/latest/cosmos-db/mgmt/documentdb/models.go b/profiles/latest/cosmos-db/mgmt/documentdb/models.go
index c2dd112fa7dd..dfc17a427c56 100644
--- a/profiles/latest/cosmos-db/mgmt/documentdb/models.go
+++ b/profiles/latest/cosmos-db/mgmt/documentdb/models.go
@@ -112,12 +112,12 @@ const (
type PrimaryAggregationType = original.PrimaryAggregationType
const (
- PrimaryAggregationTypeAverage PrimaryAggregationType = original.PrimaryAggregationTypeAverage
- PrimaryAggregationTypeLast PrimaryAggregationType = original.PrimaryAggregationTypeLast
- PrimaryAggregationTypeMaximum PrimaryAggregationType = original.PrimaryAggregationTypeMaximum
- PrimaryAggregationTypeMinimimum PrimaryAggregationType = original.PrimaryAggregationTypeMinimimum
- PrimaryAggregationTypeNone PrimaryAggregationType = original.PrimaryAggregationTypeNone
- PrimaryAggregationTypeTotal PrimaryAggregationType = original.PrimaryAggregationTypeTotal
+ PrimaryAggregationTypeAverage PrimaryAggregationType = original.PrimaryAggregationTypeAverage
+ PrimaryAggregationTypeLast PrimaryAggregationType = original.PrimaryAggregationTypeLast
+ PrimaryAggregationTypeMaximum PrimaryAggregationType = original.PrimaryAggregationTypeMaximum
+ PrimaryAggregationTypeMinimum PrimaryAggregationType = original.PrimaryAggregationTypeMinimum
+ PrimaryAggregationTypeNone PrimaryAggregationType = original.PrimaryAggregationTypeNone
+ PrimaryAggregationTypeTotal PrimaryAggregationType = original.PrimaryAggregationTypeTotal
)
type UnitType = original.UnitType
diff --git a/profiles/latest/databox/mgmt/databox/databoxapi/models.go b/profiles/latest/databox/mgmt/databox/databoxapi/models.go
index 4cbd950b6a9b..d1f0705c3f4b 100644
--- a/profiles/latest/databox/mgmt/databox/databoxapi/models.go
+++ b/profiles/latest/databox/mgmt/databox/databoxapi/models.go
@@ -19,7 +19,7 @@
package databoxapi
-import original "github.com/Azure/azure-sdk-for-go/services/databox/mgmt/2018-01-01/databox/databoxapi"
+import original "github.com/Azure/azure-sdk-for-go/services/databox/mgmt/2019-09-01/databox/databoxapi"
type JobsClientAPI = original.JobsClientAPI
type OperationsClientAPI = original.OperationsClientAPI
diff --git a/profiles/latest/databox/mgmt/databox/models.go b/profiles/latest/databox/mgmt/databox/models.go
index aaee28b88012..cfd5f24d7b2b 100644
--- a/profiles/latest/databox/mgmt/databox/models.go
+++ b/profiles/latest/databox/mgmt/databox/models.go
@@ -22,7 +22,7 @@ package databox
import (
"context"
- original "github.com/Azure/azure-sdk-for-go/services/databox/mgmt/2018-01-01/databox"
+ original "github.com/Azure/azure-sdk-for-go/services/databox/mgmt/2019-09-01/databox"
)
const (
@@ -64,20 +64,39 @@ const (
type CopyStatus = original.CopyStatus
const (
- Completed CopyStatus = original.Completed
- CompletedWithErrors CopyStatus = original.CompletedWithErrors
- Failed CopyStatus = original.Failed
- InProgress CopyStatus = original.InProgress
- NotReturned CopyStatus = original.NotReturned
- NotStarted CopyStatus = original.NotStarted
+ Completed CopyStatus = original.Completed
+ CompletedWithErrors CopyStatus = original.CompletedWithErrors
+ DeviceFormatted CopyStatus = original.DeviceFormatted
+ DeviceMetadataModified CopyStatus = original.DeviceMetadataModified
+ Failed CopyStatus = original.Failed
+ HardwareError CopyStatus = original.HardwareError
+ InProgress CopyStatus = original.InProgress
+ NotReturned CopyStatus = original.NotReturned
+ NotStarted CopyStatus = original.NotStarted
+ StorageAccountNotAccessible CopyStatus = original.StorageAccountNotAccessible
+ UnsupportedData CopyStatus = original.UnsupportedData
)
type DataDestinationType = original.DataDestinationType
const (
- DataDestinationTypeDestinationAccountDetails DataDestinationType = original.DataDestinationTypeDestinationAccountDetails
- DataDestinationTypeManagedDisk DataDestinationType = original.DataDestinationTypeManagedDisk
- DataDestinationTypeStorageAccount DataDestinationType = original.DataDestinationTypeStorageAccount
+ ManagedDisk DataDestinationType = original.ManagedDisk
+ StorageAccount DataDestinationType = original.StorageAccount
+)
+
+type DataDestinationTypeBasicDestinationAccountDetails = original.DataDestinationTypeBasicDestinationAccountDetails
+
+const (
+ DataDestinationTypeDestinationAccountDetails DataDestinationTypeBasicDestinationAccountDetails = original.DataDestinationTypeDestinationAccountDetails
+ DataDestinationTypeManagedDisk DataDestinationTypeBasicDestinationAccountDetails = original.DataDestinationTypeManagedDisk
+ DataDestinationTypeStorageAccount DataDestinationTypeBasicDestinationAccountDetails = original.DataDestinationTypeStorageAccount
+)
+
+type JobDeliveryType = original.JobDeliveryType
+
+const (
+ NonScheduled JobDeliveryType = original.NonScheduled
+ Scheduled JobDeliveryType = original.Scheduled
)
type JobDetailsTypeEnum = original.JobDetailsTypeEnum
@@ -109,15 +128,23 @@ const (
PickedUp NotificationStageName = original.PickedUp
)
+type OverallValidationStatus = original.OverallValidationStatus
+
+const (
+ AllValidToProceed OverallValidationStatus = original.AllValidToProceed
+ CertainInputValidationsSkipped OverallValidationStatus = original.CertainInputValidationsSkipped
+ InputsRevisitRequired OverallValidationStatus = original.InputsRevisitRequired
+)
+
type ShareDestinationFormatType = original.ShareDestinationFormatType
const (
- AzureFile ShareDestinationFormatType = original.AzureFile
- BlockBlob ShareDestinationFormatType = original.BlockBlob
- HCS ShareDestinationFormatType = original.HCS
- ManagedDisk ShareDestinationFormatType = original.ManagedDisk
- PageBlob ShareDestinationFormatType = original.PageBlob
- UnknownType ShareDestinationFormatType = original.UnknownType
+ ShareDestinationFormatTypeAzureFile ShareDestinationFormatType = original.ShareDestinationFormatTypeAzureFile
+ ShareDestinationFormatTypeBlockBlob ShareDestinationFormatType = original.ShareDestinationFormatTypeBlockBlob
+ ShareDestinationFormatTypeHCS ShareDestinationFormatType = original.ShareDestinationFormatTypeHCS
+ ShareDestinationFormatTypeManagedDisk ShareDestinationFormatType = original.ShareDestinationFormatTypeManagedDisk
+ ShareDestinationFormatTypePageBlob ShareDestinationFormatType = original.ShareDestinationFormatTypePageBlob
+ ShareDestinationFormatTypeUnknownType ShareDestinationFormatType = original.ShareDestinationFormatTypeUnknownType
)
type SkuDisabledReason = original.SkuDisabledReason
@@ -139,6 +166,15 @@ const (
DataBoxHeavy SkuName = original.DataBoxHeavy
)
+type SkuNameBasicScheduleAvailabilityRequest = original.SkuNameBasicScheduleAvailabilityRequest
+
+const (
+ SkuNameDataBox SkuNameBasicScheduleAvailabilityRequest = original.SkuNameDataBox
+ SkuNameDataBoxDisk SkuNameBasicScheduleAvailabilityRequest = original.SkuNameDataBoxDisk
+ SkuNameDataBoxHeavy SkuNameBasicScheduleAvailabilityRequest = original.SkuNameDataBoxHeavy
+ SkuNameScheduleAvailabilityRequest SkuNameBasicScheduleAvailabilityRequest = original.SkuNameScheduleAvailabilityRequest
+)
+
type StageName = original.StageName
const (
@@ -147,6 +183,7 @@ const (
StageNameCancelled StageName = original.StageNameCancelled
StageNameCompleted StageName = original.StageNameCompleted
StageNameCompletedWithErrors StageName = original.StageNameCompletedWithErrors
+ StageNameCompletedWithWarnings StageName = original.StageNameCompletedWithWarnings
StageNameDataCopy StageName = original.StageNameDataCopy
StageNameDelivered StageName = original.StageNameDelivered
StageNameDeviceOrdered StageName = original.StageNameDeviceOrdered
@@ -155,6 +192,8 @@ const (
StageNameFailedIssueDetectedAtAzureDC StageName = original.StageNameFailedIssueDetectedAtAzureDC
StageNameFailedIssueReportedAtCustomer StageName = original.StageNameFailedIssueReportedAtCustomer
StageNamePickedUp StageName = original.StageNamePickedUp
+ StageNameReadyToDispatchFromAzureDC StageName = original.StageNameReadyToDispatchFromAzureDC
+ StageNameReadyToReceiveAtAzureDC StageName = original.StageNameReadyToReceiveAtAzureDC
)
type StageStatus = original.StageStatus
@@ -169,6 +208,52 @@ const (
StageStatusSucceededWithErrors StageStatus = original.StageStatusSucceededWithErrors
)
+type TransportShipmentTypes = original.TransportShipmentTypes
+
+const (
+ CustomerManaged TransportShipmentTypes = original.CustomerManaged
+ MicrosoftManaged TransportShipmentTypes = original.MicrosoftManaged
+)
+
+type ValidationCategory = original.ValidationCategory
+
+const (
+ ValidationCategoryJobCreationValidation ValidationCategory = original.ValidationCategoryJobCreationValidation
+ ValidationCategoryValidationRequest ValidationCategory = original.ValidationCategoryValidationRequest
+)
+
+type ValidationStatus = original.ValidationStatus
+
+const (
+ ValidationStatusInvalid ValidationStatus = original.ValidationStatusInvalid
+ ValidationStatusSkipped ValidationStatus = original.ValidationStatusSkipped
+ ValidationStatusValid ValidationStatus = original.ValidationStatusValid
+)
+
+type ValidationType = original.ValidationType
+
+const (
+ ValidationTypeValidateAddress ValidationType = original.ValidationTypeValidateAddress
+ ValidationTypeValidateCreateOrderLimit ValidationType = original.ValidationTypeValidateCreateOrderLimit
+ ValidationTypeValidateDataDestinationDetails ValidationType = original.ValidationTypeValidateDataDestinationDetails
+ ValidationTypeValidatePreferences ValidationType = original.ValidationTypeValidatePreferences
+ ValidationTypeValidateSkuAvailability ValidationType = original.ValidationTypeValidateSkuAvailability
+ ValidationTypeValidateSubscriptionIsAllowedToCreateJob ValidationType = original.ValidationTypeValidateSubscriptionIsAllowedToCreateJob
+ ValidationTypeValidationInputRequest ValidationType = original.ValidationTypeValidationInputRequest
+)
+
+type ValidationTypeBasicValidationInputResponse = original.ValidationTypeBasicValidationInputResponse
+
+const (
+ ValidationTypeBasicValidationInputResponseValidationTypeValidateAddress ValidationTypeBasicValidationInputResponse = original.ValidationTypeBasicValidationInputResponseValidationTypeValidateAddress
+ ValidationTypeBasicValidationInputResponseValidationTypeValidateCreateOrderLimit ValidationTypeBasicValidationInputResponse = original.ValidationTypeBasicValidationInputResponseValidationTypeValidateCreateOrderLimit
+ ValidationTypeBasicValidationInputResponseValidationTypeValidateDataDestinationDetails ValidationTypeBasicValidationInputResponse = original.ValidationTypeBasicValidationInputResponseValidationTypeValidateDataDestinationDetails
+ ValidationTypeBasicValidationInputResponseValidationTypeValidatePreferences ValidationTypeBasicValidationInputResponse = original.ValidationTypeBasicValidationInputResponseValidationTypeValidatePreferences
+ ValidationTypeBasicValidationInputResponseValidationTypeValidateSkuAvailability ValidationTypeBasicValidationInputResponse = original.ValidationTypeBasicValidationInputResponseValidationTypeValidateSkuAvailability
+ ValidationTypeBasicValidationInputResponseValidationTypeValidateSubscriptionIsAllowedToCreateJob ValidationTypeBasicValidationInputResponse = original.ValidationTypeBasicValidationInputResponseValidationTypeValidateSubscriptionIsAllowedToCreateJob
+ ValidationTypeBasicValidationInputResponseValidationTypeValidationInputResponse ValidationTypeBasicValidationInputResponse = original.ValidationTypeBasicValidationInputResponseValidationTypeValidationInputResponse
+)
+
type AccountCopyLogDetails = original.AccountCopyLogDetails
type AccountCredentialDetails = original.AccountCredentialDetails
type AddressValidationOutput = original.AddressValidationOutput
@@ -184,10 +269,21 @@ type BasicCopyLogDetails = original.BasicCopyLogDetails
type BasicDestinationAccountDetails = original.BasicDestinationAccountDetails
type BasicJobDetails = original.BasicJobDetails
type BasicJobSecrets = original.BasicJobSecrets
+type BasicScheduleAvailabilityRequest = original.BasicScheduleAvailabilityRequest
+type BasicValidationInputRequest = original.BasicValidationInputRequest
+type BasicValidationInputResponse = original.BasicValidationInputResponse
+type BasicValidationRequest = original.BasicValidationRequest
type CancellationReason = original.CancellationReason
+type CloudError = original.CloudError
type ContactDetails = original.ContactDetails
type CopyLogDetails = original.CopyLogDetails
type CopyProgress = original.CopyProgress
+type CreateJobValidations = original.CreateJobValidations
+type CreateOrderLimitForSubscriptionValidationRequest = original.CreateOrderLimitForSubscriptionValidationRequest
+type CreateOrderLimitForSubscriptionValidationResponseProperties = original.CreateOrderLimitForSubscriptionValidationResponseProperties
+type DataDestinationDetailsValidationRequest = original.DataDestinationDetailsValidationRequest
+type DataDestinationDetailsValidationResponseProperties = original.DataDestinationDetailsValidationResponseProperties
+type DcAccessSecurityCode = original.DcAccessSecurityCode
type DestinationAccountDetails = original.DestinationAccountDetails
type DestinationManagedDiskDetails = original.DestinationManagedDiskDetails
type DestinationStorageAccountDetails = original.DestinationStorageAccountDetails
@@ -196,12 +292,15 @@ type DiskCopyLogDetails = original.DiskCopyLogDetails
type DiskCopyProgress = original.DiskCopyProgress
type DiskJobDetails = original.DiskJobDetails
type DiskJobSecrets = original.DiskJobSecrets
+type DiskScheduleAvailabilityRequest = original.DiskScheduleAvailabilityRequest
type DiskSecret = original.DiskSecret
type Error = original.Error
type HeavyAccountCopyLogDetails = original.HeavyAccountCopyLogDetails
type HeavyJobDetails = original.HeavyJobDetails
type HeavyJobSecrets = original.HeavyJobSecrets
+type HeavyScheduleAvailabilityRequest = original.HeavyScheduleAvailabilityRequest
type HeavySecret = original.HeavySecret
+type JobDeliveryInfo = original.JobDeliveryInfo
type JobDetails = original.JobDetails
type JobDetailsType = original.JobDetailsType
type JobErrorDetails = original.JobErrorDetails
@@ -227,7 +326,14 @@ type OperationListPage = original.OperationListPage
type OperationsClient = original.OperationsClient
type PackageShippingDetails = original.PackageShippingDetails
type Preferences = original.Preferences
+type PreferencesValidationRequest = original.PreferencesValidationRequest
+type PreferencesValidationResponseProperties = original.PreferencesValidationResponseProperties
+type RegionConfigurationRequest = original.RegionConfigurationRequest
+type RegionConfigurationResponse = original.RegionConfigurationResponse
type Resource = original.Resource
+type ScheduleAvailabilityRequest = original.ScheduleAvailabilityRequest
+type ScheduleAvailabilityRequestType = original.ScheduleAvailabilityRequestType
+type ScheduleAvailabilityResponse = original.ScheduleAvailabilityResponse
type Secret = original.Secret
type ServiceClient = original.ServiceClient
type ShareCredentialDetails = original.ShareCredentialDetails
@@ -235,15 +341,28 @@ type ShipmentPickUpRequest = original.ShipmentPickUpRequest
type ShipmentPickUpResponse = original.ShipmentPickUpResponse
type ShippingAddress = original.ShippingAddress
type Sku = original.Sku
+type SkuAvailabilityValidationRequest = original.SkuAvailabilityValidationRequest
+type SkuAvailabilityValidationResponseProperties = original.SkuAvailabilityValidationResponseProperties
type SkuCapacity = original.SkuCapacity
type SkuCost = original.SkuCost
type SkuInformation = original.SkuInformation
type SkuProperties = original.SkuProperties
+type SubscriptionIsAllowedToCreateJobValidationRequest = original.SubscriptionIsAllowedToCreateJobValidationRequest
+type SubscriptionIsAllowedToCreateJobValidationResponseProperties = original.SubscriptionIsAllowedToCreateJobValidationResponseProperties
+type TransportAvailabilityDetails = original.TransportAvailabilityDetails
+type TransportAvailabilityRequest = original.TransportAvailabilityRequest
+type TransportAvailabilityResponse = original.TransportAvailabilityResponse
+type TransportPreferences = original.TransportPreferences
type UnencryptedCredentials = original.UnencryptedCredentials
type UnencryptedCredentialsList = original.UnencryptedCredentialsList
type UpdateJobDetails = original.UpdateJobDetails
type UpdateJobProperties = original.UpdateJobProperties
type ValidateAddress = original.ValidateAddress
+type ValidationInputRequest = original.ValidationInputRequest
+type ValidationInputResponse = original.ValidationInputResponse
+type ValidationRequest = original.ValidationRequest
+type ValidationResponse = original.ValidationResponse
+type ValidationResponseProperties = original.ValidationResponseProperties
func New(subscriptionID string) BaseClient {
return original.New(subscriptionID)
@@ -302,9 +421,15 @@ func PossibleCopyLogDetailsTypeValues() []CopyLogDetailsType {
func PossibleCopyStatusValues() []CopyStatus {
return original.PossibleCopyStatusValues()
}
+func PossibleDataDestinationTypeBasicDestinationAccountDetailsValues() []DataDestinationTypeBasicDestinationAccountDetails {
+ return original.PossibleDataDestinationTypeBasicDestinationAccountDetailsValues()
+}
func PossibleDataDestinationTypeValues() []DataDestinationType {
return original.PossibleDataDestinationTypeValues()
}
+func PossibleJobDeliveryTypeValues() []JobDeliveryType {
+ return original.PossibleJobDeliveryTypeValues()
+}
func PossibleJobDetailsTypeEnumValues() []JobDetailsTypeEnum {
return original.PossibleJobDetailsTypeEnumValues()
}
@@ -314,12 +439,18 @@ func PossibleJobSecretsTypeEnumValues() []JobSecretsTypeEnum {
func PossibleNotificationStageNameValues() []NotificationStageName {
return original.PossibleNotificationStageNameValues()
}
+func PossibleOverallValidationStatusValues() []OverallValidationStatus {
+ return original.PossibleOverallValidationStatusValues()
+}
func PossibleShareDestinationFormatTypeValues() []ShareDestinationFormatType {
return original.PossibleShareDestinationFormatTypeValues()
}
func PossibleSkuDisabledReasonValues() []SkuDisabledReason {
return original.PossibleSkuDisabledReasonValues()
}
+func PossibleSkuNameBasicScheduleAvailabilityRequestValues() []SkuNameBasicScheduleAvailabilityRequest {
+ return original.PossibleSkuNameBasicScheduleAvailabilityRequestValues()
+}
func PossibleSkuNameValues() []SkuName {
return original.PossibleSkuNameValues()
}
@@ -329,6 +460,21 @@ func PossibleStageNameValues() []StageName {
func PossibleStageStatusValues() []StageStatus {
return original.PossibleStageStatusValues()
}
+func PossibleTransportShipmentTypesValues() []TransportShipmentTypes {
+ return original.PossibleTransportShipmentTypesValues()
+}
+func PossibleValidationCategoryValues() []ValidationCategory {
+ return original.PossibleValidationCategoryValues()
+}
+func PossibleValidationStatusValues() []ValidationStatus {
+ return original.PossibleValidationStatusValues()
+}
+func PossibleValidationTypeBasicValidationInputResponseValues() []ValidationTypeBasicValidationInputResponse {
+ return original.PossibleValidationTypeBasicValidationInputResponseValues()
+}
+func PossibleValidationTypeValues() []ValidationType {
+ return original.PossibleValidationTypeValues()
+}
func UserAgent() string {
return original.UserAgent() + " profiles/latest"
}
diff --git a/profiles/latest/edgegateway/mgmt/edgegateway/edgegatewayapi/models.go b/profiles/latest/databoxedge/mgmt/databoxedge/databoxedgeapi/models.go
similarity index 88%
rename from profiles/latest/edgegateway/mgmt/edgegateway/edgegatewayapi/models.go
rename to profiles/latest/databoxedge/mgmt/databoxedge/databoxedgeapi/models.go
index c73455d1c53f..fa769db5d05e 100644
--- a/profiles/latest/edgegateway/mgmt/edgegateway/edgegatewayapi/models.go
+++ b/profiles/latest/databoxedge/mgmt/databoxedge/databoxedgeapi/models.go
@@ -17,14 +17,15 @@
// This code was auto-generated by:
// github.com/Azure/azure-sdk-for-go/tools/profileBuilder
-package edgegatewayapi
+package databoxedgeapi
-import original "github.com/Azure/azure-sdk-for-go/services/edgegateway/mgmt/2019-03-01/edgegateway/edgegatewayapi"
+import original "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2019-07-01/databoxedge/databoxedgeapi"
type AlertsClientAPI = original.AlertsClientAPI
type BandwidthSchedulesClientAPI = original.BandwidthSchedulesClientAPI
type DevicesClientAPI = original.DevicesClientAPI
type JobsClientAPI = original.JobsClientAPI
+type NodesClientAPI = original.NodesClientAPI
type OperationsClientAPI = original.OperationsClientAPI
type OperationsStatusClientAPI = original.OperationsStatusClientAPI
type OrdersClientAPI = original.OrdersClientAPI
diff --git a/profiles/latest/edgegateway/mgmt/edgegateway/models.go b/profiles/latest/databoxedge/mgmt/databoxedge/models.go
similarity index 91%
rename from profiles/latest/edgegateway/mgmt/edgegateway/models.go
rename to profiles/latest/databoxedge/mgmt/databoxedge/models.go
index 24f2b3763998..3f9c78273acc 100644
--- a/profiles/latest/edgegateway/mgmt/edgegateway/models.go
+++ b/profiles/latest/databoxedge/mgmt/databoxedge/models.go
@@ -17,12 +17,12 @@
// This code was auto-generated by:
// github.com/Azure/azure-sdk-for-go/tools/profileBuilder
-package edgegateway
+package databoxedge
import (
"context"
- original "github.com/Azure/azure-sdk-for-go/services/edgegateway/mgmt/2019-03-01/edgegateway"
+ original "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2019-07-01/databoxedge"
)
const (
@@ -67,17 +67,6 @@ const (
ReadWrite ClientPermissionType = original.ReadWrite
)
-type DataBoxEdgeDeviceStatus = original.DataBoxEdgeDeviceStatus
-
-const (
- Disconnected DataBoxEdgeDeviceStatus = original.Disconnected
- NeedsAttention DataBoxEdgeDeviceStatus = original.NeedsAttention
- Offline DataBoxEdgeDeviceStatus = original.Offline
- Online DataBoxEdgeDeviceStatus = original.Online
- PartiallyDisconnected DataBoxEdgeDeviceStatus = original.PartiallyDisconnected
- ReadyToSetup DataBoxEdgeDeviceStatus = original.ReadyToSetup
-)
-
type DataPolicy = original.DataPolicy
const (
@@ -97,10 +86,22 @@ const (
Wednesday DayOfWeek = original.Wednesday
)
+type DeviceStatus = original.DeviceStatus
+
+const (
+ Disconnected DeviceStatus = original.Disconnected
+ Maintenance DeviceStatus = original.Maintenance
+ NeedsAttention DeviceStatus = original.NeedsAttention
+ Offline DeviceStatus = original.Offline
+ Online DeviceStatus = original.Online
+ PartiallyDisconnected DeviceStatus = original.PartiallyDisconnected
+ ReadyToSetup DeviceStatus = original.ReadyToSetup
+)
+
type DeviceType = original.DeviceType
const (
- DeviceTypeDataBoxEdgeDevice DeviceType = original.DeviceTypeDataBoxEdgeDevice
+ DataBoxEdgeDevice DeviceType = original.DataBoxEdgeDevice
)
type DownloadPhase = original.DownloadPhase
@@ -233,6 +234,16 @@ const (
NetworkGroupRDMA NetworkGroup = original.NetworkGroupRDMA
)
+type NodeStatus = original.NodeStatus
+
+const (
+ NodeStatusDown NodeStatus = original.NodeStatusDown
+ NodeStatusRebooting NodeStatus = original.NodeStatusRebooting
+ NodeStatusShuttingDown NodeStatus = original.NodeStatusShuttingDown
+ NodeStatusUnknown NodeStatus = original.NodeStatusUnknown
+ NodeStatusUp NodeStatus = original.NodeStatusUp
+)
+
type OrderState = original.OrderState
const (
@@ -300,8 +311,11 @@ const (
type ShareStatus = original.ShareStatus
const (
- ShareStatusOffline ShareStatus = original.ShareStatusOffline
- ShareStatusOnline ShareStatus = original.ShareStatusOnline
+ ShareStatusNeedsAttention ShareStatus = original.ShareStatusNeedsAttention
+ ShareStatusOffline ShareStatus = original.ShareStatusOffline
+ ShareStatusOK ShareStatus = original.ShareStatusOK
+ ShareStatusUnknown ShareStatus = original.ShareStatusUnknown
+ ShareStatusUpdating ShareStatus = original.ShareStatusUpdating
)
type SkuName = original.SkuName
@@ -388,14 +402,14 @@ type ClientAccessRight = original.ClientAccessRight
type CloudError = original.CloudError
type CloudErrorBody = original.CloudErrorBody
type ContactDetails = original.ContactDetails
-type DataBoxEdgeDevice = original.DataBoxEdgeDevice
-type DataBoxEdgeDeviceExtendedInfo = original.DataBoxEdgeDeviceExtendedInfo
-type DataBoxEdgeDeviceExtendedInfoProperties = original.DataBoxEdgeDeviceExtendedInfoProperties
-type DataBoxEdgeDeviceList = original.DataBoxEdgeDeviceList
-type DataBoxEdgeDeviceListIterator = original.DataBoxEdgeDeviceListIterator
-type DataBoxEdgeDeviceListPage = original.DataBoxEdgeDeviceListPage
-type DataBoxEdgeDevicePatch = original.DataBoxEdgeDevicePatch
-type DataBoxEdgeDeviceProperties = original.DataBoxEdgeDeviceProperties
+type Device = original.Device
+type DeviceExtendedInfo = original.DeviceExtendedInfo
+type DeviceExtendedInfoProperties = original.DeviceExtendedInfoProperties
+type DeviceList = original.DeviceList
+type DeviceListIterator = original.DeviceListIterator
+type DeviceListPage = original.DeviceListPage
+type DevicePatch = original.DevicePatch
+type DeviceProperties = original.DeviceProperties
type DevicesClient = original.DevicesClient
type DevicesCreateOrUpdateFuture = original.DevicesCreateOrUpdateFuture
type DevicesCreateOrUpdateSecuritySettingsFuture = original.DevicesCreateOrUpdateSecuritySettingsFuture
@@ -423,6 +437,10 @@ type NetworkAdapter = original.NetworkAdapter
type NetworkAdapterPosition = original.NetworkAdapterPosition
type NetworkSettings = original.NetworkSettings
type NetworkSettingsProperties = original.NetworkSettingsProperties
+type Node = original.Node
+type NodeList = original.NodeList
+type NodeProperties = original.NodeProperties
+type NodesClient = original.NodesClient
type Operation = original.Operation
type OperationDisplay = original.OperationDisplay
type OperationProperties = original.OperationProperties
@@ -529,11 +547,11 @@ func NewBandwidthSchedulesListIterator(page BandwidthSchedulesListPage) Bandwidt
func NewBandwidthSchedulesListPage(getNextPage func(context.Context, BandwidthSchedulesList) (BandwidthSchedulesList, error)) BandwidthSchedulesListPage {
return original.NewBandwidthSchedulesListPage(getNextPage)
}
-func NewDataBoxEdgeDeviceListIterator(page DataBoxEdgeDeviceListPage) DataBoxEdgeDeviceListIterator {
- return original.NewDataBoxEdgeDeviceListIterator(page)
+func NewDeviceListIterator(page DeviceListPage) DeviceListIterator {
+ return original.NewDeviceListIterator(page)
}
-func NewDataBoxEdgeDeviceListPage(getNextPage func(context.Context, DataBoxEdgeDeviceList) (DataBoxEdgeDeviceList, error)) DataBoxEdgeDeviceListPage {
- return original.NewDataBoxEdgeDeviceListPage(getNextPage)
+func NewDeviceListPage(getNextPage func(context.Context, DeviceList) (DeviceList, error)) DeviceListPage {
+ return original.NewDeviceListPage(getNextPage)
}
func NewDevicesClient(subscriptionID string) DevicesClient {
return original.NewDevicesClient(subscriptionID)
@@ -547,6 +565,12 @@ func NewJobsClient(subscriptionID string) JobsClient {
func NewJobsClientWithBaseURI(baseURI string, subscriptionID string) JobsClient {
return original.NewJobsClientWithBaseURI(baseURI, subscriptionID)
}
+func NewNodesClient(subscriptionID string) NodesClient {
+ return original.NewNodesClient(subscriptionID)
+}
+func NewNodesClientWithBaseURI(baseURI string, subscriptionID string) NodesClient {
+ return original.NewNodesClientWithBaseURI(baseURI, subscriptionID)
+}
func NewOperationsClient(subscriptionID string) OperationsClient {
return original.NewOperationsClient(subscriptionID)
}
@@ -655,15 +679,15 @@ func PossibleAzureContainerDataFormatValues() []AzureContainerDataFormat {
func PossibleClientPermissionTypeValues() []ClientPermissionType {
return original.PossibleClientPermissionTypeValues()
}
-func PossibleDataBoxEdgeDeviceStatusValues() []DataBoxEdgeDeviceStatus {
- return original.PossibleDataBoxEdgeDeviceStatusValues()
-}
func PossibleDataPolicyValues() []DataPolicy {
return original.PossibleDataPolicyValues()
}
func PossibleDayOfWeekValues() []DayOfWeek {
return original.PossibleDayOfWeekValues()
}
+func PossibleDeviceStatusValues() []DeviceStatus {
+ return original.PossibleDeviceStatusValues()
+}
func PossibleDeviceTypeValues() []DeviceType {
return original.PossibleDeviceTypeValues()
}
@@ -712,6 +736,9 @@ func PossibleNetworkAdapterStatusValues() []NetworkAdapterStatus {
func PossibleNetworkGroupValues() []NetworkGroup {
return original.PossibleNetworkGroupValues()
}
+func PossibleNodeStatusValues() []NodeStatus {
+ return original.PossibleNodeStatusValues()
+}
func PossibleOrderStateValues() []OrderState {
return original.PossibleOrderStateValues()
}
diff --git a/profiles/latest/datafactory/mgmt/datafactory/datafactoryapi/models.go b/profiles/latest/datafactory/mgmt/datafactory/datafactoryapi/models.go
index 2a039a860394..28f064af3a1b 100644
--- a/profiles/latest/datafactory/mgmt/datafactory/datafactoryapi/models.go
+++ b/profiles/latest/datafactory/mgmt/datafactory/datafactoryapi/models.go
@@ -22,6 +22,8 @@ package datafactoryapi
import original "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/datafactoryapi"
type ActivityRunsClientAPI = original.ActivityRunsClientAPI
+type DataFlowDebugSessionClientAPI = original.DataFlowDebugSessionClientAPI
+type DataFlowsClientAPI = original.DataFlowsClientAPI
type DatasetsClientAPI = original.DatasetsClientAPI
type ExposureControlClientAPI = original.ExposureControlClientAPI
type FactoriesClientAPI = original.FactoriesClientAPI
diff --git a/profiles/latest/datafactory/mgmt/datafactory/models.go b/profiles/latest/datafactory/mgmt/datafactory/models.go
index 6a2a948586a1..9f2331a40b3f 100644
--- a/profiles/latest/datafactory/mgmt/datafactory/models.go
+++ b/profiles/latest/datafactory/mgmt/datafactory/models.go
@@ -97,6 +97,22 @@ const (
TWO CassandraSourceReadConsistencyLevels = original.TWO
)
+type DataFlowComputeType = original.DataFlowComputeType
+
+const (
+ ComputeOptimized DataFlowComputeType = original.ComputeOptimized
+ General DataFlowComputeType = original.General
+ MemoryOptimized DataFlowComputeType = original.MemoryOptimized
+)
+
+type DataFlowDebugCommandType = original.DataFlowDebugCommandType
+
+const (
+ ExecuteExpressionQuery DataFlowDebugCommandType = original.ExecuteExpressionQuery
+ ExecutePreviewQuery DataFlowDebugCommandType = original.ExecutePreviewQuery
+ ExecuteStatisticsQuery DataFlowDebugCommandType = original.ExecuteStatisticsQuery
+)
+
type DayOfWeek = original.DayOfWeek
const (
@@ -667,6 +683,7 @@ const (
TypeDatabricksSparkPython TypeBasicActivity = original.TypeDatabricksSparkPython
TypeDataLakeAnalyticsUSQL TypeBasicActivity = original.TypeDataLakeAnalyticsUSQL
TypeDelete TypeBasicActivity = original.TypeDelete
+ TypeExecuteDataFlow TypeBasicActivity = original.TypeExecuteDataFlow
TypeExecutePipeline TypeBasicActivity = original.TypeExecutePipeline
TypeExecuteSSISPackage TypeBasicActivity = original.TypeExecuteSSISPackage
TypeExecution TypeBasicActivity = original.TypeExecution
@@ -707,6 +724,7 @@ const (
TypeCommonDataServiceForAppsSink TypeBasicCopySink = original.TypeCommonDataServiceForAppsSink
TypeCopySink TypeBasicCopySink = original.TypeCopySink
TypeCosmosDbMongoDbAPISink TypeBasicCopySink = original.TypeCosmosDbMongoDbAPISink
+ TypeCosmosDbSQLAPISink TypeBasicCopySink = original.TypeCosmosDbSQLAPISink
TypeDelimitedTextSink TypeBasicCopySink = original.TypeDelimitedTextSink
TypeDocumentDbCollectionSink TypeBasicCopySink = original.TypeDocumentDbCollectionSink
TypeDynamicsCrmSink TypeBasicCopySink = original.TypeDynamicsCrmSink
@@ -717,6 +735,7 @@ const (
TypeMicrosoftAccessSink TypeBasicCopySink = original.TypeMicrosoftAccessSink
TypeOdbcSink TypeBasicCopySink = original.TypeOdbcSink
TypeOracleSink TypeBasicCopySink = original.TypeOracleSink
+ TypeOrcSink TypeBasicCopySink = original.TypeOrcSink
TypeParquetSink TypeBasicCopySink = original.TypeParquetSink
TypeSalesforceServiceCloudSink TypeBasicCopySink = original.TypeSalesforceServiceCloudSink
TypeSalesforceSink TypeBasicCopySink = original.TypeSalesforceSink
@@ -748,6 +767,7 @@ const (
TypeConcurSource TypeBasicCopySource = original.TypeConcurSource
TypeCopySource TypeBasicCopySource = original.TypeCopySource
TypeCosmosDbMongoDbAPISource TypeBasicCopySource = original.TypeCosmosDbMongoDbAPISource
+ TypeCosmosDbSQLAPISource TypeBasicCopySource = original.TypeCosmosDbSQLAPISource
TypeCouchbaseSource TypeBasicCopySource = original.TypeCouchbaseSource
TypeDb2Source TypeBasicCopySource = original.TypeDb2Source
TypeDelimitedTextSource TypeBasicCopySource = original.TypeDelimitedTextSource
@@ -783,6 +803,7 @@ const (
TypeOffice365Source TypeBasicCopySource = original.TypeOffice365Source
TypeOracleServiceCloudSource TypeBasicCopySource = original.TypeOracleServiceCloudSource
TypeOracleSource TypeBasicCopySource = original.TypeOracleSource
+ TypeOrcSource TypeBasicCopySource = original.TypeOrcSource
TypeParquetSource TypeBasicCopySource = original.TypeParquetSource
TypePaypalSource TypeBasicCopySource = original.TypePaypalSource
TypePhoenixSource TypeBasicCopySource = original.TypePhoenixSource
@@ -810,6 +831,7 @@ const (
TypeSQLSource TypeBasicCopySource = original.TypeSQLSource
TypeSquareSource TypeBasicCopySource = original.TypeSquareSource
TypeSybaseSource TypeBasicCopySource = original.TypeSybaseSource
+ TypeTabularSource TypeBasicCopySource = original.TypeTabularSource
TypeTeradataSource TypeBasicCopySource = original.TypeTeradataSource
TypeVerticaSource TypeBasicCopySource = original.TypeVerticaSource
TypeWebSource TypeBasicCopySource = original.TypeWebSource
@@ -817,6 +839,22 @@ const (
TypeZohoSource TypeBasicCopySource = original.TypeZohoSource
)
+type TypeBasicCustomSetupBase = original.TypeBasicCustomSetupBase
+
+const (
+ TypeCmdkeySetup TypeBasicCustomSetupBase = original.TypeCmdkeySetup
+ TypeComponentSetup TypeBasicCustomSetupBase = original.TypeComponentSetup
+ TypeCustomSetupBase TypeBasicCustomSetupBase = original.TypeCustomSetupBase
+ TypeEnvironmentVariableSetup TypeBasicCustomSetupBase = original.TypeEnvironmentVariableSetup
+)
+
+type TypeBasicDataFlow = original.TypeBasicDataFlow
+
+const (
+ TypeDataFlow TypeBasicDataFlow = original.TypeDataFlow
+ TypeMappingDataFlow TypeBasicDataFlow = original.TypeMappingDataFlow
+)
+
type TypeBasicDataset = original.TypeBasicDataset
const (
@@ -841,6 +879,7 @@ const (
TypeCommonDataServiceForAppsEntity TypeBasicDataset = original.TypeCommonDataServiceForAppsEntity
TypeConcurObject TypeBasicDataset = original.TypeConcurObject
TypeCosmosDbMongoDbAPICollection TypeBasicDataset = original.TypeCosmosDbMongoDbAPICollection
+ TypeCosmosDbSQLAPICollection TypeBasicDataset = original.TypeCosmosDbSQLAPICollection
TypeCouchbaseTable TypeBasicDataset = original.TypeCouchbaseTable
TypeCustomDataset TypeBasicDataset = original.TypeCustomDataset
TypeDataset TypeBasicDataset = original.TypeDataset
@@ -877,6 +916,7 @@ const (
TypeOffice365Table TypeBasicDataset = original.TypeOffice365Table
TypeOracleServiceCloudObject TypeBasicDataset = original.TypeOracleServiceCloudObject
TypeOracleTable TypeBasicDataset = original.TypeOracleTable
+ TypeOrc TypeBasicDataset = original.TypeOrc
TypeParquet TypeBasicDataset = original.TypeParquet
TypePaypalObject TypeBasicDataset = original.TypePaypalObject
TypePhoenixObject TypeBasicDataset = original.TypePhoenixObject
@@ -1084,6 +1124,7 @@ type TypeBasicTrigger = original.TypeBasicTrigger
const (
TypeBlobEventsTrigger TypeBasicTrigger = original.TypeBlobEventsTrigger
TypeBlobTrigger TypeBasicTrigger = original.TypeBlobTrigger
+ TypeChainingTrigger TypeBasicTrigger = original.TypeChainingTrigger
TypeMultiplePipelineTrigger TypeBasicTrigger = original.TypeMultiplePipelineTrigger
TypeRerunTumblingWindowTrigger TypeBasicTrigger = original.TypeRerunTumblingWindowTrigger
TypeScheduleTrigger TypeBasicTrigger = original.TypeScheduleTrigger
@@ -1121,6 +1162,7 @@ type ActivityPolicy = original.ActivityPolicy
type ActivityRun = original.ActivityRun
type ActivityRunsClient = original.ActivityRunsClient
type ActivityRunsQueryResponse = original.ActivityRunsQueryResponse
+type AddDataFlowToDebugSessionResponse = original.AddDataFlowToDebugSessionResponse
type AmazonMWSLinkedService = original.AmazonMWSLinkedService
type AmazonMWSLinkedServiceTypeProperties = original.AmazonMWSLinkedServiceTypeProperties
type AmazonMWSObjectDataset = original.AmazonMWSObjectDataset
@@ -1245,6 +1287,8 @@ type BasicActivity = original.BasicActivity
type BasicControlActivity = original.BasicControlActivity
type BasicCopySink = original.BasicCopySink
type BasicCopySource = original.BasicCopySource
+type BasicCustomSetupBase = original.BasicCustomSetupBase
+type BasicDataFlow = original.BasicDataFlow
type BasicDataset = original.BasicDataset
type BasicDatasetCompression = original.BasicDatasetCompression
type BasicDatasetStorageFormat = original.BasicDatasetStorageFormat
@@ -1259,6 +1303,7 @@ type BasicMultiplePipelineTrigger = original.BasicMultiplePipelineTrigger
type BasicSecretBase = original.BasicSecretBase
type BasicSsisObjectMetadata = original.BasicSsisObjectMetadata
type BasicStoreWriteSettings = original.BasicStoreWriteSettings
+type BasicTabularSource = original.BasicTabularSource
type BasicTrigger = original.BasicTrigger
type BasicTriggerDependencyReference = original.BasicTriggerDependencyReference
type BasicWebLinkedServiceTypeProperties = original.BasicWebLinkedServiceTypeProperties
@@ -1277,14 +1322,19 @@ type CassandraLinkedServiceTypeProperties = original.CassandraLinkedServiceTypeP
type CassandraSource = original.CassandraSource
type CassandraTableDataset = original.CassandraTableDataset
type CassandraTableDatasetTypeProperties = original.CassandraTableDatasetTypeProperties
+type ChainingTrigger = original.ChainingTrigger
+type ChainingTriggerTypeProperties = original.ChainingTriggerTypeProperties
type CloudError = original.CloudError
type CloudErrorBody = original.CloudErrorBody
+type CmdkeySetup = original.CmdkeySetup
+type CmdkeySetupTypeProperties = original.CmdkeySetupTypeProperties
type CommonDataServiceForAppsEntityDataset = original.CommonDataServiceForAppsEntityDataset
type CommonDataServiceForAppsEntityDatasetTypeProperties = original.CommonDataServiceForAppsEntityDatasetTypeProperties
type CommonDataServiceForAppsLinkedService = original.CommonDataServiceForAppsLinkedService
type CommonDataServiceForAppsLinkedServiceTypeProperties = original.CommonDataServiceForAppsLinkedServiceTypeProperties
type CommonDataServiceForAppsSink = original.CommonDataServiceForAppsSink
type CommonDataServiceForAppsSource = original.CommonDataServiceForAppsSource
+type ComponentSetup = original.ComponentSetup
type ConcurLinkedService = original.ConcurLinkedService
type ConcurLinkedServiceTypeProperties = original.ConcurLinkedServiceTypeProperties
type ConcurObjectDataset = original.ConcurObjectDataset
@@ -1302,10 +1352,16 @@ type CosmosDbMongoDbAPILinkedService = original.CosmosDbMongoDbAPILinkedService
type CosmosDbMongoDbAPILinkedServiceTypeProperties = original.CosmosDbMongoDbAPILinkedServiceTypeProperties
type CosmosDbMongoDbAPISink = original.CosmosDbMongoDbAPISink
type CosmosDbMongoDbAPISource = original.CosmosDbMongoDbAPISource
+type CosmosDbSQLAPICollectionDataset = original.CosmosDbSQLAPICollectionDataset
+type CosmosDbSQLAPICollectionDatasetTypeProperties = original.CosmosDbSQLAPICollectionDatasetTypeProperties
+type CosmosDbSQLAPISink = original.CosmosDbSQLAPISink
+type CosmosDbSQLAPISource = original.CosmosDbSQLAPISource
type CouchbaseLinkedService = original.CouchbaseLinkedService
type CouchbaseLinkedServiceTypeProperties = original.CouchbaseLinkedServiceTypeProperties
type CouchbaseSource = original.CouchbaseSource
type CouchbaseTableDataset = original.CouchbaseTableDataset
+type CreateDataFlowDebugSessionRequest = original.CreateDataFlowDebugSessionRequest
+type CreateDataFlowDebugSessionResponse = original.CreateDataFlowDebugSessionResponse
type CreateLinkedIntegrationRuntimeRequest = original.CreateLinkedIntegrationRuntimeRequest
type CreateRunResponse = original.CreateRunResponse
type CustomActivity = original.CustomActivity
@@ -1313,6 +1369,28 @@ type CustomActivityReferenceObject = original.CustomActivityReferenceObject
type CustomActivityTypeProperties = original.CustomActivityTypeProperties
type CustomDataSourceLinkedService = original.CustomDataSourceLinkedService
type CustomDataset = original.CustomDataset
+type CustomSetupBase = original.CustomSetupBase
+type DataFlow = original.DataFlow
+type DataFlowDebugCommandPayload = original.DataFlowDebugCommandPayload
+type DataFlowDebugCommandRequest = original.DataFlowDebugCommandRequest
+type DataFlowDebugCommandResponse = original.DataFlowDebugCommandResponse
+type DataFlowDebugPackage = original.DataFlowDebugPackage
+type DataFlowDebugPackageDebugSettings = original.DataFlowDebugPackageDebugSettings
+type DataFlowDebugSessionClient = original.DataFlowDebugSessionClient
+type DataFlowDebugSessionCreateFuture = original.DataFlowDebugSessionCreateFuture
+type DataFlowDebugSessionExecuteCommandFuture = original.DataFlowDebugSessionExecuteCommandFuture
+type DataFlowDebugSessionInfo = original.DataFlowDebugSessionInfo
+type DataFlowFolder = original.DataFlowFolder
+type DataFlowListResponse = original.DataFlowListResponse
+type DataFlowListResponseIterator = original.DataFlowListResponseIterator
+type DataFlowListResponsePage = original.DataFlowListResponsePage
+type DataFlowReference = original.DataFlowReference
+type DataFlowResource = original.DataFlowResource
+type DataFlowSink = original.DataFlowSink
+type DataFlowSource = original.DataFlowSource
+type DataFlowSourceSetting = original.DataFlowSourceSetting
+type DataFlowStagingInfo = original.DataFlowStagingInfo
+type DataFlowsClient = original.DataFlowsClient
type DataLakeAnalyticsUSQLActivity = original.DataLakeAnalyticsUSQLActivity
type DataLakeAnalyticsUSQLActivityTypeProperties = original.DataLakeAnalyticsUSQLActivityTypeProperties
type DatabricksNotebookActivity = original.DatabricksNotebookActivity
@@ -1343,6 +1421,7 @@ type Db2TableDataset = original.Db2TableDataset
type Db2TableDatasetTypeProperties = original.Db2TableDatasetTypeProperties
type DeleteActivity = original.DeleteActivity
type DeleteActivityTypeProperties = original.DeleteActivityTypeProperties
+type DeleteDataFlowDebugSessionRequest = original.DeleteDataFlowDebugSessionRequest
type DelimitedTextDataset = original.DelimitedTextDataset
type DelimitedTextDatasetTypeProperties = original.DelimitedTextDatasetTypeProperties
type DelimitedTextReadSettings = original.DelimitedTextReadSettings
@@ -1382,6 +1461,10 @@ type EloquaLinkedServiceTypeProperties = original.EloquaLinkedServiceTypePropert
type EloquaObjectDataset = original.EloquaObjectDataset
type EloquaSource = original.EloquaSource
type EntityReference = original.EntityReference
+type EnvironmentVariableSetup = original.EnvironmentVariableSetup
+type EnvironmentVariableSetupTypeProperties = original.EnvironmentVariableSetupTypeProperties
+type ExecuteDataFlowActivity = original.ExecuteDataFlowActivity
+type ExecuteDataFlowActivityTypeProperties = original.ExecuteDataFlowActivityTypeProperties
type ExecutePipelineActivity = original.ExecutePipelineActivity
type ExecutePipelineActivityTypeProperties = original.ExecutePipelineActivityTypeProperties
type ExecuteSSISPackageActivity = original.ExecuteSSISPackageActivity
@@ -1423,6 +1506,7 @@ type FtpServerLinkedService = original.FtpServerLinkedService
type FtpServerLinkedServiceTypeProperties = original.FtpServerLinkedServiceTypeProperties
type FtpServerLocation = original.FtpServerLocation
type GenericDatasetTypeProperties = original.GenericDatasetTypeProperties
+type GetDataFactoryOperationStatusResponse = original.GetDataFactoryOperationStatusResponse
type GetMetadataActivity = original.GetMetadataActivity
type GetMetadataActivityTypeProperties = original.GetMetadataActivityTypeProperties
type GetSsisObjectMetadataRequest = original.GetSsisObjectMetadataRequest
@@ -1499,6 +1583,7 @@ type IntegrationRuntimeAuthKeys = original.IntegrationRuntimeAuthKeys
type IntegrationRuntimeComputeProperties = original.IntegrationRuntimeComputeProperties
type IntegrationRuntimeConnectionInfo = original.IntegrationRuntimeConnectionInfo
type IntegrationRuntimeCustomSetupScriptProperties = original.IntegrationRuntimeCustomSetupScriptProperties
+type IntegrationRuntimeDataFlowProperties = original.IntegrationRuntimeDataFlowProperties
type IntegrationRuntimeDataProxyProperties = original.IntegrationRuntimeDataProxyProperties
type IntegrationRuntimeListResponse = original.IntegrationRuntimeListResponse
type IntegrationRuntimeListResponseIterator = original.IntegrationRuntimeListResponseIterator
@@ -1531,6 +1616,7 @@ type JiraLinkedService = original.JiraLinkedService
type JiraLinkedServiceTypeProperties = original.JiraLinkedServiceTypeProperties
type JiraObjectDataset = original.JiraObjectDataset
type JiraSource = original.JiraSource
+type LicensedComponentSetupTypeProperties = original.LicensedComponentSetupTypeProperties
type LinkedIntegrationRuntime = original.LinkedIntegrationRuntime
type LinkedIntegrationRuntimeKeyAuthorization = original.LinkedIntegrationRuntimeKeyAuthorization
type LinkedIntegrationRuntimeRbacAuthorization = original.LinkedIntegrationRuntimeRbacAuthorization
@@ -1557,6 +1643,8 @@ type ManagedIntegrationRuntimeOperationResult = original.ManagedIntegrationRunti
type ManagedIntegrationRuntimeStatus = original.ManagedIntegrationRuntimeStatus
type ManagedIntegrationRuntimeStatusTypeProperties = original.ManagedIntegrationRuntimeStatusTypeProperties
type ManagedIntegrationRuntimeTypeProperties = original.ManagedIntegrationRuntimeTypeProperties
+type MappingDataFlow = original.MappingDataFlow
+type MappingDataFlowTypeProperties = original.MappingDataFlowTypeProperties
type MariaDBLinkedService = original.MariaDBLinkedService
type MariaDBLinkedServiceTypeProperties = original.MariaDBLinkedServiceTypeProperties
type MariaDBSource = original.MariaDBSource
@@ -1633,7 +1721,11 @@ type OracleSink = original.OracleSink
type OracleSource = original.OracleSource
type OracleTableDataset = original.OracleTableDataset
type OracleTableDatasetTypeProperties = original.OracleTableDatasetTypeProperties
+type OrcDataset = original.OrcDataset
+type OrcDatasetTypeProperties = original.OrcDatasetTypeProperties
type OrcFormat = original.OrcFormat
+type OrcSink = original.OrcSink
+type OrcSource = original.OrcSource
type ParameterSpecification = original.ParameterSpecification
type ParquetDataset = original.ParquetDataset
type ParquetDatasetTypeProperties = original.ParquetDatasetTypeProperties
@@ -1672,6 +1764,9 @@ type PrestoLinkedService = original.PrestoLinkedService
type PrestoLinkedServiceTypeProperties = original.PrestoLinkedServiceTypeProperties
type PrestoObjectDataset = original.PrestoObjectDataset
type PrestoSource = original.PrestoSource
+type QueryDataFlowDebugSessionsResponse = original.QueryDataFlowDebugSessionsResponse
+type QueryDataFlowDebugSessionsResponseIterator = original.QueryDataFlowDebugSessionsResponseIterator
+type QueryDataFlowDebugSessionsResponsePage = original.QueryDataFlowDebugSessionsResponsePage
type QuickBooksLinkedService = original.QuickBooksLinkedService
type QuickBooksLinkedServiceTypeProperties = original.QuickBooksLinkedServiceTypeProperties
type QuickBooksObjectDataset = original.QuickBooksObjectDataset
@@ -1832,6 +1927,7 @@ type SybaseLinkedServiceTypeProperties = original.SybaseLinkedServiceTypePropert
type SybaseSource = original.SybaseSource
type SybaseTableDataset = original.SybaseTableDataset
type SybaseTableDatasetTypeProperties = original.SybaseTableDatasetTypeProperties
+type TabularSource = original.TabularSource
type TeradataLinkedService = original.TeradataLinkedService
type TeradataLinkedServiceTypeProperties = original.TeradataLinkedServiceTypeProperties
type TeradataPartitionSettings = original.TeradataPartitionSettings
@@ -1839,6 +1935,7 @@ type TeradataSource = original.TeradataSource
type TeradataTableDataset = original.TeradataTableDataset
type TeradataTableDatasetTypeProperties = original.TeradataTableDatasetTypeProperties
type TextFormat = original.TextFormat
+type Transformation = original.Transformation
type Trigger = original.Trigger
type TriggerDependencyReference = original.TriggerDependencyReference
type TriggerListResponse = original.TriggerListResponse
@@ -1906,6 +2003,24 @@ func NewActivityRunsClient(subscriptionID string) ActivityRunsClient {
func NewActivityRunsClientWithBaseURI(baseURI string, subscriptionID string) ActivityRunsClient {
return original.NewActivityRunsClientWithBaseURI(baseURI, subscriptionID)
}
+func NewDataFlowDebugSessionClient(subscriptionID string) DataFlowDebugSessionClient {
+ return original.NewDataFlowDebugSessionClient(subscriptionID)
+}
+func NewDataFlowDebugSessionClientWithBaseURI(baseURI string, subscriptionID string) DataFlowDebugSessionClient {
+ return original.NewDataFlowDebugSessionClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewDataFlowListResponseIterator(page DataFlowListResponsePage) DataFlowListResponseIterator {
+ return original.NewDataFlowListResponseIterator(page)
+}
+func NewDataFlowListResponsePage(getNextPage func(context.Context, DataFlowListResponse) (DataFlowListResponse, error)) DataFlowListResponsePage {
+ return original.NewDataFlowListResponsePage(getNextPage)
+}
+func NewDataFlowsClient(subscriptionID string) DataFlowsClient {
+ return original.NewDataFlowsClient(subscriptionID)
+}
+func NewDataFlowsClientWithBaseURI(baseURI string, subscriptionID string) DataFlowsClient {
+ return original.NewDataFlowsClientWithBaseURI(baseURI, subscriptionID)
+}
func NewDatasetListResponseIterator(page DatasetListResponsePage) DatasetListResponseIterator {
return original.NewDatasetListResponseIterator(page)
}
@@ -2002,6 +2117,12 @@ func NewPipelinesClient(subscriptionID string) PipelinesClient {
func NewPipelinesClientWithBaseURI(baseURI string, subscriptionID string) PipelinesClient {
return original.NewPipelinesClientWithBaseURI(baseURI, subscriptionID)
}
+func NewQueryDataFlowDebugSessionsResponseIterator(page QueryDataFlowDebugSessionsResponsePage) QueryDataFlowDebugSessionsResponseIterator {
+ return original.NewQueryDataFlowDebugSessionsResponseIterator(page)
+}
+func NewQueryDataFlowDebugSessionsResponsePage(getNextPage func(context.Context, QueryDataFlowDebugSessionsResponse) (QueryDataFlowDebugSessionsResponse, error)) QueryDataFlowDebugSessionsResponsePage {
+ return original.NewQueryDataFlowDebugSessionsResponsePage(getNextPage)
+}
func NewRerunTriggerListResponseIterator(page RerunTriggerListResponsePage) RerunTriggerListResponseIterator {
return original.NewRerunTriggerListResponseIterator(page)
}
@@ -2056,6 +2177,12 @@ func PossibleBlobEventTypesValues() []BlobEventTypes {
func PossibleCassandraSourceReadConsistencyLevelsValues() []CassandraSourceReadConsistencyLevels {
return original.PossibleCassandraSourceReadConsistencyLevelsValues()
}
+func PossibleDataFlowComputeTypeValues() []DataFlowComputeType {
+ return original.PossibleDataFlowComputeTypeValues()
+}
+func PossibleDataFlowDebugCommandTypeValues() []DataFlowDebugCommandType {
+ return original.PossibleDataFlowDebugCommandTypeValues()
+}
func PossibleDayOfWeekValues() []DayOfWeek {
return original.PossibleDayOfWeekValues()
}
@@ -2257,6 +2384,12 @@ func PossibleTypeBasicCopySinkValues() []TypeBasicCopySink {
func PossibleTypeBasicCopySourceValues() []TypeBasicCopySource {
return original.PossibleTypeBasicCopySourceValues()
}
+func PossibleTypeBasicCustomSetupBaseValues() []TypeBasicCustomSetupBase {
+ return original.PossibleTypeBasicCustomSetupBaseValues()
+}
+func PossibleTypeBasicDataFlowValues() []TypeBasicDataFlow {
+ return original.PossibleTypeBasicDataFlowValues()
+}
func PossibleTypeBasicDatasetCompressionValues() []TypeBasicDatasetCompression {
return original.PossibleTypeBasicDatasetCompressionValues()
}
diff --git a/profiles/latest/eventgrid/eventgrid/models.go b/profiles/latest/eventgrid/eventgrid/models.go
index 48676620e3d3..bbc94e13941c 100644
--- a/profiles/latest/eventgrid/eventgrid/models.go
+++ b/profiles/latest/eventgrid/eventgrid/models.go
@@ -102,6 +102,15 @@ type IotHubDeviceCreatedEventData = original.IotHubDeviceCreatedEventData
type IotHubDeviceDeletedEventData = original.IotHubDeviceDeletedEventData
type IotHubDeviceDisconnectedEventData = original.IotHubDeviceDisconnectedEventData
type IotHubDeviceTelemetryEventData = original.IotHubDeviceTelemetryEventData
+type KeyVaultCertificateExpiredEventData = original.KeyVaultCertificateExpiredEventData
+type KeyVaultCertificateNearExpiryEventData = original.KeyVaultCertificateNearExpiryEventData
+type KeyVaultCertificateNewVersionCreatedEventData = original.KeyVaultCertificateNewVersionCreatedEventData
+type KeyVaultKeyExpiredEventData = original.KeyVaultKeyExpiredEventData
+type KeyVaultKeyNearExpiryEventData = original.KeyVaultKeyNearExpiryEventData
+type KeyVaultKeyNewVersionCreatedEventData = original.KeyVaultKeyNewVersionCreatedEventData
+type KeyVaultSecretExpiredEventData = original.KeyVaultSecretExpiredEventData
+type KeyVaultSecretNearExpiryEventData = original.KeyVaultSecretNearExpiryEventData
+type KeyVaultSecretNewVersionCreatedEventData = original.KeyVaultSecretNewVersionCreatedEventData
type MapsGeofenceEnteredEventData = original.MapsGeofenceEnteredEventData
type MapsGeofenceEventProperties = original.MapsGeofenceEventProperties
type MapsGeofenceExitedEventData = original.MapsGeofenceExitedEventData
diff --git a/profiles/latest/eventhub/mgmt/eventhub/models.go b/profiles/latest/eventhub/mgmt/eventhub/models.go
index 4150c90a89e2..678b8dbc2774 100644
--- a/profiles/latest/eventhub/mgmt/eventhub/models.go
+++ b/profiles/latest/eventhub/mgmt/eventhub/models.go
@@ -167,6 +167,9 @@ type NamespacesClient = original.NamespacesClient
type NamespacesCreateOrUpdateFuture = original.NamespacesCreateOrUpdateFuture
type NamespacesDeleteFuture = original.NamespacesDeleteFuture
type NetworkRuleSet = original.NetworkRuleSet
+type NetworkRuleSetListResult = original.NetworkRuleSetListResult
+type NetworkRuleSetListResultIterator = original.NetworkRuleSetListResultIterator
+type NetworkRuleSetListResultPage = original.NetworkRuleSetListResultPage
type NetworkRuleSetProperties = original.NetworkRuleSetProperties
type Operation = original.Operation
type OperationDisplay = original.OperationDisplay
@@ -245,6 +248,12 @@ func NewNamespacesClient(subscriptionID string) NamespacesClient {
func NewNamespacesClientWithBaseURI(baseURI string, subscriptionID string) NamespacesClient {
return original.NewNamespacesClientWithBaseURI(baseURI, subscriptionID)
}
+func NewNetworkRuleSetListResultIterator(page NetworkRuleSetListResultPage) NetworkRuleSetListResultIterator {
+ return original.NewNetworkRuleSetListResultIterator(page)
+}
+func NewNetworkRuleSetListResultPage(getNextPage func(context.Context, NetworkRuleSetListResult) (NetworkRuleSetListResult, error)) NetworkRuleSetListResultPage {
+ return original.NewNetworkRuleSetListResultPage(getNextPage)
+}
func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
return original.NewOperationListResultIterator(page)
}
diff --git a/profiles/latest/cognitiveservices/anomalyfinder/anomalyfinderapi/models.go b/profiles/latest/frontdoor/mgmt/frontdoor/frontdoorapi/models.go
similarity index 63%
rename from profiles/latest/cognitiveservices/anomalyfinder/anomalyfinderapi/models.go
rename to profiles/latest/frontdoor/mgmt/frontdoor/frontdoorapi/models.go
index 497b8771a7f0..08954a3ee34d 100644
--- a/profiles/latest/cognitiveservices/anomalyfinder/anomalyfinderapi/models.go
+++ b/profiles/latest/frontdoor/mgmt/frontdoor/frontdoorapi/models.go
@@ -17,8 +17,13 @@
// This code was auto-generated by:
// github.com/Azure/azure-sdk-for-go/tools/profileBuilder
-package anomalyfinderapi
+package frontdoorapi
-import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/anomalyfinder/anomalyfinderapi"
+import original "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-05-01/frontdoor/frontdoorapi"
type BaseClientAPI = original.BaseClientAPI
+type EndpointsClientAPI = original.EndpointsClientAPI
+type FrontDoorsClientAPI = original.FrontDoorsClientAPI
+type FrontendEndpointsClientAPI = original.FrontendEndpointsClientAPI
+type ManagedRuleSetsClientAPI = original.ManagedRuleSetsClientAPI
+type PoliciesClientAPI = original.PoliciesClientAPI
diff --git a/profiles/latest/frontdoor/mgmt/frontdoor/models.go b/profiles/latest/frontdoor/mgmt/frontdoor/models.go
new file mode 100644
index 000000000000..501bee6917c7
--- /dev/null
+++ b/profiles/latest/frontdoor/mgmt/frontdoor/models.go
@@ -0,0 +1,561 @@
+// +build go1.9
+
+// Copyright 2019 Microsoft Corporation
+//
+// 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.
+
+// This code was auto-generated by:
+// github.com/Azure/azure-sdk-for-go/tools/profileBuilder
+
+package frontdoor
+
+import (
+ "context"
+
+ original "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-05-01/frontdoor"
+)
+
+const (
+ DefaultBaseURI = original.DefaultBaseURI
+)
+
+type ActionType = original.ActionType
+
+const (
+ Allow ActionType = original.Allow
+ Block ActionType = original.Block
+ Log ActionType = original.Log
+ Redirect ActionType = original.Redirect
+)
+
+type Availability = original.Availability
+
+const (
+ Available Availability = original.Available
+ Unavailable Availability = original.Unavailable
+)
+
+type BackendEnabledState = original.BackendEnabledState
+
+const (
+ Disabled BackendEnabledState = original.Disabled
+ Enabled BackendEnabledState = original.Enabled
+)
+
+type CertificateSource = original.CertificateSource
+
+const (
+ CertificateSourceAzureKeyVault CertificateSource = original.CertificateSourceAzureKeyVault
+ CertificateSourceFrontDoor CertificateSource = original.CertificateSourceFrontDoor
+)
+
+type CertificateType = original.CertificateType
+
+const (
+ Dedicated CertificateType = original.Dedicated
+)
+
+type CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningState
+
+const (
+ CustomHTTPSProvisioningStateDisabled CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningStateDisabled
+ CustomHTTPSProvisioningStateDisabling CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningStateDisabling
+ CustomHTTPSProvisioningStateEnabled CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningStateEnabled
+ CustomHTTPSProvisioningStateEnabling CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningStateEnabling
+ CustomHTTPSProvisioningStateFailed CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningStateFailed
+)
+
+type CustomHTTPSProvisioningSubstate = original.CustomHTTPSProvisioningSubstate
+
+const (
+ CertificateDeleted CustomHTTPSProvisioningSubstate = original.CertificateDeleted
+ CertificateDeployed CustomHTTPSProvisioningSubstate = original.CertificateDeployed
+ DeletingCertificate CustomHTTPSProvisioningSubstate = original.DeletingCertificate
+ DeployingCertificate CustomHTTPSProvisioningSubstate = original.DeployingCertificate
+ DomainControlValidationRequestApproved CustomHTTPSProvisioningSubstate = original.DomainControlValidationRequestApproved
+ DomainControlValidationRequestRejected CustomHTTPSProvisioningSubstate = original.DomainControlValidationRequestRejected
+ DomainControlValidationRequestTimedOut CustomHTTPSProvisioningSubstate = original.DomainControlValidationRequestTimedOut
+ IssuingCertificate CustomHTTPSProvisioningSubstate = original.IssuingCertificate
+ PendingDomainControlValidationREquestApproval CustomHTTPSProvisioningSubstate = original.PendingDomainControlValidationREquestApproval
+ SubmittingDomainControlValidationRequest CustomHTTPSProvisioningSubstate = original.SubmittingDomainControlValidationRequest
+)
+
+type CustomRuleEnabledState = original.CustomRuleEnabledState
+
+const (
+ CustomRuleEnabledStateDisabled CustomRuleEnabledState = original.CustomRuleEnabledStateDisabled
+ CustomRuleEnabledStateEnabled CustomRuleEnabledState = original.CustomRuleEnabledStateEnabled
+)
+
+type DynamicCompressionEnabled = original.DynamicCompressionEnabled
+
+const (
+ DynamicCompressionEnabledDisabled DynamicCompressionEnabled = original.DynamicCompressionEnabledDisabled
+ DynamicCompressionEnabledEnabled DynamicCompressionEnabled = original.DynamicCompressionEnabledEnabled
+)
+
+type EnabledState = original.EnabledState
+
+const (
+ EnabledStateDisabled EnabledState = original.EnabledStateDisabled
+ EnabledStateEnabled EnabledState = original.EnabledStateEnabled
+)
+
+type EnforceCertificateNameCheckEnabledState = original.EnforceCertificateNameCheckEnabledState
+
+const (
+ EnforceCertificateNameCheckEnabledStateDisabled EnforceCertificateNameCheckEnabledState = original.EnforceCertificateNameCheckEnabledStateDisabled
+ EnforceCertificateNameCheckEnabledStateEnabled EnforceCertificateNameCheckEnabledState = original.EnforceCertificateNameCheckEnabledStateEnabled
+)
+
+type ForwardingProtocol = original.ForwardingProtocol
+
+const (
+ HTTPOnly ForwardingProtocol = original.HTTPOnly
+ HTTPSOnly ForwardingProtocol = original.HTTPSOnly
+ MatchRequest ForwardingProtocol = original.MatchRequest
+)
+
+type HealthProbeEnabled = original.HealthProbeEnabled
+
+const (
+ HealthProbeEnabledDisabled HealthProbeEnabled = original.HealthProbeEnabledDisabled
+ HealthProbeEnabledEnabled HealthProbeEnabled = original.HealthProbeEnabledEnabled
+)
+
+type HealthProbeMethod = original.HealthProbeMethod
+
+const (
+ GET HealthProbeMethod = original.GET
+ HEAD HealthProbeMethod = original.HEAD
+)
+
+type ManagedRuleEnabledState = original.ManagedRuleEnabledState
+
+const (
+ ManagedRuleEnabledStateDisabled ManagedRuleEnabledState = original.ManagedRuleEnabledStateDisabled
+ ManagedRuleEnabledStateEnabled ManagedRuleEnabledState = original.ManagedRuleEnabledStateEnabled
+)
+
+type MatchVariable = original.MatchVariable
+
+const (
+ Cookies MatchVariable = original.Cookies
+ PostArgs MatchVariable = original.PostArgs
+ QueryString MatchVariable = original.QueryString
+ RemoteAddr MatchVariable = original.RemoteAddr
+ RequestBody MatchVariable = original.RequestBody
+ RequestHeader MatchVariable = original.RequestHeader
+ RequestMethod MatchVariable = original.RequestMethod
+ RequestURI MatchVariable = original.RequestURI
+ SocketAddr MatchVariable = original.SocketAddr
+)
+
+type MinimumTLSVersion = original.MinimumTLSVersion
+
+const (
+ OneFullStopTwo MinimumTLSVersion = original.OneFullStopTwo
+ OneFullStopZero MinimumTLSVersion = original.OneFullStopZero
+)
+
+type NetworkOperationStatus = original.NetworkOperationStatus
+
+const (
+ Failed NetworkOperationStatus = original.Failed
+ InProgress NetworkOperationStatus = original.InProgress
+ Succeeded NetworkOperationStatus = original.Succeeded
+)
+
+type OdataType = original.OdataType
+
+const (
+ OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration OdataType = original.OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration
+ OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration OdataType = original.OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration
+ OdataTypeRouteConfiguration OdataType = original.OdataTypeRouteConfiguration
+)
+
+type Operator = original.Operator
+
+const (
+ Any Operator = original.Any
+ BeginsWith Operator = original.BeginsWith
+ Contains Operator = original.Contains
+ EndsWith Operator = original.EndsWith
+ Equal Operator = original.Equal
+ GeoMatch Operator = original.GeoMatch
+ GreaterThan Operator = original.GreaterThan
+ GreaterThanOrEqual Operator = original.GreaterThanOrEqual
+ IPMatch Operator = original.IPMatch
+ LessThan Operator = original.LessThan
+ LessThanOrEqual Operator = original.LessThanOrEqual
+ RegEx Operator = original.RegEx
+)
+
+type PolicyEnabledState = original.PolicyEnabledState
+
+const (
+ PolicyEnabledStateDisabled PolicyEnabledState = original.PolicyEnabledStateDisabled
+ PolicyEnabledStateEnabled PolicyEnabledState = original.PolicyEnabledStateEnabled
+)
+
+type PolicyMode = original.PolicyMode
+
+const (
+ Detection PolicyMode = original.Detection
+ Prevention PolicyMode = original.Prevention
+)
+
+type PolicyResourceState = original.PolicyResourceState
+
+const (
+ PolicyResourceStateCreating PolicyResourceState = original.PolicyResourceStateCreating
+ PolicyResourceStateDeleting PolicyResourceState = original.PolicyResourceStateDeleting
+ PolicyResourceStateDisabled PolicyResourceState = original.PolicyResourceStateDisabled
+ PolicyResourceStateDisabling PolicyResourceState = original.PolicyResourceStateDisabling
+ PolicyResourceStateEnabled PolicyResourceState = original.PolicyResourceStateEnabled
+ PolicyResourceStateEnabling PolicyResourceState = original.PolicyResourceStateEnabling
+)
+
+type Protocol = original.Protocol
+
+const (
+ HTTP Protocol = original.HTTP
+ HTTPS Protocol = original.HTTPS
+)
+
+type Query = original.Query
+
+const (
+ StripAll Query = original.StripAll
+ StripNone Query = original.StripNone
+)
+
+type RedirectProtocol = original.RedirectProtocol
+
+const (
+ RedirectProtocolHTTPOnly RedirectProtocol = original.RedirectProtocolHTTPOnly
+ RedirectProtocolHTTPSOnly RedirectProtocol = original.RedirectProtocolHTTPSOnly
+ RedirectProtocolMatchRequest RedirectProtocol = original.RedirectProtocolMatchRequest
+)
+
+type RedirectType = original.RedirectType
+
+const (
+ Found RedirectType = original.Found
+ Moved RedirectType = original.Moved
+ PermanentRedirect RedirectType = original.PermanentRedirect
+ TemporaryRedirect RedirectType = original.TemporaryRedirect
+)
+
+type ResourceState = original.ResourceState
+
+const (
+ ResourceStateCreating ResourceState = original.ResourceStateCreating
+ ResourceStateDeleting ResourceState = original.ResourceStateDeleting
+ ResourceStateDisabled ResourceState = original.ResourceStateDisabled
+ ResourceStateDisabling ResourceState = original.ResourceStateDisabling
+ ResourceStateEnabled ResourceState = original.ResourceStateEnabled
+ ResourceStateEnabling ResourceState = original.ResourceStateEnabling
+)
+
+type ResourceType = original.ResourceType
+
+const (
+ MicrosoftNetworkfrontDoors ResourceType = original.MicrosoftNetworkfrontDoors
+ MicrosoftNetworkfrontDoorsfrontendEndpoints ResourceType = original.MicrosoftNetworkfrontDoorsfrontendEndpoints
+)
+
+type RoutingRuleEnabledState = original.RoutingRuleEnabledState
+
+const (
+ RoutingRuleEnabledStateDisabled RoutingRuleEnabledState = original.RoutingRuleEnabledStateDisabled
+ RoutingRuleEnabledStateEnabled RoutingRuleEnabledState = original.RoutingRuleEnabledStateEnabled
+)
+
+type RuleType = original.RuleType
+
+const (
+ MatchRule RuleType = original.MatchRule
+ RateLimitRule RuleType = original.RateLimitRule
+)
+
+type SessionAffinityEnabledState = original.SessionAffinityEnabledState
+
+const (
+ SessionAffinityEnabledStateDisabled SessionAffinityEnabledState = original.SessionAffinityEnabledStateDisabled
+ SessionAffinityEnabledStateEnabled SessionAffinityEnabledState = original.SessionAffinityEnabledStateEnabled
+)
+
+type TransformType = original.TransformType
+
+const (
+ Lowercase TransformType = original.Lowercase
+ RemoveNulls TransformType = original.RemoveNulls
+ Trim TransformType = original.Trim
+ Uppercase TransformType = original.Uppercase
+ URLDecode TransformType = original.URLDecode
+ URLEncode TransformType = original.URLEncode
+)
+
+type AzureAsyncOperationResult = original.AzureAsyncOperationResult
+type Backend = original.Backend
+type BackendPool = original.BackendPool
+type BackendPoolListResult = original.BackendPoolListResult
+type BackendPoolProperties = original.BackendPoolProperties
+type BackendPoolUpdateParameters = original.BackendPoolUpdateParameters
+type BackendPoolsSettings = original.BackendPoolsSettings
+type BaseClient = original.BaseClient
+type BasicRouteConfiguration = original.BasicRouteConfiguration
+type CacheConfiguration = original.CacheConfiguration
+type CertificateSourceParameters = original.CertificateSourceParameters
+type CheckNameAvailabilityInput = original.CheckNameAvailabilityInput
+type CheckNameAvailabilityOutput = original.CheckNameAvailabilityOutput
+type CustomHTTPSConfiguration = original.CustomHTTPSConfiguration
+type CustomRule = original.CustomRule
+type CustomRuleList = original.CustomRuleList
+type EndpointsClient = original.EndpointsClient
+type EndpointsPurgeContentFuture = original.EndpointsPurgeContentFuture
+type Error = original.Error
+type ErrorDetails = original.ErrorDetails
+type ErrorResponse = original.ErrorResponse
+type ForwardingConfiguration = original.ForwardingConfiguration
+type FrontDoor = original.FrontDoor
+type FrontDoorsClient = original.FrontDoorsClient
+type FrontDoorsCreateOrUpdateFutureType = original.FrontDoorsCreateOrUpdateFutureType
+type FrontDoorsDeleteFutureType = original.FrontDoorsDeleteFutureType
+type FrontendEndpoint = original.FrontendEndpoint
+type FrontendEndpointLink = original.FrontendEndpointLink
+type FrontendEndpointProperties = original.FrontendEndpointProperties
+type FrontendEndpointUpdateParameters = original.FrontendEndpointUpdateParameters
+type FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink = original.FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink
+type FrontendEndpointsClient = original.FrontendEndpointsClient
+type FrontendEndpointsDisableHTTPSFuture = original.FrontendEndpointsDisableHTTPSFuture
+type FrontendEndpointsEnableHTTPSFuture = original.FrontendEndpointsEnableHTTPSFuture
+type FrontendEndpointsListResult = original.FrontendEndpointsListResult
+type FrontendEndpointsListResultIterator = original.FrontendEndpointsListResultIterator
+type FrontendEndpointsListResultPage = original.FrontendEndpointsListResultPage
+type HealthProbeSettingsListResult = original.HealthProbeSettingsListResult
+type HealthProbeSettingsModel = original.HealthProbeSettingsModel
+type HealthProbeSettingsProperties = original.HealthProbeSettingsProperties
+type HealthProbeSettingsUpdateParameters = original.HealthProbeSettingsUpdateParameters
+type KeyVaultCertificateSourceParameters = original.KeyVaultCertificateSourceParameters
+type KeyVaultCertificateSourceParametersVault = original.KeyVaultCertificateSourceParametersVault
+type ListResult = original.ListResult
+type ListResultIterator = original.ListResultIterator
+type ListResultPage = original.ListResultPage
+type LoadBalancingSettingsListResult = original.LoadBalancingSettingsListResult
+type LoadBalancingSettingsModel = original.LoadBalancingSettingsModel
+type LoadBalancingSettingsProperties = original.LoadBalancingSettingsProperties
+type LoadBalancingSettingsUpdateParameters = original.LoadBalancingSettingsUpdateParameters
+type ManagedRuleDefinition = original.ManagedRuleDefinition
+type ManagedRuleGroupDefinition = original.ManagedRuleGroupDefinition
+type ManagedRuleGroupOverride = original.ManagedRuleGroupOverride
+type ManagedRuleOverride = original.ManagedRuleOverride
+type ManagedRuleSet = original.ManagedRuleSet
+type ManagedRuleSetDefinition = original.ManagedRuleSetDefinition
+type ManagedRuleSetDefinitionList = original.ManagedRuleSetDefinitionList
+type ManagedRuleSetDefinitionListIterator = original.ManagedRuleSetDefinitionListIterator
+type ManagedRuleSetDefinitionListPage = original.ManagedRuleSetDefinitionListPage
+type ManagedRuleSetDefinitionProperties = original.ManagedRuleSetDefinitionProperties
+type ManagedRuleSetList = original.ManagedRuleSetList
+type ManagedRuleSetsClient = original.ManagedRuleSetsClient
+type MatchCondition = original.MatchCondition
+type PoliciesClient = original.PoliciesClient
+type PoliciesCreateOrUpdateFuture = original.PoliciesCreateOrUpdateFuture
+type PoliciesDeleteFuture = original.PoliciesDeleteFuture
+type PolicySettings = original.PolicySettings
+type Properties = original.Properties
+type PurgeParameters = original.PurgeParameters
+type RedirectConfiguration = original.RedirectConfiguration
+type Resource = original.Resource
+type RouteConfiguration = original.RouteConfiguration
+type RoutingRule = original.RoutingRule
+type RoutingRuleListResult = original.RoutingRuleListResult
+type RoutingRuleProperties = original.RoutingRuleProperties
+type RoutingRuleUpdateParameters = original.RoutingRuleUpdateParameters
+type SubResource = original.SubResource
+type TagsObject = original.TagsObject
+type UpdateParameters = original.UpdateParameters
+type ValidateCustomDomainInput = original.ValidateCustomDomainInput
+type ValidateCustomDomainOutput = original.ValidateCustomDomainOutput
+type WebApplicationFirewallPolicy = original.WebApplicationFirewallPolicy
+type WebApplicationFirewallPolicyList = original.WebApplicationFirewallPolicyList
+type WebApplicationFirewallPolicyListIterator = original.WebApplicationFirewallPolicyListIterator
+type WebApplicationFirewallPolicyListPage = original.WebApplicationFirewallPolicyListPage
+type WebApplicationFirewallPolicyProperties = original.WebApplicationFirewallPolicyProperties
+
+func New(subscriptionID string) BaseClient {
+ return original.New(subscriptionID)
+}
+func NewEndpointsClient(subscriptionID string) EndpointsClient {
+ return original.NewEndpointsClient(subscriptionID)
+}
+func NewEndpointsClientWithBaseURI(baseURI string, subscriptionID string) EndpointsClient {
+ return original.NewEndpointsClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewFrontDoorsClient(subscriptionID string) FrontDoorsClient {
+ return original.NewFrontDoorsClient(subscriptionID)
+}
+func NewFrontDoorsClientWithBaseURI(baseURI string, subscriptionID string) FrontDoorsClient {
+ return original.NewFrontDoorsClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewFrontendEndpointsClient(subscriptionID string) FrontendEndpointsClient {
+ return original.NewFrontendEndpointsClient(subscriptionID)
+}
+func NewFrontendEndpointsClientWithBaseURI(baseURI string, subscriptionID string) FrontendEndpointsClient {
+ return original.NewFrontendEndpointsClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewFrontendEndpointsListResultIterator(page FrontendEndpointsListResultPage) FrontendEndpointsListResultIterator {
+ return original.NewFrontendEndpointsListResultIterator(page)
+}
+func NewFrontendEndpointsListResultPage(getNextPage func(context.Context, FrontendEndpointsListResult) (FrontendEndpointsListResult, error)) FrontendEndpointsListResultPage {
+ return original.NewFrontendEndpointsListResultPage(getNextPage)
+}
+func NewListResultIterator(page ListResultPage) ListResultIterator {
+ return original.NewListResultIterator(page)
+}
+func NewListResultPage(getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage {
+ return original.NewListResultPage(getNextPage)
+}
+func NewManagedRuleSetDefinitionListIterator(page ManagedRuleSetDefinitionListPage) ManagedRuleSetDefinitionListIterator {
+ return original.NewManagedRuleSetDefinitionListIterator(page)
+}
+func NewManagedRuleSetDefinitionListPage(getNextPage func(context.Context, ManagedRuleSetDefinitionList) (ManagedRuleSetDefinitionList, error)) ManagedRuleSetDefinitionListPage {
+ return original.NewManagedRuleSetDefinitionListPage(getNextPage)
+}
+func NewManagedRuleSetsClient(subscriptionID string) ManagedRuleSetsClient {
+ return original.NewManagedRuleSetsClient(subscriptionID)
+}
+func NewManagedRuleSetsClientWithBaseURI(baseURI string, subscriptionID string) ManagedRuleSetsClient {
+ return original.NewManagedRuleSetsClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewPoliciesClient(subscriptionID string) PoliciesClient {
+ return original.NewPoliciesClient(subscriptionID)
+}
+func NewPoliciesClientWithBaseURI(baseURI string, subscriptionID string) PoliciesClient {
+ return original.NewPoliciesClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewWebApplicationFirewallPolicyListIterator(page WebApplicationFirewallPolicyListPage) WebApplicationFirewallPolicyListIterator {
+ return original.NewWebApplicationFirewallPolicyListIterator(page)
+}
+func NewWebApplicationFirewallPolicyListPage(getNextPage func(context.Context, WebApplicationFirewallPolicyList) (WebApplicationFirewallPolicyList, error)) WebApplicationFirewallPolicyListPage {
+ return original.NewWebApplicationFirewallPolicyListPage(getNextPage)
+}
+func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
+ return original.NewWithBaseURI(baseURI, subscriptionID)
+}
+func PossibleActionTypeValues() []ActionType {
+ return original.PossibleActionTypeValues()
+}
+func PossibleAvailabilityValues() []Availability {
+ return original.PossibleAvailabilityValues()
+}
+func PossibleBackendEnabledStateValues() []BackendEnabledState {
+ return original.PossibleBackendEnabledStateValues()
+}
+func PossibleCertificateSourceValues() []CertificateSource {
+ return original.PossibleCertificateSourceValues()
+}
+func PossibleCertificateTypeValues() []CertificateType {
+ return original.PossibleCertificateTypeValues()
+}
+func PossibleCustomHTTPSProvisioningStateValues() []CustomHTTPSProvisioningState {
+ return original.PossibleCustomHTTPSProvisioningStateValues()
+}
+func PossibleCustomHTTPSProvisioningSubstateValues() []CustomHTTPSProvisioningSubstate {
+ return original.PossibleCustomHTTPSProvisioningSubstateValues()
+}
+func PossibleCustomRuleEnabledStateValues() []CustomRuleEnabledState {
+ return original.PossibleCustomRuleEnabledStateValues()
+}
+func PossibleDynamicCompressionEnabledValues() []DynamicCompressionEnabled {
+ return original.PossibleDynamicCompressionEnabledValues()
+}
+func PossibleEnabledStateValues() []EnabledState {
+ return original.PossibleEnabledStateValues()
+}
+func PossibleEnforceCertificateNameCheckEnabledStateValues() []EnforceCertificateNameCheckEnabledState {
+ return original.PossibleEnforceCertificateNameCheckEnabledStateValues()
+}
+func PossibleForwardingProtocolValues() []ForwardingProtocol {
+ return original.PossibleForwardingProtocolValues()
+}
+func PossibleHealthProbeEnabledValues() []HealthProbeEnabled {
+ return original.PossibleHealthProbeEnabledValues()
+}
+func PossibleHealthProbeMethodValues() []HealthProbeMethod {
+ return original.PossibleHealthProbeMethodValues()
+}
+func PossibleManagedRuleEnabledStateValues() []ManagedRuleEnabledState {
+ return original.PossibleManagedRuleEnabledStateValues()
+}
+func PossibleMatchVariableValues() []MatchVariable {
+ return original.PossibleMatchVariableValues()
+}
+func PossibleMinimumTLSVersionValues() []MinimumTLSVersion {
+ return original.PossibleMinimumTLSVersionValues()
+}
+func PossibleNetworkOperationStatusValues() []NetworkOperationStatus {
+ return original.PossibleNetworkOperationStatusValues()
+}
+func PossibleOdataTypeValues() []OdataType {
+ return original.PossibleOdataTypeValues()
+}
+func PossibleOperatorValues() []Operator {
+ return original.PossibleOperatorValues()
+}
+func PossiblePolicyEnabledStateValues() []PolicyEnabledState {
+ return original.PossiblePolicyEnabledStateValues()
+}
+func PossiblePolicyModeValues() []PolicyMode {
+ return original.PossiblePolicyModeValues()
+}
+func PossiblePolicyResourceStateValues() []PolicyResourceState {
+ return original.PossiblePolicyResourceStateValues()
+}
+func PossibleProtocolValues() []Protocol {
+ return original.PossibleProtocolValues()
+}
+func PossibleQueryValues() []Query {
+ return original.PossibleQueryValues()
+}
+func PossibleRedirectProtocolValues() []RedirectProtocol {
+ return original.PossibleRedirectProtocolValues()
+}
+func PossibleRedirectTypeValues() []RedirectType {
+ return original.PossibleRedirectTypeValues()
+}
+func PossibleResourceStateValues() []ResourceState {
+ return original.PossibleResourceStateValues()
+}
+func PossibleResourceTypeValues() []ResourceType {
+ return original.PossibleResourceTypeValues()
+}
+func PossibleRoutingRuleEnabledStateValues() []RoutingRuleEnabledState {
+ return original.PossibleRoutingRuleEnabledStateValues()
+}
+func PossibleRuleTypeValues() []RuleType {
+ return original.PossibleRuleTypeValues()
+}
+func PossibleSessionAffinityEnabledStateValues() []SessionAffinityEnabledState {
+ return original.PossibleSessionAffinityEnabledStateValues()
+}
+func PossibleTransformTypeValues() []TransformType {
+ return original.PossibleTransformTypeValues()
+}
+func UserAgent() string {
+ return original.UserAgent() + " profiles/latest"
+}
+func Version() string {
+ return original.Version()
+}
diff --git a/profiles/preview/preview/devspaces/mgmt/devspaces/devspacesapi/models.go b/profiles/latest/healthcareapis/mgmt/healthcareapis/healthcareapisapi/models.go
similarity index 73%
rename from profiles/preview/preview/devspaces/mgmt/devspaces/devspacesapi/models.go
rename to profiles/latest/healthcareapis/mgmt/healthcareapis/healthcareapisapi/models.go
index 4950c9f77c2b..ebd9615bd1ab 100644
--- a/profiles/preview/preview/devspaces/mgmt/devspaces/devspacesapi/models.go
+++ b/profiles/latest/healthcareapis/mgmt/healthcareapis/healthcareapisapi/models.go
@@ -17,10 +17,10 @@
// This code was auto-generated by:
// github.com/Azure/azure-sdk-for-go/tools/profileBuilder
-package devspacesapi
+package healthcareapisapi
-import original "github.com/Azure/azure-sdk-for-go/services/preview/devspaces/mgmt/2019-01-01-preview/devspaces/devspacesapi"
+import original "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2019-09-16/healthcareapis/healthcareapisapi"
-type ContainerHostMappingsClientAPI = original.ContainerHostMappingsClientAPI
-type ControllersClientAPI = original.ControllersClientAPI
+type OperationResultsClientAPI = original.OperationResultsClientAPI
type OperationsClientAPI = original.OperationsClientAPI
+type ServicesClientAPI = original.ServicesClientAPI
diff --git a/profiles/latest/healthcareapis/mgmt/healthcareapis/models.go b/profiles/latest/healthcareapis/mgmt/healthcareapis/models.go
new file mode 100644
index 000000000000..0018a473de12
--- /dev/null
+++ b/profiles/latest/healthcareapis/mgmt/healthcareapis/models.go
@@ -0,0 +1,154 @@
+// +build go1.9
+
+// Copyright 2019 Microsoft Corporation
+//
+// 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.
+
+// This code was auto-generated by:
+// github.com/Azure/azure-sdk-for-go/tools/profileBuilder
+
+package healthcareapis
+
+import (
+ "context"
+
+ original "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2019-09-16/healthcareapis"
+)
+
+const (
+ DefaultBaseURI = original.DefaultBaseURI
+)
+
+type Kind = original.Kind
+
+const (
+ Fhir Kind = original.Fhir
+ FhirR4 Kind = original.FhirR4
+ FhirStu3 Kind = original.FhirStu3
+)
+
+type OperationResultStatus = original.OperationResultStatus
+
+const (
+ Canceled OperationResultStatus = original.Canceled
+ Failed OperationResultStatus = original.Failed
+ Requested OperationResultStatus = original.Requested
+ Running OperationResultStatus = original.Running
+ Succeeded OperationResultStatus = original.Succeeded
+)
+
+type ProvisioningState = original.ProvisioningState
+
+const (
+ ProvisioningStateAccepted ProvisioningState = original.ProvisioningStateAccepted
+ ProvisioningStateCanceled ProvisioningState = original.ProvisioningStateCanceled
+ ProvisioningStateCreating ProvisioningState = original.ProvisioningStateCreating
+ ProvisioningStateDeleting ProvisioningState = original.ProvisioningStateDeleting
+ ProvisioningStateDeprovisioned ProvisioningState = original.ProvisioningStateDeprovisioned
+ ProvisioningStateFailed ProvisioningState = original.ProvisioningStateFailed
+ ProvisioningStateSucceeded ProvisioningState = original.ProvisioningStateSucceeded
+ ProvisioningStateUpdating ProvisioningState = original.ProvisioningStateUpdating
+ ProvisioningStateVerifying ProvisioningState = original.ProvisioningStateVerifying
+)
+
+type ServiceNameUnavailabilityReason = original.ServiceNameUnavailabilityReason
+
+const (
+ AlreadyExists ServiceNameUnavailabilityReason = original.AlreadyExists
+ Invalid ServiceNameUnavailabilityReason = original.Invalid
+)
+
+type BaseClient = original.BaseClient
+type CheckNameAvailabilityParameters = original.CheckNameAvailabilityParameters
+type ErrorDetails = original.ErrorDetails
+type ErrorDetailsInternal = original.ErrorDetailsInternal
+type Operation = original.Operation
+type OperationDisplay = original.OperationDisplay
+type OperationListResult = original.OperationListResult
+type OperationListResultIterator = original.OperationListResultIterator
+type OperationListResultPage = original.OperationListResultPage
+type OperationResultsClient = original.OperationResultsClient
+type OperationResultsDescription = original.OperationResultsDescription
+type OperationsClient = original.OperationsClient
+type Resource = original.Resource
+type ServiceAccessPolicyEntry = original.ServiceAccessPolicyEntry
+type ServiceAuthenticationConfigurationInfo = original.ServiceAuthenticationConfigurationInfo
+type ServiceCorsConfigurationInfo = original.ServiceCorsConfigurationInfo
+type ServiceCosmosDbConfigurationInfo = original.ServiceCosmosDbConfigurationInfo
+type ServicesClient = original.ServicesClient
+type ServicesCreateOrUpdateFuture = original.ServicesCreateOrUpdateFuture
+type ServicesDeleteFuture = original.ServicesDeleteFuture
+type ServicesDescription = original.ServicesDescription
+type ServicesDescriptionListResult = original.ServicesDescriptionListResult
+type ServicesDescriptionListResultIterator = original.ServicesDescriptionListResultIterator
+type ServicesDescriptionListResultPage = original.ServicesDescriptionListResultPage
+type ServicesNameAvailabilityInfo = original.ServicesNameAvailabilityInfo
+type ServicesPatchDescription = original.ServicesPatchDescription
+type ServicesProperties = original.ServicesProperties
+type ServicesUpdateFuture = original.ServicesUpdateFuture
+type SetObject = original.SetObject
+
+func New(subscriptionID string) BaseClient {
+ return original.New(subscriptionID)
+}
+func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
+ return original.NewOperationListResultIterator(page)
+}
+func NewOperationListResultPage(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
+ return original.NewOperationListResultPage(getNextPage)
+}
+func NewOperationResultsClient(subscriptionID string) OperationResultsClient {
+ return original.NewOperationResultsClient(subscriptionID)
+}
+func NewOperationResultsClientWithBaseURI(baseURI string, subscriptionID string) OperationResultsClient {
+ return original.NewOperationResultsClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewOperationsClient(subscriptionID string) OperationsClient {
+ return original.NewOperationsClient(subscriptionID)
+}
+func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient {
+ return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewServicesClient(subscriptionID string) ServicesClient {
+ return original.NewServicesClient(subscriptionID)
+}
+func NewServicesClientWithBaseURI(baseURI string, subscriptionID string) ServicesClient {
+ return original.NewServicesClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewServicesDescriptionListResultIterator(page ServicesDescriptionListResultPage) ServicesDescriptionListResultIterator {
+ return original.NewServicesDescriptionListResultIterator(page)
+}
+func NewServicesDescriptionListResultPage(getNextPage func(context.Context, ServicesDescriptionListResult) (ServicesDescriptionListResult, error)) ServicesDescriptionListResultPage {
+ return original.NewServicesDescriptionListResultPage(getNextPage)
+}
+func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
+ return original.NewWithBaseURI(baseURI, subscriptionID)
+}
+func PossibleKindValues() []Kind {
+ return original.PossibleKindValues()
+}
+func PossibleOperationResultStatusValues() []OperationResultStatus {
+ return original.PossibleOperationResultStatusValues()
+}
+func PossibleProvisioningStateValues() []ProvisioningState {
+ return original.PossibleProvisioningStateValues()
+}
+func PossibleServiceNameUnavailabilityReasonValues() []ServiceNameUnavailabilityReason {
+ return original.PossibleServiceNameUnavailabilityReasonValues()
+}
+func UserAgent() string {
+ return original.UserAgent() + " profiles/latest"
+}
+func Version() string {
+ return original.Version()
+}
diff --git a/profiles/latest/kusto/mgmt/kusto/kustoapi/models.go b/profiles/latest/kusto/mgmt/kusto/kustoapi/models.go
index 07c81eaf8dab..25b871538b2d 100644
--- a/profiles/latest/kusto/mgmt/kusto/kustoapi/models.go
+++ b/profiles/latest/kusto/mgmt/kusto/kustoapi/models.go
@@ -19,8 +19,9 @@
package kustoapi
-import original "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2019-05-15/kusto/kustoapi"
+import original "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2019-09-07/kusto/kustoapi"
+type AttachedDatabaseConfigurationsClientAPI = original.AttachedDatabaseConfigurationsClientAPI
type ClustersClientAPI = original.ClustersClientAPI
type DataConnectionsClientAPI = original.DataConnectionsClientAPI
type DatabasesClientAPI = original.DatabasesClientAPI
diff --git a/profiles/latest/kusto/mgmt/kusto/models.go b/profiles/latest/kusto/mgmt/kusto/models.go
index fa4db8764073..917855cd280e 100644
--- a/profiles/latest/kusto/mgmt/kusto/models.go
+++ b/profiles/latest/kusto/mgmt/kusto/models.go
@@ -22,7 +22,7 @@ package kusto
import (
"context"
- original "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2019-05-15/kusto"
+ original "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2019-09-07/kusto"
)
const (
@@ -74,6 +74,7 @@ const (
SINGLEJSON DataFormat = original.SINGLEJSON
SOHSV DataFormat = original.SOHSV
TSV DataFormat = original.TSV
+ TSVE DataFormat = original.TSVE
TXT DataFormat = original.TXT
)
@@ -96,13 +97,44 @@ const (
DatabasePrincipalTypeUser DatabasePrincipalType = original.DatabasePrincipalTypeUser
)
+type DefaultPrincipalsModificationKind = original.DefaultPrincipalsModificationKind
+
+const (
+ DefaultPrincipalsModificationKindNone DefaultPrincipalsModificationKind = original.DefaultPrincipalsModificationKindNone
+ DefaultPrincipalsModificationKindReplace DefaultPrincipalsModificationKind = original.DefaultPrincipalsModificationKindReplace
+ DefaultPrincipalsModificationKindUnion DefaultPrincipalsModificationKind = original.DefaultPrincipalsModificationKindUnion
+)
+
+type IdentityType = original.IdentityType
+
+const (
+ IdentityTypeNone IdentityType = original.IdentityTypeNone
+ IdentityTypeSystemAssigned IdentityType = original.IdentityTypeSystemAssigned
+)
+
type Kind = original.Kind
const (
- KindDataConnection Kind = original.KindDataConnection
- KindEventGrid Kind = original.KindEventGrid
- KindEventHub Kind = original.KindEventHub
- KindIotHub Kind = original.KindIotHub
+ KindDatabase Kind = original.KindDatabase
+ KindReadOnlyFollowing Kind = original.KindReadOnlyFollowing
+ KindReadWrite Kind = original.KindReadWrite
+)
+
+type KindBasicDataConnection = original.KindBasicDataConnection
+
+const (
+ KindDataConnection KindBasicDataConnection = original.KindDataConnection
+ KindEventGrid KindBasicDataConnection = original.KindEventGrid
+ KindEventHub KindBasicDataConnection = original.KindEventHub
+ KindIotHub KindBasicDataConnection = original.KindIotHub
+)
+
+type PrincipalsModificationKind = original.PrincipalsModificationKind
+
+const (
+ PrincipalsModificationKindNone PrincipalsModificationKind = original.PrincipalsModificationKindNone
+ PrincipalsModificationKindReplace PrincipalsModificationKind = original.PrincipalsModificationKindReplace
+ PrincipalsModificationKindUnion PrincipalsModificationKind = original.PrincipalsModificationKindUnion
)
type ProvisioningState = original.ProvisioningState
@@ -137,12 +169,27 @@ const (
StateUpdating State = original.StateUpdating
)
+type Type = original.Type
+
+const (
+ MicrosoftKustoclustersattachedDatabaseConfigurations Type = original.MicrosoftKustoclustersattachedDatabaseConfigurations
+ MicrosoftKustoclustersdatabases Type = original.MicrosoftKustoclustersdatabases
+)
+
+type AttachedDatabaseConfiguration = original.AttachedDatabaseConfiguration
+type AttachedDatabaseConfigurationListResult = original.AttachedDatabaseConfigurationListResult
+type AttachedDatabaseConfigurationProperties = original.AttachedDatabaseConfigurationProperties
+type AttachedDatabaseConfigurationsClient = original.AttachedDatabaseConfigurationsClient
+type AttachedDatabaseConfigurationsCreateOrUpdateFuture = original.AttachedDatabaseConfigurationsCreateOrUpdateFuture
+type AttachedDatabaseConfigurationsDeleteFuture = original.AttachedDatabaseConfigurationsDeleteFuture
type AzureCapacity = original.AzureCapacity
type AzureEntityResource = original.AzureEntityResource
type AzureResourceSku = original.AzureResourceSku
type AzureSku = original.AzureSku
type BaseClient = original.BaseClient
type BasicDataConnection = original.BasicDataConnection
+type BasicDatabase = original.BasicDatabase
+type CheckNameRequest = original.CheckNameRequest
type CheckNameResult = original.CheckNameResult
type CloudError = original.CloudError
type CloudErrorBody = original.CloudErrorBody
@@ -154,6 +201,7 @@ type ClusterUpdate = original.ClusterUpdate
type ClustersClient = original.ClustersClient
type ClustersCreateOrUpdateFuture = original.ClustersCreateOrUpdateFuture
type ClustersDeleteFuture = original.ClustersDeleteFuture
+type ClustersDetachFollowerDatabasesFuture = original.ClustersDetachFollowerDatabasesFuture
type ClustersStartFuture = original.ClustersStartFuture
type ClustersStopFuture = original.ClustersStopFuture
type ClustersUpdateFuture = original.ClustersUpdateFuture
@@ -169,14 +217,12 @@ type DataConnectionsCreateOrUpdateFuture = original.DataConnectionsCreateOrUpdat
type DataConnectionsDeleteFuture = original.DataConnectionsDeleteFuture
type DataConnectionsUpdateFuture = original.DataConnectionsUpdateFuture
type Database = original.Database
-type DatabaseCheckNameRequest = original.DatabaseCheckNameRequest
type DatabaseListResult = original.DatabaseListResult
+type DatabaseModel = original.DatabaseModel
type DatabasePrincipal = original.DatabasePrincipal
type DatabasePrincipalListRequest = original.DatabasePrincipalListRequest
type DatabasePrincipalListResult = original.DatabasePrincipalListResult
-type DatabaseProperties = original.DatabaseProperties
type DatabaseStatistics = original.DatabaseStatistics
-type DatabaseUpdate = original.DatabaseUpdate
type DatabasesClient = original.DatabasesClient
type DatabasesCreateOrUpdateFuture = original.DatabasesCreateOrUpdateFuture
type DatabasesDeleteFuture = original.DatabasesDeleteFuture
@@ -185,8 +231,13 @@ type EventGridConnectionProperties = original.EventGridConnectionProperties
type EventGridDataConnection = original.EventGridDataConnection
type EventHubConnectionProperties = original.EventHubConnectionProperties
type EventHubDataConnection = original.EventHubDataConnection
+type FollowerDatabaseDefinition = original.FollowerDatabaseDefinition
+type FollowerDatabaseListResult = original.FollowerDatabaseListResult
+type Identity = original.Identity
+type IdentityUserAssignedIdentitiesValue = original.IdentityUserAssignedIdentitiesValue
type IotHubConnectionProperties = original.IotHubConnectionProperties
type IotHubDataConnection = original.IotHubDataConnection
+type KeyVaultProperties = original.KeyVaultProperties
type ListResourceSkusResult = original.ListResourceSkusResult
type Operation = original.Operation
type OperationDisplay = original.OperationDisplay
@@ -196,6 +247,10 @@ type OperationListResultPage = original.OperationListResultPage
type OperationsClient = original.OperationsClient
type OptimizedAutoscale = original.OptimizedAutoscale
type ProxyResource = original.ProxyResource
+type ReadOnlyFollowingDatabase = original.ReadOnlyFollowingDatabase
+type ReadOnlyFollowingDatabaseProperties = original.ReadOnlyFollowingDatabaseProperties
+type ReadWriteDatabase = original.ReadWriteDatabase
+type ReadWriteDatabaseProperties = original.ReadWriteDatabaseProperties
type Resource = original.Resource
type SkuDescription = original.SkuDescription
type SkuDescriptionList = original.SkuDescriptionList
@@ -207,6 +262,12 @@ type VirtualNetworkConfiguration = original.VirtualNetworkConfiguration
func New(subscriptionID string) BaseClient {
return original.New(subscriptionID)
}
+func NewAttachedDatabaseConfigurationsClient(subscriptionID string) AttachedDatabaseConfigurationsClient {
+ return original.NewAttachedDatabaseConfigurationsClient(subscriptionID)
+}
+func NewAttachedDatabaseConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) AttachedDatabaseConfigurationsClient {
+ return original.NewAttachedDatabaseConfigurationsClientWithBaseURI(baseURI, subscriptionID)
+}
func NewClustersClient(subscriptionID string) ClustersClient {
return original.NewClustersClient(subscriptionID)
}
@@ -258,9 +319,21 @@ func PossibleDatabasePrincipalRoleValues() []DatabasePrincipalRole {
func PossibleDatabasePrincipalTypeValues() []DatabasePrincipalType {
return original.PossibleDatabasePrincipalTypeValues()
}
+func PossibleDefaultPrincipalsModificationKindValues() []DefaultPrincipalsModificationKind {
+ return original.PossibleDefaultPrincipalsModificationKindValues()
+}
+func PossibleIdentityTypeValues() []IdentityType {
+ return original.PossibleIdentityTypeValues()
+}
+func PossibleKindBasicDataConnectionValues() []KindBasicDataConnection {
+ return original.PossibleKindBasicDataConnectionValues()
+}
func PossibleKindValues() []Kind {
return original.PossibleKindValues()
}
+func PossiblePrincipalsModificationKindValues() []PrincipalsModificationKind {
+ return original.PossiblePrincipalsModificationKindValues()
+}
func PossibleProvisioningStateValues() []ProvisioningState {
return original.PossibleProvisioningStateValues()
}
@@ -270,6 +343,9 @@ func PossibleReasonValues() []Reason {
func PossibleStateValues() []State {
return original.PossibleStateValues()
}
+func PossibleTypeValues() []Type {
+ return original.PossibleTypeValues()
+}
func UserAgent() string {
return original.UserAgent() + " profiles/latest"
}
diff --git a/profiles/latest/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go b/profiles/latest/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go
index 0d80dd1aa71c..7304674d88f3 100644
--- a/profiles/latest/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go
+++ b/profiles/latest/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go
@@ -23,6 +23,7 @@ import original "github.com/Azure/azure-sdk-for-go/services/machinelearningservi
type MachineLearningComputeClientAPI = original.MachineLearningComputeClientAPI
type OperationsClientAPI = original.OperationsClientAPI
+type QuotasClientAPI = original.QuotasClientAPI
type UsagesClientAPI = original.UsagesClientAPI
type VirtualMachineSizesClientAPI = original.VirtualMachineSizesClientAPI
type WorkspacesClientAPI = original.WorkspacesClientAPI
diff --git a/profiles/latest/machinelearningservices/mgmt/machinelearningservices/models.go b/profiles/latest/machinelearningservices/mgmt/machinelearningservices/models.go
index 683b49dd75be..ee20b507ed49 100644
--- a/profiles/latest/machinelearningservices/mgmt/machinelearningservices/models.go
+++ b/profiles/latest/machinelearningservices/mgmt/machinelearningservices/models.go
@@ -100,6 +100,12 @@ const (
Updating ProvisioningState = original.Updating
)
+type QuotaUnit = original.QuotaUnit
+
+const (
+ Count QuotaUnit = original.Count
+)
+
type RemoteLoginPortPublicAccess = original.RemoteLoginPortPublicAccess
const (
@@ -117,8 +123,19 @@ const (
type Status = original.Status
const (
- StatusDisabled Status = original.StatusDisabled
- StatusEnabled Status = original.StatusEnabled
+ Failure Status = original.Failure
+ InvalidQuotaBelowClusterMinimum Status = original.InvalidQuotaBelowClusterMinimum
+ InvalidQuotaExceedsSubscriptionLimit Status = original.InvalidQuotaExceedsSubscriptionLimit
+ InvalidVMFamilyName Status = original.InvalidVMFamilyName
+ Success Status = original.Success
+ Undefined Status = original.Undefined
+)
+
+type Status1 = original.Status1
+
+const (
+ Status1Disabled Status1 = original.Status1Disabled
+ Status1Enabled Status1 = original.Status1Enabled
)
type UnderlyingResourceAction = original.UnderlyingResourceAction
@@ -131,7 +148,7 @@ const (
type UsageUnit = original.UsageUnit
const (
- Count UsageUnit = original.Count
+ UsageUnitCount UsageUnit = original.UsageUnitCount
)
type VMPriority = original.VMPriority
@@ -176,6 +193,9 @@ type ListUsagesResult = original.ListUsagesResult
type ListUsagesResultIterator = original.ListUsagesResultIterator
type ListUsagesResultPage = original.ListUsagesResultPage
type ListWorkspaceKeysResult = original.ListWorkspaceKeysResult
+type ListWorkspaceQuotas = original.ListWorkspaceQuotas
+type ListWorkspaceQuotasIterator = original.ListWorkspaceQuotasIterator
+type ListWorkspaceQuotasPage = original.ListWorkspaceQuotasPage
type MachineLearningComputeClient = original.MachineLearningComputeClient
type MachineLearningComputeCreateOrUpdateFuture = original.MachineLearningComputeCreateOrUpdateFuture
type MachineLearningComputeDeleteFuture = original.MachineLearningComputeDeleteFuture
@@ -189,13 +209,20 @@ type PaginatedComputeResourcesList = original.PaginatedComputeResourcesList
type PaginatedComputeResourcesListIterator = original.PaginatedComputeResourcesListIterator
type PaginatedComputeResourcesListPage = original.PaginatedComputeResourcesListPage
type Password = original.Password
+type QuotaBaseProperties = original.QuotaBaseProperties
+type QuotaUpdateParameters = original.QuotaUpdateParameters
+type QuotasClient = original.QuotasClient
type RegistryListCredentialsResult = original.RegistryListCredentialsResult
type Resource = original.Resource
type ResourceID = original.ResourceID
+type ResourceName = original.ResourceName
+type ResourceQuota = original.ResourceQuota
type ScaleSettings = original.ScaleSettings
type ServicePrincipalCredentials = original.ServicePrincipalCredentials
type SslConfiguration = original.SslConfiguration
type SystemService = original.SystemService
+type UpdateWorkspaceQuotas = original.UpdateWorkspaceQuotas
+type UpdateWorkspaceQuotasResult = original.UpdateWorkspaceQuotasResult
type Usage = original.Usage
type UsageName = original.UsageName
type UsagesClient = original.UsagesClient
@@ -225,6 +252,12 @@ func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIter
func NewListUsagesResultPage(getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage {
return original.NewListUsagesResultPage(getNextPage)
}
+func NewListWorkspaceQuotasIterator(page ListWorkspaceQuotasPage) ListWorkspaceQuotasIterator {
+ return original.NewListWorkspaceQuotasIterator(page)
+}
+func NewListWorkspaceQuotasPage(getNextPage func(context.Context, ListWorkspaceQuotas) (ListWorkspaceQuotas, error)) ListWorkspaceQuotasPage {
+ return original.NewListWorkspaceQuotasPage(getNextPage)
+}
func NewMachineLearningComputeClient(subscriptionID string) MachineLearningComputeClient {
return original.NewMachineLearningComputeClient(subscriptionID)
}
@@ -243,6 +276,12 @@ func NewPaginatedComputeResourcesListIterator(page PaginatedComputeResourcesList
func NewPaginatedComputeResourcesListPage(getNextPage func(context.Context, PaginatedComputeResourcesList) (PaginatedComputeResourcesList, error)) PaginatedComputeResourcesListPage {
return original.NewPaginatedComputeResourcesListPage(getNextPage)
}
+func NewQuotasClient(subscriptionID string) QuotasClient {
+ return original.NewQuotasClient(subscriptionID)
+}
+func NewQuotasClientWithBaseURI(baseURI string, subscriptionID string) QuotasClient {
+ return original.NewQuotasClientWithBaseURI(baseURI, subscriptionID)
+}
func NewUsagesClient(subscriptionID string) UsagesClient {
return original.NewUsagesClient(subscriptionID)
}
@@ -291,12 +330,18 @@ func PossibleNodeStateValues() []NodeState {
func PossibleProvisioningStateValues() []ProvisioningState {
return original.PossibleProvisioningStateValues()
}
+func PossibleQuotaUnitValues() []QuotaUnit {
+ return original.PossibleQuotaUnitValues()
+}
func PossibleRemoteLoginPortPublicAccessValues() []RemoteLoginPortPublicAccess {
return original.PossibleRemoteLoginPortPublicAccessValues()
}
func PossibleResourceIdentityTypeValues() []ResourceIdentityType {
return original.PossibleResourceIdentityTypeValues()
}
+func PossibleStatus1Values() []Status1 {
+ return original.PossibleStatus1Values()
+}
func PossibleStatusValues() []Status {
return original.PossibleStatusValues()
}
diff --git a/profiles/latest/mobileengagement/mgmt/mobileengagement/models.go b/profiles/latest/mobileengagement/mgmt/mobileengagement/models.go
deleted file mode 100644
index aa0e123aae85..000000000000
--- a/profiles/latest/mobileengagement/mgmt/mobileengagement/models.go
+++ /dev/null
@@ -1,394 +0,0 @@
-// +build go1.9
-
-// Copyright 2019 Microsoft Corporation
-//
-// 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.
-
-// This code was auto-generated by:
-// github.com/Azure/azure-sdk-for-go/tools/profileBuilder
-
-package mobileengagement
-
-import original "github.com/Azure/azure-sdk-for-go/services/mobileengagement/mgmt/2014-12-01/mobileengagement"
-
-const (
- DefaultBaseURI = original.DefaultBaseURI
-)
-
-type AudienceOperators = original.AudienceOperators
-
-const (
- EQ AudienceOperators = original.EQ
- GE AudienceOperators = original.GE
- GT AudienceOperators = original.GT
- LE AudienceOperators = original.LE
- LT AudienceOperators = original.LT
-)
-
-type CampaignFeedbacks = original.CampaignFeedbacks
-
-const (
- Actioned CampaignFeedbacks = original.Actioned
- Exited CampaignFeedbacks = original.Exited
- Pushed CampaignFeedbacks = original.Pushed
- Replied CampaignFeedbacks = original.Replied
-)
-
-type CampaignKinds = original.CampaignKinds
-
-const (
- Announcements CampaignKinds = original.Announcements
- DataPushes CampaignKinds = original.DataPushes
- NativePushes CampaignKinds = original.NativePushes
- Polls CampaignKinds = original.Polls
-)
-
-type CampaignStates = original.CampaignStates
-
-const (
- Draft CampaignStates = original.Draft
- Finished CampaignStates = original.Finished
- InProgress CampaignStates = original.InProgress
- Queued CampaignStates = original.Queued
- Scheduled CampaignStates = original.Scheduled
-)
-
-type CampaignType = original.CampaignType
-
-const (
- Announcement CampaignType = original.Announcement
- DataPush CampaignType = original.DataPush
- NativePush CampaignType = original.NativePush
- Poll CampaignType = original.Poll
-)
-
-type CampaignTypes = original.CampaignTypes
-
-const (
- OnlyNotif CampaignTypes = original.OnlyNotif
- Textbase64 CampaignTypes = original.Textbase64
- Texthtml CampaignTypes = original.Texthtml
- Textplain CampaignTypes = original.Textplain
-)
-
-type DeliveryTimes = original.DeliveryTimes
-
-const (
- Any DeliveryTimes = original.Any
- Background DeliveryTimes = original.Background
- Session DeliveryTimes = original.Session
-)
-
-type ExportFormat = original.ExportFormat
-
-const (
- CsvBlob ExportFormat = original.CsvBlob
- JSONBlob ExportFormat = original.JSONBlob
-)
-
-type ExportState = original.ExportState
-
-const (
- ExportStateFailed ExportState = original.ExportStateFailed
- ExportStateQueued ExportState = original.ExportStateQueued
- ExportStateStarted ExportState = original.ExportStateStarted
- ExportStateSucceeded ExportState = original.ExportStateSucceeded
-)
-
-type ExportType = original.ExportType
-
-const (
- ExportTypeActivity ExportType = original.ExportTypeActivity
- ExportTypeCrash ExportType = original.ExportTypeCrash
- ExportTypeError ExportType = original.ExportTypeError
- ExportTypeEvent ExportType = original.ExportTypeEvent
- ExportTypeJob ExportType = original.ExportTypeJob
- ExportTypePush ExportType = original.ExportTypePush
- ExportTypeSession ExportType = original.ExportTypeSession
- ExportTypeTag ExportType = original.ExportTypeTag
- ExportTypeToken ExportType = original.ExportTypeToken
-)
-
-type JobStates = original.JobStates
-
-const (
- JobStatesFailed JobStates = original.JobStatesFailed
- JobStatesQueued JobStates = original.JobStatesQueued
- JobStatesStarted JobStates = original.JobStatesStarted
- JobStatesSucceeded JobStates = original.JobStatesSucceeded
-)
-
-type NotificationTypes = original.NotificationTypes
-
-const (
- Popup NotificationTypes = original.Popup
- System NotificationTypes = original.System
-)
-
-type ProvisioningStates = original.ProvisioningStates
-
-const (
- Creating ProvisioningStates = original.Creating
- Succeeded ProvisioningStates = original.Succeeded
-)
-
-type PushModes = original.PushModes
-
-const (
- Manual PushModes = original.Manual
- OneShot PushModes = original.OneShot
- RealTime PushModes = original.RealTime
-)
-
-type Type = original.Type
-
-const (
- TypeAnnouncementFeedback Type = original.TypeAnnouncementFeedback
- TypeApplicationVersion Type = original.TypeApplicationVersion
- TypeBooleanTag Type = original.TypeBooleanTag
- TypeCarrierCountry Type = original.TypeCarrierCountry
- TypeCarrierName Type = original.TypeCarrierName
- TypeCriterion Type = original.TypeCriterion
- TypeDatapushFeedback Type = original.TypeDatapushFeedback
- TypeDateTag Type = original.TypeDateTag
- TypeDeviceManufacturer Type = original.TypeDeviceManufacturer
- TypeDeviceModel Type = original.TypeDeviceModel
- TypeFirmwareVersion Type = original.TypeFirmwareVersion
- TypeGeoFencing Type = original.TypeGeoFencing
- TypeIntegerTag Type = original.TypeIntegerTag
- TypeLanguage Type = original.TypeLanguage
- TypeLocation Type = original.TypeLocation
- TypeNetworkType Type = original.TypeNetworkType
- TypePollAnswerFeedback Type = original.TypePollAnswerFeedback
- TypePollFeedback Type = original.TypePollFeedback
- TypeScreenSize Type = original.TypeScreenSize
- TypeSegment Type = original.TypeSegment
- TypeStringTag Type = original.TypeStringTag
-)
-
-type TypeBasicFilter = original.TypeBasicFilter
-
-const (
- TypeAppInfo TypeBasicFilter = original.TypeAppInfo
- TypeEngageActiveUsers TypeBasicFilter = original.TypeEngageActiveUsers
- TypeEngageIdleUsers TypeBasicFilter = original.TypeEngageIdleUsers
- TypeEngageNewUsers TypeBasicFilter = original.TypeEngageNewUsers
- TypeEngageOldUsers TypeBasicFilter = original.TypeEngageOldUsers
- TypeEngageSubset TypeBasicFilter = original.TypeEngageSubset
- TypeFilter TypeBasicFilter = original.TypeFilter
- TypeNativePushEnabled TypeBasicFilter = original.TypeNativePushEnabled
- TypePushQuota TypeBasicFilter = original.TypePushQuota
-)
-
-type APIError = original.APIError
-type APIErrorError = original.APIErrorError
-type AnnouncementFeedbackCriterion = original.AnnouncementFeedbackCriterion
-type App = original.App
-type AppCollection = original.AppCollection
-type AppCollectionListResult = original.AppCollectionListResult
-type AppCollectionListResultIterator = original.AppCollectionListResultIterator
-type AppCollectionListResultPage = original.AppCollectionListResultPage
-type AppCollectionNameAvailability = original.AppCollectionNameAvailability
-type AppCollectionProperties = original.AppCollectionProperties
-type AppCollectionsClient = original.AppCollectionsClient
-type AppInfoFilter = original.AppInfoFilter
-type AppListResult = original.AppListResult
-type AppListResultIterator = original.AppListResultIterator
-type AppListResultPage = original.AppListResultPage
-type AppProperties = original.AppProperties
-type ApplicationVersionCriterion = original.ApplicationVersionCriterion
-type AppsClient = original.AppsClient
-type BaseClient = original.BaseClient
-type BasicCriterion = original.BasicCriterion
-type BasicFilter = original.BasicFilter
-type BooleanTagCriterion = original.BooleanTagCriterion
-type Campaign = original.Campaign
-type CampaignAudience = original.CampaignAudience
-type CampaignListResult = original.CampaignListResult
-type CampaignLocalization = original.CampaignLocalization
-type CampaignPushParameters = original.CampaignPushParameters
-type CampaignPushResult = original.CampaignPushResult
-type CampaignResult = original.CampaignResult
-type CampaignState = original.CampaignState
-type CampaignStateResult = original.CampaignStateResult
-type CampaignStatisticsResult = original.CampaignStatisticsResult
-type CampaignTestNewParameters = original.CampaignTestNewParameters
-type CampaignTestSavedParameters = original.CampaignTestSavedParameters
-type CampaignsClient = original.CampaignsClient
-type CampaignsListResult = original.CampaignsListResult
-type CampaignsListResultIterator = original.CampaignsListResultIterator
-type CampaignsListResultPage = original.CampaignsListResultPage
-type CarrierCountryCriterion = original.CarrierCountryCriterion
-type CarrierNameCriterion = original.CarrierNameCriterion
-type Criterion = original.Criterion
-type DatapushFeedbackCriterion = original.DatapushFeedbackCriterion
-type DateRangeExportTaskParameter = original.DateRangeExportTaskParameter
-type DateTagCriterion = original.DateTagCriterion
-type Device = original.Device
-type DeviceInfo = original.DeviceInfo
-type DeviceLocation = original.DeviceLocation
-type DeviceManufacturerCriterion = original.DeviceManufacturerCriterion
-type DeviceMeta = original.DeviceMeta
-type DeviceModelCriterion = original.DeviceModelCriterion
-type DeviceQueryResult = original.DeviceQueryResult
-type DeviceTagsParameters = original.DeviceTagsParameters
-type DeviceTagsResult = original.DeviceTagsResult
-type DevicesClient = original.DevicesClient
-type DevicesQueryResult = original.DevicesQueryResult
-type DevicesQueryResultIterator = original.DevicesQueryResultIterator
-type DevicesQueryResultPage = original.DevicesQueryResultPage
-type EngageActiveUsersFilter = original.EngageActiveUsersFilter
-type EngageIdleUsersFilter = original.EngageIdleUsersFilter
-type EngageNewUsersFilter = original.EngageNewUsersFilter
-type EngageOldUsersFilter = original.EngageOldUsersFilter
-type EngageSubsetFilter = original.EngageSubsetFilter
-type ExportOptions = original.ExportOptions
-type ExportTaskListResult = original.ExportTaskListResult
-type ExportTaskListResultIterator = original.ExportTaskListResultIterator
-type ExportTaskListResultPage = original.ExportTaskListResultPage
-type ExportTaskParameter = original.ExportTaskParameter
-type ExportTaskResult = original.ExportTaskResult
-type ExportTasksClient = original.ExportTasksClient
-type FeedbackByCampaignParameter = original.FeedbackByCampaignParameter
-type FeedbackByDateRangeParameter = original.FeedbackByDateRangeParameter
-type Filter = original.Filter
-type FirmwareVersionCriterion = original.FirmwareVersionCriterion
-type GeoFencingCriterion = original.GeoFencingCriterion
-type ImportTask = original.ImportTask
-type ImportTaskListResult = original.ImportTaskListResult
-type ImportTaskListResultIterator = original.ImportTaskListResultIterator
-type ImportTaskListResultPage = original.ImportTaskListResultPage
-type ImportTaskResult = original.ImportTaskResult
-type ImportTasksClient = original.ImportTasksClient
-type IntegerTagCriterion = original.IntegerTagCriterion
-type LanguageCriterion = original.LanguageCriterion
-type LocationCriterion = original.LocationCriterion
-type NativePushEnabledFilter = original.NativePushEnabledFilter
-type NetworkTypeCriterion = original.NetworkTypeCriterion
-type NotificationOptions = original.NotificationOptions
-type PollAnswerFeedbackCriterion = original.PollAnswerFeedbackCriterion
-type PollFeedbackCriterion = original.PollFeedbackCriterion
-type PollQuestion = original.PollQuestion
-type PollQuestionChoice = original.PollQuestionChoice
-type PollQuestionChoiceLocalization = original.PollQuestionChoiceLocalization
-type PollQuestionLocalization = original.PollQuestionLocalization
-type PushQuotaFilter = original.PushQuotaFilter
-type Resource = original.Resource
-type ScreenSizeCriterion = original.ScreenSizeCriterion
-type SegmentCriterion = original.SegmentCriterion
-type StringTagCriterion = original.StringTagCriterion
-type SupportedPlatformsClient = original.SupportedPlatformsClient
-type SupportedPlatformsListResult = original.SupportedPlatformsListResult
-
-func New(subscriptionID string) BaseClient {
- return original.New(subscriptionID)
-}
-func NewAppCollectionsClient(subscriptionID string) AppCollectionsClient {
- return original.NewAppCollectionsClient(subscriptionID)
-}
-func NewAppCollectionsClientWithBaseURI(baseURI string, subscriptionID string) AppCollectionsClient {
- return original.NewAppCollectionsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewAppsClient(subscriptionID string) AppsClient {
- return original.NewAppsClient(subscriptionID)
-}
-func NewAppsClientWithBaseURI(baseURI string, subscriptionID string) AppsClient {
- return original.NewAppsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewCampaignsClient(subscriptionID string) CampaignsClient {
- return original.NewCampaignsClient(subscriptionID)
-}
-func NewCampaignsClientWithBaseURI(baseURI string, subscriptionID string) CampaignsClient {
- return original.NewCampaignsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewDevicesClient(subscriptionID string) DevicesClient {
- return original.NewDevicesClient(subscriptionID)
-}
-func NewDevicesClientWithBaseURI(baseURI string, subscriptionID string) DevicesClient {
- return original.NewDevicesClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewExportTasksClient(subscriptionID string) ExportTasksClient {
- return original.NewExportTasksClient(subscriptionID)
-}
-func NewExportTasksClientWithBaseURI(baseURI string, subscriptionID string) ExportTasksClient {
- return original.NewExportTasksClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewImportTasksClient(subscriptionID string) ImportTasksClient {
- return original.NewImportTasksClient(subscriptionID)
-}
-func NewImportTasksClientWithBaseURI(baseURI string, subscriptionID string) ImportTasksClient {
- return original.NewImportTasksClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewSupportedPlatformsClient(subscriptionID string) SupportedPlatformsClient {
- return original.NewSupportedPlatformsClient(subscriptionID)
-}
-func NewSupportedPlatformsClientWithBaseURI(baseURI string, subscriptionID string) SupportedPlatformsClient {
- return original.NewSupportedPlatformsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
- return original.NewWithBaseURI(baseURI, subscriptionID)
-}
-func PossibleAudienceOperatorsValues() []AudienceOperators {
- return original.PossibleAudienceOperatorsValues()
-}
-func PossibleCampaignFeedbacksValues() []CampaignFeedbacks {
- return original.PossibleCampaignFeedbacksValues()
-}
-func PossibleCampaignKindsValues() []CampaignKinds {
- return original.PossibleCampaignKindsValues()
-}
-func PossibleCampaignStatesValues() []CampaignStates {
- return original.PossibleCampaignStatesValues()
-}
-func PossibleCampaignTypeValues() []CampaignType {
- return original.PossibleCampaignTypeValues()
-}
-func PossibleCampaignTypesValues() []CampaignTypes {
- return original.PossibleCampaignTypesValues()
-}
-func PossibleDeliveryTimesValues() []DeliveryTimes {
- return original.PossibleDeliveryTimesValues()
-}
-func PossibleExportFormatValues() []ExportFormat {
- return original.PossibleExportFormatValues()
-}
-func PossibleExportStateValues() []ExportState {
- return original.PossibleExportStateValues()
-}
-func PossibleExportTypeValues() []ExportType {
- return original.PossibleExportTypeValues()
-}
-func PossibleJobStatesValues() []JobStates {
- return original.PossibleJobStatesValues()
-}
-func PossibleNotificationTypesValues() []NotificationTypes {
- return original.PossibleNotificationTypesValues()
-}
-func PossibleProvisioningStatesValues() []ProvisioningStates {
- return original.PossibleProvisioningStatesValues()
-}
-func PossiblePushModesValues() []PushModes {
- return original.PossiblePushModesValues()
-}
-func PossibleTypeBasicFilterValues() []TypeBasicFilter {
- return original.PossibleTypeBasicFilterValues()
-}
-func PossibleTypeValues() []Type {
- return original.PossibleTypeValues()
-}
-func UserAgent() string {
- return original.UserAgent() + " profiles/latest"
-}
-func Version() string {
- return original.Version()
-}
diff --git a/profiles/latest/resources/mgmt/subscriptions/models.go b/profiles/latest/resources/mgmt/subscriptions/models.go
index ed022ca731f3..0013c129fd6f 100644
--- a/profiles/latest/resources/mgmt/subscriptions/models.go
+++ b/profiles/latest/resources/mgmt/subscriptions/models.go
@@ -22,7 +22,7 @@ package subscriptions
import (
"context"
- original "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-06-01/subscriptions"
+ original "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions"
)
const (
@@ -54,6 +54,7 @@ type ListResultIterator = original.ListResultIterator
type ListResultPage = original.ListResultPage
type Location = original.Location
type LocationListResult = original.LocationListResult
+type ManagedByTenant = original.ManagedByTenant
type Operation = original.Operation
type OperationDisplay = original.OperationDisplay
type OperationListResult = original.OperationListResult
diff --git a/profiles/latest/resources/mgmt/subscriptions/subscriptionsapi/models.go b/profiles/latest/resources/mgmt/subscriptions/subscriptionsapi/models.go
index 310ddf1a3680..160e7606fe40 100644
--- a/profiles/latest/resources/mgmt/subscriptions/subscriptionsapi/models.go
+++ b/profiles/latest/resources/mgmt/subscriptions/subscriptionsapi/models.go
@@ -19,7 +19,7 @@
package subscriptionsapi
-import original "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-06-01/subscriptions/subscriptionsapi"
+import original "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions/subscriptionsapi"
type ClientAPI = original.ClientAPI
type OperationsClientAPI = original.OperationsClientAPI
diff --git a/profiles/latest/servicebus/mgmt/servicebus/models.go b/profiles/latest/servicebus/mgmt/servicebus/models.go
index f43a1dcb5b3c..a2bf7db2ca77 100644
--- a/profiles/latest/servicebus/mgmt/servicebus/models.go
+++ b/profiles/latest/servicebus/mgmt/servicebus/models.go
@@ -187,6 +187,9 @@ type NamespacesClient = original.NamespacesClient
type NamespacesCreateOrUpdateFuture = original.NamespacesCreateOrUpdateFuture
type NamespacesDeleteFuture = original.NamespacesDeleteFuture
type NetworkRuleSet = original.NetworkRuleSet
+type NetworkRuleSetListResult = original.NetworkRuleSetListResult
+type NetworkRuleSetListResultIterator = original.NetworkRuleSetListResultIterator
+type NetworkRuleSetListResultPage = original.NetworkRuleSetListResultPage
type NetworkRuleSetProperties = original.NetworkRuleSetProperties
type Operation = original.Operation
type OperationDisplay = original.OperationDisplay
@@ -296,6 +299,12 @@ func NewNamespacesClient(subscriptionID string) NamespacesClient {
func NewNamespacesClientWithBaseURI(baseURI string, subscriptionID string) NamespacesClient {
return original.NewNamespacesClientWithBaseURI(baseURI, subscriptionID)
}
+func NewNetworkRuleSetListResultIterator(page NetworkRuleSetListResultPage) NetworkRuleSetListResultIterator {
+ return original.NewNetworkRuleSetListResultIterator(page)
+}
+func NewNetworkRuleSetListResultPage(getNextPage func(context.Context, NetworkRuleSetListResult) (NetworkRuleSetListResult, error)) NetworkRuleSetListResultPage {
+ return original.NewNetworkRuleSetListResultPage(getNextPage)
+}
func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
return original.NewOperationListResultIterator(page)
}
diff --git a/profiles/latest/storage/datalake/storagedatalake/models.go b/profiles/latest/storage/datalake/storagedatalake/models.go
index 00f7de7109ea..2c818b7bc172 100644
--- a/profiles/latest/storage/datalake/storagedatalake/models.go
+++ b/profiles/latest/storage/datalake/storagedatalake/models.go
@@ -19,7 +19,7 @@
package storagedatalake
-import original "github.com/Azure/azure-sdk-for-go/services/storage/datalake/2018-11-09/storagedatalake"
+import original "github.com/Azure/azure-sdk-for-go/services/storage/datalake/2019-10-31/storagedatalake"
const (
DefaultDNSSuffix = original.DefaultDNSSuffix
@@ -28,6 +28,7 @@ const (
type PathGetPropertiesAction = original.PathGetPropertiesAction
const (
+ CheckAccess PathGetPropertiesAction = original.CheckAccess
GetAccessControl PathGetPropertiesAction = original.GetAccessControl
GetStatus PathGetPropertiesAction = original.GetStatus
)
diff --git a/profiles/latest/storage/datalake/storagedatalake/storagedatalakeapi/models.go b/profiles/latest/storage/datalake/storagedatalake/storagedatalakeapi/models.go
index 278b9df7f518..fe6cd4856f06 100644
--- a/profiles/latest/storage/datalake/storagedatalake/storagedatalakeapi/models.go
+++ b/profiles/latest/storage/datalake/storagedatalake/storagedatalakeapi/models.go
@@ -19,7 +19,7 @@
package storagedatalakeapi
-import original "github.com/Azure/azure-sdk-for-go/services/storage/datalake/2018-11-09/storagedatalake/storagedatalakeapi"
+import original "github.com/Azure/azure-sdk-for-go/services/storage/datalake/2019-10-31/storagedatalake/storagedatalakeapi"
type FilesystemClientAPI = original.FilesystemClientAPI
type PathClientAPI = original.PathClientAPI
diff --git a/profiles/latest/storage/mgmt/storage/models.go b/profiles/latest/storage/mgmt/storage/models.go
index 0c1eee97ccf2..a37cf2345411 100644
--- a/profiles/latest/storage/mgmt/storage/models.go
+++ b/profiles/latest/storage/mgmt/storage/models.go
@@ -142,6 +142,13 @@ const (
StorageV2 Kind = original.StorageV2
)
+type LargeFileSharesState = original.LargeFileSharesState
+
+const (
+ Disabled LargeFileSharesState = original.Disabled
+ Enabled LargeFileSharesState = original.Enabled
+)
+
type LeaseDuration = original.LeaseDuration
const (
@@ -282,6 +289,8 @@ type AccountCreateParameters = original.AccountCreateParameters
type AccountKey = original.AccountKey
type AccountListKeysResult = original.AccountListKeysResult
type AccountListResult = original.AccountListResult
+type AccountListResultIterator = original.AccountListResultIterator
+type AccountListResultPage = original.AccountListResultPage
type AccountProperties = original.AccountProperties
type AccountPropertiesCreateParameters = original.AccountPropertiesCreateParameters
type AccountPropertiesUpdateParameters = original.AccountPropertiesUpdateParameters
@@ -300,7 +309,10 @@ type BlobServiceItems = original.BlobServiceItems
type BlobServiceProperties = original.BlobServiceProperties
type BlobServicePropertiesProperties = original.BlobServicePropertiesProperties
type BlobServicesClient = original.BlobServicesClient
+type ChangeFeed = original.ChangeFeed
type CheckNameAvailabilityResult = original.CheckNameAvailabilityResult
+type CloudError = original.CloudError
+type CloudErrorBody = original.CloudErrorBody
type ContainerProperties = original.ContainerProperties
type CorsRule = original.CorsRule
type CorsRules = original.CorsRules
@@ -313,8 +325,6 @@ type Encryption = original.Encryption
type EncryptionService = original.EncryptionService
type EncryptionServices = original.EncryptionServices
type Endpoints = original.Endpoints
-type ErrorResponse = original.ErrorResponse
-type ErrorResponseBody = original.ErrorResponseBody
type FileServiceItems = original.FileServiceItems
type FileServiceProperties = original.FileServiceProperties
type FileServicePropertiesProperties = original.FileServicePropertiesProperties
@@ -381,6 +391,12 @@ type VirtualNetworkRule = original.VirtualNetworkRule
func New(subscriptionID string) BaseClient {
return original.New(subscriptionID)
}
+func NewAccountListResultIterator(page AccountListResultPage) AccountListResultIterator {
+ return original.NewAccountListResultIterator(page)
+}
+func NewAccountListResultPage(getNextPage func(context.Context, AccountListResult) (AccountListResult, error)) AccountListResultPage {
+ return original.NewAccountListResultPage(getNextPage)
+}
func NewAccountsClient(subscriptionID string) AccountsClient {
return original.NewAccountsClient(subscriptionID)
}
@@ -495,6 +511,9 @@ func PossibleKeySourceValues() []KeySource {
func PossibleKindValues() []Kind {
return original.PossibleKindValues()
}
+func PossibleLargeFileSharesStateValues() []LargeFileSharesState {
+ return original.PossibleLargeFileSharesStateValues()
+}
func PossibleLeaseDurationValues() []LeaseDuration {
return original.PossibleLeaseDurationValues()
}
diff --git a/profiles/preview/appinsights/insights/models.go b/profiles/preview/appinsights/insights/models.go
deleted file mode 100644
index cc63022b1de0..000000000000
--- a/profiles/preview/appinsights/insights/models.go
+++ /dev/null
@@ -1,229 +0,0 @@
-// +build go1.9
-
-// Copyright 2019 Microsoft Corporation
-//
-// 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.
-
-// This code was auto-generated by:
-// github.com/Azure/azure-sdk-for-go/tools/profileBuilder
-
-package insights
-
-import original "github.com/Azure/azure-sdk-for-go/services/appinsights/v1/insights"
-
-const (
- DefaultBaseURI = original.DefaultBaseURI
-)
-
-type EventType = original.EventType
-
-const (
- All EventType = original.All
- AvailabilityResults EventType = original.AvailabilityResults
- BrowserTimings EventType = original.BrowserTimings
- CustomEvents EventType = original.CustomEvents
- CustomMetrics EventType = original.CustomMetrics
- Dependencies EventType = original.Dependencies
- Exceptions EventType = original.Exceptions
- PageViews EventType = original.PageViews
- PerformanceCounters EventType = original.PerformanceCounters
- Requests EventType = original.Requests
- Traces EventType = original.Traces
-)
-
-type MetricID = original.MetricID
-
-const (
- AvailabilityResultsavailabilityPercentage MetricID = original.AvailabilityResultsavailabilityPercentage
- AvailabilityResultsduration MetricID = original.AvailabilityResultsduration
- BillingtelemetryCount MetricID = original.BillingtelemetryCount
- ClientnetworkDuration MetricID = original.ClientnetworkDuration
- ClientprocessingDuration MetricID = original.ClientprocessingDuration
- ClientreceiveDuration MetricID = original.ClientreceiveDuration
- ClientsendDuration MetricID = original.ClientsendDuration
- ClienttotalDuration MetricID = original.ClienttotalDuration
- CustomEventscount MetricID = original.CustomEventscount
- Dependenciescount MetricID = original.Dependenciescount
- Dependenciesduration MetricID = original.Dependenciesduration
- Dependenciesfailed MetricID = original.Dependenciesfailed
- Exceptionsbrowser MetricID = original.Exceptionsbrowser
- Exceptionscount MetricID = original.Exceptionscount
- Exceptionsserver MetricID = original.Exceptionsserver
- PageViewscount MetricID = original.PageViewscount
- PageViewsduration MetricID = original.PageViewsduration
- PerformanceCountersexceptionsPerSecond MetricID = original.PerformanceCountersexceptionsPerSecond
- PerformanceCountersmemoryAvailableBytes MetricID = original.PerformanceCountersmemoryAvailableBytes
- PerformanceCountersprocessCPUPercentage MetricID = original.PerformanceCountersprocessCPUPercentage
- PerformanceCountersprocessIOBytesPerSecond MetricID = original.PerformanceCountersprocessIOBytesPerSecond
- PerformanceCountersprocessorCPUPercentage MetricID = original.PerformanceCountersprocessorCPUPercentage
- PerformanceCountersprocessPrivateBytes MetricID = original.PerformanceCountersprocessPrivateBytes
- PerformanceCountersrequestExecutionTime MetricID = original.PerformanceCountersrequestExecutionTime
- PerformanceCountersrequestsInQueue MetricID = original.PerformanceCountersrequestsInQueue
- PerformanceCountersrequestsPerSecond MetricID = original.PerformanceCountersrequestsPerSecond
- Requestscount MetricID = original.Requestscount
- Requestsduration MetricID = original.Requestsduration
- Requestsfailed MetricID = original.Requestsfailed
- Sessionscount MetricID = original.Sessionscount
- Usersauthenticated MetricID = original.Usersauthenticated
- Userscount MetricID = original.Userscount
-)
-
-type MetricsAggregation = original.MetricsAggregation
-
-const (
- Avg MetricsAggregation = original.Avg
- Count MetricsAggregation = original.Count
- Max MetricsAggregation = original.Max
- Min MetricsAggregation = original.Min
- Sum MetricsAggregation = original.Sum
- Unique MetricsAggregation = original.Unique
-)
-
-type MetricsSegment = original.MetricsSegment
-
-const (
- ApplicationBuild MetricsSegment = original.ApplicationBuild
- ApplicationVersion MetricsSegment = original.ApplicationVersion
- AuthenticatedOrAnonymousTraffic MetricsSegment = original.AuthenticatedOrAnonymousTraffic
- Browser MetricsSegment = original.Browser
- BrowserVersion MetricsSegment = original.BrowserVersion
- City MetricsSegment = original.City
- CloudRoleName MetricsSegment = original.CloudRoleName
- CloudServiceName MetricsSegment = original.CloudServiceName
- Continent MetricsSegment = original.Continent
- CountryOrRegion MetricsSegment = original.CountryOrRegion
- DeploymentID MetricsSegment = original.DeploymentID
- DeploymentUnit MetricsSegment = original.DeploymentUnit
- DeviceType MetricsSegment = original.DeviceType
- Environment MetricsSegment = original.Environment
- HostingLocation MetricsSegment = original.HostingLocation
- InstanceName MetricsSegment = original.InstanceName
-)
-
-type Type = original.Type
-
-const (
- TypeAvailabilityResult Type = original.TypeAvailabilityResult
- TypeBrowserTiming Type = original.TypeBrowserTiming
- TypeCustomEvent Type = original.TypeCustomEvent
- TypeCustomMetric Type = original.TypeCustomMetric
- TypeDependency Type = original.TypeDependency
- TypeEventsResultData Type = original.TypeEventsResultData
- TypeException Type = original.TypeException
- TypePageView Type = original.TypePageView
- TypePerformanceCounter Type = original.TypePerformanceCounter
- TypeRequest Type = original.TypeRequest
- TypeTrace Type = original.TypeTrace
-)
-
-type BaseClient = original.BaseClient
-type BasicEventsResultData = original.BasicEventsResultData
-type Column = original.Column
-type ErrorDetail = original.ErrorDetail
-type ErrorInfo = original.ErrorInfo
-type ErrorResponse = original.ErrorResponse
-type EventsAiInfo = original.EventsAiInfo
-type EventsApplicationInfo = original.EventsApplicationInfo
-type EventsAvailabilityResultInfo = original.EventsAvailabilityResultInfo
-type EventsAvailabilityResultResult = original.EventsAvailabilityResultResult
-type EventsBrowserTimingInfo = original.EventsBrowserTimingInfo
-type EventsBrowserTimingResult = original.EventsBrowserTimingResult
-type EventsClient = original.EventsClient
-type EventsClientInfo = original.EventsClientInfo
-type EventsClientPerformanceInfo = original.EventsClientPerformanceInfo
-type EventsCloudInfo = original.EventsCloudInfo
-type EventsCustomEventInfo = original.EventsCustomEventInfo
-type EventsCustomEventResult = original.EventsCustomEventResult
-type EventsCustomMetricInfo = original.EventsCustomMetricInfo
-type EventsCustomMetricResult = original.EventsCustomMetricResult
-type EventsDependencyInfo = original.EventsDependencyInfo
-type EventsDependencyResult = original.EventsDependencyResult
-type EventsExceptionDetail = original.EventsExceptionDetail
-type EventsExceptionDetailsParsedStack = original.EventsExceptionDetailsParsedStack
-type EventsExceptionInfo = original.EventsExceptionInfo
-type EventsExceptionResult = original.EventsExceptionResult
-type EventsOperationInfo = original.EventsOperationInfo
-type EventsPageViewInfo = original.EventsPageViewInfo
-type EventsPageViewResult = original.EventsPageViewResult
-type EventsPerformanceCounterInfo = original.EventsPerformanceCounterInfo
-type EventsPerformanceCounterResult = original.EventsPerformanceCounterResult
-type EventsRequestInfo = original.EventsRequestInfo
-type EventsRequestResult = original.EventsRequestResult
-type EventsResult = original.EventsResult
-type EventsResultData = original.EventsResultData
-type EventsResultDataCustomDimensions = original.EventsResultDataCustomDimensions
-type EventsResultDataCustomMeasurements = original.EventsResultDataCustomMeasurements
-type EventsResults = original.EventsResults
-type EventsSessionInfo = original.EventsSessionInfo
-type EventsTraceInfo = original.EventsTraceInfo
-type EventsTraceResult = original.EventsTraceResult
-type EventsUserInfo = original.EventsUserInfo
-type ListMetricsResultsItem = original.ListMetricsResultsItem
-type MetricsClient = original.MetricsClient
-type MetricsPostBodySchema = original.MetricsPostBodySchema
-type MetricsPostBodySchemaParameters = original.MetricsPostBodySchemaParameters
-type MetricsResult = original.MetricsResult
-type MetricsResultInfo = original.MetricsResultInfo
-type MetricsResultsItem = original.MetricsResultsItem
-type MetricsSegmentInfo = original.MetricsSegmentInfo
-type QueryBody = original.QueryBody
-type QueryClient = original.QueryClient
-type QueryResults = original.QueryResults
-type SetObject = original.SetObject
-type Table = original.Table
-
-func New() BaseClient {
- return original.New()
-}
-func NewEventsClient() EventsClient {
- return original.NewEventsClient()
-}
-func NewEventsClientWithBaseURI(baseURI string) EventsClient {
- return original.NewEventsClientWithBaseURI(baseURI)
-}
-func NewMetricsClient() MetricsClient {
- return original.NewMetricsClient()
-}
-func NewMetricsClientWithBaseURI(baseURI string) MetricsClient {
- return original.NewMetricsClientWithBaseURI(baseURI)
-}
-func NewQueryClient() QueryClient {
- return original.NewQueryClient()
-}
-func NewQueryClientWithBaseURI(baseURI string) QueryClient {
- return original.NewQueryClientWithBaseURI(baseURI)
-}
-func NewWithBaseURI(baseURI string) BaseClient {
- return original.NewWithBaseURI(baseURI)
-}
-func PossibleEventTypeValues() []EventType {
- return original.PossibleEventTypeValues()
-}
-func PossibleMetricIDValues() []MetricID {
- return original.PossibleMetricIDValues()
-}
-func PossibleMetricsAggregationValues() []MetricsAggregation {
- return original.PossibleMetricsAggregationValues()
-}
-func PossibleMetricsSegmentValues() []MetricsSegment {
- return original.PossibleMetricsSegmentValues()
-}
-func PossibleTypeValues() []Type {
- return original.PossibleTypeValues()
-}
-func UserAgent() string {
- return original.UserAgent() + " profiles/preview"
-}
-func Version() string {
- return original.Version()
-}
diff --git a/profiles/preview/cognitiveservices/anomalyfinder/models.go b/profiles/preview/cognitiveservices/anomalyfinder/models.go
deleted file mode 100644
index a0cb7dd25a4f..000000000000
--- a/profiles/preview/cognitiveservices/anomalyfinder/models.go
+++ /dev/null
@@ -1,56 +0,0 @@
-// +build go1.9
-
-// Copyright 2019 Microsoft Corporation
-//
-// 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.
-
-// This code was auto-generated by:
-// github.com/Azure/azure-sdk-for-go/tools/profileBuilder
-
-package anomalyfinder
-
-import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/anomalyfinder"
-
-type Granularity = original.Granularity
-
-const (
- Daily Granularity = original.Daily
- Hourly Granularity = original.Hourly
- Minutely Granularity = original.Minutely
- Monthly Granularity = original.Monthly
- Weekly Granularity = original.Weekly
- Yearly Granularity = original.Yearly
-)
-
-type APIError = original.APIError
-type BaseClient = original.BaseClient
-type EntireDetectResponse = original.EntireDetectResponse
-type LastDetectResponse = original.LastDetectResponse
-type Point = original.Point
-type Request = original.Request
-
-func New(endpoint string) BaseClient {
- return original.New(endpoint)
-}
-func NewWithoutDefaults(endpoint string) BaseClient {
- return original.NewWithoutDefaults(endpoint)
-}
-func PossibleGranularityValues() []Granularity {
- return original.PossibleGranularityValues()
-}
-func UserAgent() string {
- return original.UserAgent() + " profiles/preview"
-}
-func Version() string {
- return original.Version()
-}
diff --git a/profiles/preview/cognitiveservices/luis/programmatic/models.go b/profiles/preview/cognitiveservices/luis/programmatic/models.go
deleted file mode 100644
index bb1528ceddbc..000000000000
--- a/profiles/preview/cognitiveservices/luis/programmatic/models.go
+++ /dev/null
@@ -1,453 +0,0 @@
-// +build go1.9
-
-// Copyright 2019 Microsoft Corporation
-//
-// 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.
-
-// This code was auto-generated by:
-// github.com/Azure/azure-sdk-for-go/tools/profileBuilder
-
-package programmatic
-
-import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/luis/programmatic"
-
-type AzureRegions = original.AzureRegions
-
-const (
- Australiaeast AzureRegions = original.Australiaeast
- Brazilsouth AzureRegions = original.Brazilsouth
- Eastasia AzureRegions = original.Eastasia
- Eastus AzureRegions = original.Eastus
- Eastus2 AzureRegions = original.Eastus2
- Northeurope AzureRegions = original.Northeurope
- Southcentralus AzureRegions = original.Southcentralus
- Southeastasia AzureRegions = original.Southeastasia
- Westcentralus AzureRegions = original.Westcentralus
- Westeurope AzureRegions = original.Westeurope
- Westus AzureRegions = original.Westus
- Westus2 AzureRegions = original.Westus2
-)
-
-type OperationStatusType = original.OperationStatusType
-
-const (
- Failed OperationStatusType = original.Failed
- FAILED OperationStatusType = original.FAILED
- Success OperationStatusType = original.Success
-)
-
-type ReadableType = original.ReadableType
-
-const (
- ReadableTypeClosedListEntityExtractor ReadableType = original.ReadableTypeClosedListEntityExtractor
- ReadableTypeCompositeEntityExtractor ReadableType = original.ReadableTypeCompositeEntityExtractor
- ReadableTypeEntityExtractor ReadableType = original.ReadableTypeEntityExtractor
- ReadableTypeHierarchicalChildEntityExtractor ReadableType = original.ReadableTypeHierarchicalChildEntityExtractor
- ReadableTypeHierarchicalEntityExtractor ReadableType = original.ReadableTypeHierarchicalEntityExtractor
- ReadableTypeIntentClassifier ReadableType = original.ReadableTypeIntentClassifier
- ReadableTypePatternAnyEntityExtractor ReadableType = original.ReadableTypePatternAnyEntityExtractor
- ReadableTypePrebuiltEntityExtractor ReadableType = original.ReadableTypePrebuiltEntityExtractor
- ReadableTypeRegexEntityExtractor ReadableType = original.ReadableTypeRegexEntityExtractor
-)
-
-type ReadableType1 = original.ReadableType1
-
-const (
- ReadableType1ClosedListEntityExtractor ReadableType1 = original.ReadableType1ClosedListEntityExtractor
- ReadableType1CompositeEntityExtractor ReadableType1 = original.ReadableType1CompositeEntityExtractor
- ReadableType1EntityExtractor ReadableType1 = original.ReadableType1EntityExtractor
- ReadableType1HierarchicalChildEntityExtractor ReadableType1 = original.ReadableType1HierarchicalChildEntityExtractor
- ReadableType1HierarchicalEntityExtractor ReadableType1 = original.ReadableType1HierarchicalEntityExtractor
- ReadableType1IntentClassifier ReadableType1 = original.ReadableType1IntentClassifier
- ReadableType1PatternAnyEntityExtractor ReadableType1 = original.ReadableType1PatternAnyEntityExtractor
- ReadableType1PrebuiltEntityExtractor ReadableType1 = original.ReadableType1PrebuiltEntityExtractor
- ReadableType1RegexEntityExtractor ReadableType1 = original.ReadableType1RegexEntityExtractor
-)
-
-type ReadableType10 = original.ReadableType10
-
-const (
- ReadableType10ClosedListEntityExtractor ReadableType10 = original.ReadableType10ClosedListEntityExtractor
- ReadableType10CompositeEntityExtractor ReadableType10 = original.ReadableType10CompositeEntityExtractor
- ReadableType10EntityExtractor ReadableType10 = original.ReadableType10EntityExtractor
- ReadableType10HierarchicalChildEntityExtractor ReadableType10 = original.ReadableType10HierarchicalChildEntityExtractor
- ReadableType10HierarchicalEntityExtractor ReadableType10 = original.ReadableType10HierarchicalEntityExtractor
- ReadableType10IntentClassifier ReadableType10 = original.ReadableType10IntentClassifier
- ReadableType10PatternAnyEntityExtractor ReadableType10 = original.ReadableType10PatternAnyEntityExtractor
- ReadableType10PrebuiltEntityExtractor ReadableType10 = original.ReadableType10PrebuiltEntityExtractor
- ReadableType10RegexEntityExtractor ReadableType10 = original.ReadableType10RegexEntityExtractor
-)
-
-type ReadableType2 = original.ReadableType2
-
-const (
- ReadableType2ClosedListEntityExtractor ReadableType2 = original.ReadableType2ClosedListEntityExtractor
- ReadableType2CompositeEntityExtractor ReadableType2 = original.ReadableType2CompositeEntityExtractor
- ReadableType2EntityExtractor ReadableType2 = original.ReadableType2EntityExtractor
- ReadableType2HierarchicalChildEntityExtractor ReadableType2 = original.ReadableType2HierarchicalChildEntityExtractor
- ReadableType2HierarchicalEntityExtractor ReadableType2 = original.ReadableType2HierarchicalEntityExtractor
- ReadableType2IntentClassifier ReadableType2 = original.ReadableType2IntentClassifier
- ReadableType2PatternAnyEntityExtractor ReadableType2 = original.ReadableType2PatternAnyEntityExtractor
- ReadableType2PrebuiltEntityExtractor ReadableType2 = original.ReadableType2PrebuiltEntityExtractor
- ReadableType2RegexEntityExtractor ReadableType2 = original.ReadableType2RegexEntityExtractor
-)
-
-type ReadableType3 = original.ReadableType3
-
-const (
- ReadableType3ClosedListEntityExtractor ReadableType3 = original.ReadableType3ClosedListEntityExtractor
- ReadableType3CompositeEntityExtractor ReadableType3 = original.ReadableType3CompositeEntityExtractor
- ReadableType3EntityExtractor ReadableType3 = original.ReadableType3EntityExtractor
- ReadableType3HierarchicalChildEntityExtractor ReadableType3 = original.ReadableType3HierarchicalChildEntityExtractor
- ReadableType3HierarchicalEntityExtractor ReadableType3 = original.ReadableType3HierarchicalEntityExtractor
- ReadableType3IntentClassifier ReadableType3 = original.ReadableType3IntentClassifier
- ReadableType3PatternAnyEntityExtractor ReadableType3 = original.ReadableType3PatternAnyEntityExtractor
- ReadableType3PrebuiltEntityExtractor ReadableType3 = original.ReadableType3PrebuiltEntityExtractor
- ReadableType3RegexEntityExtractor ReadableType3 = original.ReadableType3RegexEntityExtractor
-)
-
-type ReadableType4 = original.ReadableType4
-
-const (
- ReadableType4ClosedListEntityExtractor ReadableType4 = original.ReadableType4ClosedListEntityExtractor
- ReadableType4CompositeEntityExtractor ReadableType4 = original.ReadableType4CompositeEntityExtractor
- ReadableType4EntityExtractor ReadableType4 = original.ReadableType4EntityExtractor
- ReadableType4HierarchicalChildEntityExtractor ReadableType4 = original.ReadableType4HierarchicalChildEntityExtractor
- ReadableType4HierarchicalEntityExtractor ReadableType4 = original.ReadableType4HierarchicalEntityExtractor
- ReadableType4IntentClassifier ReadableType4 = original.ReadableType4IntentClassifier
- ReadableType4PatternAnyEntityExtractor ReadableType4 = original.ReadableType4PatternAnyEntityExtractor
- ReadableType4PrebuiltEntityExtractor ReadableType4 = original.ReadableType4PrebuiltEntityExtractor
- ReadableType4RegexEntityExtractor ReadableType4 = original.ReadableType4RegexEntityExtractor
-)
-
-type ReadableType5 = original.ReadableType5
-
-const (
- ReadableType5ClosedListEntityExtractor ReadableType5 = original.ReadableType5ClosedListEntityExtractor
- ReadableType5CompositeEntityExtractor ReadableType5 = original.ReadableType5CompositeEntityExtractor
- ReadableType5EntityExtractor ReadableType5 = original.ReadableType5EntityExtractor
- ReadableType5HierarchicalChildEntityExtractor ReadableType5 = original.ReadableType5HierarchicalChildEntityExtractor
- ReadableType5HierarchicalEntityExtractor ReadableType5 = original.ReadableType5HierarchicalEntityExtractor
- ReadableType5IntentClassifier ReadableType5 = original.ReadableType5IntentClassifier
- ReadableType5PatternAnyEntityExtractor ReadableType5 = original.ReadableType5PatternAnyEntityExtractor
- ReadableType5PrebuiltEntityExtractor ReadableType5 = original.ReadableType5PrebuiltEntityExtractor
- ReadableType5RegexEntityExtractor ReadableType5 = original.ReadableType5RegexEntityExtractor
-)
-
-type ReadableType6 = original.ReadableType6
-
-const (
- ReadableType6ClosedListEntityExtractor ReadableType6 = original.ReadableType6ClosedListEntityExtractor
- ReadableType6CompositeEntityExtractor ReadableType6 = original.ReadableType6CompositeEntityExtractor
- ReadableType6EntityExtractor ReadableType6 = original.ReadableType6EntityExtractor
- ReadableType6HierarchicalChildEntityExtractor ReadableType6 = original.ReadableType6HierarchicalChildEntityExtractor
- ReadableType6HierarchicalEntityExtractor ReadableType6 = original.ReadableType6HierarchicalEntityExtractor
- ReadableType6IntentClassifier ReadableType6 = original.ReadableType6IntentClassifier
- ReadableType6PatternAnyEntityExtractor ReadableType6 = original.ReadableType6PatternAnyEntityExtractor
- ReadableType6PrebuiltEntityExtractor ReadableType6 = original.ReadableType6PrebuiltEntityExtractor
- ReadableType6RegexEntityExtractor ReadableType6 = original.ReadableType6RegexEntityExtractor
-)
-
-type ReadableType7 = original.ReadableType7
-
-const (
- ReadableType7ClosedListEntityExtractor ReadableType7 = original.ReadableType7ClosedListEntityExtractor
- ReadableType7CompositeEntityExtractor ReadableType7 = original.ReadableType7CompositeEntityExtractor
- ReadableType7EntityExtractor ReadableType7 = original.ReadableType7EntityExtractor
- ReadableType7HierarchicalChildEntityExtractor ReadableType7 = original.ReadableType7HierarchicalChildEntityExtractor
- ReadableType7HierarchicalEntityExtractor ReadableType7 = original.ReadableType7HierarchicalEntityExtractor
- ReadableType7IntentClassifier ReadableType7 = original.ReadableType7IntentClassifier
- ReadableType7PatternAnyEntityExtractor ReadableType7 = original.ReadableType7PatternAnyEntityExtractor
- ReadableType7PrebuiltEntityExtractor ReadableType7 = original.ReadableType7PrebuiltEntityExtractor
- ReadableType7RegexEntityExtractor ReadableType7 = original.ReadableType7RegexEntityExtractor
-)
-
-type ReadableType8 = original.ReadableType8
-
-const (
- ReadableType8ClosedListEntityExtractor ReadableType8 = original.ReadableType8ClosedListEntityExtractor
- ReadableType8CompositeEntityExtractor ReadableType8 = original.ReadableType8CompositeEntityExtractor
- ReadableType8EntityExtractor ReadableType8 = original.ReadableType8EntityExtractor
- ReadableType8HierarchicalChildEntityExtractor ReadableType8 = original.ReadableType8HierarchicalChildEntityExtractor
- ReadableType8HierarchicalEntityExtractor ReadableType8 = original.ReadableType8HierarchicalEntityExtractor
- ReadableType8IntentClassifier ReadableType8 = original.ReadableType8IntentClassifier
- ReadableType8PatternAnyEntityExtractor ReadableType8 = original.ReadableType8PatternAnyEntityExtractor
- ReadableType8PrebuiltEntityExtractor ReadableType8 = original.ReadableType8PrebuiltEntityExtractor
- ReadableType8RegexEntityExtractor ReadableType8 = original.ReadableType8RegexEntityExtractor
-)
-
-type ReadableType9 = original.ReadableType9
-
-const (
- ReadableType9ClosedListEntityExtractor ReadableType9 = original.ReadableType9ClosedListEntityExtractor
- ReadableType9CompositeEntityExtractor ReadableType9 = original.ReadableType9CompositeEntityExtractor
- ReadableType9EntityExtractor ReadableType9 = original.ReadableType9EntityExtractor
- ReadableType9HierarchicalChildEntityExtractor ReadableType9 = original.ReadableType9HierarchicalChildEntityExtractor
- ReadableType9HierarchicalEntityExtractor ReadableType9 = original.ReadableType9HierarchicalEntityExtractor
- ReadableType9IntentClassifier ReadableType9 = original.ReadableType9IntentClassifier
- ReadableType9PatternAnyEntityExtractor ReadableType9 = original.ReadableType9PatternAnyEntityExtractor
- ReadableType9PrebuiltEntityExtractor ReadableType9 = original.ReadableType9PrebuiltEntityExtractor
- ReadableType9RegexEntityExtractor ReadableType9 = original.ReadableType9RegexEntityExtractor
-)
-
-type Status = original.Status
-
-const (
- StatusFail Status = original.StatusFail
- StatusInProgress Status = original.StatusInProgress
- StatusQueued Status = original.StatusQueued
- StatusSuccess Status = original.StatusSuccess
- StatusUpToDate Status = original.StatusUpToDate
-)
-
-type Status1 = original.Status1
-
-const (
- Status1Fail Status1 = original.Status1Fail
- Status1InProgress Status1 = original.Status1InProgress
- Status1Queued Status1 = original.Status1Queued
- Status1Success Status1 = original.Status1Success
- Status1UpToDate Status1 = original.Status1UpToDate
-)
-
-type TrainingStatus = original.TrainingStatus
-
-const (
- InProgress TrainingStatus = original.InProgress
- NeedsTraining TrainingStatus = original.NeedsTraining
- Trained TrainingStatus = original.Trained
-)
-
-type ApplicationCreateObject = original.ApplicationCreateObject
-type ApplicationInfoResponse = original.ApplicationInfoResponse
-type ApplicationPublishObject = original.ApplicationPublishObject
-type ApplicationSettingUpdateObject = original.ApplicationSettingUpdateObject
-type ApplicationSettings = original.ApplicationSettings
-type ApplicationUpdateObject = original.ApplicationUpdateObject
-type AppsClient = original.AppsClient
-type AvailableCulture = original.AvailableCulture
-type AvailablePrebuiltEntityModel = original.AvailablePrebuiltEntityModel
-type BaseClient = original.BaseClient
-type BatchLabelExample = original.BatchLabelExample
-type ChildEntity = original.ChildEntity
-type ClosedList = original.ClosedList
-type ClosedListEntityExtractor = original.ClosedListEntityExtractor
-type ClosedListModelCreateObject = original.ClosedListModelCreateObject
-type ClosedListModelPatchObject = original.ClosedListModelPatchObject
-type ClosedListModelUpdateObject = original.ClosedListModelUpdateObject
-type CollaboratorsArray = original.CollaboratorsArray
-type CompositeChildModelCreateObject = original.CompositeChildModelCreateObject
-type CompositeEntityExtractor = original.CompositeEntityExtractor
-type CompositeEntityModel = original.CompositeEntityModel
-type CustomPrebuiltModel = original.CustomPrebuiltModel
-type EndpointInfo = original.EndpointInfo
-type EnqueueTrainingResponse = original.EnqueueTrainingResponse
-type EntitiesSuggestionExample = original.EntitiesSuggestionExample
-type EntityExtractor = original.EntityExtractor
-type EntityLabel = original.EntityLabel
-type EntityLabelObject = original.EntityLabelObject
-type EntityModelInfo = original.EntityModelInfo
-type EntityPrediction = original.EntityPrediction
-type EntityRole = original.EntityRole
-type EntityRoleCreateObject = original.EntityRoleCreateObject
-type EntityRoleUpdateObject = original.EntityRoleUpdateObject
-type ErrorResponse = original.ErrorResponse
-type ExampleLabelObject = original.ExampleLabelObject
-type ExamplesClient = original.ExamplesClient
-type ExplicitListItem = original.ExplicitListItem
-type ExplicitListItemCreateObject = original.ExplicitListItemCreateObject
-type ExplicitListItemUpdateObject = original.ExplicitListItemUpdateObject
-type FeatureInfoObject = original.FeatureInfoObject
-type FeaturesClient = original.FeaturesClient
-type FeaturesResponseObject = original.FeaturesResponseObject
-type HierarchicalChildEntity = original.HierarchicalChildEntity
-type HierarchicalChildModelCreateObject = original.HierarchicalChildModelCreateObject
-type HierarchicalChildModelUpdateObject = original.HierarchicalChildModelUpdateObject
-type HierarchicalEntityExtractor = original.HierarchicalEntityExtractor
-type HierarchicalEntityModel = original.HierarchicalEntityModel
-type HierarchicalModel = original.HierarchicalModel
-type Int32 = original.Int32
-type IntentClassifier = original.IntentClassifier
-type IntentPrediction = original.IntentPrediction
-type IntentsSuggestionExample = original.IntentsSuggestionExample
-type JSONEntity = original.JSONEntity
-type JSONModelFeature = original.JSONModelFeature
-type JSONRegexFeature = original.JSONRegexFeature
-type JSONUtterance = original.JSONUtterance
-type LabelExampleResponse = original.LabelExampleResponse
-type LabeledUtterance = original.LabeledUtterance
-type ListApplicationInfoResponse = original.ListApplicationInfoResponse
-type ListAvailableCulture = original.ListAvailableCulture
-type ListAvailablePrebuiltEntityModel = original.ListAvailablePrebuiltEntityModel
-type ListBatchLabelExample = original.ListBatchLabelExample
-type ListClosedListEntityExtractor = original.ListClosedListEntityExtractor
-type ListCompositeEntityExtractor = original.ListCompositeEntityExtractor
-type ListCustomPrebuiltModel = original.ListCustomPrebuiltModel
-type ListEntitiesSuggestionExample = original.ListEntitiesSuggestionExample
-type ListEntityExtractor = original.ListEntityExtractor
-type ListEntityRole = original.ListEntityRole
-type ListExplicitListItem = original.ListExplicitListItem
-type ListHierarchicalEntityExtractor = original.ListHierarchicalEntityExtractor
-type ListIntentClassifier = original.ListIntentClassifier
-type ListIntentsSuggestionExample = original.ListIntentsSuggestionExample
-type ListLabeledUtterance = original.ListLabeledUtterance
-type ListModelInfoResponse = original.ListModelInfoResponse
-type ListModelTrainingInfo = original.ListModelTrainingInfo
-type ListPatternAnyEntityExtractor = original.ListPatternAnyEntityExtractor
-type ListPatternRuleInfo = original.ListPatternRuleInfo
-type ListPhraseListFeatureInfo = original.ListPhraseListFeatureInfo
-type ListPrebuiltDomain = original.ListPrebuiltDomain
-type ListPrebuiltEntityExtractor = original.ListPrebuiltEntityExtractor
-type ListRegexEntityExtractor = original.ListRegexEntityExtractor
-type ListString = original.ListString
-type ListUUID = original.ListUUID
-type ListVersionInfo = original.ListVersionInfo
-type LuisApp = original.LuisApp
-type ModelClient = original.ModelClient
-type ModelCreateObject = original.ModelCreateObject
-type ModelInfo = original.ModelInfo
-type ModelInfoResponse = original.ModelInfoResponse
-type ModelTrainingDetails = original.ModelTrainingDetails
-type ModelTrainingInfo = original.ModelTrainingInfo
-type ModelUpdateObject = original.ModelUpdateObject
-type OperationError = original.OperationError
-type OperationStatus = original.OperationStatus
-type PatternAny = original.PatternAny
-type PatternAnyEntityExtractor = original.PatternAnyEntityExtractor
-type PatternAnyModelCreateObject = original.PatternAnyModelCreateObject
-type PatternAnyModelUpdateObject = original.PatternAnyModelUpdateObject
-type PatternClient = original.PatternClient
-type PatternCreateObject = original.PatternCreateObject
-type PatternFeatureInfo = original.PatternFeatureInfo
-type PatternRule = original.PatternRule
-type PatternRuleCreateObject = original.PatternRuleCreateObject
-type PatternRuleInfo = original.PatternRuleInfo
-type PatternRuleUpdateObject = original.PatternRuleUpdateObject
-type PatternUpdateObject = original.PatternUpdateObject
-type PermissionsClient = original.PermissionsClient
-type PersonalAssistantsResponse = original.PersonalAssistantsResponse
-type PhraseListFeatureInfo = original.PhraseListFeatureInfo
-type PhraselistCreateObject = original.PhraselistCreateObject
-type PhraselistUpdateObject = original.PhraselistUpdateObject
-type PrebuiltDomain = original.PrebuiltDomain
-type PrebuiltDomainCreateBaseObject = original.PrebuiltDomainCreateBaseObject
-type PrebuiltDomainCreateObject = original.PrebuiltDomainCreateObject
-type PrebuiltDomainItem = original.PrebuiltDomainItem
-type PrebuiltDomainModelCreateObject = original.PrebuiltDomainModelCreateObject
-type PrebuiltDomainObject = original.PrebuiltDomainObject
-type PrebuiltEntity = original.PrebuiltEntity
-type PrebuiltEntityExtractor = original.PrebuiltEntityExtractor
-type ProductionOrStagingEndpointInfo = original.ProductionOrStagingEndpointInfo
-type ReadCloser = original.ReadCloser
-type RegexEntity = original.RegexEntity
-type RegexEntityExtractor = original.RegexEntityExtractor
-type RegexModelCreateObject = original.RegexModelCreateObject
-type RegexModelUpdateObject = original.RegexModelUpdateObject
-type SetString = original.SetString
-type String = original.String
-type SubClosedList = original.SubClosedList
-type SubClosedListResponse = original.SubClosedListResponse
-type TaskUpdateObject = original.TaskUpdateObject
-type TrainClient = original.TrainClient
-type UUID = original.UUID
-type UserAccessList = original.UserAccessList
-type UserCollaborator = original.UserCollaborator
-type VersionInfo = original.VersionInfo
-type VersionsClient = original.VersionsClient
-type WordListBaseUpdateObject = original.WordListBaseUpdateObject
-type WordListObject = original.WordListObject
-
-func New(azureRegion AzureRegions) BaseClient {
- return original.New(azureRegion)
-}
-func NewAppsClient(azureRegion AzureRegions) AppsClient {
- return original.NewAppsClient(azureRegion)
-}
-func NewExamplesClient(azureRegion AzureRegions) ExamplesClient {
- return original.NewExamplesClient(azureRegion)
-}
-func NewFeaturesClient(azureRegion AzureRegions) FeaturesClient {
- return original.NewFeaturesClient(azureRegion)
-}
-func NewModelClient(azureRegion AzureRegions) ModelClient {
- return original.NewModelClient(azureRegion)
-}
-func NewPatternClient(azureRegion AzureRegions) PatternClient {
- return original.NewPatternClient(azureRegion)
-}
-func NewPermissionsClient(azureRegion AzureRegions) PermissionsClient {
- return original.NewPermissionsClient(azureRegion)
-}
-func NewTrainClient(azureRegion AzureRegions) TrainClient {
- return original.NewTrainClient(azureRegion)
-}
-func NewVersionsClient(azureRegion AzureRegions) VersionsClient {
- return original.NewVersionsClient(azureRegion)
-}
-func NewWithoutDefaults(azureRegion AzureRegions) BaseClient {
- return original.NewWithoutDefaults(azureRegion)
-}
-func PossibleAzureRegionsValues() []AzureRegions {
- return original.PossibleAzureRegionsValues()
-}
-func PossibleOperationStatusTypeValues() []OperationStatusType {
- return original.PossibleOperationStatusTypeValues()
-}
-func PossibleReadableType10Values() []ReadableType10 {
- return original.PossibleReadableType10Values()
-}
-func PossibleReadableType1Values() []ReadableType1 {
- return original.PossibleReadableType1Values()
-}
-func PossibleReadableType2Values() []ReadableType2 {
- return original.PossibleReadableType2Values()
-}
-func PossibleReadableType3Values() []ReadableType3 {
- return original.PossibleReadableType3Values()
-}
-func PossibleReadableType4Values() []ReadableType4 {
- return original.PossibleReadableType4Values()
-}
-func PossibleReadableType5Values() []ReadableType5 {
- return original.PossibleReadableType5Values()
-}
-func PossibleReadableType6Values() []ReadableType6 {
- return original.PossibleReadableType6Values()
-}
-func PossibleReadableType7Values() []ReadableType7 {
- return original.PossibleReadableType7Values()
-}
-func PossibleReadableType8Values() []ReadableType8 {
- return original.PossibleReadableType8Values()
-}
-func PossibleReadableType9Values() []ReadableType9 {
- return original.PossibleReadableType9Values()
-}
-func PossibleReadableTypeValues() []ReadableType {
- return original.PossibleReadableTypeValues()
-}
-func PossibleStatus1Values() []Status1 {
- return original.PossibleStatus1Values()
-}
-func PossibleStatusValues() []Status {
- return original.PossibleStatusValues()
-}
-func PossibleTrainingStatusValues() []TrainingStatus {
- return original.PossibleTrainingStatusValues()
-}
-func UserAgent() string {
- return original.UserAgent() + " profiles/preview"
-}
-func Version() string {
- return original.Version()
-}
diff --git a/profiles/preview/compute/mgmt/compute/models.go b/profiles/preview/compute/mgmt/compute/models.go
index c83bb89dce7c..0eb12de56c1f 100644
--- a/profiles/preview/compute/mgmt/compute/models.go
+++ b/profiles/preview/compute/mgmt/compute/models.go
@@ -460,6 +460,14 @@ const (
Regular VirtualMachinePriorityTypes = original.Regular
)
+type VirtualMachineScaleSetScaleInRules = original.VirtualMachineScaleSetScaleInRules
+
+const (
+ Default VirtualMachineScaleSetScaleInRules = original.Default
+ NewestVM VirtualMachineScaleSetScaleInRules = original.NewestVM
+ OldestVM VirtualMachineScaleSetScaleInRules = original.OldestVM
+)
+
type VirtualMachineScaleSetSkuScaleType = original.VirtualMachineScaleSetSkuScaleType
const (
@@ -866,6 +874,7 @@ type RunCommandParameterDefinition = original.RunCommandParameterDefinition
type RunCommandResult = original.RunCommandResult
type SSHConfiguration = original.SSHConfiguration
type SSHPublicKey = original.SSHPublicKey
+type ScaleInPolicy = original.ScaleInPolicy
type ScheduledEventsProfile = original.ScheduledEventsProfile
type Sku = original.Sku
type Snapshot = original.Snapshot
@@ -1508,6 +1517,9 @@ func PossibleVirtualMachineEvictionPolicyTypesValues() []VirtualMachineEvictionP
func PossibleVirtualMachinePriorityTypesValues() []VirtualMachinePriorityTypes {
return original.PossibleVirtualMachinePriorityTypesValues()
}
+func PossibleVirtualMachineScaleSetScaleInRulesValues() []VirtualMachineScaleSetScaleInRules {
+ return original.PossibleVirtualMachineScaleSetScaleInRulesValues()
+}
func PossibleVirtualMachineScaleSetSkuScaleTypeValues() []VirtualMachineScaleSetSkuScaleType {
return original.PossibleVirtualMachineScaleSetSkuScaleTypeValues()
}
diff --git a/profiles/preview/containerregistry/mgmt/containerregistry/containerregistryapi/models.go b/profiles/preview/containerregistry/mgmt/containerregistry/containerregistryapi/models.go
index 976f96f6266c..1d33365b1341 100644
--- a/profiles/preview/containerregistry/mgmt/containerregistry/containerregistryapi/models.go
+++ b/profiles/preview/containerregistry/mgmt/containerregistry/containerregistryapi/models.go
@@ -25,5 +25,7 @@ type OperationsClientAPI = original.OperationsClientAPI
type RegistriesClientAPI = original.RegistriesClientAPI
type ReplicationsClientAPI = original.ReplicationsClientAPI
type RunsClientAPI = original.RunsClientAPI
+type ScopeMapsClientAPI = original.ScopeMapsClientAPI
type TasksClientAPI = original.TasksClientAPI
+type TokensClientAPI = original.TokensClientAPI
type WebhooksClientAPI = original.WebhooksClientAPI
diff --git a/profiles/preview/containerregistry/mgmt/containerregistry/models.go b/profiles/preview/containerregistry/mgmt/containerregistry/models.go
index dbe09e21f9ce..39b34d0ed182 100644
--- a/profiles/preview/containerregistry/mgmt/containerregistry/models.go
+++ b/profiles/preview/containerregistry/mgmt/containerregistry/models.go
@@ -196,6 +196,27 @@ const (
TaskStatusEnabled TaskStatus = original.TaskStatusEnabled
)
+type TokenCertificateName = original.TokenCertificateName
+
+const (
+ Certificate1 TokenCertificateName = original.Certificate1
+ Certificate2 TokenCertificateName = original.Certificate2
+)
+
+type TokenPasswordName = original.TokenPasswordName
+
+const (
+ TokenPasswordNamePassword1 TokenPasswordName = original.TokenPasswordNamePassword1
+ TokenPasswordNamePassword2 TokenPasswordName = original.TokenPasswordNamePassword2
+)
+
+type TokenStatus = original.TokenStatus
+
+const (
+ TokenStatusDisabled TokenStatus = original.TokenStatusDisabled
+ TokenStatusEnabled TokenStatus = original.TokenStatusEnabled
+)
+
type TokenType = original.TokenType
const (
@@ -247,8 +268,8 @@ const (
type UpdateTriggerPayloadType = original.UpdateTriggerPayloadType
const (
- Default UpdateTriggerPayloadType = original.Default
- Token UpdateTriggerPayloadType = original.Token
+ UpdateTriggerPayloadTypeDefault UpdateTriggerPayloadType = original.UpdateTriggerPayloadTypeDefault
+ UpdateTriggerPayloadTypeToken UpdateTriggerPayloadType = original.UpdateTriggerPayloadTypeToken
)
type Variant = original.Variant
@@ -308,6 +329,8 @@ type EventResponseMessage = original.EventResponseMessage
type FileTaskRunRequest = original.FileTaskRunRequest
type FileTaskStep = original.FileTaskStep
type FileTaskStepUpdateParameters = original.FileTaskStepUpdateParameters
+type GenerateCredentialsParameters = original.GenerateCredentialsParameters
+type GenerateCredentialsResult = original.GenerateCredentialsResult
type IPRule = original.IPRule
type IdentityProperties = original.IdentityProperties
type ImageDescriptor = original.ImageDescriptor
@@ -335,6 +358,7 @@ type RegenerateCredentialParameters = original.RegenerateCredentialParameters
type RegistriesClient = original.RegistriesClient
type RegistriesCreateFuture = original.RegistriesCreateFuture
type RegistriesDeleteFuture = original.RegistriesDeleteFuture
+type RegistriesGenerateCredentialsFuture = original.RegistriesGenerateCredentialsFuture
type RegistriesImportImageFuture = original.RegistriesImportImageFuture
type RegistriesScheduleRunFuture = original.RegistriesScheduleRunFuture
type RegistriesUpdateFuture = original.RegistriesUpdateFuture
@@ -376,6 +400,17 @@ type RunUpdateParameters = original.RunUpdateParameters
type RunsCancelFuture = original.RunsCancelFuture
type RunsClient = original.RunsClient
type RunsUpdateFuture = original.RunsUpdateFuture
+type ScopeMap = original.ScopeMap
+type ScopeMapListResult = original.ScopeMapListResult
+type ScopeMapListResultIterator = original.ScopeMapListResultIterator
+type ScopeMapListResultPage = original.ScopeMapListResultPage
+type ScopeMapProperties = original.ScopeMapProperties
+type ScopeMapPropertiesUpdateParameters = original.ScopeMapPropertiesUpdateParameters
+type ScopeMapUpdateParameters = original.ScopeMapUpdateParameters
+type ScopeMapsClient = original.ScopeMapsClient
+type ScopeMapsCreateFuture = original.ScopeMapsCreateFuture
+type ScopeMapsDeleteFuture = original.ScopeMapsDeleteFuture
+type ScopeMapsUpdateFuture = original.ScopeMapsUpdateFuture
type SecretObject = original.SecretObject
type SetValue = original.SetValue
type Sku = original.Sku
@@ -407,6 +442,20 @@ type TasksUpdateFuture = original.TasksUpdateFuture
type TimerTrigger = original.TimerTrigger
type TimerTriggerDescriptor = original.TimerTriggerDescriptor
type TimerTriggerUpdateParameters = original.TimerTriggerUpdateParameters
+type Token = original.Token
+type TokenCertificate = original.TokenCertificate
+type TokenCredentialsProperties = original.TokenCredentialsProperties
+type TokenListResult = original.TokenListResult
+type TokenListResultIterator = original.TokenListResultIterator
+type TokenListResultPage = original.TokenListResultPage
+type TokenPassword = original.TokenPassword
+type TokenProperties = original.TokenProperties
+type TokenUpdateParameters = original.TokenUpdateParameters
+type TokenUpdateProperties = original.TokenUpdateProperties
+type TokensClient = original.TokensClient
+type TokensCreateFuture = original.TokensCreateFuture
+type TokensDeleteFuture = original.TokensDeleteFuture
+type TokensUpdateFuture = original.TokensUpdateFuture
type TriggerProperties = original.TriggerProperties
type TriggerUpdateParameters = original.TriggerUpdateParameters
type TrustPolicy = original.TrustPolicy
@@ -483,6 +532,18 @@ func NewRunsClient(subscriptionID string) RunsClient {
func NewRunsClientWithBaseURI(baseURI string, subscriptionID string) RunsClient {
return original.NewRunsClientWithBaseURI(baseURI, subscriptionID)
}
+func NewScopeMapListResultIterator(page ScopeMapListResultPage) ScopeMapListResultIterator {
+ return original.NewScopeMapListResultIterator(page)
+}
+func NewScopeMapListResultPage(getNextPage func(context.Context, ScopeMapListResult) (ScopeMapListResult, error)) ScopeMapListResultPage {
+ return original.NewScopeMapListResultPage(getNextPage)
+}
+func NewScopeMapsClient(subscriptionID string) ScopeMapsClient {
+ return original.NewScopeMapsClient(subscriptionID)
+}
+func NewScopeMapsClientWithBaseURI(baseURI string, subscriptionID string) ScopeMapsClient {
+ return original.NewScopeMapsClientWithBaseURI(baseURI, subscriptionID)
+}
func NewTaskListResultIterator(page TaskListResultPage) TaskListResultIterator {
return original.NewTaskListResultIterator(page)
}
@@ -495,6 +556,18 @@ func NewTasksClient(subscriptionID string) TasksClient {
func NewTasksClientWithBaseURI(baseURI string, subscriptionID string) TasksClient {
return original.NewTasksClientWithBaseURI(baseURI, subscriptionID)
}
+func NewTokenListResultIterator(page TokenListResultPage) TokenListResultIterator {
+ return original.NewTokenListResultIterator(page)
+}
+func NewTokenListResultPage(getNextPage func(context.Context, TokenListResult) (TokenListResult, error)) TokenListResultPage {
+ return original.NewTokenListResultPage(getNextPage)
+}
+func NewTokensClient(subscriptionID string) TokensClient {
+ return original.NewTokensClient(subscriptionID)
+}
+func NewTokensClientWithBaseURI(baseURI string, subscriptionID string) TokensClient {
+ return original.NewTokensClientWithBaseURI(baseURI, subscriptionID)
+}
func NewWebhookListResultIterator(page WebhookListResultPage) WebhookListResultIterator {
return original.NewWebhookListResultIterator(page)
}
@@ -573,6 +646,15 @@ func PossibleSourceTriggerEventValues() []SourceTriggerEvent {
func PossibleTaskStatusValues() []TaskStatus {
return original.PossibleTaskStatusValues()
}
+func PossibleTokenCertificateNameValues() []TokenCertificateName {
+ return original.PossibleTokenCertificateNameValues()
+}
+func PossibleTokenPasswordNameValues() []TokenPasswordName {
+ return original.PossibleTokenPasswordNameValues()
+}
+func PossibleTokenStatusValues() []TokenStatus {
+ return original.PossibleTokenStatusValues()
+}
func PossibleTokenTypeValues() []TokenType {
return original.PossibleTokenTypeValues()
}
diff --git a/profiles/preview/cosmos-db/mgmt/documentdb/models.go b/profiles/preview/cosmos-db/mgmt/documentdb/models.go
index 079c75b4b084..dbc3ce68bf22 100644
--- a/profiles/preview/cosmos-db/mgmt/documentdb/models.go
+++ b/profiles/preview/cosmos-db/mgmt/documentdb/models.go
@@ -112,12 +112,12 @@ const (
type PrimaryAggregationType = original.PrimaryAggregationType
const (
- PrimaryAggregationTypeAverage PrimaryAggregationType = original.PrimaryAggregationTypeAverage
- PrimaryAggregationTypeLast PrimaryAggregationType = original.PrimaryAggregationTypeLast
- PrimaryAggregationTypeMaximum PrimaryAggregationType = original.PrimaryAggregationTypeMaximum
- PrimaryAggregationTypeMinimimum PrimaryAggregationType = original.PrimaryAggregationTypeMinimimum
- PrimaryAggregationTypeNone PrimaryAggregationType = original.PrimaryAggregationTypeNone
- PrimaryAggregationTypeTotal PrimaryAggregationType = original.PrimaryAggregationTypeTotal
+ PrimaryAggregationTypeAverage PrimaryAggregationType = original.PrimaryAggregationTypeAverage
+ PrimaryAggregationTypeLast PrimaryAggregationType = original.PrimaryAggregationTypeLast
+ PrimaryAggregationTypeMaximum PrimaryAggregationType = original.PrimaryAggregationTypeMaximum
+ PrimaryAggregationTypeMinimum PrimaryAggregationType = original.PrimaryAggregationTypeMinimum
+ PrimaryAggregationTypeNone PrimaryAggregationType = original.PrimaryAggregationTypeNone
+ PrimaryAggregationTypeTotal PrimaryAggregationType = original.PrimaryAggregationTypeTotal
)
type UnitType = original.UnitType
diff --git a/profiles/preview/databox/mgmt/databox/databoxapi/models.go b/profiles/preview/databox/mgmt/databox/databoxapi/models.go
index 4cbd950b6a9b..d1f0705c3f4b 100644
--- a/profiles/preview/databox/mgmt/databox/databoxapi/models.go
+++ b/profiles/preview/databox/mgmt/databox/databoxapi/models.go
@@ -19,7 +19,7 @@
package databoxapi
-import original "github.com/Azure/azure-sdk-for-go/services/databox/mgmt/2018-01-01/databox/databoxapi"
+import original "github.com/Azure/azure-sdk-for-go/services/databox/mgmt/2019-09-01/databox/databoxapi"
type JobsClientAPI = original.JobsClientAPI
type OperationsClientAPI = original.OperationsClientAPI
diff --git a/profiles/preview/databox/mgmt/databox/models.go b/profiles/preview/databox/mgmt/databox/models.go
index ca081e0e77d4..ab19aaa4a8f5 100644
--- a/profiles/preview/databox/mgmt/databox/models.go
+++ b/profiles/preview/databox/mgmt/databox/models.go
@@ -22,7 +22,7 @@ package databox
import (
"context"
- original "github.com/Azure/azure-sdk-for-go/services/databox/mgmt/2018-01-01/databox"
+ original "github.com/Azure/azure-sdk-for-go/services/databox/mgmt/2019-09-01/databox"
)
const (
@@ -64,20 +64,39 @@ const (
type CopyStatus = original.CopyStatus
const (
- Completed CopyStatus = original.Completed
- CompletedWithErrors CopyStatus = original.CompletedWithErrors
- Failed CopyStatus = original.Failed
- InProgress CopyStatus = original.InProgress
- NotReturned CopyStatus = original.NotReturned
- NotStarted CopyStatus = original.NotStarted
+ Completed CopyStatus = original.Completed
+ CompletedWithErrors CopyStatus = original.CompletedWithErrors
+ DeviceFormatted CopyStatus = original.DeviceFormatted
+ DeviceMetadataModified CopyStatus = original.DeviceMetadataModified
+ Failed CopyStatus = original.Failed
+ HardwareError CopyStatus = original.HardwareError
+ InProgress CopyStatus = original.InProgress
+ NotReturned CopyStatus = original.NotReturned
+ NotStarted CopyStatus = original.NotStarted
+ StorageAccountNotAccessible CopyStatus = original.StorageAccountNotAccessible
+ UnsupportedData CopyStatus = original.UnsupportedData
)
type DataDestinationType = original.DataDestinationType
const (
- DataDestinationTypeDestinationAccountDetails DataDestinationType = original.DataDestinationTypeDestinationAccountDetails
- DataDestinationTypeManagedDisk DataDestinationType = original.DataDestinationTypeManagedDisk
- DataDestinationTypeStorageAccount DataDestinationType = original.DataDestinationTypeStorageAccount
+ ManagedDisk DataDestinationType = original.ManagedDisk
+ StorageAccount DataDestinationType = original.StorageAccount
+)
+
+type DataDestinationTypeBasicDestinationAccountDetails = original.DataDestinationTypeBasicDestinationAccountDetails
+
+const (
+ DataDestinationTypeDestinationAccountDetails DataDestinationTypeBasicDestinationAccountDetails = original.DataDestinationTypeDestinationAccountDetails
+ DataDestinationTypeManagedDisk DataDestinationTypeBasicDestinationAccountDetails = original.DataDestinationTypeManagedDisk
+ DataDestinationTypeStorageAccount DataDestinationTypeBasicDestinationAccountDetails = original.DataDestinationTypeStorageAccount
+)
+
+type JobDeliveryType = original.JobDeliveryType
+
+const (
+ NonScheduled JobDeliveryType = original.NonScheduled
+ Scheduled JobDeliveryType = original.Scheduled
)
type JobDetailsTypeEnum = original.JobDetailsTypeEnum
@@ -109,15 +128,23 @@ const (
PickedUp NotificationStageName = original.PickedUp
)
+type OverallValidationStatus = original.OverallValidationStatus
+
+const (
+ AllValidToProceed OverallValidationStatus = original.AllValidToProceed
+ CertainInputValidationsSkipped OverallValidationStatus = original.CertainInputValidationsSkipped
+ InputsRevisitRequired OverallValidationStatus = original.InputsRevisitRequired
+)
+
type ShareDestinationFormatType = original.ShareDestinationFormatType
const (
- AzureFile ShareDestinationFormatType = original.AzureFile
- BlockBlob ShareDestinationFormatType = original.BlockBlob
- HCS ShareDestinationFormatType = original.HCS
- ManagedDisk ShareDestinationFormatType = original.ManagedDisk
- PageBlob ShareDestinationFormatType = original.PageBlob
- UnknownType ShareDestinationFormatType = original.UnknownType
+ ShareDestinationFormatTypeAzureFile ShareDestinationFormatType = original.ShareDestinationFormatTypeAzureFile
+ ShareDestinationFormatTypeBlockBlob ShareDestinationFormatType = original.ShareDestinationFormatTypeBlockBlob
+ ShareDestinationFormatTypeHCS ShareDestinationFormatType = original.ShareDestinationFormatTypeHCS
+ ShareDestinationFormatTypeManagedDisk ShareDestinationFormatType = original.ShareDestinationFormatTypeManagedDisk
+ ShareDestinationFormatTypePageBlob ShareDestinationFormatType = original.ShareDestinationFormatTypePageBlob
+ ShareDestinationFormatTypeUnknownType ShareDestinationFormatType = original.ShareDestinationFormatTypeUnknownType
)
type SkuDisabledReason = original.SkuDisabledReason
@@ -139,6 +166,15 @@ const (
DataBoxHeavy SkuName = original.DataBoxHeavy
)
+type SkuNameBasicScheduleAvailabilityRequest = original.SkuNameBasicScheduleAvailabilityRequest
+
+const (
+ SkuNameDataBox SkuNameBasicScheduleAvailabilityRequest = original.SkuNameDataBox
+ SkuNameDataBoxDisk SkuNameBasicScheduleAvailabilityRequest = original.SkuNameDataBoxDisk
+ SkuNameDataBoxHeavy SkuNameBasicScheduleAvailabilityRequest = original.SkuNameDataBoxHeavy
+ SkuNameScheduleAvailabilityRequest SkuNameBasicScheduleAvailabilityRequest = original.SkuNameScheduleAvailabilityRequest
+)
+
type StageName = original.StageName
const (
@@ -147,6 +183,7 @@ const (
StageNameCancelled StageName = original.StageNameCancelled
StageNameCompleted StageName = original.StageNameCompleted
StageNameCompletedWithErrors StageName = original.StageNameCompletedWithErrors
+ StageNameCompletedWithWarnings StageName = original.StageNameCompletedWithWarnings
StageNameDataCopy StageName = original.StageNameDataCopy
StageNameDelivered StageName = original.StageNameDelivered
StageNameDeviceOrdered StageName = original.StageNameDeviceOrdered
@@ -155,6 +192,8 @@ const (
StageNameFailedIssueDetectedAtAzureDC StageName = original.StageNameFailedIssueDetectedAtAzureDC
StageNameFailedIssueReportedAtCustomer StageName = original.StageNameFailedIssueReportedAtCustomer
StageNamePickedUp StageName = original.StageNamePickedUp
+ StageNameReadyToDispatchFromAzureDC StageName = original.StageNameReadyToDispatchFromAzureDC
+ StageNameReadyToReceiveAtAzureDC StageName = original.StageNameReadyToReceiveAtAzureDC
)
type StageStatus = original.StageStatus
@@ -169,6 +208,52 @@ const (
StageStatusSucceededWithErrors StageStatus = original.StageStatusSucceededWithErrors
)
+type TransportShipmentTypes = original.TransportShipmentTypes
+
+const (
+ CustomerManaged TransportShipmentTypes = original.CustomerManaged
+ MicrosoftManaged TransportShipmentTypes = original.MicrosoftManaged
+)
+
+type ValidationCategory = original.ValidationCategory
+
+const (
+ ValidationCategoryJobCreationValidation ValidationCategory = original.ValidationCategoryJobCreationValidation
+ ValidationCategoryValidationRequest ValidationCategory = original.ValidationCategoryValidationRequest
+)
+
+type ValidationStatus = original.ValidationStatus
+
+const (
+ ValidationStatusInvalid ValidationStatus = original.ValidationStatusInvalid
+ ValidationStatusSkipped ValidationStatus = original.ValidationStatusSkipped
+ ValidationStatusValid ValidationStatus = original.ValidationStatusValid
+)
+
+type ValidationType = original.ValidationType
+
+const (
+ ValidationTypeValidateAddress ValidationType = original.ValidationTypeValidateAddress
+ ValidationTypeValidateCreateOrderLimit ValidationType = original.ValidationTypeValidateCreateOrderLimit
+ ValidationTypeValidateDataDestinationDetails ValidationType = original.ValidationTypeValidateDataDestinationDetails
+ ValidationTypeValidatePreferences ValidationType = original.ValidationTypeValidatePreferences
+ ValidationTypeValidateSkuAvailability ValidationType = original.ValidationTypeValidateSkuAvailability
+ ValidationTypeValidateSubscriptionIsAllowedToCreateJob ValidationType = original.ValidationTypeValidateSubscriptionIsAllowedToCreateJob
+ ValidationTypeValidationInputRequest ValidationType = original.ValidationTypeValidationInputRequest
+)
+
+type ValidationTypeBasicValidationInputResponse = original.ValidationTypeBasicValidationInputResponse
+
+const (
+ ValidationTypeBasicValidationInputResponseValidationTypeValidateAddress ValidationTypeBasicValidationInputResponse = original.ValidationTypeBasicValidationInputResponseValidationTypeValidateAddress
+ ValidationTypeBasicValidationInputResponseValidationTypeValidateCreateOrderLimit ValidationTypeBasicValidationInputResponse = original.ValidationTypeBasicValidationInputResponseValidationTypeValidateCreateOrderLimit
+ ValidationTypeBasicValidationInputResponseValidationTypeValidateDataDestinationDetails ValidationTypeBasicValidationInputResponse = original.ValidationTypeBasicValidationInputResponseValidationTypeValidateDataDestinationDetails
+ ValidationTypeBasicValidationInputResponseValidationTypeValidatePreferences ValidationTypeBasicValidationInputResponse = original.ValidationTypeBasicValidationInputResponseValidationTypeValidatePreferences
+ ValidationTypeBasicValidationInputResponseValidationTypeValidateSkuAvailability ValidationTypeBasicValidationInputResponse = original.ValidationTypeBasicValidationInputResponseValidationTypeValidateSkuAvailability
+ ValidationTypeBasicValidationInputResponseValidationTypeValidateSubscriptionIsAllowedToCreateJob ValidationTypeBasicValidationInputResponse = original.ValidationTypeBasicValidationInputResponseValidationTypeValidateSubscriptionIsAllowedToCreateJob
+ ValidationTypeBasicValidationInputResponseValidationTypeValidationInputResponse ValidationTypeBasicValidationInputResponse = original.ValidationTypeBasicValidationInputResponseValidationTypeValidationInputResponse
+)
+
type AccountCopyLogDetails = original.AccountCopyLogDetails
type AccountCredentialDetails = original.AccountCredentialDetails
type AddressValidationOutput = original.AddressValidationOutput
@@ -184,10 +269,21 @@ type BasicCopyLogDetails = original.BasicCopyLogDetails
type BasicDestinationAccountDetails = original.BasicDestinationAccountDetails
type BasicJobDetails = original.BasicJobDetails
type BasicJobSecrets = original.BasicJobSecrets
+type BasicScheduleAvailabilityRequest = original.BasicScheduleAvailabilityRequest
+type BasicValidationInputRequest = original.BasicValidationInputRequest
+type BasicValidationInputResponse = original.BasicValidationInputResponse
+type BasicValidationRequest = original.BasicValidationRequest
type CancellationReason = original.CancellationReason
+type CloudError = original.CloudError
type ContactDetails = original.ContactDetails
type CopyLogDetails = original.CopyLogDetails
type CopyProgress = original.CopyProgress
+type CreateJobValidations = original.CreateJobValidations
+type CreateOrderLimitForSubscriptionValidationRequest = original.CreateOrderLimitForSubscriptionValidationRequest
+type CreateOrderLimitForSubscriptionValidationResponseProperties = original.CreateOrderLimitForSubscriptionValidationResponseProperties
+type DataDestinationDetailsValidationRequest = original.DataDestinationDetailsValidationRequest
+type DataDestinationDetailsValidationResponseProperties = original.DataDestinationDetailsValidationResponseProperties
+type DcAccessSecurityCode = original.DcAccessSecurityCode
type DestinationAccountDetails = original.DestinationAccountDetails
type DestinationManagedDiskDetails = original.DestinationManagedDiskDetails
type DestinationStorageAccountDetails = original.DestinationStorageAccountDetails
@@ -196,12 +292,15 @@ type DiskCopyLogDetails = original.DiskCopyLogDetails
type DiskCopyProgress = original.DiskCopyProgress
type DiskJobDetails = original.DiskJobDetails
type DiskJobSecrets = original.DiskJobSecrets
+type DiskScheduleAvailabilityRequest = original.DiskScheduleAvailabilityRequest
type DiskSecret = original.DiskSecret
type Error = original.Error
type HeavyAccountCopyLogDetails = original.HeavyAccountCopyLogDetails
type HeavyJobDetails = original.HeavyJobDetails
type HeavyJobSecrets = original.HeavyJobSecrets
+type HeavyScheduleAvailabilityRequest = original.HeavyScheduleAvailabilityRequest
type HeavySecret = original.HeavySecret
+type JobDeliveryInfo = original.JobDeliveryInfo
type JobDetails = original.JobDetails
type JobDetailsType = original.JobDetailsType
type JobErrorDetails = original.JobErrorDetails
@@ -227,7 +326,14 @@ type OperationListPage = original.OperationListPage
type OperationsClient = original.OperationsClient
type PackageShippingDetails = original.PackageShippingDetails
type Preferences = original.Preferences
+type PreferencesValidationRequest = original.PreferencesValidationRequest
+type PreferencesValidationResponseProperties = original.PreferencesValidationResponseProperties
+type RegionConfigurationRequest = original.RegionConfigurationRequest
+type RegionConfigurationResponse = original.RegionConfigurationResponse
type Resource = original.Resource
+type ScheduleAvailabilityRequest = original.ScheduleAvailabilityRequest
+type ScheduleAvailabilityRequestType = original.ScheduleAvailabilityRequestType
+type ScheduleAvailabilityResponse = original.ScheduleAvailabilityResponse
type Secret = original.Secret
type ServiceClient = original.ServiceClient
type ShareCredentialDetails = original.ShareCredentialDetails
@@ -235,15 +341,28 @@ type ShipmentPickUpRequest = original.ShipmentPickUpRequest
type ShipmentPickUpResponse = original.ShipmentPickUpResponse
type ShippingAddress = original.ShippingAddress
type Sku = original.Sku
+type SkuAvailabilityValidationRequest = original.SkuAvailabilityValidationRequest
+type SkuAvailabilityValidationResponseProperties = original.SkuAvailabilityValidationResponseProperties
type SkuCapacity = original.SkuCapacity
type SkuCost = original.SkuCost
type SkuInformation = original.SkuInformation
type SkuProperties = original.SkuProperties
+type SubscriptionIsAllowedToCreateJobValidationRequest = original.SubscriptionIsAllowedToCreateJobValidationRequest
+type SubscriptionIsAllowedToCreateJobValidationResponseProperties = original.SubscriptionIsAllowedToCreateJobValidationResponseProperties
+type TransportAvailabilityDetails = original.TransportAvailabilityDetails
+type TransportAvailabilityRequest = original.TransportAvailabilityRequest
+type TransportAvailabilityResponse = original.TransportAvailabilityResponse
+type TransportPreferences = original.TransportPreferences
type UnencryptedCredentials = original.UnencryptedCredentials
type UnencryptedCredentialsList = original.UnencryptedCredentialsList
type UpdateJobDetails = original.UpdateJobDetails
type UpdateJobProperties = original.UpdateJobProperties
type ValidateAddress = original.ValidateAddress
+type ValidationInputRequest = original.ValidationInputRequest
+type ValidationInputResponse = original.ValidationInputResponse
+type ValidationRequest = original.ValidationRequest
+type ValidationResponse = original.ValidationResponse
+type ValidationResponseProperties = original.ValidationResponseProperties
func New(subscriptionID string) BaseClient {
return original.New(subscriptionID)
@@ -302,9 +421,15 @@ func PossibleCopyLogDetailsTypeValues() []CopyLogDetailsType {
func PossibleCopyStatusValues() []CopyStatus {
return original.PossibleCopyStatusValues()
}
+func PossibleDataDestinationTypeBasicDestinationAccountDetailsValues() []DataDestinationTypeBasicDestinationAccountDetails {
+ return original.PossibleDataDestinationTypeBasicDestinationAccountDetailsValues()
+}
func PossibleDataDestinationTypeValues() []DataDestinationType {
return original.PossibleDataDestinationTypeValues()
}
+func PossibleJobDeliveryTypeValues() []JobDeliveryType {
+ return original.PossibleJobDeliveryTypeValues()
+}
func PossibleJobDetailsTypeEnumValues() []JobDetailsTypeEnum {
return original.PossibleJobDetailsTypeEnumValues()
}
@@ -314,12 +439,18 @@ func PossibleJobSecretsTypeEnumValues() []JobSecretsTypeEnum {
func PossibleNotificationStageNameValues() []NotificationStageName {
return original.PossibleNotificationStageNameValues()
}
+func PossibleOverallValidationStatusValues() []OverallValidationStatus {
+ return original.PossibleOverallValidationStatusValues()
+}
func PossibleShareDestinationFormatTypeValues() []ShareDestinationFormatType {
return original.PossibleShareDestinationFormatTypeValues()
}
func PossibleSkuDisabledReasonValues() []SkuDisabledReason {
return original.PossibleSkuDisabledReasonValues()
}
+func PossibleSkuNameBasicScheduleAvailabilityRequestValues() []SkuNameBasicScheduleAvailabilityRequest {
+ return original.PossibleSkuNameBasicScheduleAvailabilityRequestValues()
+}
func PossibleSkuNameValues() []SkuName {
return original.PossibleSkuNameValues()
}
@@ -329,6 +460,21 @@ func PossibleStageNameValues() []StageName {
func PossibleStageStatusValues() []StageStatus {
return original.PossibleStageStatusValues()
}
+func PossibleTransportShipmentTypesValues() []TransportShipmentTypes {
+ return original.PossibleTransportShipmentTypesValues()
+}
+func PossibleValidationCategoryValues() []ValidationCategory {
+ return original.PossibleValidationCategoryValues()
+}
+func PossibleValidationStatusValues() []ValidationStatus {
+ return original.PossibleValidationStatusValues()
+}
+func PossibleValidationTypeBasicValidationInputResponseValues() []ValidationTypeBasicValidationInputResponse {
+ return original.PossibleValidationTypeBasicValidationInputResponseValues()
+}
+func PossibleValidationTypeValues() []ValidationType {
+ return original.PossibleValidationTypeValues()
+}
func UserAgent() string {
return original.UserAgent() + " profiles/preview"
}
diff --git a/profiles/preview/edgegateway/mgmt/edgegateway/edgegatewayapi/models.go b/profiles/preview/databoxedge/mgmt/databoxedge/databoxedgeapi/models.go
similarity index 88%
rename from profiles/preview/edgegateway/mgmt/edgegateway/edgegatewayapi/models.go
rename to profiles/preview/databoxedge/mgmt/databoxedge/databoxedgeapi/models.go
index c73455d1c53f..fa769db5d05e 100644
--- a/profiles/preview/edgegateway/mgmt/edgegateway/edgegatewayapi/models.go
+++ b/profiles/preview/databoxedge/mgmt/databoxedge/databoxedgeapi/models.go
@@ -17,14 +17,15 @@
// This code was auto-generated by:
// github.com/Azure/azure-sdk-for-go/tools/profileBuilder
-package edgegatewayapi
+package databoxedgeapi
-import original "github.com/Azure/azure-sdk-for-go/services/edgegateway/mgmt/2019-03-01/edgegateway/edgegatewayapi"
+import original "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2019-07-01/databoxedge/databoxedgeapi"
type AlertsClientAPI = original.AlertsClientAPI
type BandwidthSchedulesClientAPI = original.BandwidthSchedulesClientAPI
type DevicesClientAPI = original.DevicesClientAPI
type JobsClientAPI = original.JobsClientAPI
+type NodesClientAPI = original.NodesClientAPI
type OperationsClientAPI = original.OperationsClientAPI
type OperationsStatusClientAPI = original.OperationsStatusClientAPI
type OrdersClientAPI = original.OrdersClientAPI
diff --git a/profiles/preview/edgegateway/mgmt/edgegateway/models.go b/profiles/preview/databoxedge/mgmt/databoxedge/models.go
similarity index 91%
rename from profiles/preview/edgegateway/mgmt/edgegateway/models.go
rename to profiles/preview/databoxedge/mgmt/databoxedge/models.go
index 8f963cdad2e5..873bd0836bb3 100644
--- a/profiles/preview/edgegateway/mgmt/edgegateway/models.go
+++ b/profiles/preview/databoxedge/mgmt/databoxedge/models.go
@@ -17,12 +17,12 @@
// This code was auto-generated by:
// github.com/Azure/azure-sdk-for-go/tools/profileBuilder
-package edgegateway
+package databoxedge
import (
"context"
- original "github.com/Azure/azure-sdk-for-go/services/edgegateway/mgmt/2019-03-01/edgegateway"
+ original "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2019-07-01/databoxedge"
)
const (
@@ -67,17 +67,6 @@ const (
ReadWrite ClientPermissionType = original.ReadWrite
)
-type DataBoxEdgeDeviceStatus = original.DataBoxEdgeDeviceStatus
-
-const (
- Disconnected DataBoxEdgeDeviceStatus = original.Disconnected
- NeedsAttention DataBoxEdgeDeviceStatus = original.NeedsAttention
- Offline DataBoxEdgeDeviceStatus = original.Offline
- Online DataBoxEdgeDeviceStatus = original.Online
- PartiallyDisconnected DataBoxEdgeDeviceStatus = original.PartiallyDisconnected
- ReadyToSetup DataBoxEdgeDeviceStatus = original.ReadyToSetup
-)
-
type DataPolicy = original.DataPolicy
const (
@@ -97,10 +86,22 @@ const (
Wednesday DayOfWeek = original.Wednesday
)
+type DeviceStatus = original.DeviceStatus
+
+const (
+ Disconnected DeviceStatus = original.Disconnected
+ Maintenance DeviceStatus = original.Maintenance
+ NeedsAttention DeviceStatus = original.NeedsAttention
+ Offline DeviceStatus = original.Offline
+ Online DeviceStatus = original.Online
+ PartiallyDisconnected DeviceStatus = original.PartiallyDisconnected
+ ReadyToSetup DeviceStatus = original.ReadyToSetup
+)
+
type DeviceType = original.DeviceType
const (
- DeviceTypeDataBoxEdgeDevice DeviceType = original.DeviceTypeDataBoxEdgeDevice
+ DataBoxEdgeDevice DeviceType = original.DataBoxEdgeDevice
)
type DownloadPhase = original.DownloadPhase
@@ -233,6 +234,16 @@ const (
NetworkGroupRDMA NetworkGroup = original.NetworkGroupRDMA
)
+type NodeStatus = original.NodeStatus
+
+const (
+ NodeStatusDown NodeStatus = original.NodeStatusDown
+ NodeStatusRebooting NodeStatus = original.NodeStatusRebooting
+ NodeStatusShuttingDown NodeStatus = original.NodeStatusShuttingDown
+ NodeStatusUnknown NodeStatus = original.NodeStatusUnknown
+ NodeStatusUp NodeStatus = original.NodeStatusUp
+)
+
type OrderState = original.OrderState
const (
@@ -300,8 +311,11 @@ const (
type ShareStatus = original.ShareStatus
const (
- ShareStatusOffline ShareStatus = original.ShareStatusOffline
- ShareStatusOnline ShareStatus = original.ShareStatusOnline
+ ShareStatusNeedsAttention ShareStatus = original.ShareStatusNeedsAttention
+ ShareStatusOffline ShareStatus = original.ShareStatusOffline
+ ShareStatusOK ShareStatus = original.ShareStatusOK
+ ShareStatusUnknown ShareStatus = original.ShareStatusUnknown
+ ShareStatusUpdating ShareStatus = original.ShareStatusUpdating
)
type SkuName = original.SkuName
@@ -388,14 +402,14 @@ type ClientAccessRight = original.ClientAccessRight
type CloudError = original.CloudError
type CloudErrorBody = original.CloudErrorBody
type ContactDetails = original.ContactDetails
-type DataBoxEdgeDevice = original.DataBoxEdgeDevice
-type DataBoxEdgeDeviceExtendedInfo = original.DataBoxEdgeDeviceExtendedInfo
-type DataBoxEdgeDeviceExtendedInfoProperties = original.DataBoxEdgeDeviceExtendedInfoProperties
-type DataBoxEdgeDeviceList = original.DataBoxEdgeDeviceList
-type DataBoxEdgeDeviceListIterator = original.DataBoxEdgeDeviceListIterator
-type DataBoxEdgeDeviceListPage = original.DataBoxEdgeDeviceListPage
-type DataBoxEdgeDevicePatch = original.DataBoxEdgeDevicePatch
-type DataBoxEdgeDeviceProperties = original.DataBoxEdgeDeviceProperties
+type Device = original.Device
+type DeviceExtendedInfo = original.DeviceExtendedInfo
+type DeviceExtendedInfoProperties = original.DeviceExtendedInfoProperties
+type DeviceList = original.DeviceList
+type DeviceListIterator = original.DeviceListIterator
+type DeviceListPage = original.DeviceListPage
+type DevicePatch = original.DevicePatch
+type DeviceProperties = original.DeviceProperties
type DevicesClient = original.DevicesClient
type DevicesCreateOrUpdateFuture = original.DevicesCreateOrUpdateFuture
type DevicesCreateOrUpdateSecuritySettingsFuture = original.DevicesCreateOrUpdateSecuritySettingsFuture
@@ -423,6 +437,10 @@ type NetworkAdapter = original.NetworkAdapter
type NetworkAdapterPosition = original.NetworkAdapterPosition
type NetworkSettings = original.NetworkSettings
type NetworkSettingsProperties = original.NetworkSettingsProperties
+type Node = original.Node
+type NodeList = original.NodeList
+type NodeProperties = original.NodeProperties
+type NodesClient = original.NodesClient
type Operation = original.Operation
type OperationDisplay = original.OperationDisplay
type OperationProperties = original.OperationProperties
@@ -529,11 +547,11 @@ func NewBandwidthSchedulesListIterator(page BandwidthSchedulesListPage) Bandwidt
func NewBandwidthSchedulesListPage(getNextPage func(context.Context, BandwidthSchedulesList) (BandwidthSchedulesList, error)) BandwidthSchedulesListPage {
return original.NewBandwidthSchedulesListPage(getNextPage)
}
-func NewDataBoxEdgeDeviceListIterator(page DataBoxEdgeDeviceListPage) DataBoxEdgeDeviceListIterator {
- return original.NewDataBoxEdgeDeviceListIterator(page)
+func NewDeviceListIterator(page DeviceListPage) DeviceListIterator {
+ return original.NewDeviceListIterator(page)
}
-func NewDataBoxEdgeDeviceListPage(getNextPage func(context.Context, DataBoxEdgeDeviceList) (DataBoxEdgeDeviceList, error)) DataBoxEdgeDeviceListPage {
- return original.NewDataBoxEdgeDeviceListPage(getNextPage)
+func NewDeviceListPage(getNextPage func(context.Context, DeviceList) (DeviceList, error)) DeviceListPage {
+ return original.NewDeviceListPage(getNextPage)
}
func NewDevicesClient(subscriptionID string) DevicesClient {
return original.NewDevicesClient(subscriptionID)
@@ -547,6 +565,12 @@ func NewJobsClient(subscriptionID string) JobsClient {
func NewJobsClientWithBaseURI(baseURI string, subscriptionID string) JobsClient {
return original.NewJobsClientWithBaseURI(baseURI, subscriptionID)
}
+func NewNodesClient(subscriptionID string) NodesClient {
+ return original.NewNodesClient(subscriptionID)
+}
+func NewNodesClientWithBaseURI(baseURI string, subscriptionID string) NodesClient {
+ return original.NewNodesClientWithBaseURI(baseURI, subscriptionID)
+}
func NewOperationsClient(subscriptionID string) OperationsClient {
return original.NewOperationsClient(subscriptionID)
}
@@ -655,15 +679,15 @@ func PossibleAzureContainerDataFormatValues() []AzureContainerDataFormat {
func PossibleClientPermissionTypeValues() []ClientPermissionType {
return original.PossibleClientPermissionTypeValues()
}
-func PossibleDataBoxEdgeDeviceStatusValues() []DataBoxEdgeDeviceStatus {
- return original.PossibleDataBoxEdgeDeviceStatusValues()
-}
func PossibleDataPolicyValues() []DataPolicy {
return original.PossibleDataPolicyValues()
}
func PossibleDayOfWeekValues() []DayOfWeek {
return original.PossibleDayOfWeekValues()
}
+func PossibleDeviceStatusValues() []DeviceStatus {
+ return original.PossibleDeviceStatusValues()
+}
func PossibleDeviceTypeValues() []DeviceType {
return original.PossibleDeviceTypeValues()
}
@@ -712,6 +736,9 @@ func PossibleNetworkAdapterStatusValues() []NetworkAdapterStatus {
func PossibleNetworkGroupValues() []NetworkGroup {
return original.PossibleNetworkGroupValues()
}
+func PossibleNodeStatusValues() []NodeStatus {
+ return original.PossibleNodeStatusValues()
+}
func PossibleOrderStateValues() []OrderState {
return original.PossibleOrderStateValues()
}
diff --git a/profiles/preview/datafactory/mgmt/datafactory/datafactoryapi/models.go b/profiles/preview/datafactory/mgmt/datafactory/datafactoryapi/models.go
index 2a039a860394..28f064af3a1b 100644
--- a/profiles/preview/datafactory/mgmt/datafactory/datafactoryapi/models.go
+++ b/profiles/preview/datafactory/mgmt/datafactory/datafactoryapi/models.go
@@ -22,6 +22,8 @@ package datafactoryapi
import original "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory/datafactoryapi"
type ActivityRunsClientAPI = original.ActivityRunsClientAPI
+type DataFlowDebugSessionClientAPI = original.DataFlowDebugSessionClientAPI
+type DataFlowsClientAPI = original.DataFlowsClientAPI
type DatasetsClientAPI = original.DatasetsClientAPI
type ExposureControlClientAPI = original.ExposureControlClientAPI
type FactoriesClientAPI = original.FactoriesClientAPI
diff --git a/profiles/preview/datafactory/mgmt/datafactory/models.go b/profiles/preview/datafactory/mgmt/datafactory/models.go
index 5b7373730a53..fd2334ff249f 100644
--- a/profiles/preview/datafactory/mgmt/datafactory/models.go
+++ b/profiles/preview/datafactory/mgmt/datafactory/models.go
@@ -97,6 +97,22 @@ const (
TWO CassandraSourceReadConsistencyLevels = original.TWO
)
+type DataFlowComputeType = original.DataFlowComputeType
+
+const (
+ ComputeOptimized DataFlowComputeType = original.ComputeOptimized
+ General DataFlowComputeType = original.General
+ MemoryOptimized DataFlowComputeType = original.MemoryOptimized
+)
+
+type DataFlowDebugCommandType = original.DataFlowDebugCommandType
+
+const (
+ ExecuteExpressionQuery DataFlowDebugCommandType = original.ExecuteExpressionQuery
+ ExecutePreviewQuery DataFlowDebugCommandType = original.ExecutePreviewQuery
+ ExecuteStatisticsQuery DataFlowDebugCommandType = original.ExecuteStatisticsQuery
+)
+
type DayOfWeek = original.DayOfWeek
const (
@@ -667,6 +683,7 @@ const (
TypeDatabricksSparkPython TypeBasicActivity = original.TypeDatabricksSparkPython
TypeDataLakeAnalyticsUSQL TypeBasicActivity = original.TypeDataLakeAnalyticsUSQL
TypeDelete TypeBasicActivity = original.TypeDelete
+ TypeExecuteDataFlow TypeBasicActivity = original.TypeExecuteDataFlow
TypeExecutePipeline TypeBasicActivity = original.TypeExecutePipeline
TypeExecuteSSISPackage TypeBasicActivity = original.TypeExecuteSSISPackage
TypeExecution TypeBasicActivity = original.TypeExecution
@@ -707,6 +724,7 @@ const (
TypeCommonDataServiceForAppsSink TypeBasicCopySink = original.TypeCommonDataServiceForAppsSink
TypeCopySink TypeBasicCopySink = original.TypeCopySink
TypeCosmosDbMongoDbAPISink TypeBasicCopySink = original.TypeCosmosDbMongoDbAPISink
+ TypeCosmosDbSQLAPISink TypeBasicCopySink = original.TypeCosmosDbSQLAPISink
TypeDelimitedTextSink TypeBasicCopySink = original.TypeDelimitedTextSink
TypeDocumentDbCollectionSink TypeBasicCopySink = original.TypeDocumentDbCollectionSink
TypeDynamicsCrmSink TypeBasicCopySink = original.TypeDynamicsCrmSink
@@ -717,6 +735,7 @@ const (
TypeMicrosoftAccessSink TypeBasicCopySink = original.TypeMicrosoftAccessSink
TypeOdbcSink TypeBasicCopySink = original.TypeOdbcSink
TypeOracleSink TypeBasicCopySink = original.TypeOracleSink
+ TypeOrcSink TypeBasicCopySink = original.TypeOrcSink
TypeParquetSink TypeBasicCopySink = original.TypeParquetSink
TypeSalesforceServiceCloudSink TypeBasicCopySink = original.TypeSalesforceServiceCloudSink
TypeSalesforceSink TypeBasicCopySink = original.TypeSalesforceSink
@@ -748,6 +767,7 @@ const (
TypeConcurSource TypeBasicCopySource = original.TypeConcurSource
TypeCopySource TypeBasicCopySource = original.TypeCopySource
TypeCosmosDbMongoDbAPISource TypeBasicCopySource = original.TypeCosmosDbMongoDbAPISource
+ TypeCosmosDbSQLAPISource TypeBasicCopySource = original.TypeCosmosDbSQLAPISource
TypeCouchbaseSource TypeBasicCopySource = original.TypeCouchbaseSource
TypeDb2Source TypeBasicCopySource = original.TypeDb2Source
TypeDelimitedTextSource TypeBasicCopySource = original.TypeDelimitedTextSource
@@ -783,6 +803,7 @@ const (
TypeOffice365Source TypeBasicCopySource = original.TypeOffice365Source
TypeOracleServiceCloudSource TypeBasicCopySource = original.TypeOracleServiceCloudSource
TypeOracleSource TypeBasicCopySource = original.TypeOracleSource
+ TypeOrcSource TypeBasicCopySource = original.TypeOrcSource
TypeParquetSource TypeBasicCopySource = original.TypeParquetSource
TypePaypalSource TypeBasicCopySource = original.TypePaypalSource
TypePhoenixSource TypeBasicCopySource = original.TypePhoenixSource
@@ -810,6 +831,7 @@ const (
TypeSQLSource TypeBasicCopySource = original.TypeSQLSource
TypeSquareSource TypeBasicCopySource = original.TypeSquareSource
TypeSybaseSource TypeBasicCopySource = original.TypeSybaseSource
+ TypeTabularSource TypeBasicCopySource = original.TypeTabularSource
TypeTeradataSource TypeBasicCopySource = original.TypeTeradataSource
TypeVerticaSource TypeBasicCopySource = original.TypeVerticaSource
TypeWebSource TypeBasicCopySource = original.TypeWebSource
@@ -817,6 +839,22 @@ const (
TypeZohoSource TypeBasicCopySource = original.TypeZohoSource
)
+type TypeBasicCustomSetupBase = original.TypeBasicCustomSetupBase
+
+const (
+ TypeCmdkeySetup TypeBasicCustomSetupBase = original.TypeCmdkeySetup
+ TypeComponentSetup TypeBasicCustomSetupBase = original.TypeComponentSetup
+ TypeCustomSetupBase TypeBasicCustomSetupBase = original.TypeCustomSetupBase
+ TypeEnvironmentVariableSetup TypeBasicCustomSetupBase = original.TypeEnvironmentVariableSetup
+)
+
+type TypeBasicDataFlow = original.TypeBasicDataFlow
+
+const (
+ TypeDataFlow TypeBasicDataFlow = original.TypeDataFlow
+ TypeMappingDataFlow TypeBasicDataFlow = original.TypeMappingDataFlow
+)
+
type TypeBasicDataset = original.TypeBasicDataset
const (
@@ -841,6 +879,7 @@ const (
TypeCommonDataServiceForAppsEntity TypeBasicDataset = original.TypeCommonDataServiceForAppsEntity
TypeConcurObject TypeBasicDataset = original.TypeConcurObject
TypeCosmosDbMongoDbAPICollection TypeBasicDataset = original.TypeCosmosDbMongoDbAPICollection
+ TypeCosmosDbSQLAPICollection TypeBasicDataset = original.TypeCosmosDbSQLAPICollection
TypeCouchbaseTable TypeBasicDataset = original.TypeCouchbaseTable
TypeCustomDataset TypeBasicDataset = original.TypeCustomDataset
TypeDataset TypeBasicDataset = original.TypeDataset
@@ -877,6 +916,7 @@ const (
TypeOffice365Table TypeBasicDataset = original.TypeOffice365Table
TypeOracleServiceCloudObject TypeBasicDataset = original.TypeOracleServiceCloudObject
TypeOracleTable TypeBasicDataset = original.TypeOracleTable
+ TypeOrc TypeBasicDataset = original.TypeOrc
TypeParquet TypeBasicDataset = original.TypeParquet
TypePaypalObject TypeBasicDataset = original.TypePaypalObject
TypePhoenixObject TypeBasicDataset = original.TypePhoenixObject
@@ -1084,6 +1124,7 @@ type TypeBasicTrigger = original.TypeBasicTrigger
const (
TypeBlobEventsTrigger TypeBasicTrigger = original.TypeBlobEventsTrigger
TypeBlobTrigger TypeBasicTrigger = original.TypeBlobTrigger
+ TypeChainingTrigger TypeBasicTrigger = original.TypeChainingTrigger
TypeMultiplePipelineTrigger TypeBasicTrigger = original.TypeMultiplePipelineTrigger
TypeRerunTumblingWindowTrigger TypeBasicTrigger = original.TypeRerunTumblingWindowTrigger
TypeScheduleTrigger TypeBasicTrigger = original.TypeScheduleTrigger
@@ -1121,6 +1162,7 @@ type ActivityPolicy = original.ActivityPolicy
type ActivityRun = original.ActivityRun
type ActivityRunsClient = original.ActivityRunsClient
type ActivityRunsQueryResponse = original.ActivityRunsQueryResponse
+type AddDataFlowToDebugSessionResponse = original.AddDataFlowToDebugSessionResponse
type AmazonMWSLinkedService = original.AmazonMWSLinkedService
type AmazonMWSLinkedServiceTypeProperties = original.AmazonMWSLinkedServiceTypeProperties
type AmazonMWSObjectDataset = original.AmazonMWSObjectDataset
@@ -1245,6 +1287,8 @@ type BasicActivity = original.BasicActivity
type BasicControlActivity = original.BasicControlActivity
type BasicCopySink = original.BasicCopySink
type BasicCopySource = original.BasicCopySource
+type BasicCustomSetupBase = original.BasicCustomSetupBase
+type BasicDataFlow = original.BasicDataFlow
type BasicDataset = original.BasicDataset
type BasicDatasetCompression = original.BasicDatasetCompression
type BasicDatasetStorageFormat = original.BasicDatasetStorageFormat
@@ -1259,6 +1303,7 @@ type BasicMultiplePipelineTrigger = original.BasicMultiplePipelineTrigger
type BasicSecretBase = original.BasicSecretBase
type BasicSsisObjectMetadata = original.BasicSsisObjectMetadata
type BasicStoreWriteSettings = original.BasicStoreWriteSettings
+type BasicTabularSource = original.BasicTabularSource
type BasicTrigger = original.BasicTrigger
type BasicTriggerDependencyReference = original.BasicTriggerDependencyReference
type BasicWebLinkedServiceTypeProperties = original.BasicWebLinkedServiceTypeProperties
@@ -1277,14 +1322,19 @@ type CassandraLinkedServiceTypeProperties = original.CassandraLinkedServiceTypeP
type CassandraSource = original.CassandraSource
type CassandraTableDataset = original.CassandraTableDataset
type CassandraTableDatasetTypeProperties = original.CassandraTableDatasetTypeProperties
+type ChainingTrigger = original.ChainingTrigger
+type ChainingTriggerTypeProperties = original.ChainingTriggerTypeProperties
type CloudError = original.CloudError
type CloudErrorBody = original.CloudErrorBody
+type CmdkeySetup = original.CmdkeySetup
+type CmdkeySetupTypeProperties = original.CmdkeySetupTypeProperties
type CommonDataServiceForAppsEntityDataset = original.CommonDataServiceForAppsEntityDataset
type CommonDataServiceForAppsEntityDatasetTypeProperties = original.CommonDataServiceForAppsEntityDatasetTypeProperties
type CommonDataServiceForAppsLinkedService = original.CommonDataServiceForAppsLinkedService
type CommonDataServiceForAppsLinkedServiceTypeProperties = original.CommonDataServiceForAppsLinkedServiceTypeProperties
type CommonDataServiceForAppsSink = original.CommonDataServiceForAppsSink
type CommonDataServiceForAppsSource = original.CommonDataServiceForAppsSource
+type ComponentSetup = original.ComponentSetup
type ConcurLinkedService = original.ConcurLinkedService
type ConcurLinkedServiceTypeProperties = original.ConcurLinkedServiceTypeProperties
type ConcurObjectDataset = original.ConcurObjectDataset
@@ -1302,10 +1352,16 @@ type CosmosDbMongoDbAPILinkedService = original.CosmosDbMongoDbAPILinkedService
type CosmosDbMongoDbAPILinkedServiceTypeProperties = original.CosmosDbMongoDbAPILinkedServiceTypeProperties
type CosmosDbMongoDbAPISink = original.CosmosDbMongoDbAPISink
type CosmosDbMongoDbAPISource = original.CosmosDbMongoDbAPISource
+type CosmosDbSQLAPICollectionDataset = original.CosmosDbSQLAPICollectionDataset
+type CosmosDbSQLAPICollectionDatasetTypeProperties = original.CosmosDbSQLAPICollectionDatasetTypeProperties
+type CosmosDbSQLAPISink = original.CosmosDbSQLAPISink
+type CosmosDbSQLAPISource = original.CosmosDbSQLAPISource
type CouchbaseLinkedService = original.CouchbaseLinkedService
type CouchbaseLinkedServiceTypeProperties = original.CouchbaseLinkedServiceTypeProperties
type CouchbaseSource = original.CouchbaseSource
type CouchbaseTableDataset = original.CouchbaseTableDataset
+type CreateDataFlowDebugSessionRequest = original.CreateDataFlowDebugSessionRequest
+type CreateDataFlowDebugSessionResponse = original.CreateDataFlowDebugSessionResponse
type CreateLinkedIntegrationRuntimeRequest = original.CreateLinkedIntegrationRuntimeRequest
type CreateRunResponse = original.CreateRunResponse
type CustomActivity = original.CustomActivity
@@ -1313,6 +1369,28 @@ type CustomActivityReferenceObject = original.CustomActivityReferenceObject
type CustomActivityTypeProperties = original.CustomActivityTypeProperties
type CustomDataSourceLinkedService = original.CustomDataSourceLinkedService
type CustomDataset = original.CustomDataset
+type CustomSetupBase = original.CustomSetupBase
+type DataFlow = original.DataFlow
+type DataFlowDebugCommandPayload = original.DataFlowDebugCommandPayload
+type DataFlowDebugCommandRequest = original.DataFlowDebugCommandRequest
+type DataFlowDebugCommandResponse = original.DataFlowDebugCommandResponse
+type DataFlowDebugPackage = original.DataFlowDebugPackage
+type DataFlowDebugPackageDebugSettings = original.DataFlowDebugPackageDebugSettings
+type DataFlowDebugSessionClient = original.DataFlowDebugSessionClient
+type DataFlowDebugSessionCreateFuture = original.DataFlowDebugSessionCreateFuture
+type DataFlowDebugSessionExecuteCommandFuture = original.DataFlowDebugSessionExecuteCommandFuture
+type DataFlowDebugSessionInfo = original.DataFlowDebugSessionInfo
+type DataFlowFolder = original.DataFlowFolder
+type DataFlowListResponse = original.DataFlowListResponse
+type DataFlowListResponseIterator = original.DataFlowListResponseIterator
+type DataFlowListResponsePage = original.DataFlowListResponsePage
+type DataFlowReference = original.DataFlowReference
+type DataFlowResource = original.DataFlowResource
+type DataFlowSink = original.DataFlowSink
+type DataFlowSource = original.DataFlowSource
+type DataFlowSourceSetting = original.DataFlowSourceSetting
+type DataFlowStagingInfo = original.DataFlowStagingInfo
+type DataFlowsClient = original.DataFlowsClient
type DataLakeAnalyticsUSQLActivity = original.DataLakeAnalyticsUSQLActivity
type DataLakeAnalyticsUSQLActivityTypeProperties = original.DataLakeAnalyticsUSQLActivityTypeProperties
type DatabricksNotebookActivity = original.DatabricksNotebookActivity
@@ -1343,6 +1421,7 @@ type Db2TableDataset = original.Db2TableDataset
type Db2TableDatasetTypeProperties = original.Db2TableDatasetTypeProperties
type DeleteActivity = original.DeleteActivity
type DeleteActivityTypeProperties = original.DeleteActivityTypeProperties
+type DeleteDataFlowDebugSessionRequest = original.DeleteDataFlowDebugSessionRequest
type DelimitedTextDataset = original.DelimitedTextDataset
type DelimitedTextDatasetTypeProperties = original.DelimitedTextDatasetTypeProperties
type DelimitedTextReadSettings = original.DelimitedTextReadSettings
@@ -1382,6 +1461,10 @@ type EloquaLinkedServiceTypeProperties = original.EloquaLinkedServiceTypePropert
type EloquaObjectDataset = original.EloquaObjectDataset
type EloquaSource = original.EloquaSource
type EntityReference = original.EntityReference
+type EnvironmentVariableSetup = original.EnvironmentVariableSetup
+type EnvironmentVariableSetupTypeProperties = original.EnvironmentVariableSetupTypeProperties
+type ExecuteDataFlowActivity = original.ExecuteDataFlowActivity
+type ExecuteDataFlowActivityTypeProperties = original.ExecuteDataFlowActivityTypeProperties
type ExecutePipelineActivity = original.ExecutePipelineActivity
type ExecutePipelineActivityTypeProperties = original.ExecutePipelineActivityTypeProperties
type ExecuteSSISPackageActivity = original.ExecuteSSISPackageActivity
@@ -1423,6 +1506,7 @@ type FtpServerLinkedService = original.FtpServerLinkedService
type FtpServerLinkedServiceTypeProperties = original.FtpServerLinkedServiceTypeProperties
type FtpServerLocation = original.FtpServerLocation
type GenericDatasetTypeProperties = original.GenericDatasetTypeProperties
+type GetDataFactoryOperationStatusResponse = original.GetDataFactoryOperationStatusResponse
type GetMetadataActivity = original.GetMetadataActivity
type GetMetadataActivityTypeProperties = original.GetMetadataActivityTypeProperties
type GetSsisObjectMetadataRequest = original.GetSsisObjectMetadataRequest
@@ -1499,6 +1583,7 @@ type IntegrationRuntimeAuthKeys = original.IntegrationRuntimeAuthKeys
type IntegrationRuntimeComputeProperties = original.IntegrationRuntimeComputeProperties
type IntegrationRuntimeConnectionInfo = original.IntegrationRuntimeConnectionInfo
type IntegrationRuntimeCustomSetupScriptProperties = original.IntegrationRuntimeCustomSetupScriptProperties
+type IntegrationRuntimeDataFlowProperties = original.IntegrationRuntimeDataFlowProperties
type IntegrationRuntimeDataProxyProperties = original.IntegrationRuntimeDataProxyProperties
type IntegrationRuntimeListResponse = original.IntegrationRuntimeListResponse
type IntegrationRuntimeListResponseIterator = original.IntegrationRuntimeListResponseIterator
@@ -1531,6 +1616,7 @@ type JiraLinkedService = original.JiraLinkedService
type JiraLinkedServiceTypeProperties = original.JiraLinkedServiceTypeProperties
type JiraObjectDataset = original.JiraObjectDataset
type JiraSource = original.JiraSource
+type LicensedComponentSetupTypeProperties = original.LicensedComponentSetupTypeProperties
type LinkedIntegrationRuntime = original.LinkedIntegrationRuntime
type LinkedIntegrationRuntimeKeyAuthorization = original.LinkedIntegrationRuntimeKeyAuthorization
type LinkedIntegrationRuntimeRbacAuthorization = original.LinkedIntegrationRuntimeRbacAuthorization
@@ -1557,6 +1643,8 @@ type ManagedIntegrationRuntimeOperationResult = original.ManagedIntegrationRunti
type ManagedIntegrationRuntimeStatus = original.ManagedIntegrationRuntimeStatus
type ManagedIntegrationRuntimeStatusTypeProperties = original.ManagedIntegrationRuntimeStatusTypeProperties
type ManagedIntegrationRuntimeTypeProperties = original.ManagedIntegrationRuntimeTypeProperties
+type MappingDataFlow = original.MappingDataFlow
+type MappingDataFlowTypeProperties = original.MappingDataFlowTypeProperties
type MariaDBLinkedService = original.MariaDBLinkedService
type MariaDBLinkedServiceTypeProperties = original.MariaDBLinkedServiceTypeProperties
type MariaDBSource = original.MariaDBSource
@@ -1633,7 +1721,11 @@ type OracleSink = original.OracleSink
type OracleSource = original.OracleSource
type OracleTableDataset = original.OracleTableDataset
type OracleTableDatasetTypeProperties = original.OracleTableDatasetTypeProperties
+type OrcDataset = original.OrcDataset
+type OrcDatasetTypeProperties = original.OrcDatasetTypeProperties
type OrcFormat = original.OrcFormat
+type OrcSink = original.OrcSink
+type OrcSource = original.OrcSource
type ParameterSpecification = original.ParameterSpecification
type ParquetDataset = original.ParquetDataset
type ParquetDatasetTypeProperties = original.ParquetDatasetTypeProperties
@@ -1672,6 +1764,9 @@ type PrestoLinkedService = original.PrestoLinkedService
type PrestoLinkedServiceTypeProperties = original.PrestoLinkedServiceTypeProperties
type PrestoObjectDataset = original.PrestoObjectDataset
type PrestoSource = original.PrestoSource
+type QueryDataFlowDebugSessionsResponse = original.QueryDataFlowDebugSessionsResponse
+type QueryDataFlowDebugSessionsResponseIterator = original.QueryDataFlowDebugSessionsResponseIterator
+type QueryDataFlowDebugSessionsResponsePage = original.QueryDataFlowDebugSessionsResponsePage
type QuickBooksLinkedService = original.QuickBooksLinkedService
type QuickBooksLinkedServiceTypeProperties = original.QuickBooksLinkedServiceTypeProperties
type QuickBooksObjectDataset = original.QuickBooksObjectDataset
@@ -1832,6 +1927,7 @@ type SybaseLinkedServiceTypeProperties = original.SybaseLinkedServiceTypePropert
type SybaseSource = original.SybaseSource
type SybaseTableDataset = original.SybaseTableDataset
type SybaseTableDatasetTypeProperties = original.SybaseTableDatasetTypeProperties
+type TabularSource = original.TabularSource
type TeradataLinkedService = original.TeradataLinkedService
type TeradataLinkedServiceTypeProperties = original.TeradataLinkedServiceTypeProperties
type TeradataPartitionSettings = original.TeradataPartitionSettings
@@ -1839,6 +1935,7 @@ type TeradataSource = original.TeradataSource
type TeradataTableDataset = original.TeradataTableDataset
type TeradataTableDatasetTypeProperties = original.TeradataTableDatasetTypeProperties
type TextFormat = original.TextFormat
+type Transformation = original.Transformation
type Trigger = original.Trigger
type TriggerDependencyReference = original.TriggerDependencyReference
type TriggerListResponse = original.TriggerListResponse
@@ -1906,6 +2003,24 @@ func NewActivityRunsClient(subscriptionID string) ActivityRunsClient {
func NewActivityRunsClientWithBaseURI(baseURI string, subscriptionID string) ActivityRunsClient {
return original.NewActivityRunsClientWithBaseURI(baseURI, subscriptionID)
}
+func NewDataFlowDebugSessionClient(subscriptionID string) DataFlowDebugSessionClient {
+ return original.NewDataFlowDebugSessionClient(subscriptionID)
+}
+func NewDataFlowDebugSessionClientWithBaseURI(baseURI string, subscriptionID string) DataFlowDebugSessionClient {
+ return original.NewDataFlowDebugSessionClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewDataFlowListResponseIterator(page DataFlowListResponsePage) DataFlowListResponseIterator {
+ return original.NewDataFlowListResponseIterator(page)
+}
+func NewDataFlowListResponsePage(getNextPage func(context.Context, DataFlowListResponse) (DataFlowListResponse, error)) DataFlowListResponsePage {
+ return original.NewDataFlowListResponsePage(getNextPage)
+}
+func NewDataFlowsClient(subscriptionID string) DataFlowsClient {
+ return original.NewDataFlowsClient(subscriptionID)
+}
+func NewDataFlowsClientWithBaseURI(baseURI string, subscriptionID string) DataFlowsClient {
+ return original.NewDataFlowsClientWithBaseURI(baseURI, subscriptionID)
+}
func NewDatasetListResponseIterator(page DatasetListResponsePage) DatasetListResponseIterator {
return original.NewDatasetListResponseIterator(page)
}
@@ -2002,6 +2117,12 @@ func NewPipelinesClient(subscriptionID string) PipelinesClient {
func NewPipelinesClientWithBaseURI(baseURI string, subscriptionID string) PipelinesClient {
return original.NewPipelinesClientWithBaseURI(baseURI, subscriptionID)
}
+func NewQueryDataFlowDebugSessionsResponseIterator(page QueryDataFlowDebugSessionsResponsePage) QueryDataFlowDebugSessionsResponseIterator {
+ return original.NewQueryDataFlowDebugSessionsResponseIterator(page)
+}
+func NewQueryDataFlowDebugSessionsResponsePage(getNextPage func(context.Context, QueryDataFlowDebugSessionsResponse) (QueryDataFlowDebugSessionsResponse, error)) QueryDataFlowDebugSessionsResponsePage {
+ return original.NewQueryDataFlowDebugSessionsResponsePage(getNextPage)
+}
func NewRerunTriggerListResponseIterator(page RerunTriggerListResponsePage) RerunTriggerListResponseIterator {
return original.NewRerunTriggerListResponseIterator(page)
}
@@ -2056,6 +2177,12 @@ func PossibleBlobEventTypesValues() []BlobEventTypes {
func PossibleCassandraSourceReadConsistencyLevelsValues() []CassandraSourceReadConsistencyLevels {
return original.PossibleCassandraSourceReadConsistencyLevelsValues()
}
+func PossibleDataFlowComputeTypeValues() []DataFlowComputeType {
+ return original.PossibleDataFlowComputeTypeValues()
+}
+func PossibleDataFlowDebugCommandTypeValues() []DataFlowDebugCommandType {
+ return original.PossibleDataFlowDebugCommandTypeValues()
+}
func PossibleDayOfWeekValues() []DayOfWeek {
return original.PossibleDayOfWeekValues()
}
@@ -2257,6 +2384,12 @@ func PossibleTypeBasicCopySinkValues() []TypeBasicCopySink {
func PossibleTypeBasicCopySourceValues() []TypeBasicCopySource {
return original.PossibleTypeBasicCopySourceValues()
}
+func PossibleTypeBasicCustomSetupBaseValues() []TypeBasicCustomSetupBase {
+ return original.PossibleTypeBasicCustomSetupBaseValues()
+}
+func PossibleTypeBasicDataFlowValues() []TypeBasicDataFlow {
+ return original.PossibleTypeBasicDataFlowValues()
+}
func PossibleTypeBasicDatasetCompressionValues() []TypeBasicDatasetCompression {
return original.PossibleTypeBasicDatasetCompressionValues()
}
diff --git a/profiles/preview/eventgrid/eventgrid/models.go b/profiles/preview/eventgrid/eventgrid/models.go
index bbf6b0545a9a..74269b8b100a 100644
--- a/profiles/preview/eventgrid/eventgrid/models.go
+++ b/profiles/preview/eventgrid/eventgrid/models.go
@@ -102,6 +102,15 @@ type IotHubDeviceCreatedEventData = original.IotHubDeviceCreatedEventData
type IotHubDeviceDeletedEventData = original.IotHubDeviceDeletedEventData
type IotHubDeviceDisconnectedEventData = original.IotHubDeviceDisconnectedEventData
type IotHubDeviceTelemetryEventData = original.IotHubDeviceTelemetryEventData
+type KeyVaultCertificateExpiredEventData = original.KeyVaultCertificateExpiredEventData
+type KeyVaultCertificateNearExpiryEventData = original.KeyVaultCertificateNearExpiryEventData
+type KeyVaultCertificateNewVersionCreatedEventData = original.KeyVaultCertificateNewVersionCreatedEventData
+type KeyVaultKeyExpiredEventData = original.KeyVaultKeyExpiredEventData
+type KeyVaultKeyNearExpiryEventData = original.KeyVaultKeyNearExpiryEventData
+type KeyVaultKeyNewVersionCreatedEventData = original.KeyVaultKeyNewVersionCreatedEventData
+type KeyVaultSecretExpiredEventData = original.KeyVaultSecretExpiredEventData
+type KeyVaultSecretNearExpiryEventData = original.KeyVaultSecretNearExpiryEventData
+type KeyVaultSecretNewVersionCreatedEventData = original.KeyVaultSecretNewVersionCreatedEventData
type MapsGeofenceEnteredEventData = original.MapsGeofenceEnteredEventData
type MapsGeofenceEventProperties = original.MapsGeofenceEventProperties
type MapsGeofenceExitedEventData = original.MapsGeofenceExitedEventData
diff --git a/profiles/preview/eventhub/mgmt/eventhub/models.go b/profiles/preview/eventhub/mgmt/eventhub/models.go
index ea5dbb5867e7..47ba92e0dbf1 100644
--- a/profiles/preview/eventhub/mgmt/eventhub/models.go
+++ b/profiles/preview/eventhub/mgmt/eventhub/models.go
@@ -167,6 +167,9 @@ type NamespacesClient = original.NamespacesClient
type NamespacesCreateOrUpdateFuture = original.NamespacesCreateOrUpdateFuture
type NamespacesDeleteFuture = original.NamespacesDeleteFuture
type NetworkRuleSet = original.NetworkRuleSet
+type NetworkRuleSetListResult = original.NetworkRuleSetListResult
+type NetworkRuleSetListResultIterator = original.NetworkRuleSetListResultIterator
+type NetworkRuleSetListResultPage = original.NetworkRuleSetListResultPage
type NetworkRuleSetProperties = original.NetworkRuleSetProperties
type Operation = original.Operation
type OperationDisplay = original.OperationDisplay
@@ -245,6 +248,12 @@ func NewNamespacesClient(subscriptionID string) NamespacesClient {
func NewNamespacesClientWithBaseURI(baseURI string, subscriptionID string) NamespacesClient {
return original.NewNamespacesClientWithBaseURI(baseURI, subscriptionID)
}
+func NewNetworkRuleSetListResultIterator(page NetworkRuleSetListResultPage) NetworkRuleSetListResultIterator {
+ return original.NewNetworkRuleSetListResultIterator(page)
+}
+func NewNetworkRuleSetListResultPage(getNextPage func(context.Context, NetworkRuleSetListResult) (NetworkRuleSetListResult, error)) NetworkRuleSetListResultPage {
+ return original.NewNetworkRuleSetListResultPage(getNextPage)
+}
func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
return original.NewOperationListResultIterator(page)
}
diff --git a/profiles/preview/cognitiveservices/anomalyfinder/anomalyfinderapi/models.go b/profiles/preview/frontdoor/mgmt/frontdoor/frontdoorapi/models.go
similarity index 63%
rename from profiles/preview/cognitiveservices/anomalyfinder/anomalyfinderapi/models.go
rename to profiles/preview/frontdoor/mgmt/frontdoor/frontdoorapi/models.go
index 497b8771a7f0..08954a3ee34d 100644
--- a/profiles/preview/cognitiveservices/anomalyfinder/anomalyfinderapi/models.go
+++ b/profiles/preview/frontdoor/mgmt/frontdoor/frontdoorapi/models.go
@@ -17,8 +17,13 @@
// This code was auto-generated by:
// github.com/Azure/azure-sdk-for-go/tools/profileBuilder
-package anomalyfinderapi
+package frontdoorapi
-import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/anomalyfinder/anomalyfinderapi"
+import original "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-05-01/frontdoor/frontdoorapi"
type BaseClientAPI = original.BaseClientAPI
+type EndpointsClientAPI = original.EndpointsClientAPI
+type FrontDoorsClientAPI = original.FrontDoorsClientAPI
+type FrontendEndpointsClientAPI = original.FrontendEndpointsClientAPI
+type ManagedRuleSetsClientAPI = original.ManagedRuleSetsClientAPI
+type PoliciesClientAPI = original.PoliciesClientAPI
diff --git a/profiles/preview/frontdoor/mgmt/frontdoor/models.go b/profiles/preview/frontdoor/mgmt/frontdoor/models.go
new file mode 100644
index 000000000000..b2c48ed85c7f
--- /dev/null
+++ b/profiles/preview/frontdoor/mgmt/frontdoor/models.go
@@ -0,0 +1,561 @@
+// +build go1.9
+
+// Copyright 2019 Microsoft Corporation
+//
+// 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.
+
+// This code was auto-generated by:
+// github.com/Azure/azure-sdk-for-go/tools/profileBuilder
+
+package frontdoor
+
+import (
+ "context"
+
+ original "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-05-01/frontdoor"
+)
+
+const (
+ DefaultBaseURI = original.DefaultBaseURI
+)
+
+type ActionType = original.ActionType
+
+const (
+ Allow ActionType = original.Allow
+ Block ActionType = original.Block
+ Log ActionType = original.Log
+ Redirect ActionType = original.Redirect
+)
+
+type Availability = original.Availability
+
+const (
+ Available Availability = original.Available
+ Unavailable Availability = original.Unavailable
+)
+
+type BackendEnabledState = original.BackendEnabledState
+
+const (
+ Disabled BackendEnabledState = original.Disabled
+ Enabled BackendEnabledState = original.Enabled
+)
+
+type CertificateSource = original.CertificateSource
+
+const (
+ CertificateSourceAzureKeyVault CertificateSource = original.CertificateSourceAzureKeyVault
+ CertificateSourceFrontDoor CertificateSource = original.CertificateSourceFrontDoor
+)
+
+type CertificateType = original.CertificateType
+
+const (
+ Dedicated CertificateType = original.Dedicated
+)
+
+type CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningState
+
+const (
+ CustomHTTPSProvisioningStateDisabled CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningStateDisabled
+ CustomHTTPSProvisioningStateDisabling CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningStateDisabling
+ CustomHTTPSProvisioningStateEnabled CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningStateEnabled
+ CustomHTTPSProvisioningStateEnabling CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningStateEnabling
+ CustomHTTPSProvisioningStateFailed CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningStateFailed
+)
+
+type CustomHTTPSProvisioningSubstate = original.CustomHTTPSProvisioningSubstate
+
+const (
+ CertificateDeleted CustomHTTPSProvisioningSubstate = original.CertificateDeleted
+ CertificateDeployed CustomHTTPSProvisioningSubstate = original.CertificateDeployed
+ DeletingCertificate CustomHTTPSProvisioningSubstate = original.DeletingCertificate
+ DeployingCertificate CustomHTTPSProvisioningSubstate = original.DeployingCertificate
+ DomainControlValidationRequestApproved CustomHTTPSProvisioningSubstate = original.DomainControlValidationRequestApproved
+ DomainControlValidationRequestRejected CustomHTTPSProvisioningSubstate = original.DomainControlValidationRequestRejected
+ DomainControlValidationRequestTimedOut CustomHTTPSProvisioningSubstate = original.DomainControlValidationRequestTimedOut
+ IssuingCertificate CustomHTTPSProvisioningSubstate = original.IssuingCertificate
+ PendingDomainControlValidationREquestApproval CustomHTTPSProvisioningSubstate = original.PendingDomainControlValidationREquestApproval
+ SubmittingDomainControlValidationRequest CustomHTTPSProvisioningSubstate = original.SubmittingDomainControlValidationRequest
+)
+
+type CustomRuleEnabledState = original.CustomRuleEnabledState
+
+const (
+ CustomRuleEnabledStateDisabled CustomRuleEnabledState = original.CustomRuleEnabledStateDisabled
+ CustomRuleEnabledStateEnabled CustomRuleEnabledState = original.CustomRuleEnabledStateEnabled
+)
+
+type DynamicCompressionEnabled = original.DynamicCompressionEnabled
+
+const (
+ DynamicCompressionEnabledDisabled DynamicCompressionEnabled = original.DynamicCompressionEnabledDisabled
+ DynamicCompressionEnabledEnabled DynamicCompressionEnabled = original.DynamicCompressionEnabledEnabled
+)
+
+type EnabledState = original.EnabledState
+
+const (
+ EnabledStateDisabled EnabledState = original.EnabledStateDisabled
+ EnabledStateEnabled EnabledState = original.EnabledStateEnabled
+)
+
+type EnforceCertificateNameCheckEnabledState = original.EnforceCertificateNameCheckEnabledState
+
+const (
+ EnforceCertificateNameCheckEnabledStateDisabled EnforceCertificateNameCheckEnabledState = original.EnforceCertificateNameCheckEnabledStateDisabled
+ EnforceCertificateNameCheckEnabledStateEnabled EnforceCertificateNameCheckEnabledState = original.EnforceCertificateNameCheckEnabledStateEnabled
+)
+
+type ForwardingProtocol = original.ForwardingProtocol
+
+const (
+ HTTPOnly ForwardingProtocol = original.HTTPOnly
+ HTTPSOnly ForwardingProtocol = original.HTTPSOnly
+ MatchRequest ForwardingProtocol = original.MatchRequest
+)
+
+type HealthProbeEnabled = original.HealthProbeEnabled
+
+const (
+ HealthProbeEnabledDisabled HealthProbeEnabled = original.HealthProbeEnabledDisabled
+ HealthProbeEnabledEnabled HealthProbeEnabled = original.HealthProbeEnabledEnabled
+)
+
+type HealthProbeMethod = original.HealthProbeMethod
+
+const (
+ GET HealthProbeMethod = original.GET
+ HEAD HealthProbeMethod = original.HEAD
+)
+
+type ManagedRuleEnabledState = original.ManagedRuleEnabledState
+
+const (
+ ManagedRuleEnabledStateDisabled ManagedRuleEnabledState = original.ManagedRuleEnabledStateDisabled
+ ManagedRuleEnabledStateEnabled ManagedRuleEnabledState = original.ManagedRuleEnabledStateEnabled
+)
+
+type MatchVariable = original.MatchVariable
+
+const (
+ Cookies MatchVariable = original.Cookies
+ PostArgs MatchVariable = original.PostArgs
+ QueryString MatchVariable = original.QueryString
+ RemoteAddr MatchVariable = original.RemoteAddr
+ RequestBody MatchVariable = original.RequestBody
+ RequestHeader MatchVariable = original.RequestHeader
+ RequestMethod MatchVariable = original.RequestMethod
+ RequestURI MatchVariable = original.RequestURI
+ SocketAddr MatchVariable = original.SocketAddr
+)
+
+type MinimumTLSVersion = original.MinimumTLSVersion
+
+const (
+ OneFullStopTwo MinimumTLSVersion = original.OneFullStopTwo
+ OneFullStopZero MinimumTLSVersion = original.OneFullStopZero
+)
+
+type NetworkOperationStatus = original.NetworkOperationStatus
+
+const (
+ Failed NetworkOperationStatus = original.Failed
+ InProgress NetworkOperationStatus = original.InProgress
+ Succeeded NetworkOperationStatus = original.Succeeded
+)
+
+type OdataType = original.OdataType
+
+const (
+ OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration OdataType = original.OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration
+ OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration OdataType = original.OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration
+ OdataTypeRouteConfiguration OdataType = original.OdataTypeRouteConfiguration
+)
+
+type Operator = original.Operator
+
+const (
+ Any Operator = original.Any
+ BeginsWith Operator = original.BeginsWith
+ Contains Operator = original.Contains
+ EndsWith Operator = original.EndsWith
+ Equal Operator = original.Equal
+ GeoMatch Operator = original.GeoMatch
+ GreaterThan Operator = original.GreaterThan
+ GreaterThanOrEqual Operator = original.GreaterThanOrEqual
+ IPMatch Operator = original.IPMatch
+ LessThan Operator = original.LessThan
+ LessThanOrEqual Operator = original.LessThanOrEqual
+ RegEx Operator = original.RegEx
+)
+
+type PolicyEnabledState = original.PolicyEnabledState
+
+const (
+ PolicyEnabledStateDisabled PolicyEnabledState = original.PolicyEnabledStateDisabled
+ PolicyEnabledStateEnabled PolicyEnabledState = original.PolicyEnabledStateEnabled
+)
+
+type PolicyMode = original.PolicyMode
+
+const (
+ Detection PolicyMode = original.Detection
+ Prevention PolicyMode = original.Prevention
+)
+
+type PolicyResourceState = original.PolicyResourceState
+
+const (
+ PolicyResourceStateCreating PolicyResourceState = original.PolicyResourceStateCreating
+ PolicyResourceStateDeleting PolicyResourceState = original.PolicyResourceStateDeleting
+ PolicyResourceStateDisabled PolicyResourceState = original.PolicyResourceStateDisabled
+ PolicyResourceStateDisabling PolicyResourceState = original.PolicyResourceStateDisabling
+ PolicyResourceStateEnabled PolicyResourceState = original.PolicyResourceStateEnabled
+ PolicyResourceStateEnabling PolicyResourceState = original.PolicyResourceStateEnabling
+)
+
+type Protocol = original.Protocol
+
+const (
+ HTTP Protocol = original.HTTP
+ HTTPS Protocol = original.HTTPS
+)
+
+type Query = original.Query
+
+const (
+ StripAll Query = original.StripAll
+ StripNone Query = original.StripNone
+)
+
+type RedirectProtocol = original.RedirectProtocol
+
+const (
+ RedirectProtocolHTTPOnly RedirectProtocol = original.RedirectProtocolHTTPOnly
+ RedirectProtocolHTTPSOnly RedirectProtocol = original.RedirectProtocolHTTPSOnly
+ RedirectProtocolMatchRequest RedirectProtocol = original.RedirectProtocolMatchRequest
+)
+
+type RedirectType = original.RedirectType
+
+const (
+ Found RedirectType = original.Found
+ Moved RedirectType = original.Moved
+ PermanentRedirect RedirectType = original.PermanentRedirect
+ TemporaryRedirect RedirectType = original.TemporaryRedirect
+)
+
+type ResourceState = original.ResourceState
+
+const (
+ ResourceStateCreating ResourceState = original.ResourceStateCreating
+ ResourceStateDeleting ResourceState = original.ResourceStateDeleting
+ ResourceStateDisabled ResourceState = original.ResourceStateDisabled
+ ResourceStateDisabling ResourceState = original.ResourceStateDisabling
+ ResourceStateEnabled ResourceState = original.ResourceStateEnabled
+ ResourceStateEnabling ResourceState = original.ResourceStateEnabling
+)
+
+type ResourceType = original.ResourceType
+
+const (
+ MicrosoftNetworkfrontDoors ResourceType = original.MicrosoftNetworkfrontDoors
+ MicrosoftNetworkfrontDoorsfrontendEndpoints ResourceType = original.MicrosoftNetworkfrontDoorsfrontendEndpoints
+)
+
+type RoutingRuleEnabledState = original.RoutingRuleEnabledState
+
+const (
+ RoutingRuleEnabledStateDisabled RoutingRuleEnabledState = original.RoutingRuleEnabledStateDisabled
+ RoutingRuleEnabledStateEnabled RoutingRuleEnabledState = original.RoutingRuleEnabledStateEnabled
+)
+
+type RuleType = original.RuleType
+
+const (
+ MatchRule RuleType = original.MatchRule
+ RateLimitRule RuleType = original.RateLimitRule
+)
+
+type SessionAffinityEnabledState = original.SessionAffinityEnabledState
+
+const (
+ SessionAffinityEnabledStateDisabled SessionAffinityEnabledState = original.SessionAffinityEnabledStateDisabled
+ SessionAffinityEnabledStateEnabled SessionAffinityEnabledState = original.SessionAffinityEnabledStateEnabled
+)
+
+type TransformType = original.TransformType
+
+const (
+ Lowercase TransformType = original.Lowercase
+ RemoveNulls TransformType = original.RemoveNulls
+ Trim TransformType = original.Trim
+ Uppercase TransformType = original.Uppercase
+ URLDecode TransformType = original.URLDecode
+ URLEncode TransformType = original.URLEncode
+)
+
+type AzureAsyncOperationResult = original.AzureAsyncOperationResult
+type Backend = original.Backend
+type BackendPool = original.BackendPool
+type BackendPoolListResult = original.BackendPoolListResult
+type BackendPoolProperties = original.BackendPoolProperties
+type BackendPoolUpdateParameters = original.BackendPoolUpdateParameters
+type BackendPoolsSettings = original.BackendPoolsSettings
+type BaseClient = original.BaseClient
+type BasicRouteConfiguration = original.BasicRouteConfiguration
+type CacheConfiguration = original.CacheConfiguration
+type CertificateSourceParameters = original.CertificateSourceParameters
+type CheckNameAvailabilityInput = original.CheckNameAvailabilityInput
+type CheckNameAvailabilityOutput = original.CheckNameAvailabilityOutput
+type CustomHTTPSConfiguration = original.CustomHTTPSConfiguration
+type CustomRule = original.CustomRule
+type CustomRuleList = original.CustomRuleList
+type EndpointsClient = original.EndpointsClient
+type EndpointsPurgeContentFuture = original.EndpointsPurgeContentFuture
+type Error = original.Error
+type ErrorDetails = original.ErrorDetails
+type ErrorResponse = original.ErrorResponse
+type ForwardingConfiguration = original.ForwardingConfiguration
+type FrontDoor = original.FrontDoor
+type FrontDoorsClient = original.FrontDoorsClient
+type FrontDoorsCreateOrUpdateFutureType = original.FrontDoorsCreateOrUpdateFutureType
+type FrontDoorsDeleteFutureType = original.FrontDoorsDeleteFutureType
+type FrontendEndpoint = original.FrontendEndpoint
+type FrontendEndpointLink = original.FrontendEndpointLink
+type FrontendEndpointProperties = original.FrontendEndpointProperties
+type FrontendEndpointUpdateParameters = original.FrontendEndpointUpdateParameters
+type FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink = original.FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink
+type FrontendEndpointsClient = original.FrontendEndpointsClient
+type FrontendEndpointsDisableHTTPSFuture = original.FrontendEndpointsDisableHTTPSFuture
+type FrontendEndpointsEnableHTTPSFuture = original.FrontendEndpointsEnableHTTPSFuture
+type FrontendEndpointsListResult = original.FrontendEndpointsListResult
+type FrontendEndpointsListResultIterator = original.FrontendEndpointsListResultIterator
+type FrontendEndpointsListResultPage = original.FrontendEndpointsListResultPage
+type HealthProbeSettingsListResult = original.HealthProbeSettingsListResult
+type HealthProbeSettingsModel = original.HealthProbeSettingsModel
+type HealthProbeSettingsProperties = original.HealthProbeSettingsProperties
+type HealthProbeSettingsUpdateParameters = original.HealthProbeSettingsUpdateParameters
+type KeyVaultCertificateSourceParameters = original.KeyVaultCertificateSourceParameters
+type KeyVaultCertificateSourceParametersVault = original.KeyVaultCertificateSourceParametersVault
+type ListResult = original.ListResult
+type ListResultIterator = original.ListResultIterator
+type ListResultPage = original.ListResultPage
+type LoadBalancingSettingsListResult = original.LoadBalancingSettingsListResult
+type LoadBalancingSettingsModel = original.LoadBalancingSettingsModel
+type LoadBalancingSettingsProperties = original.LoadBalancingSettingsProperties
+type LoadBalancingSettingsUpdateParameters = original.LoadBalancingSettingsUpdateParameters
+type ManagedRuleDefinition = original.ManagedRuleDefinition
+type ManagedRuleGroupDefinition = original.ManagedRuleGroupDefinition
+type ManagedRuleGroupOverride = original.ManagedRuleGroupOverride
+type ManagedRuleOverride = original.ManagedRuleOverride
+type ManagedRuleSet = original.ManagedRuleSet
+type ManagedRuleSetDefinition = original.ManagedRuleSetDefinition
+type ManagedRuleSetDefinitionList = original.ManagedRuleSetDefinitionList
+type ManagedRuleSetDefinitionListIterator = original.ManagedRuleSetDefinitionListIterator
+type ManagedRuleSetDefinitionListPage = original.ManagedRuleSetDefinitionListPage
+type ManagedRuleSetDefinitionProperties = original.ManagedRuleSetDefinitionProperties
+type ManagedRuleSetList = original.ManagedRuleSetList
+type ManagedRuleSetsClient = original.ManagedRuleSetsClient
+type MatchCondition = original.MatchCondition
+type PoliciesClient = original.PoliciesClient
+type PoliciesCreateOrUpdateFuture = original.PoliciesCreateOrUpdateFuture
+type PoliciesDeleteFuture = original.PoliciesDeleteFuture
+type PolicySettings = original.PolicySettings
+type Properties = original.Properties
+type PurgeParameters = original.PurgeParameters
+type RedirectConfiguration = original.RedirectConfiguration
+type Resource = original.Resource
+type RouteConfiguration = original.RouteConfiguration
+type RoutingRule = original.RoutingRule
+type RoutingRuleListResult = original.RoutingRuleListResult
+type RoutingRuleProperties = original.RoutingRuleProperties
+type RoutingRuleUpdateParameters = original.RoutingRuleUpdateParameters
+type SubResource = original.SubResource
+type TagsObject = original.TagsObject
+type UpdateParameters = original.UpdateParameters
+type ValidateCustomDomainInput = original.ValidateCustomDomainInput
+type ValidateCustomDomainOutput = original.ValidateCustomDomainOutput
+type WebApplicationFirewallPolicy = original.WebApplicationFirewallPolicy
+type WebApplicationFirewallPolicyList = original.WebApplicationFirewallPolicyList
+type WebApplicationFirewallPolicyListIterator = original.WebApplicationFirewallPolicyListIterator
+type WebApplicationFirewallPolicyListPage = original.WebApplicationFirewallPolicyListPage
+type WebApplicationFirewallPolicyProperties = original.WebApplicationFirewallPolicyProperties
+
+func New(subscriptionID string) BaseClient {
+ return original.New(subscriptionID)
+}
+func NewEndpointsClient(subscriptionID string) EndpointsClient {
+ return original.NewEndpointsClient(subscriptionID)
+}
+func NewEndpointsClientWithBaseURI(baseURI string, subscriptionID string) EndpointsClient {
+ return original.NewEndpointsClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewFrontDoorsClient(subscriptionID string) FrontDoorsClient {
+ return original.NewFrontDoorsClient(subscriptionID)
+}
+func NewFrontDoorsClientWithBaseURI(baseURI string, subscriptionID string) FrontDoorsClient {
+ return original.NewFrontDoorsClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewFrontendEndpointsClient(subscriptionID string) FrontendEndpointsClient {
+ return original.NewFrontendEndpointsClient(subscriptionID)
+}
+func NewFrontendEndpointsClientWithBaseURI(baseURI string, subscriptionID string) FrontendEndpointsClient {
+ return original.NewFrontendEndpointsClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewFrontendEndpointsListResultIterator(page FrontendEndpointsListResultPage) FrontendEndpointsListResultIterator {
+ return original.NewFrontendEndpointsListResultIterator(page)
+}
+func NewFrontendEndpointsListResultPage(getNextPage func(context.Context, FrontendEndpointsListResult) (FrontendEndpointsListResult, error)) FrontendEndpointsListResultPage {
+ return original.NewFrontendEndpointsListResultPage(getNextPage)
+}
+func NewListResultIterator(page ListResultPage) ListResultIterator {
+ return original.NewListResultIterator(page)
+}
+func NewListResultPage(getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage {
+ return original.NewListResultPage(getNextPage)
+}
+func NewManagedRuleSetDefinitionListIterator(page ManagedRuleSetDefinitionListPage) ManagedRuleSetDefinitionListIterator {
+ return original.NewManagedRuleSetDefinitionListIterator(page)
+}
+func NewManagedRuleSetDefinitionListPage(getNextPage func(context.Context, ManagedRuleSetDefinitionList) (ManagedRuleSetDefinitionList, error)) ManagedRuleSetDefinitionListPage {
+ return original.NewManagedRuleSetDefinitionListPage(getNextPage)
+}
+func NewManagedRuleSetsClient(subscriptionID string) ManagedRuleSetsClient {
+ return original.NewManagedRuleSetsClient(subscriptionID)
+}
+func NewManagedRuleSetsClientWithBaseURI(baseURI string, subscriptionID string) ManagedRuleSetsClient {
+ return original.NewManagedRuleSetsClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewPoliciesClient(subscriptionID string) PoliciesClient {
+ return original.NewPoliciesClient(subscriptionID)
+}
+func NewPoliciesClientWithBaseURI(baseURI string, subscriptionID string) PoliciesClient {
+ return original.NewPoliciesClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewWebApplicationFirewallPolicyListIterator(page WebApplicationFirewallPolicyListPage) WebApplicationFirewallPolicyListIterator {
+ return original.NewWebApplicationFirewallPolicyListIterator(page)
+}
+func NewWebApplicationFirewallPolicyListPage(getNextPage func(context.Context, WebApplicationFirewallPolicyList) (WebApplicationFirewallPolicyList, error)) WebApplicationFirewallPolicyListPage {
+ return original.NewWebApplicationFirewallPolicyListPage(getNextPage)
+}
+func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
+ return original.NewWithBaseURI(baseURI, subscriptionID)
+}
+func PossibleActionTypeValues() []ActionType {
+ return original.PossibleActionTypeValues()
+}
+func PossibleAvailabilityValues() []Availability {
+ return original.PossibleAvailabilityValues()
+}
+func PossibleBackendEnabledStateValues() []BackendEnabledState {
+ return original.PossibleBackendEnabledStateValues()
+}
+func PossibleCertificateSourceValues() []CertificateSource {
+ return original.PossibleCertificateSourceValues()
+}
+func PossibleCertificateTypeValues() []CertificateType {
+ return original.PossibleCertificateTypeValues()
+}
+func PossibleCustomHTTPSProvisioningStateValues() []CustomHTTPSProvisioningState {
+ return original.PossibleCustomHTTPSProvisioningStateValues()
+}
+func PossibleCustomHTTPSProvisioningSubstateValues() []CustomHTTPSProvisioningSubstate {
+ return original.PossibleCustomHTTPSProvisioningSubstateValues()
+}
+func PossibleCustomRuleEnabledStateValues() []CustomRuleEnabledState {
+ return original.PossibleCustomRuleEnabledStateValues()
+}
+func PossibleDynamicCompressionEnabledValues() []DynamicCompressionEnabled {
+ return original.PossibleDynamicCompressionEnabledValues()
+}
+func PossibleEnabledStateValues() []EnabledState {
+ return original.PossibleEnabledStateValues()
+}
+func PossibleEnforceCertificateNameCheckEnabledStateValues() []EnforceCertificateNameCheckEnabledState {
+ return original.PossibleEnforceCertificateNameCheckEnabledStateValues()
+}
+func PossibleForwardingProtocolValues() []ForwardingProtocol {
+ return original.PossibleForwardingProtocolValues()
+}
+func PossibleHealthProbeEnabledValues() []HealthProbeEnabled {
+ return original.PossibleHealthProbeEnabledValues()
+}
+func PossibleHealthProbeMethodValues() []HealthProbeMethod {
+ return original.PossibleHealthProbeMethodValues()
+}
+func PossibleManagedRuleEnabledStateValues() []ManagedRuleEnabledState {
+ return original.PossibleManagedRuleEnabledStateValues()
+}
+func PossibleMatchVariableValues() []MatchVariable {
+ return original.PossibleMatchVariableValues()
+}
+func PossibleMinimumTLSVersionValues() []MinimumTLSVersion {
+ return original.PossibleMinimumTLSVersionValues()
+}
+func PossibleNetworkOperationStatusValues() []NetworkOperationStatus {
+ return original.PossibleNetworkOperationStatusValues()
+}
+func PossibleOdataTypeValues() []OdataType {
+ return original.PossibleOdataTypeValues()
+}
+func PossibleOperatorValues() []Operator {
+ return original.PossibleOperatorValues()
+}
+func PossiblePolicyEnabledStateValues() []PolicyEnabledState {
+ return original.PossiblePolicyEnabledStateValues()
+}
+func PossiblePolicyModeValues() []PolicyMode {
+ return original.PossiblePolicyModeValues()
+}
+func PossiblePolicyResourceStateValues() []PolicyResourceState {
+ return original.PossiblePolicyResourceStateValues()
+}
+func PossibleProtocolValues() []Protocol {
+ return original.PossibleProtocolValues()
+}
+func PossibleQueryValues() []Query {
+ return original.PossibleQueryValues()
+}
+func PossibleRedirectProtocolValues() []RedirectProtocol {
+ return original.PossibleRedirectProtocolValues()
+}
+func PossibleRedirectTypeValues() []RedirectType {
+ return original.PossibleRedirectTypeValues()
+}
+func PossibleResourceStateValues() []ResourceState {
+ return original.PossibleResourceStateValues()
+}
+func PossibleResourceTypeValues() []ResourceType {
+ return original.PossibleResourceTypeValues()
+}
+func PossibleRoutingRuleEnabledStateValues() []RoutingRuleEnabledState {
+ return original.PossibleRoutingRuleEnabledStateValues()
+}
+func PossibleRuleTypeValues() []RuleType {
+ return original.PossibleRuleTypeValues()
+}
+func PossibleSessionAffinityEnabledStateValues() []SessionAffinityEnabledState {
+ return original.PossibleSessionAffinityEnabledStateValues()
+}
+func PossibleTransformTypeValues() []TransformType {
+ return original.PossibleTransformTypeValues()
+}
+func UserAgent() string {
+ return original.UserAgent() + " profiles/preview"
+}
+func Version() string {
+ return original.Version()
+}
diff --git a/profiles/preview/preview/machinelearning/mgmt/services/servicesapi/models.go b/profiles/preview/healthcareapis/mgmt/healthcareapis/healthcareapisapi/models.go
similarity index 72%
rename from profiles/preview/preview/machinelearning/mgmt/services/servicesapi/models.go
rename to profiles/preview/healthcareapis/mgmt/healthcareapis/healthcareapisapi/models.go
index 14f1fcfc2676..ebd9615bd1ab 100644
--- a/profiles/preview/preview/machinelearning/mgmt/services/servicesapi/models.go
+++ b/profiles/preview/healthcareapis/mgmt/healthcareapis/healthcareapisapi/models.go
@@ -17,10 +17,10 @@
// This code was auto-generated by:
// github.com/Azure/azure-sdk-for-go/tools/profileBuilder
-package servicesapi
+package healthcareapisapi
-import original "github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2018-03-01-preview/services/servicesapi"
+import original "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2019-09-16/healthcareapis/healthcareapisapi"
-type MachineLearningComputeClientAPI = original.MachineLearningComputeClientAPI
+type OperationResultsClientAPI = original.OperationResultsClientAPI
type OperationsClientAPI = original.OperationsClientAPI
-type WorkspacesClientAPI = original.WorkspacesClientAPI
+type ServicesClientAPI = original.ServicesClientAPI
diff --git a/profiles/preview/healthcareapis/mgmt/healthcareapis/models.go b/profiles/preview/healthcareapis/mgmt/healthcareapis/models.go
new file mode 100644
index 000000000000..13f5929787eb
--- /dev/null
+++ b/profiles/preview/healthcareapis/mgmt/healthcareapis/models.go
@@ -0,0 +1,154 @@
+// +build go1.9
+
+// Copyright 2019 Microsoft Corporation
+//
+// 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.
+
+// This code was auto-generated by:
+// github.com/Azure/azure-sdk-for-go/tools/profileBuilder
+
+package healthcareapis
+
+import (
+ "context"
+
+ original "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2019-09-16/healthcareapis"
+)
+
+const (
+ DefaultBaseURI = original.DefaultBaseURI
+)
+
+type Kind = original.Kind
+
+const (
+ Fhir Kind = original.Fhir
+ FhirR4 Kind = original.FhirR4
+ FhirStu3 Kind = original.FhirStu3
+)
+
+type OperationResultStatus = original.OperationResultStatus
+
+const (
+ Canceled OperationResultStatus = original.Canceled
+ Failed OperationResultStatus = original.Failed
+ Requested OperationResultStatus = original.Requested
+ Running OperationResultStatus = original.Running
+ Succeeded OperationResultStatus = original.Succeeded
+)
+
+type ProvisioningState = original.ProvisioningState
+
+const (
+ ProvisioningStateAccepted ProvisioningState = original.ProvisioningStateAccepted
+ ProvisioningStateCanceled ProvisioningState = original.ProvisioningStateCanceled
+ ProvisioningStateCreating ProvisioningState = original.ProvisioningStateCreating
+ ProvisioningStateDeleting ProvisioningState = original.ProvisioningStateDeleting
+ ProvisioningStateDeprovisioned ProvisioningState = original.ProvisioningStateDeprovisioned
+ ProvisioningStateFailed ProvisioningState = original.ProvisioningStateFailed
+ ProvisioningStateSucceeded ProvisioningState = original.ProvisioningStateSucceeded
+ ProvisioningStateUpdating ProvisioningState = original.ProvisioningStateUpdating
+ ProvisioningStateVerifying ProvisioningState = original.ProvisioningStateVerifying
+)
+
+type ServiceNameUnavailabilityReason = original.ServiceNameUnavailabilityReason
+
+const (
+ AlreadyExists ServiceNameUnavailabilityReason = original.AlreadyExists
+ Invalid ServiceNameUnavailabilityReason = original.Invalid
+)
+
+type BaseClient = original.BaseClient
+type CheckNameAvailabilityParameters = original.CheckNameAvailabilityParameters
+type ErrorDetails = original.ErrorDetails
+type ErrorDetailsInternal = original.ErrorDetailsInternal
+type Operation = original.Operation
+type OperationDisplay = original.OperationDisplay
+type OperationListResult = original.OperationListResult
+type OperationListResultIterator = original.OperationListResultIterator
+type OperationListResultPage = original.OperationListResultPage
+type OperationResultsClient = original.OperationResultsClient
+type OperationResultsDescription = original.OperationResultsDescription
+type OperationsClient = original.OperationsClient
+type Resource = original.Resource
+type ServiceAccessPolicyEntry = original.ServiceAccessPolicyEntry
+type ServiceAuthenticationConfigurationInfo = original.ServiceAuthenticationConfigurationInfo
+type ServiceCorsConfigurationInfo = original.ServiceCorsConfigurationInfo
+type ServiceCosmosDbConfigurationInfo = original.ServiceCosmosDbConfigurationInfo
+type ServicesClient = original.ServicesClient
+type ServicesCreateOrUpdateFuture = original.ServicesCreateOrUpdateFuture
+type ServicesDeleteFuture = original.ServicesDeleteFuture
+type ServicesDescription = original.ServicesDescription
+type ServicesDescriptionListResult = original.ServicesDescriptionListResult
+type ServicesDescriptionListResultIterator = original.ServicesDescriptionListResultIterator
+type ServicesDescriptionListResultPage = original.ServicesDescriptionListResultPage
+type ServicesNameAvailabilityInfo = original.ServicesNameAvailabilityInfo
+type ServicesPatchDescription = original.ServicesPatchDescription
+type ServicesProperties = original.ServicesProperties
+type ServicesUpdateFuture = original.ServicesUpdateFuture
+type SetObject = original.SetObject
+
+func New(subscriptionID string) BaseClient {
+ return original.New(subscriptionID)
+}
+func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
+ return original.NewOperationListResultIterator(page)
+}
+func NewOperationListResultPage(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
+ return original.NewOperationListResultPage(getNextPage)
+}
+func NewOperationResultsClient(subscriptionID string) OperationResultsClient {
+ return original.NewOperationResultsClient(subscriptionID)
+}
+func NewOperationResultsClientWithBaseURI(baseURI string, subscriptionID string) OperationResultsClient {
+ return original.NewOperationResultsClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewOperationsClient(subscriptionID string) OperationsClient {
+ return original.NewOperationsClient(subscriptionID)
+}
+func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient {
+ return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewServicesClient(subscriptionID string) ServicesClient {
+ return original.NewServicesClient(subscriptionID)
+}
+func NewServicesClientWithBaseURI(baseURI string, subscriptionID string) ServicesClient {
+ return original.NewServicesClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewServicesDescriptionListResultIterator(page ServicesDescriptionListResultPage) ServicesDescriptionListResultIterator {
+ return original.NewServicesDescriptionListResultIterator(page)
+}
+func NewServicesDescriptionListResultPage(getNextPage func(context.Context, ServicesDescriptionListResult) (ServicesDescriptionListResult, error)) ServicesDescriptionListResultPage {
+ return original.NewServicesDescriptionListResultPage(getNextPage)
+}
+func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
+ return original.NewWithBaseURI(baseURI, subscriptionID)
+}
+func PossibleKindValues() []Kind {
+ return original.PossibleKindValues()
+}
+func PossibleOperationResultStatusValues() []OperationResultStatus {
+ return original.PossibleOperationResultStatusValues()
+}
+func PossibleProvisioningStateValues() []ProvisioningState {
+ return original.PossibleProvisioningStateValues()
+}
+func PossibleServiceNameUnavailabilityReasonValues() []ServiceNameUnavailabilityReason {
+ return original.PossibleServiceNameUnavailabilityReasonValues()
+}
+func UserAgent() string {
+ return original.UserAgent() + " profiles/preview"
+}
+func Version() string {
+ return original.Version()
+}
diff --git a/profiles/preview/kusto/mgmt/kusto/kustoapi/models.go b/profiles/preview/kusto/mgmt/kusto/kustoapi/models.go
index 07c81eaf8dab..25b871538b2d 100644
--- a/profiles/preview/kusto/mgmt/kusto/kustoapi/models.go
+++ b/profiles/preview/kusto/mgmt/kusto/kustoapi/models.go
@@ -19,8 +19,9 @@
package kustoapi
-import original "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2019-05-15/kusto/kustoapi"
+import original "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2019-09-07/kusto/kustoapi"
+type AttachedDatabaseConfigurationsClientAPI = original.AttachedDatabaseConfigurationsClientAPI
type ClustersClientAPI = original.ClustersClientAPI
type DataConnectionsClientAPI = original.DataConnectionsClientAPI
type DatabasesClientAPI = original.DatabasesClientAPI
diff --git a/profiles/preview/kusto/mgmt/kusto/models.go b/profiles/preview/kusto/mgmt/kusto/models.go
index 85187acf6ee2..0683433aa011 100644
--- a/profiles/preview/kusto/mgmt/kusto/models.go
+++ b/profiles/preview/kusto/mgmt/kusto/models.go
@@ -22,7 +22,7 @@ package kusto
import (
"context"
- original "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2019-05-15/kusto"
+ original "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2019-09-07/kusto"
)
const (
@@ -74,6 +74,7 @@ const (
SINGLEJSON DataFormat = original.SINGLEJSON
SOHSV DataFormat = original.SOHSV
TSV DataFormat = original.TSV
+ TSVE DataFormat = original.TSVE
TXT DataFormat = original.TXT
)
@@ -96,13 +97,44 @@ const (
DatabasePrincipalTypeUser DatabasePrincipalType = original.DatabasePrincipalTypeUser
)
+type DefaultPrincipalsModificationKind = original.DefaultPrincipalsModificationKind
+
+const (
+ DefaultPrincipalsModificationKindNone DefaultPrincipalsModificationKind = original.DefaultPrincipalsModificationKindNone
+ DefaultPrincipalsModificationKindReplace DefaultPrincipalsModificationKind = original.DefaultPrincipalsModificationKindReplace
+ DefaultPrincipalsModificationKindUnion DefaultPrincipalsModificationKind = original.DefaultPrincipalsModificationKindUnion
+)
+
+type IdentityType = original.IdentityType
+
+const (
+ IdentityTypeNone IdentityType = original.IdentityTypeNone
+ IdentityTypeSystemAssigned IdentityType = original.IdentityTypeSystemAssigned
+)
+
type Kind = original.Kind
const (
- KindDataConnection Kind = original.KindDataConnection
- KindEventGrid Kind = original.KindEventGrid
- KindEventHub Kind = original.KindEventHub
- KindIotHub Kind = original.KindIotHub
+ KindDatabase Kind = original.KindDatabase
+ KindReadOnlyFollowing Kind = original.KindReadOnlyFollowing
+ KindReadWrite Kind = original.KindReadWrite
+)
+
+type KindBasicDataConnection = original.KindBasicDataConnection
+
+const (
+ KindDataConnection KindBasicDataConnection = original.KindDataConnection
+ KindEventGrid KindBasicDataConnection = original.KindEventGrid
+ KindEventHub KindBasicDataConnection = original.KindEventHub
+ KindIotHub KindBasicDataConnection = original.KindIotHub
+)
+
+type PrincipalsModificationKind = original.PrincipalsModificationKind
+
+const (
+ PrincipalsModificationKindNone PrincipalsModificationKind = original.PrincipalsModificationKindNone
+ PrincipalsModificationKindReplace PrincipalsModificationKind = original.PrincipalsModificationKindReplace
+ PrincipalsModificationKindUnion PrincipalsModificationKind = original.PrincipalsModificationKindUnion
)
type ProvisioningState = original.ProvisioningState
@@ -137,12 +169,27 @@ const (
StateUpdating State = original.StateUpdating
)
+type Type = original.Type
+
+const (
+ MicrosoftKustoclustersattachedDatabaseConfigurations Type = original.MicrosoftKustoclustersattachedDatabaseConfigurations
+ MicrosoftKustoclustersdatabases Type = original.MicrosoftKustoclustersdatabases
+)
+
+type AttachedDatabaseConfiguration = original.AttachedDatabaseConfiguration
+type AttachedDatabaseConfigurationListResult = original.AttachedDatabaseConfigurationListResult
+type AttachedDatabaseConfigurationProperties = original.AttachedDatabaseConfigurationProperties
+type AttachedDatabaseConfigurationsClient = original.AttachedDatabaseConfigurationsClient
+type AttachedDatabaseConfigurationsCreateOrUpdateFuture = original.AttachedDatabaseConfigurationsCreateOrUpdateFuture
+type AttachedDatabaseConfigurationsDeleteFuture = original.AttachedDatabaseConfigurationsDeleteFuture
type AzureCapacity = original.AzureCapacity
type AzureEntityResource = original.AzureEntityResource
type AzureResourceSku = original.AzureResourceSku
type AzureSku = original.AzureSku
type BaseClient = original.BaseClient
type BasicDataConnection = original.BasicDataConnection
+type BasicDatabase = original.BasicDatabase
+type CheckNameRequest = original.CheckNameRequest
type CheckNameResult = original.CheckNameResult
type CloudError = original.CloudError
type CloudErrorBody = original.CloudErrorBody
@@ -154,6 +201,7 @@ type ClusterUpdate = original.ClusterUpdate
type ClustersClient = original.ClustersClient
type ClustersCreateOrUpdateFuture = original.ClustersCreateOrUpdateFuture
type ClustersDeleteFuture = original.ClustersDeleteFuture
+type ClustersDetachFollowerDatabasesFuture = original.ClustersDetachFollowerDatabasesFuture
type ClustersStartFuture = original.ClustersStartFuture
type ClustersStopFuture = original.ClustersStopFuture
type ClustersUpdateFuture = original.ClustersUpdateFuture
@@ -169,14 +217,12 @@ type DataConnectionsCreateOrUpdateFuture = original.DataConnectionsCreateOrUpdat
type DataConnectionsDeleteFuture = original.DataConnectionsDeleteFuture
type DataConnectionsUpdateFuture = original.DataConnectionsUpdateFuture
type Database = original.Database
-type DatabaseCheckNameRequest = original.DatabaseCheckNameRequest
type DatabaseListResult = original.DatabaseListResult
+type DatabaseModel = original.DatabaseModel
type DatabasePrincipal = original.DatabasePrincipal
type DatabasePrincipalListRequest = original.DatabasePrincipalListRequest
type DatabasePrincipalListResult = original.DatabasePrincipalListResult
-type DatabaseProperties = original.DatabaseProperties
type DatabaseStatistics = original.DatabaseStatistics
-type DatabaseUpdate = original.DatabaseUpdate
type DatabasesClient = original.DatabasesClient
type DatabasesCreateOrUpdateFuture = original.DatabasesCreateOrUpdateFuture
type DatabasesDeleteFuture = original.DatabasesDeleteFuture
@@ -185,8 +231,13 @@ type EventGridConnectionProperties = original.EventGridConnectionProperties
type EventGridDataConnection = original.EventGridDataConnection
type EventHubConnectionProperties = original.EventHubConnectionProperties
type EventHubDataConnection = original.EventHubDataConnection
+type FollowerDatabaseDefinition = original.FollowerDatabaseDefinition
+type FollowerDatabaseListResult = original.FollowerDatabaseListResult
+type Identity = original.Identity
+type IdentityUserAssignedIdentitiesValue = original.IdentityUserAssignedIdentitiesValue
type IotHubConnectionProperties = original.IotHubConnectionProperties
type IotHubDataConnection = original.IotHubDataConnection
+type KeyVaultProperties = original.KeyVaultProperties
type ListResourceSkusResult = original.ListResourceSkusResult
type Operation = original.Operation
type OperationDisplay = original.OperationDisplay
@@ -196,6 +247,10 @@ type OperationListResultPage = original.OperationListResultPage
type OperationsClient = original.OperationsClient
type OptimizedAutoscale = original.OptimizedAutoscale
type ProxyResource = original.ProxyResource
+type ReadOnlyFollowingDatabase = original.ReadOnlyFollowingDatabase
+type ReadOnlyFollowingDatabaseProperties = original.ReadOnlyFollowingDatabaseProperties
+type ReadWriteDatabase = original.ReadWriteDatabase
+type ReadWriteDatabaseProperties = original.ReadWriteDatabaseProperties
type Resource = original.Resource
type SkuDescription = original.SkuDescription
type SkuDescriptionList = original.SkuDescriptionList
@@ -207,6 +262,12 @@ type VirtualNetworkConfiguration = original.VirtualNetworkConfiguration
func New(subscriptionID string) BaseClient {
return original.New(subscriptionID)
}
+func NewAttachedDatabaseConfigurationsClient(subscriptionID string) AttachedDatabaseConfigurationsClient {
+ return original.NewAttachedDatabaseConfigurationsClient(subscriptionID)
+}
+func NewAttachedDatabaseConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) AttachedDatabaseConfigurationsClient {
+ return original.NewAttachedDatabaseConfigurationsClientWithBaseURI(baseURI, subscriptionID)
+}
func NewClustersClient(subscriptionID string) ClustersClient {
return original.NewClustersClient(subscriptionID)
}
@@ -258,9 +319,21 @@ func PossibleDatabasePrincipalRoleValues() []DatabasePrincipalRole {
func PossibleDatabasePrincipalTypeValues() []DatabasePrincipalType {
return original.PossibleDatabasePrincipalTypeValues()
}
+func PossibleDefaultPrincipalsModificationKindValues() []DefaultPrincipalsModificationKind {
+ return original.PossibleDefaultPrincipalsModificationKindValues()
+}
+func PossibleIdentityTypeValues() []IdentityType {
+ return original.PossibleIdentityTypeValues()
+}
+func PossibleKindBasicDataConnectionValues() []KindBasicDataConnection {
+ return original.PossibleKindBasicDataConnectionValues()
+}
func PossibleKindValues() []Kind {
return original.PossibleKindValues()
}
+func PossiblePrincipalsModificationKindValues() []PrincipalsModificationKind {
+ return original.PossiblePrincipalsModificationKindValues()
+}
func PossibleProvisioningStateValues() []ProvisioningState {
return original.PossibleProvisioningStateValues()
}
@@ -270,6 +343,9 @@ func PossibleReasonValues() []Reason {
func PossibleStateValues() []State {
return original.PossibleStateValues()
}
+func PossibleTypeValues() []Type {
+ return original.PossibleTypeValues()
+}
func UserAgent() string {
return original.UserAgent() + " profiles/preview"
}
diff --git a/profiles/preview/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go b/profiles/preview/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go
index 0d80dd1aa71c..7304674d88f3 100644
--- a/profiles/preview/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go
+++ b/profiles/preview/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go
@@ -23,6 +23,7 @@ import original "github.com/Azure/azure-sdk-for-go/services/machinelearningservi
type MachineLearningComputeClientAPI = original.MachineLearningComputeClientAPI
type OperationsClientAPI = original.OperationsClientAPI
+type QuotasClientAPI = original.QuotasClientAPI
type UsagesClientAPI = original.UsagesClientAPI
type VirtualMachineSizesClientAPI = original.VirtualMachineSizesClientAPI
type WorkspacesClientAPI = original.WorkspacesClientAPI
diff --git a/profiles/preview/machinelearningservices/mgmt/machinelearningservices/models.go b/profiles/preview/machinelearningservices/mgmt/machinelearningservices/models.go
index de8a0ceee1f8..d685dcb8580c 100644
--- a/profiles/preview/machinelearningservices/mgmt/machinelearningservices/models.go
+++ b/profiles/preview/machinelearningservices/mgmt/machinelearningservices/models.go
@@ -100,6 +100,12 @@ const (
Updating ProvisioningState = original.Updating
)
+type QuotaUnit = original.QuotaUnit
+
+const (
+ Count QuotaUnit = original.Count
+)
+
type RemoteLoginPortPublicAccess = original.RemoteLoginPortPublicAccess
const (
@@ -117,8 +123,19 @@ const (
type Status = original.Status
const (
- StatusDisabled Status = original.StatusDisabled
- StatusEnabled Status = original.StatusEnabled
+ Failure Status = original.Failure
+ InvalidQuotaBelowClusterMinimum Status = original.InvalidQuotaBelowClusterMinimum
+ InvalidQuotaExceedsSubscriptionLimit Status = original.InvalidQuotaExceedsSubscriptionLimit
+ InvalidVMFamilyName Status = original.InvalidVMFamilyName
+ Success Status = original.Success
+ Undefined Status = original.Undefined
+)
+
+type Status1 = original.Status1
+
+const (
+ Status1Disabled Status1 = original.Status1Disabled
+ Status1Enabled Status1 = original.Status1Enabled
)
type UnderlyingResourceAction = original.UnderlyingResourceAction
@@ -131,7 +148,7 @@ const (
type UsageUnit = original.UsageUnit
const (
- Count UsageUnit = original.Count
+ UsageUnitCount UsageUnit = original.UsageUnitCount
)
type VMPriority = original.VMPriority
@@ -176,6 +193,9 @@ type ListUsagesResult = original.ListUsagesResult
type ListUsagesResultIterator = original.ListUsagesResultIterator
type ListUsagesResultPage = original.ListUsagesResultPage
type ListWorkspaceKeysResult = original.ListWorkspaceKeysResult
+type ListWorkspaceQuotas = original.ListWorkspaceQuotas
+type ListWorkspaceQuotasIterator = original.ListWorkspaceQuotasIterator
+type ListWorkspaceQuotasPage = original.ListWorkspaceQuotasPage
type MachineLearningComputeClient = original.MachineLearningComputeClient
type MachineLearningComputeCreateOrUpdateFuture = original.MachineLearningComputeCreateOrUpdateFuture
type MachineLearningComputeDeleteFuture = original.MachineLearningComputeDeleteFuture
@@ -189,13 +209,20 @@ type PaginatedComputeResourcesList = original.PaginatedComputeResourcesList
type PaginatedComputeResourcesListIterator = original.PaginatedComputeResourcesListIterator
type PaginatedComputeResourcesListPage = original.PaginatedComputeResourcesListPage
type Password = original.Password
+type QuotaBaseProperties = original.QuotaBaseProperties
+type QuotaUpdateParameters = original.QuotaUpdateParameters
+type QuotasClient = original.QuotasClient
type RegistryListCredentialsResult = original.RegistryListCredentialsResult
type Resource = original.Resource
type ResourceID = original.ResourceID
+type ResourceName = original.ResourceName
+type ResourceQuota = original.ResourceQuota
type ScaleSettings = original.ScaleSettings
type ServicePrincipalCredentials = original.ServicePrincipalCredentials
type SslConfiguration = original.SslConfiguration
type SystemService = original.SystemService
+type UpdateWorkspaceQuotas = original.UpdateWorkspaceQuotas
+type UpdateWorkspaceQuotasResult = original.UpdateWorkspaceQuotasResult
type Usage = original.Usage
type UsageName = original.UsageName
type UsagesClient = original.UsagesClient
@@ -225,6 +252,12 @@ func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIter
func NewListUsagesResultPage(getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage {
return original.NewListUsagesResultPage(getNextPage)
}
+func NewListWorkspaceQuotasIterator(page ListWorkspaceQuotasPage) ListWorkspaceQuotasIterator {
+ return original.NewListWorkspaceQuotasIterator(page)
+}
+func NewListWorkspaceQuotasPage(getNextPage func(context.Context, ListWorkspaceQuotas) (ListWorkspaceQuotas, error)) ListWorkspaceQuotasPage {
+ return original.NewListWorkspaceQuotasPage(getNextPage)
+}
func NewMachineLearningComputeClient(subscriptionID string) MachineLearningComputeClient {
return original.NewMachineLearningComputeClient(subscriptionID)
}
@@ -243,6 +276,12 @@ func NewPaginatedComputeResourcesListIterator(page PaginatedComputeResourcesList
func NewPaginatedComputeResourcesListPage(getNextPage func(context.Context, PaginatedComputeResourcesList) (PaginatedComputeResourcesList, error)) PaginatedComputeResourcesListPage {
return original.NewPaginatedComputeResourcesListPage(getNextPage)
}
+func NewQuotasClient(subscriptionID string) QuotasClient {
+ return original.NewQuotasClient(subscriptionID)
+}
+func NewQuotasClientWithBaseURI(baseURI string, subscriptionID string) QuotasClient {
+ return original.NewQuotasClientWithBaseURI(baseURI, subscriptionID)
+}
func NewUsagesClient(subscriptionID string) UsagesClient {
return original.NewUsagesClient(subscriptionID)
}
@@ -291,12 +330,18 @@ func PossibleNodeStateValues() []NodeState {
func PossibleProvisioningStateValues() []ProvisioningState {
return original.PossibleProvisioningStateValues()
}
+func PossibleQuotaUnitValues() []QuotaUnit {
+ return original.PossibleQuotaUnitValues()
+}
func PossibleRemoteLoginPortPublicAccessValues() []RemoteLoginPortPublicAccess {
return original.PossibleRemoteLoginPortPublicAccessValues()
}
func PossibleResourceIdentityTypeValues() []ResourceIdentityType {
return original.PossibleResourceIdentityTypeValues()
}
+func PossibleStatus1Values() []Status1 {
+ return original.PossibleStatus1Values()
+}
func PossibleStatusValues() []Status {
return original.PossibleStatusValues()
}
diff --git a/profiles/preview/mobileengagement/mgmt/mobileengagement/models.go b/profiles/preview/mobileengagement/mgmt/mobileengagement/models.go
deleted file mode 100644
index d00733e2a2db..000000000000
--- a/profiles/preview/mobileengagement/mgmt/mobileengagement/models.go
+++ /dev/null
@@ -1,394 +0,0 @@
-// +build go1.9
-
-// Copyright 2019 Microsoft Corporation
-//
-// 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.
-
-// This code was auto-generated by:
-// github.com/Azure/azure-sdk-for-go/tools/profileBuilder
-
-package mobileengagement
-
-import original "github.com/Azure/azure-sdk-for-go/services/mobileengagement/mgmt/2014-12-01/mobileengagement"
-
-const (
- DefaultBaseURI = original.DefaultBaseURI
-)
-
-type AudienceOperators = original.AudienceOperators
-
-const (
- EQ AudienceOperators = original.EQ
- GE AudienceOperators = original.GE
- GT AudienceOperators = original.GT
- LE AudienceOperators = original.LE
- LT AudienceOperators = original.LT
-)
-
-type CampaignFeedbacks = original.CampaignFeedbacks
-
-const (
- Actioned CampaignFeedbacks = original.Actioned
- Exited CampaignFeedbacks = original.Exited
- Pushed CampaignFeedbacks = original.Pushed
- Replied CampaignFeedbacks = original.Replied
-)
-
-type CampaignKinds = original.CampaignKinds
-
-const (
- Announcements CampaignKinds = original.Announcements
- DataPushes CampaignKinds = original.DataPushes
- NativePushes CampaignKinds = original.NativePushes
- Polls CampaignKinds = original.Polls
-)
-
-type CampaignStates = original.CampaignStates
-
-const (
- Draft CampaignStates = original.Draft
- Finished CampaignStates = original.Finished
- InProgress CampaignStates = original.InProgress
- Queued CampaignStates = original.Queued
- Scheduled CampaignStates = original.Scheduled
-)
-
-type CampaignType = original.CampaignType
-
-const (
- Announcement CampaignType = original.Announcement
- DataPush CampaignType = original.DataPush
- NativePush CampaignType = original.NativePush
- Poll CampaignType = original.Poll
-)
-
-type CampaignTypes = original.CampaignTypes
-
-const (
- OnlyNotif CampaignTypes = original.OnlyNotif
- Textbase64 CampaignTypes = original.Textbase64
- Texthtml CampaignTypes = original.Texthtml
- Textplain CampaignTypes = original.Textplain
-)
-
-type DeliveryTimes = original.DeliveryTimes
-
-const (
- Any DeliveryTimes = original.Any
- Background DeliveryTimes = original.Background
- Session DeliveryTimes = original.Session
-)
-
-type ExportFormat = original.ExportFormat
-
-const (
- CsvBlob ExportFormat = original.CsvBlob
- JSONBlob ExportFormat = original.JSONBlob
-)
-
-type ExportState = original.ExportState
-
-const (
- ExportStateFailed ExportState = original.ExportStateFailed
- ExportStateQueued ExportState = original.ExportStateQueued
- ExportStateStarted ExportState = original.ExportStateStarted
- ExportStateSucceeded ExportState = original.ExportStateSucceeded
-)
-
-type ExportType = original.ExportType
-
-const (
- ExportTypeActivity ExportType = original.ExportTypeActivity
- ExportTypeCrash ExportType = original.ExportTypeCrash
- ExportTypeError ExportType = original.ExportTypeError
- ExportTypeEvent ExportType = original.ExportTypeEvent
- ExportTypeJob ExportType = original.ExportTypeJob
- ExportTypePush ExportType = original.ExportTypePush
- ExportTypeSession ExportType = original.ExportTypeSession
- ExportTypeTag ExportType = original.ExportTypeTag
- ExportTypeToken ExportType = original.ExportTypeToken
-)
-
-type JobStates = original.JobStates
-
-const (
- JobStatesFailed JobStates = original.JobStatesFailed
- JobStatesQueued JobStates = original.JobStatesQueued
- JobStatesStarted JobStates = original.JobStatesStarted
- JobStatesSucceeded JobStates = original.JobStatesSucceeded
-)
-
-type NotificationTypes = original.NotificationTypes
-
-const (
- Popup NotificationTypes = original.Popup
- System NotificationTypes = original.System
-)
-
-type ProvisioningStates = original.ProvisioningStates
-
-const (
- Creating ProvisioningStates = original.Creating
- Succeeded ProvisioningStates = original.Succeeded
-)
-
-type PushModes = original.PushModes
-
-const (
- Manual PushModes = original.Manual
- OneShot PushModes = original.OneShot
- RealTime PushModes = original.RealTime
-)
-
-type Type = original.Type
-
-const (
- TypeAnnouncementFeedback Type = original.TypeAnnouncementFeedback
- TypeApplicationVersion Type = original.TypeApplicationVersion
- TypeBooleanTag Type = original.TypeBooleanTag
- TypeCarrierCountry Type = original.TypeCarrierCountry
- TypeCarrierName Type = original.TypeCarrierName
- TypeCriterion Type = original.TypeCriterion
- TypeDatapushFeedback Type = original.TypeDatapushFeedback
- TypeDateTag Type = original.TypeDateTag
- TypeDeviceManufacturer Type = original.TypeDeviceManufacturer
- TypeDeviceModel Type = original.TypeDeviceModel
- TypeFirmwareVersion Type = original.TypeFirmwareVersion
- TypeGeoFencing Type = original.TypeGeoFencing
- TypeIntegerTag Type = original.TypeIntegerTag
- TypeLanguage Type = original.TypeLanguage
- TypeLocation Type = original.TypeLocation
- TypeNetworkType Type = original.TypeNetworkType
- TypePollAnswerFeedback Type = original.TypePollAnswerFeedback
- TypePollFeedback Type = original.TypePollFeedback
- TypeScreenSize Type = original.TypeScreenSize
- TypeSegment Type = original.TypeSegment
- TypeStringTag Type = original.TypeStringTag
-)
-
-type TypeBasicFilter = original.TypeBasicFilter
-
-const (
- TypeAppInfo TypeBasicFilter = original.TypeAppInfo
- TypeEngageActiveUsers TypeBasicFilter = original.TypeEngageActiveUsers
- TypeEngageIdleUsers TypeBasicFilter = original.TypeEngageIdleUsers
- TypeEngageNewUsers TypeBasicFilter = original.TypeEngageNewUsers
- TypeEngageOldUsers TypeBasicFilter = original.TypeEngageOldUsers
- TypeEngageSubset TypeBasicFilter = original.TypeEngageSubset
- TypeFilter TypeBasicFilter = original.TypeFilter
- TypeNativePushEnabled TypeBasicFilter = original.TypeNativePushEnabled
- TypePushQuota TypeBasicFilter = original.TypePushQuota
-)
-
-type APIError = original.APIError
-type APIErrorError = original.APIErrorError
-type AnnouncementFeedbackCriterion = original.AnnouncementFeedbackCriterion
-type App = original.App
-type AppCollection = original.AppCollection
-type AppCollectionListResult = original.AppCollectionListResult
-type AppCollectionListResultIterator = original.AppCollectionListResultIterator
-type AppCollectionListResultPage = original.AppCollectionListResultPage
-type AppCollectionNameAvailability = original.AppCollectionNameAvailability
-type AppCollectionProperties = original.AppCollectionProperties
-type AppCollectionsClient = original.AppCollectionsClient
-type AppInfoFilter = original.AppInfoFilter
-type AppListResult = original.AppListResult
-type AppListResultIterator = original.AppListResultIterator
-type AppListResultPage = original.AppListResultPage
-type AppProperties = original.AppProperties
-type ApplicationVersionCriterion = original.ApplicationVersionCriterion
-type AppsClient = original.AppsClient
-type BaseClient = original.BaseClient
-type BasicCriterion = original.BasicCriterion
-type BasicFilter = original.BasicFilter
-type BooleanTagCriterion = original.BooleanTagCriterion
-type Campaign = original.Campaign
-type CampaignAudience = original.CampaignAudience
-type CampaignListResult = original.CampaignListResult
-type CampaignLocalization = original.CampaignLocalization
-type CampaignPushParameters = original.CampaignPushParameters
-type CampaignPushResult = original.CampaignPushResult
-type CampaignResult = original.CampaignResult
-type CampaignState = original.CampaignState
-type CampaignStateResult = original.CampaignStateResult
-type CampaignStatisticsResult = original.CampaignStatisticsResult
-type CampaignTestNewParameters = original.CampaignTestNewParameters
-type CampaignTestSavedParameters = original.CampaignTestSavedParameters
-type CampaignsClient = original.CampaignsClient
-type CampaignsListResult = original.CampaignsListResult
-type CampaignsListResultIterator = original.CampaignsListResultIterator
-type CampaignsListResultPage = original.CampaignsListResultPage
-type CarrierCountryCriterion = original.CarrierCountryCriterion
-type CarrierNameCriterion = original.CarrierNameCriterion
-type Criterion = original.Criterion
-type DatapushFeedbackCriterion = original.DatapushFeedbackCriterion
-type DateRangeExportTaskParameter = original.DateRangeExportTaskParameter
-type DateTagCriterion = original.DateTagCriterion
-type Device = original.Device
-type DeviceInfo = original.DeviceInfo
-type DeviceLocation = original.DeviceLocation
-type DeviceManufacturerCriterion = original.DeviceManufacturerCriterion
-type DeviceMeta = original.DeviceMeta
-type DeviceModelCriterion = original.DeviceModelCriterion
-type DeviceQueryResult = original.DeviceQueryResult
-type DeviceTagsParameters = original.DeviceTagsParameters
-type DeviceTagsResult = original.DeviceTagsResult
-type DevicesClient = original.DevicesClient
-type DevicesQueryResult = original.DevicesQueryResult
-type DevicesQueryResultIterator = original.DevicesQueryResultIterator
-type DevicesQueryResultPage = original.DevicesQueryResultPage
-type EngageActiveUsersFilter = original.EngageActiveUsersFilter
-type EngageIdleUsersFilter = original.EngageIdleUsersFilter
-type EngageNewUsersFilter = original.EngageNewUsersFilter
-type EngageOldUsersFilter = original.EngageOldUsersFilter
-type EngageSubsetFilter = original.EngageSubsetFilter
-type ExportOptions = original.ExportOptions
-type ExportTaskListResult = original.ExportTaskListResult
-type ExportTaskListResultIterator = original.ExportTaskListResultIterator
-type ExportTaskListResultPage = original.ExportTaskListResultPage
-type ExportTaskParameter = original.ExportTaskParameter
-type ExportTaskResult = original.ExportTaskResult
-type ExportTasksClient = original.ExportTasksClient
-type FeedbackByCampaignParameter = original.FeedbackByCampaignParameter
-type FeedbackByDateRangeParameter = original.FeedbackByDateRangeParameter
-type Filter = original.Filter
-type FirmwareVersionCriterion = original.FirmwareVersionCriterion
-type GeoFencingCriterion = original.GeoFencingCriterion
-type ImportTask = original.ImportTask
-type ImportTaskListResult = original.ImportTaskListResult
-type ImportTaskListResultIterator = original.ImportTaskListResultIterator
-type ImportTaskListResultPage = original.ImportTaskListResultPage
-type ImportTaskResult = original.ImportTaskResult
-type ImportTasksClient = original.ImportTasksClient
-type IntegerTagCriterion = original.IntegerTagCriterion
-type LanguageCriterion = original.LanguageCriterion
-type LocationCriterion = original.LocationCriterion
-type NativePushEnabledFilter = original.NativePushEnabledFilter
-type NetworkTypeCriterion = original.NetworkTypeCriterion
-type NotificationOptions = original.NotificationOptions
-type PollAnswerFeedbackCriterion = original.PollAnswerFeedbackCriterion
-type PollFeedbackCriterion = original.PollFeedbackCriterion
-type PollQuestion = original.PollQuestion
-type PollQuestionChoice = original.PollQuestionChoice
-type PollQuestionChoiceLocalization = original.PollQuestionChoiceLocalization
-type PollQuestionLocalization = original.PollQuestionLocalization
-type PushQuotaFilter = original.PushQuotaFilter
-type Resource = original.Resource
-type ScreenSizeCriterion = original.ScreenSizeCriterion
-type SegmentCriterion = original.SegmentCriterion
-type StringTagCriterion = original.StringTagCriterion
-type SupportedPlatformsClient = original.SupportedPlatformsClient
-type SupportedPlatformsListResult = original.SupportedPlatformsListResult
-
-func New(subscriptionID string) BaseClient {
- return original.New(subscriptionID)
-}
-func NewAppCollectionsClient(subscriptionID string) AppCollectionsClient {
- return original.NewAppCollectionsClient(subscriptionID)
-}
-func NewAppCollectionsClientWithBaseURI(baseURI string, subscriptionID string) AppCollectionsClient {
- return original.NewAppCollectionsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewAppsClient(subscriptionID string) AppsClient {
- return original.NewAppsClient(subscriptionID)
-}
-func NewAppsClientWithBaseURI(baseURI string, subscriptionID string) AppsClient {
- return original.NewAppsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewCampaignsClient(subscriptionID string) CampaignsClient {
- return original.NewCampaignsClient(subscriptionID)
-}
-func NewCampaignsClientWithBaseURI(baseURI string, subscriptionID string) CampaignsClient {
- return original.NewCampaignsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewDevicesClient(subscriptionID string) DevicesClient {
- return original.NewDevicesClient(subscriptionID)
-}
-func NewDevicesClientWithBaseURI(baseURI string, subscriptionID string) DevicesClient {
- return original.NewDevicesClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewExportTasksClient(subscriptionID string) ExportTasksClient {
- return original.NewExportTasksClient(subscriptionID)
-}
-func NewExportTasksClientWithBaseURI(baseURI string, subscriptionID string) ExportTasksClient {
- return original.NewExportTasksClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewImportTasksClient(subscriptionID string) ImportTasksClient {
- return original.NewImportTasksClient(subscriptionID)
-}
-func NewImportTasksClientWithBaseURI(baseURI string, subscriptionID string) ImportTasksClient {
- return original.NewImportTasksClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewSupportedPlatformsClient(subscriptionID string) SupportedPlatformsClient {
- return original.NewSupportedPlatformsClient(subscriptionID)
-}
-func NewSupportedPlatformsClientWithBaseURI(baseURI string, subscriptionID string) SupportedPlatformsClient {
- return original.NewSupportedPlatformsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
- return original.NewWithBaseURI(baseURI, subscriptionID)
-}
-func PossibleAudienceOperatorsValues() []AudienceOperators {
- return original.PossibleAudienceOperatorsValues()
-}
-func PossibleCampaignFeedbacksValues() []CampaignFeedbacks {
- return original.PossibleCampaignFeedbacksValues()
-}
-func PossibleCampaignKindsValues() []CampaignKinds {
- return original.PossibleCampaignKindsValues()
-}
-func PossibleCampaignStatesValues() []CampaignStates {
- return original.PossibleCampaignStatesValues()
-}
-func PossibleCampaignTypeValues() []CampaignType {
- return original.PossibleCampaignTypeValues()
-}
-func PossibleCampaignTypesValues() []CampaignTypes {
- return original.PossibleCampaignTypesValues()
-}
-func PossibleDeliveryTimesValues() []DeliveryTimes {
- return original.PossibleDeliveryTimesValues()
-}
-func PossibleExportFormatValues() []ExportFormat {
- return original.PossibleExportFormatValues()
-}
-func PossibleExportStateValues() []ExportState {
- return original.PossibleExportStateValues()
-}
-func PossibleExportTypeValues() []ExportType {
- return original.PossibleExportTypeValues()
-}
-func PossibleJobStatesValues() []JobStates {
- return original.PossibleJobStatesValues()
-}
-func PossibleNotificationTypesValues() []NotificationTypes {
- return original.PossibleNotificationTypesValues()
-}
-func PossibleProvisioningStatesValues() []ProvisioningStates {
- return original.PossibleProvisioningStatesValues()
-}
-func PossiblePushModesValues() []PushModes {
- return original.PossiblePushModesValues()
-}
-func PossibleTypeBasicFilterValues() []TypeBasicFilter {
- return original.PossibleTypeBasicFilterValues()
-}
-func PossibleTypeValues() []Type {
- return original.PossibleTypeValues()
-}
-func UserAgent() string {
- return original.UserAgent() + " profiles/preview"
-}
-func Version() string {
- return original.Version()
-}
diff --git a/profiles/preview/preview/appconfiguration/mgmt/appconfiguration/models.go b/profiles/preview/preview/appconfiguration/mgmt/appconfiguration/models.go
index 6ac37bf91349..695ea51ccff1 100644
--- a/profiles/preview/preview/appconfiguration/mgmt/appconfiguration/models.go
+++ b/profiles/preview/preview/appconfiguration/mgmt/appconfiguration/models.go
@@ -57,6 +57,8 @@ type ConfigurationStoresCreateFuture = original.ConfigurationStoresCreateFuture
type ConfigurationStoresDeleteFuture = original.ConfigurationStoresDeleteFuture
type ConfigurationStoresUpdateFuture = original.ConfigurationStoresUpdateFuture
type Error = original.Error
+type KeyValue = original.KeyValue
+type ListKeyValueParameters = original.ListKeyValueParameters
type NameAvailabilityStatus = original.NameAvailabilityStatus
type OperationDefinition = original.OperationDefinition
type OperationDefinitionDisplay = original.OperationDefinitionDisplay
diff --git a/profiles/preview/preview/datashare/mgmt/datashare/models.go b/profiles/preview/preview/datashare/mgmt/datashare/models.go
index 1de16e97db28..a2f529f07097 100644
--- a/profiles/preview/preview/datashare/mgmt/datashare/models.go
+++ b/profiles/preview/preview/datashare/mgmt/datashare/models.go
@@ -47,6 +47,8 @@ const (
Blob DataSetType = original.Blob
BlobFolder DataSetType = original.BlobFolder
Container DataSetType = original.Container
+ SQLDBTable DataSetType = original.SQLDBTable
+ SQLDWTable DataSetType = original.SQLDWTable
)
type InvitationStatus = original.InvitationStatus
@@ -70,6 +72,8 @@ const (
KindBlobFolder Kind = original.KindBlobFolder
KindContainer Kind = original.KindContainer
KindDataSet Kind = original.KindDataSet
+ KindSQLDBTable Kind = original.KindSQLDBTable
+ KindSQLDWTable Kind = original.KindSQLDWTable
)
type KindBasicDataSetMapping = original.KindBasicDataSetMapping
@@ -82,6 +86,8 @@ const (
KindBasicDataSetMappingKindBlobFolder KindBasicDataSetMapping = original.KindBasicDataSetMappingKindBlobFolder
KindBasicDataSetMappingKindContainer KindBasicDataSetMapping = original.KindBasicDataSetMappingKindContainer
KindBasicDataSetMappingKindDataSetMapping KindBasicDataSetMapping = original.KindBasicDataSetMappingKindDataSetMapping
+ KindBasicDataSetMappingKindSQLDBTable KindBasicDataSetMapping = original.KindBasicDataSetMappingKindSQLDBTable
+ KindBasicDataSetMappingKindSQLDWTable KindBasicDataSetMapping = original.KindBasicDataSetMappingKindSQLDWTable
)
type KindBasicSourceShareSynchronizationSetting = original.KindBasicSourceShareSynchronizationSetting
@@ -105,6 +111,13 @@ const (
KindBasicTriggerKindTrigger KindBasicTrigger = original.KindBasicTriggerKindTrigger
)
+type OutputType = original.OutputType
+
+const (
+ Csv OutputType = original.Csv
+ Parquet OutputType = original.Parquet
+)
+
type ProvisioningState = original.ProvisioningState
const (
@@ -266,6 +279,14 @@ type ProviderShareSubscriptionProperties = original.ProviderShareSubscriptionPro
type ProviderShareSubscriptionsClient = original.ProviderShareSubscriptionsClient
type ProviderShareSubscriptionsRevokeFuture = original.ProviderShareSubscriptionsRevokeFuture
type ProxyDto = original.ProxyDto
+type SQLDBTableDataSet = original.SQLDBTableDataSet
+type SQLDBTableDataSetMapping = original.SQLDBTableDataSetMapping
+type SQLDBTableDataSetMappingProperties = original.SQLDBTableDataSetMappingProperties
+type SQLDBTableProperties = original.SQLDBTableProperties
+type SQLDWTableDataSet = original.SQLDWTableDataSet
+type SQLDWTableDataSetMapping = original.SQLDWTableDataSetMapping
+type SQLDWTableDataSetMappingProperties = original.SQLDWTableDataSetMappingProperties
+type SQLDWTableProperties = original.SQLDWTableProperties
type ScheduledSourceShareSynchronizationSettingProperties = original.ScheduledSourceShareSynchronizationSettingProperties
type ScheduledSourceSynchronizationSetting = original.ScheduledSourceSynchronizationSetting
type ScheduledSynchronizationSetting = original.ScheduledSynchronizationSetting
@@ -519,6 +540,9 @@ func PossibleKindBasicTriggerValues() []KindBasicTrigger {
func PossibleKindValues() []Kind {
return original.PossibleKindValues()
}
+func PossibleOutputTypeValues() []OutputType {
+ return original.PossibleOutputTypeValues()
+}
func PossibleProvisioningStateValues() []ProvisioningState {
return original.PossibleProvisioningStateValues()
}
diff --git a/profiles/preview/preview/devspaces/mgmt/devspaces/models.go b/profiles/preview/preview/devspaces/mgmt/devspaces/models.go
deleted file mode 100644
index c083fceafe9b..000000000000
--- a/profiles/preview/preview/devspaces/mgmt/devspaces/models.go
+++ /dev/null
@@ -1,137 +0,0 @@
-// +build go1.9
-
-// Copyright 2019 Microsoft Corporation
-//
-// 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.
-
-// This code was auto-generated by:
-// github.com/Azure/azure-sdk-for-go/tools/profileBuilder
-
-package devspaces
-
-import (
- "context"
-
- original "github.com/Azure/azure-sdk-for-go/services/preview/devspaces/mgmt/2019-01-01-preview/devspaces"
-)
-
-const (
- DefaultBaseURI = original.DefaultBaseURI
-)
-
-type InstanceType = original.InstanceType
-
-const (
- InstanceTypeKubernetes InstanceType = original.InstanceTypeKubernetes
- InstanceTypeOrchestratorSpecificConnectionDetails InstanceType = original.InstanceTypeOrchestratorSpecificConnectionDetails
-)
-
-type ProvisioningState = original.ProvisioningState
-
-const (
- Canceled ProvisioningState = original.Canceled
- Creating ProvisioningState = original.Creating
- Deleted ProvisioningState = original.Deleted
- Deleting ProvisioningState = original.Deleting
- Failed ProvisioningState = original.Failed
- Succeeded ProvisioningState = original.Succeeded
- Updating ProvisioningState = original.Updating
-)
-
-type SkuTier = original.SkuTier
-
-const (
- Standard SkuTier = original.Standard
-)
-
-type BaseClient = original.BaseClient
-type BasicOrchestratorSpecificConnectionDetails = original.BasicOrchestratorSpecificConnectionDetails
-type ContainerHostMapping = original.ContainerHostMapping
-type ContainerHostMappingsClient = original.ContainerHostMappingsClient
-type Controller = original.Controller
-type ControllerConnectionDetails = original.ControllerConnectionDetails
-type ControllerConnectionDetailsList = original.ControllerConnectionDetailsList
-type ControllerList = original.ControllerList
-type ControllerListIterator = original.ControllerListIterator
-type ControllerListPage = original.ControllerListPage
-type ControllerProperties = original.ControllerProperties
-type ControllerUpdateParameters = original.ControllerUpdateParameters
-type ControllersClient = original.ControllersClient
-type ControllersCreateFuture = original.ControllersCreateFuture
-type ControllersDeleteFuture = original.ControllersDeleteFuture
-type ErrorDetails = original.ErrorDetails
-type ErrorResponse = original.ErrorResponse
-type KubernetesConnectionDetails = original.KubernetesConnectionDetails
-type OperationsClient = original.OperationsClient
-type OrchestratorSpecificConnectionDetails = original.OrchestratorSpecificConnectionDetails
-type Resource = original.Resource
-type ResourceProviderOperationDefinition = original.ResourceProviderOperationDefinition
-type ResourceProviderOperationDisplay = original.ResourceProviderOperationDisplay
-type ResourceProviderOperationList = original.ResourceProviderOperationList
-type ResourceProviderOperationListIterator = original.ResourceProviderOperationListIterator
-type ResourceProviderOperationListPage = original.ResourceProviderOperationListPage
-type SetObject = original.SetObject
-type Sku = original.Sku
-type TrackedResource = original.TrackedResource
-
-func New(subscriptionID string) BaseClient {
- return original.New(subscriptionID)
-}
-func NewContainerHostMappingsClient(subscriptionID string) ContainerHostMappingsClient {
- return original.NewContainerHostMappingsClient(subscriptionID)
-}
-func NewContainerHostMappingsClientWithBaseURI(baseURI string, subscriptionID string) ContainerHostMappingsClient {
- return original.NewContainerHostMappingsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewControllerListIterator(page ControllerListPage) ControllerListIterator {
- return original.NewControllerListIterator(page)
-}
-func NewControllerListPage(getNextPage func(context.Context, ControllerList) (ControllerList, error)) ControllerListPage {
- return original.NewControllerListPage(getNextPage)
-}
-func NewControllersClient(subscriptionID string) ControllersClient {
- return original.NewControllersClient(subscriptionID)
-}
-func NewControllersClientWithBaseURI(baseURI string, subscriptionID string) ControllersClient {
- return original.NewControllersClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewOperationsClient(subscriptionID string) OperationsClient {
- return original.NewOperationsClient(subscriptionID)
-}
-func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient {
- return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewResourceProviderOperationListIterator(page ResourceProviderOperationListPage) ResourceProviderOperationListIterator {
- return original.NewResourceProviderOperationListIterator(page)
-}
-func NewResourceProviderOperationListPage(getNextPage func(context.Context, ResourceProviderOperationList) (ResourceProviderOperationList, error)) ResourceProviderOperationListPage {
- return original.NewResourceProviderOperationListPage(getNextPage)
-}
-func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
- return original.NewWithBaseURI(baseURI, subscriptionID)
-}
-func PossibleInstanceTypeValues() []InstanceType {
- return original.PossibleInstanceTypeValues()
-}
-func PossibleProvisioningStateValues() []ProvisioningState {
- return original.PossibleProvisioningStateValues()
-}
-func PossibleSkuTierValues() []SkuTier {
- return original.PossibleSkuTierValues()
-}
-func UserAgent() string {
- return original.UserAgent() + " profiles/preview"
-}
-func Version() string {
- return original.Version()
-}
diff --git a/profiles/preview/preview/frontdoor/mgmt/frontdoor/frontdoorapi/models.go b/profiles/preview/preview/frontdoor/mgmt/frontdoor/frontdoorapi/models.go
index b2d40a2d8b82..8a4e9fe3dfdd 100644
--- a/profiles/preview/preview/frontdoor/mgmt/frontdoor/frontdoorapi/models.go
+++ b/profiles/preview/preview/frontdoor/mgmt/frontdoor/frontdoorapi/models.go
@@ -19,15 +19,10 @@
package frontdoorapi
-import original "github.com/Azure/azure-sdk-for-go/services/preview/frontdoor/mgmt/2019-05-01/frontdoor/frontdoorapi"
+import original "github.com/Azure/azure-sdk-for-go/services/preview/frontdoor/mgmt/2018-08-01-preview/frontdoor/frontdoorapi"
-type BackendPoolsClientAPI = original.BackendPoolsClientAPI
type BaseClientAPI = original.BaseClientAPI
type EndpointsClientAPI = original.EndpointsClientAPI
type FrontDoorsClientAPI = original.FrontDoorsClientAPI
type FrontendEndpointsClientAPI = original.FrontendEndpointsClientAPI
-type HealthProbeSettingsClientAPI = original.HealthProbeSettingsClientAPI
-type LoadBalancingSettingsClientAPI = original.LoadBalancingSettingsClientAPI
-type ManagedRuleSetsClientAPI = original.ManagedRuleSetsClientAPI
type PoliciesClientAPI = original.PoliciesClientAPI
-type RoutingRulesClientAPI = original.RoutingRulesClientAPI
diff --git a/profiles/preview/preview/frontdoor/mgmt/frontdoor/models.go b/profiles/preview/preview/frontdoor/mgmt/frontdoor/models.go
index 38aa56ec23bf..f7bfa1e2a7e0 100644
--- a/profiles/preview/preview/frontdoor/mgmt/frontdoor/models.go
+++ b/profiles/preview/preview/frontdoor/mgmt/frontdoor/models.go
@@ -22,20 +22,19 @@ package frontdoor
import (
"context"
- original "github.com/Azure/azure-sdk-for-go/services/preview/frontdoor/mgmt/2019-05-01/frontdoor"
+ original "github.com/Azure/azure-sdk-for-go/services/preview/frontdoor/mgmt/2018-08-01-preview/frontdoor"
)
const (
DefaultBaseURI = original.DefaultBaseURI
)
-type ActionType = original.ActionType
+type Action = original.Action
const (
- Allow ActionType = original.Allow
- Block ActionType = original.Block
- Log ActionType = original.Log
- Redirect ActionType = original.Redirect
+ Allow Action = original.Allow
+ Block Action = original.Block
+ Log Action = original.Log
)
type Availability = original.Availability
@@ -45,13 +44,6 @@ const (
Unavailable Availability = original.Unavailable
)
-type BackendEnabledState = original.BackendEnabledState
-
-const (
- Disabled BackendEnabledState = original.Disabled
- Enabled BackendEnabledState = original.Enabled
-)
-
type CertificateSource = original.CertificateSource
const (
@@ -68,11 +60,11 @@ const (
type CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningState
const (
- CustomHTTPSProvisioningStateDisabled CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningStateDisabled
- CustomHTTPSProvisioningStateDisabling CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningStateDisabling
- CustomHTTPSProvisioningStateEnabled CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningStateEnabled
- CustomHTTPSProvisioningStateEnabling CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningStateEnabling
- CustomHTTPSProvisioningStateFailed CustomHTTPSProvisioningState = original.CustomHTTPSProvisioningStateFailed
+ Disabled CustomHTTPSProvisioningState = original.Disabled
+ Disabling CustomHTTPSProvisioningState = original.Disabling
+ Enabled CustomHTTPSProvisioningState = original.Enabled
+ Enabling CustomHTTPSProvisioningState = original.Enabling
+ Failed CustomHTTPSProvisioningState = original.Failed
)
type CustomHTTPSProvisioningSubstate = original.CustomHTTPSProvisioningSubstate
@@ -90,13 +82,6 @@ const (
SubmittingDomainControlValidationRequest CustomHTTPSProvisioningSubstate = original.SubmittingDomainControlValidationRequest
)
-type CustomRuleEnabledState = original.CustomRuleEnabledState
-
-const (
- CustomRuleEnabledStateDisabled CustomRuleEnabledState = original.CustomRuleEnabledStateDisabled
- CustomRuleEnabledStateEnabled CustomRuleEnabledState = original.CustomRuleEnabledStateEnabled
-)
-
type DynamicCompressionEnabled = original.DynamicCompressionEnabled
const (
@@ -111,11 +96,11 @@ const (
EnabledStateEnabled EnabledState = original.EnabledStateEnabled
)
-type EnforceCertificateNameCheckEnabledState = original.EnforceCertificateNameCheckEnabledState
+type EnabledStateEnum = original.EnabledStateEnum
const (
- EnforceCertificateNameCheckEnabledStateDisabled EnforceCertificateNameCheckEnabledState = original.EnforceCertificateNameCheckEnabledStateDisabled
- EnforceCertificateNameCheckEnabledStateEnabled EnforceCertificateNameCheckEnabledState = original.EnforceCertificateNameCheckEnabledStateEnabled
+ EnabledStateEnumDisabled EnabledStateEnum = original.EnabledStateEnumDisabled
+ EnabledStateEnumEnabled EnabledStateEnum = original.EnabledStateEnumEnabled
)
type ForwardingProtocol = original.ForwardingProtocol
@@ -126,62 +111,31 @@ const (
MatchRequest ForwardingProtocol = original.MatchRequest
)
-type HealthProbeEnabled = original.HealthProbeEnabled
-
-const (
- HealthProbeEnabledDisabled HealthProbeEnabled = original.HealthProbeEnabledDisabled
- HealthProbeEnabledEnabled HealthProbeEnabled = original.HealthProbeEnabledEnabled
-)
-
-type HealthProbeMethod = original.HealthProbeMethod
-
-const (
- GET HealthProbeMethod = original.GET
- HEAD HealthProbeMethod = original.HEAD
-)
-
-type ManagedRuleEnabledState = original.ManagedRuleEnabledState
-
-const (
- ManagedRuleEnabledStateDisabled ManagedRuleEnabledState = original.ManagedRuleEnabledStateDisabled
- ManagedRuleEnabledStateEnabled ManagedRuleEnabledState = original.ManagedRuleEnabledStateEnabled
-)
-
-type MatchVariable = original.MatchVariable
+type MatchCondition = original.MatchCondition
const (
- Cookies MatchVariable = original.Cookies
- PostArgs MatchVariable = original.PostArgs
- QueryString MatchVariable = original.QueryString
- RemoteAddr MatchVariable = original.RemoteAddr
- RequestBody MatchVariable = original.RequestBody
- RequestHeader MatchVariable = original.RequestHeader
- RequestMethod MatchVariable = original.RequestMethod
- RequestURI MatchVariable = original.RequestURI
- SocketAddr MatchVariable = original.SocketAddr
+ PostArgs MatchCondition = original.PostArgs
+ QueryString MatchCondition = original.QueryString
+ RemoteAddr MatchCondition = original.RemoteAddr
+ RequestBody MatchCondition = original.RequestBody
+ RequestHeader MatchCondition = original.RequestHeader
+ RequestMethod MatchCondition = original.RequestMethod
+ RequestURI MatchCondition = original.RequestURI
)
-type MinimumTLSVersion = original.MinimumTLSVersion
+type Mode = original.Mode
const (
- OneFullStopTwo MinimumTLSVersion = original.OneFullStopTwo
- OneFullStopZero MinimumTLSVersion = original.OneFullStopZero
+ Detection Mode = original.Detection
+ Prevention Mode = original.Prevention
)
type NetworkOperationStatus = original.NetworkOperationStatus
const (
- Failed NetworkOperationStatus = original.Failed
- InProgress NetworkOperationStatus = original.InProgress
- Succeeded NetworkOperationStatus = original.Succeeded
-)
-
-type OdataType = original.OdataType
-
-const (
- OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration OdataType = original.OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration
- OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration OdataType = original.OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration
- OdataTypeRouteConfiguration OdataType = original.OdataTypeRouteConfiguration
+ NetworkOperationStatusFailed NetworkOperationStatus = original.NetworkOperationStatusFailed
+ NetworkOperationStatusInProgress NetworkOperationStatus = original.NetworkOperationStatusInProgress
+ NetworkOperationStatusSucceeded NetworkOperationStatus = original.NetworkOperationStatusSucceeded
)
type Operator = original.Operator
@@ -198,32 +152,6 @@ const (
IPMatch Operator = original.IPMatch
LessThan Operator = original.LessThan
LessThanOrEqual Operator = original.LessThanOrEqual
- RegEx Operator = original.RegEx
-)
-
-type PolicyEnabledState = original.PolicyEnabledState
-
-const (
- PolicyEnabledStateDisabled PolicyEnabledState = original.PolicyEnabledStateDisabled
- PolicyEnabledStateEnabled PolicyEnabledState = original.PolicyEnabledStateEnabled
-)
-
-type PolicyMode = original.PolicyMode
-
-const (
- Detection PolicyMode = original.Detection
- Prevention PolicyMode = original.Prevention
-)
-
-type PolicyResourceState = original.PolicyResourceState
-
-const (
- PolicyResourceStateCreating PolicyResourceState = original.PolicyResourceStateCreating
- PolicyResourceStateDeleting PolicyResourceState = original.PolicyResourceStateDeleting
- PolicyResourceStateDisabled PolicyResourceState = original.PolicyResourceStateDisabled
- PolicyResourceStateDisabling PolicyResourceState = original.PolicyResourceStateDisabling
- PolicyResourceStateEnabled PolicyResourceState = original.PolicyResourceStateEnabled
- PolicyResourceStateEnabling PolicyResourceState = original.PolicyResourceStateEnabling
)
type Protocol = original.Protocol
@@ -240,23 +168,6 @@ const (
StripNone Query = original.StripNone
)
-type RedirectProtocol = original.RedirectProtocol
-
-const (
- RedirectProtocolHTTPOnly RedirectProtocol = original.RedirectProtocolHTTPOnly
- RedirectProtocolHTTPSOnly RedirectProtocol = original.RedirectProtocolHTTPSOnly
- RedirectProtocolMatchRequest RedirectProtocol = original.RedirectProtocolMatchRequest
-)
-
-type RedirectType = original.RedirectType
-
-const (
- Found RedirectType = original.Found
- Moved RedirectType = original.Moved
- PermanentRedirect RedirectType = original.PermanentRedirect
- TemporaryRedirect RedirectType = original.TemporaryRedirect
-)
-
type ResourceState = original.ResourceState
const (
@@ -275,11 +186,18 @@ const (
MicrosoftNetworkfrontDoorsfrontendEndpoints ResourceType = original.MicrosoftNetworkfrontDoorsfrontendEndpoints
)
-type RoutingRuleEnabledState = original.RoutingRuleEnabledState
+type RuleGroupOverride = original.RuleGroupOverride
+
+const (
+ SQLInjection RuleGroupOverride = original.SQLInjection
+ XSS RuleGroupOverride = original.XSS
+)
+
+type RuleSetType = original.RuleSetType
const (
- RoutingRuleEnabledStateDisabled RoutingRuleEnabledState = original.RoutingRuleEnabledStateDisabled
- RoutingRuleEnabledStateEnabled RoutingRuleEnabledState = original.RoutingRuleEnabledStateEnabled
+ RuleSetTypeAzureManagedRuleSet RuleSetType = original.RuleSetTypeAzureManagedRuleSet
+ RuleSetTypeUnknown RuleSetType = original.RuleSetTypeUnknown
)
type RuleType = original.RuleType
@@ -296,67 +214,72 @@ const (
SessionAffinityEnabledStateEnabled SessionAffinityEnabledState = original.SessionAffinityEnabledStateEnabled
)
-type TransformType = original.TransformType
+type TLSProtocolType = original.TLSProtocolType
+
+const (
+ ServerNameIndication TLSProtocolType = original.ServerNameIndication
+)
+
+type Transform = original.Transform
+
+const (
+ HTMLEntityDecode Transform = original.HTMLEntityDecode
+ Lowercase Transform = original.Lowercase
+ RemoveNulls Transform = original.RemoveNulls
+ Trim Transform = original.Trim
+ Uppercase Transform = original.Uppercase
+ URLDecode Transform = original.URLDecode
+ URLEncode Transform = original.URLEncode
+)
+
+type WebApplicationFirewallPolicy = original.WebApplicationFirewallPolicy
const (
- Lowercase TransformType = original.Lowercase
- RemoveNulls TransformType = original.RemoveNulls
- Trim TransformType = original.Trim
- Uppercase TransformType = original.Uppercase
- URLDecode TransformType = original.URLDecode
- URLEncode TransformType = original.URLEncode
+ WebApplicationFirewallPolicyCreating WebApplicationFirewallPolicy = original.WebApplicationFirewallPolicyCreating
+ WebApplicationFirewallPolicyDeleting WebApplicationFirewallPolicy = original.WebApplicationFirewallPolicyDeleting
+ WebApplicationFirewallPolicyDisabled WebApplicationFirewallPolicy = original.WebApplicationFirewallPolicyDisabled
+ WebApplicationFirewallPolicyDisabling WebApplicationFirewallPolicy = original.WebApplicationFirewallPolicyDisabling
+ WebApplicationFirewallPolicyEnabled WebApplicationFirewallPolicy = original.WebApplicationFirewallPolicyEnabled
+ WebApplicationFirewallPolicyEnabling WebApplicationFirewallPolicy = original.WebApplicationFirewallPolicyEnabling
)
type AzureAsyncOperationResult = original.AzureAsyncOperationResult
+type AzureManagedOverrideRuleGroup = original.AzureManagedOverrideRuleGroup
+type AzureManagedRuleSet = original.AzureManagedRuleSet
type Backend = original.Backend
type BackendPool = original.BackendPool
type BackendPoolListResult = original.BackendPoolListResult
-type BackendPoolListResultIterator = original.BackendPoolListResultIterator
-type BackendPoolListResultPage = original.BackendPoolListResultPage
type BackendPoolProperties = original.BackendPoolProperties
type BackendPoolUpdateParameters = original.BackendPoolUpdateParameters
-type BackendPoolsClient = original.BackendPoolsClient
-type BackendPoolsCreateOrUpdateFuture = original.BackendPoolsCreateOrUpdateFuture
-type BackendPoolsDeleteFuture = original.BackendPoolsDeleteFuture
-type BackendPoolsSettings = original.BackendPoolsSettings
type BaseClient = original.BaseClient
-type BasicRouteConfiguration = original.BasicRouteConfiguration
+type BasicManagedRuleSet = original.BasicManagedRuleSet
type CacheConfiguration = original.CacheConfiguration
type CertificateSourceParameters = original.CertificateSourceParameters
type CheckNameAvailabilityInput = original.CheckNameAvailabilityInput
type CheckNameAvailabilityOutput = original.CheckNameAvailabilityOutput
type CustomHTTPSConfiguration = original.CustomHTTPSConfiguration
type CustomRule = original.CustomRule
-type CustomRuleList = original.CustomRuleList
+type CustomRules = original.CustomRules
type EndpointsClient = original.EndpointsClient
type EndpointsPurgeContentFuture = original.EndpointsPurgeContentFuture
type Error = original.Error
type ErrorDetails = original.ErrorDetails
type ErrorResponse = original.ErrorResponse
-type ForwardingConfiguration = original.ForwardingConfiguration
type FrontDoor = original.FrontDoor
type FrontDoorsClient = original.FrontDoorsClient
type FrontDoorsCreateOrUpdateFutureType = original.FrontDoorsCreateOrUpdateFutureType
type FrontDoorsDeleteFutureType = original.FrontDoorsDeleteFutureType
type FrontendEndpoint = original.FrontendEndpoint
-type FrontendEndpointLink = original.FrontendEndpointLink
type FrontendEndpointProperties = original.FrontendEndpointProperties
type FrontendEndpointUpdateParameters = original.FrontendEndpointUpdateParameters
type FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink = original.FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink
type FrontendEndpointsClient = original.FrontendEndpointsClient
-type FrontendEndpointsCreateOrUpdateFuture = original.FrontendEndpointsCreateOrUpdateFuture
-type FrontendEndpointsDeleteFuture = original.FrontendEndpointsDeleteFuture
type FrontendEndpointsDisableHTTPSFuture = original.FrontendEndpointsDisableHTTPSFuture
type FrontendEndpointsEnableHTTPSFuture = original.FrontendEndpointsEnableHTTPSFuture
type FrontendEndpointsListResult = original.FrontendEndpointsListResult
type FrontendEndpointsListResultIterator = original.FrontendEndpointsListResultIterator
type FrontendEndpointsListResultPage = original.FrontendEndpointsListResultPage
-type HealthProbeSettingsClient = original.HealthProbeSettingsClient
-type HealthProbeSettingsCreateOrUpdateFuture = original.HealthProbeSettingsCreateOrUpdateFuture
-type HealthProbeSettingsDeleteFuture = original.HealthProbeSettingsDeleteFuture
type HealthProbeSettingsListResult = original.HealthProbeSettingsListResult
-type HealthProbeSettingsListResultIterator = original.HealthProbeSettingsListResultIterator
-type HealthProbeSettingsListResultPage = original.HealthProbeSettingsListResultPage
type HealthProbeSettingsModel = original.HealthProbeSettingsModel
type HealthProbeSettingsProperties = original.HealthProbeSettingsProperties
type HealthProbeSettingsUpdateParameters = original.HealthProbeSettingsUpdateParameters
@@ -365,72 +288,37 @@ type KeyVaultCertificateSourceParametersVault = original.KeyVaultCertificateSour
type ListResult = original.ListResult
type ListResultIterator = original.ListResultIterator
type ListResultPage = original.ListResultPage
-type LoadBalancingSettingsClient = original.LoadBalancingSettingsClient
-type LoadBalancingSettingsCreateOrUpdateFuture = original.LoadBalancingSettingsCreateOrUpdateFuture
-type LoadBalancingSettingsDeleteFuture = original.LoadBalancingSettingsDeleteFuture
type LoadBalancingSettingsListResult = original.LoadBalancingSettingsListResult
-type LoadBalancingSettingsListResultIterator = original.LoadBalancingSettingsListResultIterator
-type LoadBalancingSettingsListResultPage = original.LoadBalancingSettingsListResultPage
type LoadBalancingSettingsModel = original.LoadBalancingSettingsModel
type LoadBalancingSettingsProperties = original.LoadBalancingSettingsProperties
type LoadBalancingSettingsUpdateParameters = original.LoadBalancingSettingsUpdateParameters
-type ManagedRuleDefinition = original.ManagedRuleDefinition
-type ManagedRuleGroupDefinition = original.ManagedRuleGroupDefinition
-type ManagedRuleGroupOverride = original.ManagedRuleGroupOverride
-type ManagedRuleOverride = original.ManagedRuleOverride
type ManagedRuleSet = original.ManagedRuleSet
-type ManagedRuleSetDefinition = original.ManagedRuleSetDefinition
-type ManagedRuleSetDefinitionList = original.ManagedRuleSetDefinitionList
-type ManagedRuleSetDefinitionListIterator = original.ManagedRuleSetDefinitionListIterator
-type ManagedRuleSetDefinitionListPage = original.ManagedRuleSetDefinitionListPage
-type ManagedRuleSetDefinitionProperties = original.ManagedRuleSetDefinitionProperties
-type ManagedRuleSetList = original.ManagedRuleSetList
-type ManagedRuleSetsClient = original.ManagedRuleSetsClient
-type MatchCondition = original.MatchCondition
+type ManagedRuleSets = original.ManagedRuleSets
+type MatchCondition1 = original.MatchCondition1
type PoliciesClient = original.PoliciesClient
-type PoliciesCreateOrUpdateFuture = original.PoliciesCreateOrUpdateFuture
type PoliciesDeleteFuture = original.PoliciesDeleteFuture
type PolicySettings = original.PolicySettings
type Properties = original.Properties
type PurgeParameters = original.PurgeParameters
-type RedirectConfiguration = original.RedirectConfiguration
type Resource = original.Resource
-type RouteConfiguration = original.RouteConfiguration
type RoutingRule = original.RoutingRule
type RoutingRuleListResult = original.RoutingRuleListResult
-type RoutingRuleListResultIterator = original.RoutingRuleListResultIterator
-type RoutingRuleListResultPage = original.RoutingRuleListResultPage
type RoutingRuleProperties = original.RoutingRuleProperties
type RoutingRuleUpdateParameters = original.RoutingRuleUpdateParameters
-type RoutingRulesClient = original.RoutingRulesClient
-type RoutingRulesCreateOrUpdateFuture = original.RoutingRulesCreateOrUpdateFuture
-type RoutingRulesDeleteFuture = original.RoutingRulesDeleteFuture
type SubResource = original.SubResource
type TagsObject = original.TagsObject
type UpdateParameters = original.UpdateParameters
type ValidateCustomDomainInput = original.ValidateCustomDomainInput
type ValidateCustomDomainOutput = original.ValidateCustomDomainOutput
-type WebApplicationFirewallPolicy = original.WebApplicationFirewallPolicy
-type WebApplicationFirewallPolicyList = original.WebApplicationFirewallPolicyList
-type WebApplicationFirewallPolicyListIterator = original.WebApplicationFirewallPolicyListIterator
-type WebApplicationFirewallPolicyListPage = original.WebApplicationFirewallPolicyListPage
-type WebApplicationFirewallPolicyProperties = original.WebApplicationFirewallPolicyProperties
+type WebApplicationFirewallPolicy1 = original.WebApplicationFirewallPolicy1
+type WebApplicationFirewallPolicyListResult = original.WebApplicationFirewallPolicyListResult
+type WebApplicationFirewallPolicyListResultIterator = original.WebApplicationFirewallPolicyListResultIterator
+type WebApplicationFirewallPolicyListResultPage = original.WebApplicationFirewallPolicyListResultPage
+type WebApplicationFirewallPolicyPropertiesFormat = original.WebApplicationFirewallPolicyPropertiesFormat
func New(subscriptionID string) BaseClient {
return original.New(subscriptionID)
}
-func NewBackendPoolListResultIterator(page BackendPoolListResultPage) BackendPoolListResultIterator {
- return original.NewBackendPoolListResultIterator(page)
-}
-func NewBackendPoolListResultPage(getNextPage func(context.Context, BackendPoolListResult) (BackendPoolListResult, error)) BackendPoolListResultPage {
- return original.NewBackendPoolListResultPage(getNextPage)
-}
-func NewBackendPoolsClient(subscriptionID string) BackendPoolsClient {
- return original.NewBackendPoolsClient(subscriptionID)
-}
-func NewBackendPoolsClientWithBaseURI(baseURI string, subscriptionID string) BackendPoolsClient {
- return original.NewBackendPoolsClientWithBaseURI(baseURI, subscriptionID)
-}
func NewEndpointsClient(subscriptionID string) EndpointsClient {
return original.NewEndpointsClient(subscriptionID)
}
@@ -455,84 +343,33 @@ func NewFrontendEndpointsListResultIterator(page FrontendEndpointsListResultPage
func NewFrontendEndpointsListResultPage(getNextPage func(context.Context, FrontendEndpointsListResult) (FrontendEndpointsListResult, error)) FrontendEndpointsListResultPage {
return original.NewFrontendEndpointsListResultPage(getNextPage)
}
-func NewHealthProbeSettingsClient(subscriptionID string) HealthProbeSettingsClient {
- return original.NewHealthProbeSettingsClient(subscriptionID)
-}
-func NewHealthProbeSettingsClientWithBaseURI(baseURI string, subscriptionID string) HealthProbeSettingsClient {
- return original.NewHealthProbeSettingsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewHealthProbeSettingsListResultIterator(page HealthProbeSettingsListResultPage) HealthProbeSettingsListResultIterator {
- return original.NewHealthProbeSettingsListResultIterator(page)
-}
-func NewHealthProbeSettingsListResultPage(getNextPage func(context.Context, HealthProbeSettingsListResult) (HealthProbeSettingsListResult, error)) HealthProbeSettingsListResultPage {
- return original.NewHealthProbeSettingsListResultPage(getNextPage)
-}
func NewListResultIterator(page ListResultPage) ListResultIterator {
return original.NewListResultIterator(page)
}
func NewListResultPage(getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage {
return original.NewListResultPage(getNextPage)
}
-func NewLoadBalancingSettingsClient(subscriptionID string) LoadBalancingSettingsClient {
- return original.NewLoadBalancingSettingsClient(subscriptionID)
-}
-func NewLoadBalancingSettingsClientWithBaseURI(baseURI string, subscriptionID string) LoadBalancingSettingsClient {
- return original.NewLoadBalancingSettingsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewLoadBalancingSettingsListResultIterator(page LoadBalancingSettingsListResultPage) LoadBalancingSettingsListResultIterator {
- return original.NewLoadBalancingSettingsListResultIterator(page)
-}
-func NewLoadBalancingSettingsListResultPage(getNextPage func(context.Context, LoadBalancingSettingsListResult) (LoadBalancingSettingsListResult, error)) LoadBalancingSettingsListResultPage {
- return original.NewLoadBalancingSettingsListResultPage(getNextPage)
-}
-func NewManagedRuleSetDefinitionListIterator(page ManagedRuleSetDefinitionListPage) ManagedRuleSetDefinitionListIterator {
- return original.NewManagedRuleSetDefinitionListIterator(page)
-}
-func NewManagedRuleSetDefinitionListPage(getNextPage func(context.Context, ManagedRuleSetDefinitionList) (ManagedRuleSetDefinitionList, error)) ManagedRuleSetDefinitionListPage {
- return original.NewManagedRuleSetDefinitionListPage(getNextPage)
-}
-func NewManagedRuleSetsClient(subscriptionID string) ManagedRuleSetsClient {
- return original.NewManagedRuleSetsClient(subscriptionID)
-}
-func NewManagedRuleSetsClientWithBaseURI(baseURI string, subscriptionID string) ManagedRuleSetsClient {
- return original.NewManagedRuleSetsClientWithBaseURI(baseURI, subscriptionID)
-}
func NewPoliciesClient(subscriptionID string) PoliciesClient {
return original.NewPoliciesClient(subscriptionID)
}
func NewPoliciesClientWithBaseURI(baseURI string, subscriptionID string) PoliciesClient {
return original.NewPoliciesClientWithBaseURI(baseURI, subscriptionID)
}
-func NewRoutingRuleListResultIterator(page RoutingRuleListResultPage) RoutingRuleListResultIterator {
- return original.NewRoutingRuleListResultIterator(page)
-}
-func NewRoutingRuleListResultPage(getNextPage func(context.Context, RoutingRuleListResult) (RoutingRuleListResult, error)) RoutingRuleListResultPage {
- return original.NewRoutingRuleListResultPage(getNextPage)
-}
-func NewRoutingRulesClient(subscriptionID string) RoutingRulesClient {
- return original.NewRoutingRulesClient(subscriptionID)
+func NewWebApplicationFirewallPolicyListResultIterator(page WebApplicationFirewallPolicyListResultPage) WebApplicationFirewallPolicyListResultIterator {
+ return original.NewWebApplicationFirewallPolicyListResultIterator(page)
}
-func NewRoutingRulesClientWithBaseURI(baseURI string, subscriptionID string) RoutingRulesClient {
- return original.NewRoutingRulesClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewWebApplicationFirewallPolicyListIterator(page WebApplicationFirewallPolicyListPage) WebApplicationFirewallPolicyListIterator {
- return original.NewWebApplicationFirewallPolicyListIterator(page)
-}
-func NewWebApplicationFirewallPolicyListPage(getNextPage func(context.Context, WebApplicationFirewallPolicyList) (WebApplicationFirewallPolicyList, error)) WebApplicationFirewallPolicyListPage {
- return original.NewWebApplicationFirewallPolicyListPage(getNextPage)
+func NewWebApplicationFirewallPolicyListResultPage(getNextPage func(context.Context, WebApplicationFirewallPolicyListResult) (WebApplicationFirewallPolicyListResult, error)) WebApplicationFirewallPolicyListResultPage {
+ return original.NewWebApplicationFirewallPolicyListResultPage(getNextPage)
}
func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
return original.NewWithBaseURI(baseURI, subscriptionID)
}
-func PossibleActionTypeValues() []ActionType {
- return original.PossibleActionTypeValues()
+func PossibleActionValues() []Action {
+ return original.PossibleActionValues()
}
func PossibleAvailabilityValues() []Availability {
return original.PossibleAvailabilityValues()
}
-func PossibleBackendEnabledStateValues() []BackendEnabledState {
- return original.PossibleBackendEnabledStateValues()
-}
func PossibleCertificateSourceValues() []CertificateSource {
return original.PossibleCertificateSourceValues()
}
@@ -545,74 +382,47 @@ func PossibleCustomHTTPSProvisioningStateValues() []CustomHTTPSProvisioningState
func PossibleCustomHTTPSProvisioningSubstateValues() []CustomHTTPSProvisioningSubstate {
return original.PossibleCustomHTTPSProvisioningSubstateValues()
}
-func PossibleCustomRuleEnabledStateValues() []CustomRuleEnabledState {
- return original.PossibleCustomRuleEnabledStateValues()
-}
func PossibleDynamicCompressionEnabledValues() []DynamicCompressionEnabled {
return original.PossibleDynamicCompressionEnabledValues()
}
+func PossibleEnabledStateEnumValues() []EnabledStateEnum {
+ return original.PossibleEnabledStateEnumValues()
+}
func PossibleEnabledStateValues() []EnabledState {
return original.PossibleEnabledStateValues()
}
-func PossibleEnforceCertificateNameCheckEnabledStateValues() []EnforceCertificateNameCheckEnabledState {
- return original.PossibleEnforceCertificateNameCheckEnabledStateValues()
-}
func PossibleForwardingProtocolValues() []ForwardingProtocol {
return original.PossibleForwardingProtocolValues()
}
-func PossibleHealthProbeEnabledValues() []HealthProbeEnabled {
- return original.PossibleHealthProbeEnabledValues()
+func PossibleMatchConditionValues() []MatchCondition {
+ return original.PossibleMatchConditionValues()
}
-func PossibleHealthProbeMethodValues() []HealthProbeMethod {
- return original.PossibleHealthProbeMethodValues()
-}
-func PossibleManagedRuleEnabledStateValues() []ManagedRuleEnabledState {
- return original.PossibleManagedRuleEnabledStateValues()
-}
-func PossibleMatchVariableValues() []MatchVariable {
- return original.PossibleMatchVariableValues()
-}
-func PossibleMinimumTLSVersionValues() []MinimumTLSVersion {
- return original.PossibleMinimumTLSVersionValues()
+func PossibleModeValues() []Mode {
+ return original.PossibleModeValues()
}
func PossibleNetworkOperationStatusValues() []NetworkOperationStatus {
return original.PossibleNetworkOperationStatusValues()
}
-func PossibleOdataTypeValues() []OdataType {
- return original.PossibleOdataTypeValues()
-}
func PossibleOperatorValues() []Operator {
return original.PossibleOperatorValues()
}
-func PossiblePolicyEnabledStateValues() []PolicyEnabledState {
- return original.PossiblePolicyEnabledStateValues()
-}
-func PossiblePolicyModeValues() []PolicyMode {
- return original.PossiblePolicyModeValues()
-}
-func PossiblePolicyResourceStateValues() []PolicyResourceState {
- return original.PossiblePolicyResourceStateValues()
-}
func PossibleProtocolValues() []Protocol {
return original.PossibleProtocolValues()
}
func PossibleQueryValues() []Query {
return original.PossibleQueryValues()
}
-func PossibleRedirectProtocolValues() []RedirectProtocol {
- return original.PossibleRedirectProtocolValues()
-}
-func PossibleRedirectTypeValues() []RedirectType {
- return original.PossibleRedirectTypeValues()
-}
func PossibleResourceStateValues() []ResourceState {
return original.PossibleResourceStateValues()
}
func PossibleResourceTypeValues() []ResourceType {
return original.PossibleResourceTypeValues()
}
-func PossibleRoutingRuleEnabledStateValues() []RoutingRuleEnabledState {
- return original.PossibleRoutingRuleEnabledStateValues()
+func PossibleRuleGroupOverrideValues() []RuleGroupOverride {
+ return original.PossibleRuleGroupOverrideValues()
+}
+func PossibleRuleSetTypeValues() []RuleSetType {
+ return original.PossibleRuleSetTypeValues()
}
func PossibleRuleTypeValues() []RuleType {
return original.PossibleRuleTypeValues()
@@ -620,8 +430,14 @@ func PossibleRuleTypeValues() []RuleType {
func PossibleSessionAffinityEnabledStateValues() []SessionAffinityEnabledState {
return original.PossibleSessionAffinityEnabledStateValues()
}
-func PossibleTransformTypeValues() []TransformType {
- return original.PossibleTransformTypeValues()
+func PossibleTLSProtocolTypeValues() []TLSProtocolType {
+ return original.PossibleTLSProtocolTypeValues()
+}
+func PossibleTransformValues() []Transform {
+ return original.PossibleTransformValues()
+}
+func PossibleWebApplicationFirewallPolicyValues() []WebApplicationFirewallPolicy {
+ return original.PossibleWebApplicationFirewallPolicyValues()
}
func UserAgent() string {
return original.UserAgent() + " profiles/preview"
diff --git a/profiles/preview/preview/logic/mgmt/logic/logicapi/models.go b/profiles/preview/preview/logic/mgmt/logic/logicapi/models.go
index 14c12e7e0d6b..707ce253505e 100644
--- a/profiles/preview/preview/logic/mgmt/logic/logicapi/models.go
+++ b/profiles/preview/preview/logic/mgmt/logic/logicapi/models.go
@@ -19,7 +19,7 @@
package logicapi
-import original "github.com/Azure/azure-sdk-for-go/services/preview/logic/mgmt/2018-07-01-preview/logic/logicapi"
+import original "github.com/Azure/azure-sdk-for-go/services/preview/logic/mgmt/2019-05-01/logic/logicapi"
type IntegrationAccountAgreementsClientAPI = original.IntegrationAccountAgreementsClientAPI
type IntegrationAccountAssembliesClientAPI = original.IntegrationAccountAssembliesClientAPI
@@ -30,6 +30,11 @@ type IntegrationAccountPartnersClientAPI = original.IntegrationAccountPartnersCl
type IntegrationAccountSchemasClientAPI = original.IntegrationAccountSchemasClientAPI
type IntegrationAccountSessionsClientAPI = original.IntegrationAccountSessionsClientAPI
type IntegrationAccountsClientAPI = original.IntegrationAccountsClientAPI
+type IntegrationServiceEnvironmentManagedAPIOperationsClientAPI = original.IntegrationServiceEnvironmentManagedAPIOperationsClientAPI
+type IntegrationServiceEnvironmentManagedApisClientAPI = original.IntegrationServiceEnvironmentManagedApisClientAPI
+type IntegrationServiceEnvironmentNetworkHealthClientAPI = original.IntegrationServiceEnvironmentNetworkHealthClientAPI
+type IntegrationServiceEnvironmentSkusClientAPI = original.IntegrationServiceEnvironmentSkusClientAPI
+type IntegrationServiceEnvironmentsClientAPI = original.IntegrationServiceEnvironmentsClientAPI
type OperationsClientAPI = original.OperationsClientAPI
type WorkflowRunActionRepetitionsClientAPI = original.WorkflowRunActionRepetitionsClientAPI
type WorkflowRunActionRepetitionsRequestHistoriesClientAPI = original.WorkflowRunActionRepetitionsRequestHistoriesClientAPI
diff --git a/profiles/preview/preview/logic/mgmt/logic/models.go b/profiles/preview/preview/logic/mgmt/logic/models.go
index 4840cfe366c6..d440b4dcda88 100644
--- a/profiles/preview/preview/logic/mgmt/logic/models.go
+++ b/profiles/preview/preview/logic/mgmt/logic/models.go
@@ -22,13 +22,38 @@ package logic
import (
"context"
- original "github.com/Azure/azure-sdk-for-go/services/preview/logic/mgmt/2018-07-01-preview/logic"
+ original "github.com/Azure/azure-sdk-for-go/services/preview/logic/mgmt/2019-05-01/logic"
)
const (
DefaultBaseURI = original.DefaultBaseURI
)
+type APIDeploymentParameterVisibility = original.APIDeploymentParameterVisibility
+
+const (
+ APIDeploymentParameterVisibilityDefault APIDeploymentParameterVisibility = original.APIDeploymentParameterVisibilityDefault
+ APIDeploymentParameterVisibilityInternal APIDeploymentParameterVisibility = original.APIDeploymentParameterVisibilityInternal
+ APIDeploymentParameterVisibilityNotSpecified APIDeploymentParameterVisibility = original.APIDeploymentParameterVisibilityNotSpecified
+)
+
+type APITier = original.APITier
+
+const (
+ APITierEnterprise APITier = original.APITierEnterprise
+ APITierNotSpecified APITier = original.APITierNotSpecified
+ APITierPremium APITier = original.APITierPremium
+ APITierStandard APITier = original.APITierStandard
+)
+
+type APIType = original.APIType
+
+const (
+ APITypeNotSpecified APIType = original.APITypeNotSpecified
+ APITypeRest APIType = original.APITypeRest
+ APITypeSoap APIType = original.APITypeSoap
+)
+
type AgreementType = original.AgreementType
const (
@@ -38,6 +63,15 @@ const (
X12 AgreementType = original.X12
)
+type AzureAsyncOperationState = original.AzureAsyncOperationState
+
+const (
+ Canceled AzureAsyncOperationState = original.Canceled
+ Failed AzureAsyncOperationState = original.Failed
+ Pending AzureAsyncOperationState = original.Pending
+ Succeeded AzureAsyncOperationState = original.Succeeded
+)
+
type DayOfWeek = original.DayOfWeek
const (
@@ -102,6 +136,15 @@ const (
EncryptionAlgorithmRC2 EncryptionAlgorithm = original.EncryptionAlgorithmRC2
)
+type ErrorResponseCode = original.ErrorResponseCode
+
+const (
+ ErrorResponseCodeIntegrationServiceEnvironmentNotFound ErrorResponseCode = original.ErrorResponseCodeIntegrationServiceEnvironmentNotFound
+ ErrorResponseCodeInternalServerError ErrorResponseCode = original.ErrorResponseCodeInternalServerError
+ ErrorResponseCodeInvalidOperationID ErrorResponseCode = original.ErrorResponseCodeInvalidOperationID
+ ErrorResponseCodeNotSpecified ErrorResponseCode = original.ErrorResponseCodeNotSpecified
+)
+
type EventLevel = original.EventLevel
const (
@@ -134,6 +177,65 @@ const (
IntegrationAccountSkuNameStandard IntegrationAccountSkuName = original.IntegrationAccountSkuNameStandard
)
+type IntegrationServiceEnvironmentAccessEndpointType = original.IntegrationServiceEnvironmentAccessEndpointType
+
+const (
+ IntegrationServiceEnvironmentAccessEndpointTypeExternal IntegrationServiceEnvironmentAccessEndpointType = original.IntegrationServiceEnvironmentAccessEndpointTypeExternal
+ IntegrationServiceEnvironmentAccessEndpointTypeInternal IntegrationServiceEnvironmentAccessEndpointType = original.IntegrationServiceEnvironmentAccessEndpointTypeInternal
+ IntegrationServiceEnvironmentAccessEndpointTypeNotSpecified IntegrationServiceEnvironmentAccessEndpointType = original.IntegrationServiceEnvironmentAccessEndpointTypeNotSpecified
+)
+
+type IntegrationServiceEnvironmentNetworkDependencyCategoryType = original.IntegrationServiceEnvironmentNetworkDependencyCategoryType
+
+const (
+ IntegrationServiceEnvironmentNetworkDependencyCategoryTypeAccessEndpoints IntegrationServiceEnvironmentNetworkDependencyCategoryType = original.IntegrationServiceEnvironmentNetworkDependencyCategoryTypeAccessEndpoints
+ IntegrationServiceEnvironmentNetworkDependencyCategoryTypeAzureActiveDirectory IntegrationServiceEnvironmentNetworkDependencyCategoryType = original.IntegrationServiceEnvironmentNetworkDependencyCategoryTypeAzureActiveDirectory
+ IntegrationServiceEnvironmentNetworkDependencyCategoryTypeAzureManagement IntegrationServiceEnvironmentNetworkDependencyCategoryType = original.IntegrationServiceEnvironmentNetworkDependencyCategoryTypeAzureManagement
+ IntegrationServiceEnvironmentNetworkDependencyCategoryTypeAzureStorage IntegrationServiceEnvironmentNetworkDependencyCategoryType = original.IntegrationServiceEnvironmentNetworkDependencyCategoryTypeAzureStorage
+ IntegrationServiceEnvironmentNetworkDependencyCategoryTypeDiagnosticLogsAndMetrics IntegrationServiceEnvironmentNetworkDependencyCategoryType = original.IntegrationServiceEnvironmentNetworkDependencyCategoryTypeDiagnosticLogsAndMetrics
+ IntegrationServiceEnvironmentNetworkDependencyCategoryTypeIntegrationServiceEnvironmentConnectors IntegrationServiceEnvironmentNetworkDependencyCategoryType = original.IntegrationServiceEnvironmentNetworkDependencyCategoryTypeIntegrationServiceEnvironmentConnectors
+ IntegrationServiceEnvironmentNetworkDependencyCategoryTypeNotSpecified IntegrationServiceEnvironmentNetworkDependencyCategoryType = original.IntegrationServiceEnvironmentNetworkDependencyCategoryTypeNotSpecified
+ IntegrationServiceEnvironmentNetworkDependencyCategoryTypeRecoveryService IntegrationServiceEnvironmentNetworkDependencyCategoryType = original.IntegrationServiceEnvironmentNetworkDependencyCategoryTypeRecoveryService
+ IntegrationServiceEnvironmentNetworkDependencyCategoryTypeRedisCache IntegrationServiceEnvironmentNetworkDependencyCategoryType = original.IntegrationServiceEnvironmentNetworkDependencyCategoryTypeRedisCache
+ IntegrationServiceEnvironmentNetworkDependencyCategoryTypeRegionalService IntegrationServiceEnvironmentNetworkDependencyCategoryType = original.IntegrationServiceEnvironmentNetworkDependencyCategoryTypeRegionalService
+ IntegrationServiceEnvironmentNetworkDependencyCategoryTypeSQL IntegrationServiceEnvironmentNetworkDependencyCategoryType = original.IntegrationServiceEnvironmentNetworkDependencyCategoryTypeSQL
+ IntegrationServiceEnvironmentNetworkDependencyCategoryTypeSSLCertificateVerification IntegrationServiceEnvironmentNetworkDependencyCategoryType = original.IntegrationServiceEnvironmentNetworkDependencyCategoryTypeSSLCertificateVerification
+)
+
+type IntegrationServiceEnvironmentNetworkDependencyHealthState = original.IntegrationServiceEnvironmentNetworkDependencyHealthState
+
+const (
+ IntegrationServiceEnvironmentNetworkDependencyHealthStateHealthy IntegrationServiceEnvironmentNetworkDependencyHealthState = original.IntegrationServiceEnvironmentNetworkDependencyHealthStateHealthy
+ IntegrationServiceEnvironmentNetworkDependencyHealthStateNotSpecified IntegrationServiceEnvironmentNetworkDependencyHealthState = original.IntegrationServiceEnvironmentNetworkDependencyHealthStateNotSpecified
+ IntegrationServiceEnvironmentNetworkDependencyHealthStateUnhealthy IntegrationServiceEnvironmentNetworkDependencyHealthState = original.IntegrationServiceEnvironmentNetworkDependencyHealthStateUnhealthy
+ IntegrationServiceEnvironmentNetworkDependencyHealthStateUnknown IntegrationServiceEnvironmentNetworkDependencyHealthState = original.IntegrationServiceEnvironmentNetworkDependencyHealthStateUnknown
+)
+
+type IntegrationServiceEnvironmentNetworkEndPointAccessibilityState = original.IntegrationServiceEnvironmentNetworkEndPointAccessibilityState
+
+const (
+ IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateAvailable IntegrationServiceEnvironmentNetworkEndPointAccessibilityState = original.IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateAvailable
+ IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateNotAvailable IntegrationServiceEnvironmentNetworkEndPointAccessibilityState = original.IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateNotAvailable
+ IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateNotSpecified IntegrationServiceEnvironmentNetworkEndPointAccessibilityState = original.IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateNotSpecified
+ IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateUnknown IntegrationServiceEnvironmentNetworkEndPointAccessibilityState = original.IntegrationServiceEnvironmentNetworkEndPointAccessibilityStateUnknown
+)
+
+type IntegrationServiceEnvironmentSkuName = original.IntegrationServiceEnvironmentSkuName
+
+const (
+ IntegrationServiceEnvironmentSkuNameDeveloper IntegrationServiceEnvironmentSkuName = original.IntegrationServiceEnvironmentSkuNameDeveloper
+ IntegrationServiceEnvironmentSkuNameNotSpecified IntegrationServiceEnvironmentSkuName = original.IntegrationServiceEnvironmentSkuNameNotSpecified
+ IntegrationServiceEnvironmentSkuNamePremium IntegrationServiceEnvironmentSkuName = original.IntegrationServiceEnvironmentSkuNamePremium
+)
+
+type IntegrationServiceEnvironmentSkuScaleType = original.IntegrationServiceEnvironmentSkuScaleType
+
+const (
+ Automatic IntegrationServiceEnvironmentSkuScaleType = original.Automatic
+ Manual IntegrationServiceEnvironmentSkuScaleType = original.Manual
+ None IntegrationServiceEnvironmentSkuScaleType = original.None
+)
+
type KeyType = original.KeyType
const (
@@ -233,11 +335,32 @@ const (
SkuNameStandard SkuName = original.SkuNameStandard
)
+type StatusAnnotation = original.StatusAnnotation
+
+const (
+ StatusAnnotationNotSpecified StatusAnnotation = original.StatusAnnotationNotSpecified
+ StatusAnnotationPreview StatusAnnotation = original.StatusAnnotationPreview
+ StatusAnnotationProduction StatusAnnotation = original.StatusAnnotationProduction
+)
+
+type SwaggerSchemaType = original.SwaggerSchemaType
+
+const (
+ Array SwaggerSchemaType = original.Array
+ Boolean SwaggerSchemaType = original.Boolean
+ File SwaggerSchemaType = original.File
+ Integer SwaggerSchemaType = original.Integer
+ Null SwaggerSchemaType = original.Null
+ Number SwaggerSchemaType = original.Number
+ Object SwaggerSchemaType = original.Object
+ String SwaggerSchemaType = original.String
+)
+
type TrackEventsOperationOptions = original.TrackEventsOperationOptions
const (
- DisableSourceInfoEnrich TrackEventsOperationOptions = original.DisableSourceInfoEnrich
- None TrackEventsOperationOptions = original.None
+ TrackEventsOperationOptionsDisableSourceInfoEnrich TrackEventsOperationOptions = original.TrackEventsOperationOptionsDisableSourceInfoEnrich
+ TrackEventsOperationOptionsNone TrackEventsOperationOptions = original.TrackEventsOperationOptionsNone
)
type TrackingRecordType = original.TrackingRecordType
@@ -354,6 +477,14 @@ const (
WorkflowTriggerProvisioningStateUpdating WorkflowTriggerProvisioningState = original.WorkflowTriggerProvisioningStateUpdating
)
+type WsdlImportMethod = original.WsdlImportMethod
+
+const (
+ WsdlImportMethodNotSpecified WsdlImportMethod = original.WsdlImportMethodNotSpecified
+ WsdlImportMethodSoapPassThrough WsdlImportMethod = original.WsdlImportMethodSoapPassThrough
+ WsdlImportMethodSoapToRest WsdlImportMethod = original.WsdlImportMethodSoapToRest
+)
+
type X12CharacterSet = original.X12CharacterSet
const (
@@ -381,6 +512,21 @@ const (
X12TimeFormatNotSpecified X12TimeFormat = original.X12TimeFormatNotSpecified
)
+type APIDeploymentParameterMetadata = original.APIDeploymentParameterMetadata
+type APIDeploymentParameterMetadataSet = original.APIDeploymentParameterMetadataSet
+type APIOperation = original.APIOperation
+type APIOperationAnnotation = original.APIOperationAnnotation
+type APIOperationListResult = original.APIOperationListResult
+type APIOperationListResultIterator = original.APIOperationListResultIterator
+type APIOperationListResultPage = original.APIOperationListResultPage
+type APIOperationPropertiesDefinition = original.APIOperationPropertiesDefinition
+type APIReference = original.APIReference
+type APIResourceBackendService = original.APIResourceBackendService
+type APIResourceDefinitions = original.APIResourceDefinitions
+type APIResourceGeneralInformation = original.APIResourceGeneralInformation
+type APIResourceMetadata = original.APIResourceMetadata
+type APIResourcePolicies = original.APIResourcePolicies
+type APIResourceProperties = original.APIResourceProperties
type AS2AcknowledgementConnectionSettings = original.AS2AcknowledgementConnectionSettings
type AS2AgreementContent = original.AS2AgreementContent
type AS2EnvelopeSettings = original.AS2EnvelopeSettings
@@ -429,8 +575,12 @@ type ErrorResponse = original.ErrorResponse
type Expression = original.Expression
type ExpressionRoot = original.ExpressionRoot
type ExpressionTraces = original.ExpressionTraces
+type ExtendedErrorInfo = original.ExtendedErrorInfo
+type FlowEndpoints = original.FlowEndpoints
+type FlowEndpointsConfiguration = original.FlowEndpointsConfiguration
type GenerateUpgradedDefinitionParameters = original.GenerateUpgradedDefinitionParameters
type GetCallbackURLParameters = original.GetCallbackURLParameters
+type IPAddress = original.IPAddress
type IntegrationAccount = original.IntegrationAccount
type IntegrationAccountAgreement = original.IntegrationAccountAgreement
type IntegrationAccountAgreementFilter = original.IntegrationAccountAgreementFilter
@@ -465,6 +615,7 @@ type IntegrationAccountPartnerListResultIterator = original.IntegrationAccountPa
type IntegrationAccountPartnerListResultPage = original.IntegrationAccountPartnerListResultPage
type IntegrationAccountPartnerProperties = original.IntegrationAccountPartnerProperties
type IntegrationAccountPartnersClient = original.IntegrationAccountPartnersClient
+type IntegrationAccountProperties = original.IntegrationAccountProperties
type IntegrationAccountSchema = original.IntegrationAccountSchema
type IntegrationAccountSchemaFilter = original.IntegrationAccountSchemaFilter
type IntegrationAccountSchemaListResult = original.IntegrationAccountSchemaListResult
@@ -481,6 +632,32 @@ type IntegrationAccountSessionProperties = original.IntegrationAccountSessionPro
type IntegrationAccountSessionsClient = original.IntegrationAccountSessionsClient
type IntegrationAccountSku = original.IntegrationAccountSku
type IntegrationAccountsClient = original.IntegrationAccountsClient
+type IntegrationServiceEnvironment = original.IntegrationServiceEnvironment
+type IntegrationServiceEnvironmentAccessEndpoint = original.IntegrationServiceEnvironmentAccessEndpoint
+type IntegrationServiceEnvironmentListResult = original.IntegrationServiceEnvironmentListResult
+type IntegrationServiceEnvironmentListResultIterator = original.IntegrationServiceEnvironmentListResultIterator
+type IntegrationServiceEnvironmentListResultPage = original.IntegrationServiceEnvironmentListResultPage
+type IntegrationServiceEnvironmentManagedAPIOperationsClient = original.IntegrationServiceEnvironmentManagedAPIOperationsClient
+type IntegrationServiceEnvironmentManagedApisClient = original.IntegrationServiceEnvironmentManagedApisClient
+type IntegrationServiceEnvironmentManagedApisDeleteFuture = original.IntegrationServiceEnvironmentManagedApisDeleteFuture
+type IntegrationServiceEnvironmentManagedApisPutFuture = original.IntegrationServiceEnvironmentManagedApisPutFuture
+type IntegrationServiceEnvironmentNetworkDependency = original.IntegrationServiceEnvironmentNetworkDependency
+type IntegrationServiceEnvironmentNetworkDependencyHealth = original.IntegrationServiceEnvironmentNetworkDependencyHealth
+type IntegrationServiceEnvironmentNetworkEndpoint = original.IntegrationServiceEnvironmentNetworkEndpoint
+type IntegrationServiceEnvironmentNetworkHealthClient = original.IntegrationServiceEnvironmentNetworkHealthClient
+type IntegrationServiceEnvironmentProperties = original.IntegrationServiceEnvironmentProperties
+type IntegrationServiceEnvironmentSku = original.IntegrationServiceEnvironmentSku
+type IntegrationServiceEnvironmentSkuCapacity = original.IntegrationServiceEnvironmentSkuCapacity
+type IntegrationServiceEnvironmentSkuDefinition = original.IntegrationServiceEnvironmentSkuDefinition
+type IntegrationServiceEnvironmentSkuDefinitionSku = original.IntegrationServiceEnvironmentSkuDefinitionSku
+type IntegrationServiceEnvironmentSkuList = original.IntegrationServiceEnvironmentSkuList
+type IntegrationServiceEnvironmentSkuListIterator = original.IntegrationServiceEnvironmentSkuListIterator
+type IntegrationServiceEnvironmentSkuListPage = original.IntegrationServiceEnvironmentSkuListPage
+type IntegrationServiceEnvironmentSkusClient = original.IntegrationServiceEnvironmentSkusClient
+type IntegrationServiceEnvironmentSubnetNetworkHealth = original.IntegrationServiceEnvironmentSubnetNetworkHealth
+type IntegrationServiceEnvironmentsClient = original.IntegrationServiceEnvironmentsClient
+type IntegrationServiceEnvironmentsCreateOrUpdateFuture = original.IntegrationServiceEnvironmentsCreateOrUpdateFuture
+type IntegrationServiceEnvironmentsUpdateFuture = original.IntegrationServiceEnvironmentsUpdateFuture
type JSONSchema = original.JSONSchema
type KeyVaultKey = original.KeyVaultKey
type KeyVaultKeyAttributes = original.KeyVaultKeyAttributes
@@ -489,6 +666,11 @@ type KeyVaultKeyReference = original.KeyVaultKeyReference
type KeyVaultKeyReferenceKeyVault = original.KeyVaultKeyReferenceKeyVault
type KeyVaultReference = original.KeyVaultReference
type ListKeyVaultKeysDefinition = original.ListKeyVaultKeysDefinition
+type ManagedAPI = original.ManagedAPI
+type ManagedAPIListResult = original.ManagedAPIListResult
+type ManagedAPIListResultIterator = original.ManagedAPIListResultIterator
+type ManagedAPIListResultPage = original.ManagedAPIListResultPage
+type NetworkConfiguration = original.NetworkConfiguration
type Operation = original.Operation
type OperationDisplay = original.OperationDisplay
type OperationListResult = original.OperationListResult
@@ -514,10 +696,21 @@ type Response = original.Response
type RetryHistory = original.RetryHistory
type RunActionCorrelation = original.RunActionCorrelation
type RunCorrelation = original.RunCorrelation
+type SetIntegrationServiceEnvironmentSubnetNetworkHealth = original.SetIntegrationServiceEnvironmentSubnetNetworkHealth
type SetObject = original.SetObject
type SetTriggerStateActionDefinition = original.SetTriggerStateActionDefinition
type Sku = original.Sku
type SubResource = original.SubResource
+type SwaggerCustomDynamicList = original.SwaggerCustomDynamicList
+type SwaggerCustomDynamicProperties = original.SwaggerCustomDynamicProperties
+type SwaggerCustomDynamicSchema = original.SwaggerCustomDynamicSchema
+type SwaggerCustomDynamicTree = original.SwaggerCustomDynamicTree
+type SwaggerCustomDynamicTreeCommand = original.SwaggerCustomDynamicTreeCommand
+type SwaggerCustomDynamicTreeParameter = original.SwaggerCustomDynamicTreeParameter
+type SwaggerCustomDynamicTreeSettings = original.SwaggerCustomDynamicTreeSettings
+type SwaggerExternalDocumentation = original.SwaggerExternalDocumentation
+type SwaggerSchema = original.SwaggerSchema
+type SwaggerXML = original.SwaggerXML
type TrackingEvent = original.TrackingEvent
type TrackingEventErrorInfo = original.TrackingEventErrorInfo
type TrackingEventsDefinition = original.TrackingEventsDefinition
@@ -577,6 +770,8 @@ type WorkflowVersionProperties = original.WorkflowVersionProperties
type WorkflowVersionTriggersClient = original.WorkflowVersionTriggersClient
type WorkflowVersionsClient = original.WorkflowVersionsClient
type WorkflowsClient = original.WorkflowsClient
+type WorkflowsMoveFuture = original.WorkflowsMoveFuture
+type WsdlService = original.WsdlService
type X12AcknowledgementSettings = original.X12AcknowledgementSettings
type X12AgreementContent = original.X12AgreementContent
type X12DelimiterOverrides = original.X12DelimiterOverrides
@@ -596,6 +791,12 @@ type X12ValidationSettings = original.X12ValidationSettings
func New(subscriptionID string) BaseClient {
return original.New(subscriptionID)
}
+func NewAPIOperationListResultIterator(page APIOperationListResultPage) APIOperationListResultIterator {
+ return original.NewAPIOperationListResultIterator(page)
+}
+func NewAPIOperationListResultPage(getNextPage func(context.Context, APIOperationListResult) (APIOperationListResult, error)) APIOperationListResultPage {
+ return original.NewAPIOperationListResultPage(getNextPage)
+}
func NewIntegrationAccountAgreementListResultIterator(page IntegrationAccountAgreementListResultPage) IntegrationAccountAgreementListResultIterator {
return original.NewIntegrationAccountAgreementListResultIterator(page)
}
@@ -692,6 +893,54 @@ func NewIntegrationAccountsClient(subscriptionID string) IntegrationAccountsClie
func NewIntegrationAccountsClientWithBaseURI(baseURI string, subscriptionID string) IntegrationAccountsClient {
return original.NewIntegrationAccountsClientWithBaseURI(baseURI, subscriptionID)
}
+func NewIntegrationServiceEnvironmentListResultIterator(page IntegrationServiceEnvironmentListResultPage) IntegrationServiceEnvironmentListResultIterator {
+ return original.NewIntegrationServiceEnvironmentListResultIterator(page)
+}
+func NewIntegrationServiceEnvironmentListResultPage(getNextPage func(context.Context, IntegrationServiceEnvironmentListResult) (IntegrationServiceEnvironmentListResult, error)) IntegrationServiceEnvironmentListResultPage {
+ return original.NewIntegrationServiceEnvironmentListResultPage(getNextPage)
+}
+func NewIntegrationServiceEnvironmentManagedAPIOperationsClient(subscriptionID string) IntegrationServiceEnvironmentManagedAPIOperationsClient {
+ return original.NewIntegrationServiceEnvironmentManagedAPIOperationsClient(subscriptionID)
+}
+func NewIntegrationServiceEnvironmentManagedAPIOperationsClientWithBaseURI(baseURI string, subscriptionID string) IntegrationServiceEnvironmentManagedAPIOperationsClient {
+ return original.NewIntegrationServiceEnvironmentManagedAPIOperationsClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewIntegrationServiceEnvironmentManagedApisClient(subscriptionID string) IntegrationServiceEnvironmentManagedApisClient {
+ return original.NewIntegrationServiceEnvironmentManagedApisClient(subscriptionID)
+}
+func NewIntegrationServiceEnvironmentManagedApisClientWithBaseURI(baseURI string, subscriptionID string) IntegrationServiceEnvironmentManagedApisClient {
+ return original.NewIntegrationServiceEnvironmentManagedApisClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewIntegrationServiceEnvironmentNetworkHealthClient(subscriptionID string) IntegrationServiceEnvironmentNetworkHealthClient {
+ return original.NewIntegrationServiceEnvironmentNetworkHealthClient(subscriptionID)
+}
+func NewIntegrationServiceEnvironmentNetworkHealthClientWithBaseURI(baseURI string, subscriptionID string) IntegrationServiceEnvironmentNetworkHealthClient {
+ return original.NewIntegrationServiceEnvironmentNetworkHealthClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewIntegrationServiceEnvironmentSkuListIterator(page IntegrationServiceEnvironmentSkuListPage) IntegrationServiceEnvironmentSkuListIterator {
+ return original.NewIntegrationServiceEnvironmentSkuListIterator(page)
+}
+func NewIntegrationServiceEnvironmentSkuListPage(getNextPage func(context.Context, IntegrationServiceEnvironmentSkuList) (IntegrationServiceEnvironmentSkuList, error)) IntegrationServiceEnvironmentSkuListPage {
+ return original.NewIntegrationServiceEnvironmentSkuListPage(getNextPage)
+}
+func NewIntegrationServiceEnvironmentSkusClient(subscriptionID string) IntegrationServiceEnvironmentSkusClient {
+ return original.NewIntegrationServiceEnvironmentSkusClient(subscriptionID)
+}
+func NewIntegrationServiceEnvironmentSkusClientWithBaseURI(baseURI string, subscriptionID string) IntegrationServiceEnvironmentSkusClient {
+ return original.NewIntegrationServiceEnvironmentSkusClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewIntegrationServiceEnvironmentsClient(subscriptionID string) IntegrationServiceEnvironmentsClient {
+ return original.NewIntegrationServiceEnvironmentsClient(subscriptionID)
+}
+func NewIntegrationServiceEnvironmentsClientWithBaseURI(baseURI string, subscriptionID string) IntegrationServiceEnvironmentsClient {
+ return original.NewIntegrationServiceEnvironmentsClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewManagedAPIListResultIterator(page ManagedAPIListResultPage) ManagedAPIListResultIterator {
+ return original.NewManagedAPIListResultIterator(page)
+}
+func NewManagedAPIListResultPage(getNextPage func(context.Context, ManagedAPIListResult) (ManagedAPIListResult, error)) ManagedAPIListResultPage {
+ return original.NewManagedAPIListResultPage(getNextPage)
+}
func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
return original.NewOperationListResultIterator(page)
}
@@ -821,9 +1070,21 @@ func NewWorkflowsClient(subscriptionID string) WorkflowsClient {
func NewWorkflowsClientWithBaseURI(baseURI string, subscriptionID string) WorkflowsClient {
return original.NewWorkflowsClientWithBaseURI(baseURI, subscriptionID)
}
+func PossibleAPIDeploymentParameterVisibilityValues() []APIDeploymentParameterVisibility {
+ return original.PossibleAPIDeploymentParameterVisibilityValues()
+}
+func PossibleAPITierValues() []APITier {
+ return original.PossibleAPITierValues()
+}
+func PossibleAPITypeValues() []APIType {
+ return original.PossibleAPITypeValues()
+}
func PossibleAgreementTypeValues() []AgreementType {
return original.PossibleAgreementTypeValues()
}
+func PossibleAzureAsyncOperationStateValues() []AzureAsyncOperationState {
+ return original.PossibleAzureAsyncOperationStateValues()
+}
func PossibleDayOfWeekValues() []DayOfWeek {
return original.PossibleDayOfWeekValues()
}
@@ -839,6 +1100,9 @@ func PossibleEdifactDecimalIndicatorValues() []EdifactDecimalIndicator {
func PossibleEncryptionAlgorithmValues() []EncryptionAlgorithm {
return original.PossibleEncryptionAlgorithmValues()
}
+func PossibleErrorResponseCodeValues() []ErrorResponseCode {
+ return original.PossibleErrorResponseCodeValues()
+}
func PossibleEventLevelValues() []EventLevel {
return original.PossibleEventLevelValues()
}
@@ -848,6 +1112,24 @@ func PossibleHashingAlgorithmValues() []HashingAlgorithm {
func PossibleIntegrationAccountSkuNameValues() []IntegrationAccountSkuName {
return original.PossibleIntegrationAccountSkuNameValues()
}
+func PossibleIntegrationServiceEnvironmentAccessEndpointTypeValues() []IntegrationServiceEnvironmentAccessEndpointType {
+ return original.PossibleIntegrationServiceEnvironmentAccessEndpointTypeValues()
+}
+func PossibleIntegrationServiceEnvironmentNetworkDependencyCategoryTypeValues() []IntegrationServiceEnvironmentNetworkDependencyCategoryType {
+ return original.PossibleIntegrationServiceEnvironmentNetworkDependencyCategoryTypeValues()
+}
+func PossibleIntegrationServiceEnvironmentNetworkDependencyHealthStateValues() []IntegrationServiceEnvironmentNetworkDependencyHealthState {
+ return original.PossibleIntegrationServiceEnvironmentNetworkDependencyHealthStateValues()
+}
+func PossibleIntegrationServiceEnvironmentNetworkEndPointAccessibilityStateValues() []IntegrationServiceEnvironmentNetworkEndPointAccessibilityState {
+ return original.PossibleIntegrationServiceEnvironmentNetworkEndPointAccessibilityStateValues()
+}
+func PossibleIntegrationServiceEnvironmentSkuNameValues() []IntegrationServiceEnvironmentSkuName {
+ return original.PossibleIntegrationServiceEnvironmentSkuNameValues()
+}
+func PossibleIntegrationServiceEnvironmentSkuScaleTypeValues() []IntegrationServiceEnvironmentSkuScaleType {
+ return original.PossibleIntegrationServiceEnvironmentSkuScaleTypeValues()
+}
func PossibleKeyTypeValues() []KeyType {
return original.PossibleKeyTypeValues()
}
@@ -878,6 +1160,12 @@ func PossibleSigningAlgorithmValues() []SigningAlgorithm {
func PossibleSkuNameValues() []SkuName {
return original.PossibleSkuNameValues()
}
+func PossibleStatusAnnotationValues() []StatusAnnotation {
+ return original.PossibleStatusAnnotationValues()
+}
+func PossibleSwaggerSchemaTypeValues() []SwaggerSchemaType {
+ return original.PossibleSwaggerSchemaTypeValues()
+}
func PossibleTrackEventsOperationOptionsValues() []TrackEventsOperationOptions {
return original.PossibleTrackEventsOperationOptionsValues()
}
@@ -902,6 +1190,9 @@ func PossibleWorkflowStatusValues() []WorkflowStatus {
func PossibleWorkflowTriggerProvisioningStateValues() []WorkflowTriggerProvisioningState {
return original.PossibleWorkflowTriggerProvisioningStateValues()
}
+func PossibleWsdlImportMethodValues() []WsdlImportMethod {
+ return original.PossibleWsdlImportMethodValues()
+}
func PossibleX12CharacterSetValues() []X12CharacterSet {
return original.PossibleX12CharacterSetValues()
}
diff --git a/profiles/preview/preview/machinelearning/mgmt/services/models.go b/profiles/preview/preview/machinelearning/mgmt/services/models.go
deleted file mode 100644
index 467c0da43664..000000000000
--- a/profiles/preview/preview/machinelearning/mgmt/services/models.go
+++ /dev/null
@@ -1,196 +0,0 @@
-// +build go1.9
-
-// Copyright 2019 Microsoft Corporation
-//
-// 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.
-
-// This code was auto-generated by:
-// github.com/Azure/azure-sdk-for-go/tools/profileBuilder
-
-package services
-
-import (
- "context"
-
- original "github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2018-03-01-preview/services"
-)
-
-const (
- DefaultBaseURI = original.DefaultBaseURI
-)
-
-type ComputeType = original.ComputeType
-
-const (
- ComputeTypeAKS ComputeType = original.ComputeTypeAKS
- ComputeTypeBatchAI ComputeType = original.ComputeTypeBatchAI
- ComputeTypeDataFactory ComputeType = original.ComputeTypeDataFactory
- ComputeTypeHDInsight ComputeType = original.ComputeTypeHDInsight
- ComputeTypeVirtualMachine ComputeType = original.ComputeTypeVirtualMachine
-)
-
-type ComputeTypeBasicCompute = original.ComputeTypeBasicCompute
-
-const (
- ComputeTypeAKS1 ComputeTypeBasicCompute = original.ComputeTypeAKS1
- ComputeTypeBatchAI1 ComputeTypeBasicCompute = original.ComputeTypeBatchAI1
- ComputeTypeCompute ComputeTypeBasicCompute = original.ComputeTypeCompute
- ComputeTypeDataFactory1 ComputeTypeBasicCompute = original.ComputeTypeDataFactory1
- ComputeTypeHDInsight1 ComputeTypeBasicCompute = original.ComputeTypeHDInsight1
- ComputeTypeVirtualMachine1 ComputeTypeBasicCompute = original.ComputeTypeVirtualMachine1
-)
-
-type ComputeTypeBasicComputeSecrets = original.ComputeTypeBasicComputeSecrets
-
-const (
- ComputeTypeBasicComputeSecretsComputeTypeAKS ComputeTypeBasicComputeSecrets = original.ComputeTypeBasicComputeSecretsComputeTypeAKS
- ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets ComputeTypeBasicComputeSecrets = original.ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets
- ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine ComputeTypeBasicComputeSecrets = original.ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine
-)
-
-type ProvisioningState = original.ProvisioningState
-
-const (
- Canceled ProvisioningState = original.Canceled
- Creating ProvisioningState = original.Creating
- Deleting ProvisioningState = original.Deleting
- Failed ProvisioningState = original.Failed
- Succeeded ProvisioningState = original.Succeeded
- Unknown ProvisioningState = original.Unknown
- Updating ProvisioningState = original.Updating
-)
-
-type ResourceIdentityType = original.ResourceIdentityType
-
-const (
- SystemAssigned ResourceIdentityType = original.SystemAssigned
-)
-
-type Status = original.Status
-
-const (
- Disabled Status = original.Disabled
- Enabled Status = original.Enabled
-)
-
-type AKS = original.AKS
-type AKSProperties = original.AKSProperties
-type AksComputeSecrets = original.AksComputeSecrets
-type BaseClient = original.BaseClient
-type BasicCompute = original.BasicCompute
-type BasicComputeSecrets = original.BasicComputeSecrets
-type BatchAI = original.BatchAI
-type BatchAIProperties = original.BatchAIProperties
-type Compute = original.Compute
-type ComputeResource = original.ComputeResource
-type ComputeSecrets = original.ComputeSecrets
-type ComputeSecretsModel = original.ComputeSecretsModel
-type DataFactory = original.DataFactory
-type ErrorDetail = original.ErrorDetail
-type ErrorResponse = original.ErrorResponse
-type HDInsight = original.HDInsight
-type HDInsightProperties = original.HDInsightProperties
-type Identity = original.Identity
-type ListWorkspaceKeysResult = original.ListWorkspaceKeysResult
-type MachineLearningComputeClient = original.MachineLearningComputeClient
-type MachineLearningComputeCreateOrUpdateFuture = original.MachineLearningComputeCreateOrUpdateFuture
-type MachineLearningComputeDeleteFuture = original.MachineLearningComputeDeleteFuture
-type MachineLearningComputeSystemUpdateFuture = original.MachineLearningComputeSystemUpdateFuture
-type MachineLearningServiceError = original.MachineLearningServiceError
-type Operation = original.Operation
-type OperationDisplay = original.OperationDisplay
-type OperationListResult = original.OperationListResult
-type OperationsClient = original.OperationsClient
-type PaginatedComputeResourcesList = original.PaginatedComputeResourcesList
-type PaginatedComputeResourcesListIterator = original.PaginatedComputeResourcesListIterator
-type PaginatedComputeResourcesListPage = original.PaginatedComputeResourcesListPage
-type Password = original.Password
-type PrincipalCredentials = original.PrincipalCredentials
-type RegistryListCredentialsResult = original.RegistryListCredentialsResult
-type Resource = original.Resource
-type ScaleSettings = original.ScaleSettings
-type SslConfiguration = original.SslConfiguration
-type SystemService = original.SystemService
-type VirtualMachine = original.VirtualMachine
-type VirtualMachineProperties = original.VirtualMachineProperties
-type VirtualMachineSSHCredentials = original.VirtualMachineSSHCredentials
-type VirtualMachineSecrets = original.VirtualMachineSecrets
-type Workspace = original.Workspace
-type WorkspaceListResult = original.WorkspaceListResult
-type WorkspaceListResultIterator = original.WorkspaceListResultIterator
-type WorkspaceListResultPage = original.WorkspaceListResultPage
-type WorkspaceProperties = original.WorkspaceProperties
-type WorkspacePropertiesUpdateParameters = original.WorkspacePropertiesUpdateParameters
-type WorkspaceUpdateParameters = original.WorkspaceUpdateParameters
-type WorkspacesClient = original.WorkspacesClient
-
-func New(subscriptionID string) BaseClient {
- return original.New(subscriptionID)
-}
-func NewMachineLearningComputeClient(subscriptionID string) MachineLearningComputeClient {
- return original.NewMachineLearningComputeClient(subscriptionID)
-}
-func NewMachineLearningComputeClientWithBaseURI(baseURI string, subscriptionID string) MachineLearningComputeClient {
- return original.NewMachineLearningComputeClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewOperationsClient(subscriptionID string) OperationsClient {
- return original.NewOperationsClient(subscriptionID)
-}
-func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient {
- return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewPaginatedComputeResourcesListIterator(page PaginatedComputeResourcesListPage) PaginatedComputeResourcesListIterator {
- return original.NewPaginatedComputeResourcesListIterator(page)
-}
-func NewPaginatedComputeResourcesListPage(getNextPage func(context.Context, PaginatedComputeResourcesList) (PaginatedComputeResourcesList, error)) PaginatedComputeResourcesListPage {
- return original.NewPaginatedComputeResourcesListPage(getNextPage)
-}
-func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
- return original.NewWithBaseURI(baseURI, subscriptionID)
-}
-func NewWorkspaceListResultIterator(page WorkspaceListResultPage) WorkspaceListResultIterator {
- return original.NewWorkspaceListResultIterator(page)
-}
-func NewWorkspaceListResultPage(getNextPage func(context.Context, WorkspaceListResult) (WorkspaceListResult, error)) WorkspaceListResultPage {
- return original.NewWorkspaceListResultPage(getNextPage)
-}
-func NewWorkspacesClient(subscriptionID string) WorkspacesClient {
- return original.NewWorkspacesClient(subscriptionID)
-}
-func NewWorkspacesClientWithBaseURI(baseURI string, subscriptionID string) WorkspacesClient {
- return original.NewWorkspacesClientWithBaseURI(baseURI, subscriptionID)
-}
-func PossibleComputeTypeBasicComputeSecretsValues() []ComputeTypeBasicComputeSecrets {
- return original.PossibleComputeTypeBasicComputeSecretsValues()
-}
-func PossibleComputeTypeBasicComputeValues() []ComputeTypeBasicCompute {
- return original.PossibleComputeTypeBasicComputeValues()
-}
-func PossibleComputeTypeValues() []ComputeType {
- return original.PossibleComputeTypeValues()
-}
-func PossibleProvisioningStateValues() []ProvisioningState {
- return original.PossibleProvisioningStateValues()
-}
-func PossibleResourceIdentityTypeValues() []ResourceIdentityType {
- return original.PossibleResourceIdentityTypeValues()
-}
-func PossibleStatusValues() []Status {
- return original.PossibleStatusValues()
-}
-func UserAgent() string {
- return original.UserAgent() + " profiles/preview"
-}
-func Version() string {
- return original.Version()
-}
diff --git a/profiles/preview/preview/maintenance/mgmt/maintenance/maintenanceapi/models.go b/profiles/preview/preview/maintenance/mgmt/maintenance/maintenanceapi/models.go
new file mode 100644
index 000000000000..9aae9dd8b0d4
--- /dev/null
+++ b/profiles/preview/preview/maintenance/mgmt/maintenance/maintenanceapi/models.go
@@ -0,0 +1,28 @@
+// +build go1.9
+
+// Copyright 2019 Microsoft Corporation
+//
+// 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.
+
+// This code was auto-generated by:
+// github.com/Azure/azure-sdk-for-go/tools/profileBuilder
+
+package maintenanceapi
+
+import original "github.com/Azure/azure-sdk-for-go/services/preview/maintenance/mgmt/2018-06-01-preview/maintenance/maintenanceapi"
+
+type ApplyUpdatesClientAPI = original.ApplyUpdatesClientAPI
+type ConfigurationAssignmentsClientAPI = original.ConfigurationAssignmentsClientAPI
+type ConfigurationsClientAPI = original.ConfigurationsClientAPI
+type OperationsClientAPI = original.OperationsClientAPI
+type UpdatesClientAPI = original.UpdatesClientAPI
diff --git a/profiles/preview/preview/maintenance/mgmt/maintenance/models.go b/profiles/preview/preview/maintenance/mgmt/maintenance/models.go
new file mode 100644
index 000000000000..873254c688c5
--- /dev/null
+++ b/profiles/preview/preview/maintenance/mgmt/maintenance/models.go
@@ -0,0 +1,130 @@
+// +build go1.9
+
+// Copyright 2019 Microsoft Corporation
+//
+// 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.
+
+// This code was auto-generated by:
+// github.com/Azure/azure-sdk-for-go/tools/profileBuilder
+
+package maintenance
+
+import original "github.com/Azure/azure-sdk-for-go/services/preview/maintenance/mgmt/2018-06-01-preview/maintenance"
+
+const (
+ DefaultBaseURI = original.DefaultBaseURI
+)
+
+type ImpactType = original.ImpactType
+
+const (
+ Freeze ImpactType = original.Freeze
+ None ImpactType = original.None
+ Redeploy ImpactType = original.Redeploy
+ Restart ImpactType = original.Restart
+)
+
+type Scope = original.Scope
+
+const (
+ ScopeAll Scope = original.ScopeAll
+ ScopeHost Scope = original.ScopeHost
+ ScopeInResource Scope = original.ScopeInResource
+ ScopeResource Scope = original.ScopeResource
+)
+
+type UpdateStatus = original.UpdateStatus
+
+const (
+ Completed UpdateStatus = original.Completed
+ InProgress UpdateStatus = original.InProgress
+ Pending UpdateStatus = original.Pending
+ RetryLater UpdateStatus = original.RetryLater
+ RetryNow UpdateStatus = original.RetryNow
+)
+
+type ApplyUpdate = original.ApplyUpdate
+type ApplyUpdateProperties = original.ApplyUpdateProperties
+type ApplyUpdatesClient = original.ApplyUpdatesClient
+type BaseClient = original.BaseClient
+type Configuration = original.Configuration
+type ConfigurationAssignment = original.ConfigurationAssignment
+type ConfigurationAssignmentProperties = original.ConfigurationAssignmentProperties
+type ConfigurationAssignmentsClient = original.ConfigurationAssignmentsClient
+type ConfigurationProperties = original.ConfigurationProperties
+type ConfigurationsClient = original.ConfigurationsClient
+type Error = original.Error
+type ErrorDetails = original.ErrorDetails
+type ListConfigurationAssignmentsResult = original.ListConfigurationAssignmentsResult
+type ListMaintenanceConfigurationsResult = original.ListMaintenanceConfigurationsResult
+type ListUpdatesResult = original.ListUpdatesResult
+type Operation = original.Operation
+type OperationInfo = original.OperationInfo
+type OperationsClient = original.OperationsClient
+type OperationsListResult = original.OperationsListResult
+type Resource = original.Resource
+type Update = original.Update
+type UpdateProperties = original.UpdateProperties
+type UpdatesClient = original.UpdatesClient
+
+func New(subscriptionID string) BaseClient {
+ return original.New(subscriptionID)
+}
+func NewApplyUpdatesClient(subscriptionID string) ApplyUpdatesClient {
+ return original.NewApplyUpdatesClient(subscriptionID)
+}
+func NewApplyUpdatesClientWithBaseURI(baseURI string, subscriptionID string) ApplyUpdatesClient {
+ return original.NewApplyUpdatesClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewConfigurationAssignmentsClient(subscriptionID string) ConfigurationAssignmentsClient {
+ return original.NewConfigurationAssignmentsClient(subscriptionID)
+}
+func NewConfigurationAssignmentsClientWithBaseURI(baseURI string, subscriptionID string) ConfigurationAssignmentsClient {
+ return original.NewConfigurationAssignmentsClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewConfigurationsClient(subscriptionID string) ConfigurationsClient {
+ return original.NewConfigurationsClient(subscriptionID)
+}
+func NewConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) ConfigurationsClient {
+ return original.NewConfigurationsClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewOperationsClient(subscriptionID string) OperationsClient {
+ return original.NewOperationsClient(subscriptionID)
+}
+func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient {
+ return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewUpdatesClient(subscriptionID string) UpdatesClient {
+ return original.NewUpdatesClient(subscriptionID)
+}
+func NewUpdatesClientWithBaseURI(baseURI string, subscriptionID string) UpdatesClient {
+ return original.NewUpdatesClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
+ return original.NewWithBaseURI(baseURI, subscriptionID)
+}
+func PossibleImpactTypeValues() []ImpactType {
+ return original.PossibleImpactTypeValues()
+}
+func PossibleScopeValues() []Scope {
+ return original.PossibleScopeValues()
+}
+func PossibleUpdateStatusValues() []UpdateStatus {
+ return original.PossibleUpdateStatusValues()
+}
+func UserAgent() string {
+ return original.UserAgent() + " profiles/preview"
+}
+func Version() string {
+ return original.Version()
+}
diff --git a/profiles/preview/preview/reservations/mgmt/reservations/models.go b/profiles/preview/preview/reservations/mgmt/reservations/models.go
index 56e317240017..93e8b2bf8b0f 100644
--- a/profiles/preview/preview/reservations/mgmt/reservations/models.go
+++ b/profiles/preview/preview/reservations/mgmt/reservations/models.go
@@ -103,6 +103,22 @@ const (
On InstanceFlexibility = original.On
)
+type PaymentStatus = original.PaymentStatus
+
+const (
+ Cancelled PaymentStatus = original.Cancelled
+ Failed PaymentStatus = original.Failed
+ Scheduled PaymentStatus = original.Scheduled
+ Succeeded PaymentStatus = original.Succeeded
+)
+
+type ReservationBillingPlan = original.ReservationBillingPlan
+
+const (
+ Monthly ReservationBillingPlan = original.Monthly
+ Upfront ReservationBillingPlan = original.Upfront
+)
+
type ReservationTerm = original.ReservationTerm
const (
@@ -146,6 +162,7 @@ type CalculatePriceResponseProperties = original.CalculatePriceResponsePropertie
type CalculatePriceResponsePropertiesBillingCurrencyTotal = original.CalculatePriceResponsePropertiesBillingCurrencyTotal
type CalculatePriceResponsePropertiesPricingCurrencyTotal = original.CalculatePriceResponsePropertiesPricingCurrencyTotal
type Catalog = original.Catalog
+type CatalogBillingPlansItem = original.CatalogBillingPlansItem
type Client = original.Client
type Error = original.Error
type ExtendedErrorInfo = original.ExtendedErrorInfo
@@ -164,6 +181,7 @@ type OperationList = original.OperationList
type OperationListIterator = original.OperationListIterator
type OperationListPage = original.OperationListPage
type OperationResponse = original.OperationResponse
+type OrderBillingPlanInformation = original.OrderBillingPlanInformation
type OrderClient = original.OrderClient
type OrderList = original.OrderList
type OrderListIterator = original.OrderListIterator
@@ -174,6 +192,8 @@ type OrderResponse = original.OrderResponse
type Patch = original.Patch
type PatchProperties = original.PatchProperties
type PatchPropertiesRenewProperties = original.PatchPropertiesRenewProperties
+type PaymentDetail = original.PaymentDetail
+type Price = original.Price
type Properties = original.Properties
type PropertiesType = original.PropertiesType
type PurchaseRequest = original.PurchaseRequest
@@ -247,6 +267,12 @@ func PossibleErrorResponseCodeValues() []ErrorResponseCode {
func PossibleInstanceFlexibilityValues() []InstanceFlexibility {
return original.PossibleInstanceFlexibilityValues()
}
+func PossiblePaymentStatusValues() []PaymentStatus {
+ return original.PossiblePaymentStatusValues()
+}
+func PossibleReservationBillingPlanValues() []ReservationBillingPlan {
+ return original.PossibleReservationBillingPlanValues()
+}
func PossibleReservationTermValues() []ReservationTerm {
return original.PossibleReservationTermValues()
}
diff --git a/profiles/preview/preview/security/mgmt/security/models.go b/profiles/preview/preview/security/mgmt/security/models.go
index 9798ac9547d7..9c7bccc72a46 100644
--- a/profiles/preview/preview/security/mgmt/security/models.go
+++ b/profiles/preview/preview/security/mgmt/security/models.go
@@ -59,6 +59,15 @@ const (
AlertsToAdminsOn AlertsToAdmins = original.AlertsToAdminsOn
)
+type AssessedResourceType = original.AssessedResourceType
+
+const (
+ AssessedResourceTypeAdditionalData AssessedResourceType = original.AssessedResourceTypeAdditionalData
+ AssessedResourceTypeContainerRegistryVulnerability AssessedResourceType = original.AssessedResourceTypeContainerRegistryVulnerability
+ AssessedResourceTypeServerVulnerabilityAssessment AssessedResourceType = original.AssessedResourceTypeServerVulnerabilityAssessment
+ AssessedResourceTypeSQLServerVulnerability AssessedResourceType = original.AssessedResourceTypeSQLServerVulnerability
+)
+
type AutoProvision = original.AutoProvision
const (
@@ -114,6 +123,7 @@ type EnforcementMode = original.EnforcementMode
const (
Audit EnforcementMode = original.Audit
Enforce EnforcementMode = original.Enforce
+ None EnforcementMode = original.None
)
type EnforcementMode1 = original.EnforcementMode1
@@ -121,6 +131,23 @@ type EnforcementMode1 = original.EnforcementMode1
const (
EnforcementMode1Audit EnforcementMode1 = original.EnforcementMode1Audit
EnforcementMode1Enforce EnforcementMode1 = original.EnforcementMode1Enforce
+ EnforcementMode1None EnforcementMode1 = original.EnforcementMode1None
+)
+
+type Exe = original.Exe
+
+const (
+ ExeAudit Exe = original.ExeAudit
+ ExeEnforce Exe = original.ExeEnforce
+ ExeNone Exe = original.ExeNone
+)
+
+type Executable = original.Executable
+
+const (
+ ExecutableAudit Executable = original.ExecutableAudit
+ ExecutableEnforce Executable = original.ExecutableEnforce
+ ExecutableNone Executable = original.ExecutableNone
)
type ExportData = original.ExportData
@@ -149,12 +176,12 @@ const (
type FileType = original.FileType
const (
- Dll FileType = original.Dll
- Exe FileType = original.Exe
- Executable FileType = original.Executable
- Msi FileType = original.Msi
- Script FileType = original.Script
- Unknown FileType = original.Unknown
+ FileTypeDll FileType = original.FileTypeDll
+ FileTypeExe FileType = original.FileTypeExe
+ FileTypeExecutable FileType = original.FileTypeExecutable
+ FileTypeMsi FileType = original.FileTypeMsi
+ FileTypeScript FileType = original.FileTypeScript
+ FileTypeUnknown FileType = original.FileTypeUnknown
)
type Issue = original.Issue
@@ -177,6 +204,14 @@ const (
KindExternalSecuritySolution KindEnum = original.KindExternalSecuritySolution
)
+type Msi = original.Msi
+
+const (
+ MsiAudit Msi = original.MsiAudit
+ MsiEnforce Msi = original.MsiEnforce
+ MsiNone Msi = original.MsiNone
+)
+
type PricingTier = original.PricingTier
const (
@@ -273,6 +308,14 @@ const (
OffByPolicy ResourceStatus = original.OffByPolicy
)
+type Script = original.Script
+
+const (
+ ScriptAudit Script = original.ScriptAudit
+ ScriptEnforce Script = original.ScriptEnforce
+ ScriptNone Script = original.ScriptNone
+)
+
type SettingKind = original.SettingKind
const (
@@ -280,6 +323,14 @@ const (
SettingKindDataExportSetting SettingKind = original.SettingKindDataExportSetting
)
+type Severity = original.Severity
+
+const (
+ SeverityHigh Severity = original.SeverityHigh
+ SeverityLow Severity = original.SeverityLow
+ SeverityMedium Severity = original.SeverityMedium
+)
+
type SolutionStatus = original.SolutionStatus
const (
@@ -287,14 +338,22 @@ const (
SolutionStatusEnabled SolutionStatus = original.SolutionStatusEnabled
)
+type Source = original.Source
+
+const (
+ SourceAws Source = original.SourceAws
+ SourceAzure Source = original.SourceAzure
+ SourceResourceDetails Source = original.SourceResourceDetails
+)
+
type SourceSystem = original.SourceSystem
const (
- AzureAppLocker SourceSystem = original.AzureAppLocker
- AzureAuditD SourceSystem = original.AzureAuditD
- NonAzureAppLocker SourceSystem = original.NonAzureAppLocker
- NonAzureAuditD SourceSystem = original.NonAzureAuditD
- None SourceSystem = original.None
+ SourceSystemAzureAppLocker SourceSystem = original.SourceSystemAzureAppLocker
+ SourceSystemAzureAuditD SourceSystem = original.SourceSystemAzureAuditD
+ SourceSystemNonAzureAppLocker SourceSystem = original.SourceSystemNonAzureAppLocker
+ SourceSystemNonAzureAuditD SourceSystem = original.SourceSystemNonAzureAuditD
+ SourceSystemNone SourceSystem = original.SourceSystemNone
)
type State = original.State
@@ -321,6 +380,14 @@ const (
UserRequested StatusReason = original.UserRequested
)
+type SubAssessmentStatusCode = original.SubAssessmentStatusCode
+
+const (
+ SubAssessmentStatusCodeHealthy SubAssessmentStatusCode = original.SubAssessmentStatusCodeHealthy
+ SubAssessmentStatusCodeNotApplicable SubAssessmentStatusCode = original.SubAssessmentStatusCodeNotApplicable
+ SubAssessmentStatusCodeUnhealthy SubAssessmentStatusCode = original.SubAssessmentStatusCodeUnhealthy
+)
+
type Type = original.Type
const (
@@ -332,10 +399,18 @@ const (
VersionAndAboveSignature Type = original.VersionAndAboveSignature
)
+type ValueType = original.ValueType
+
+const (
+ IPCidr ValueType = original.IPCidr
+ String ValueType = original.String
+)
+
type AadConnectivityState1 = original.AadConnectivityState1
type AadExternalSecuritySolution = original.AadExternalSecuritySolution
type AadSolutionProperties = original.AadSolutionProperties
type AdaptiveApplicationControlsClient = original.AdaptiveApplicationControlsClient
+type AdditionalData = original.AdditionalData
type AdvancedThreatProtectionClient = original.AdvancedThreatProtectionClient
type AdvancedThreatProtectionProperties = original.AdvancedThreatProtectionProperties
type AdvancedThreatProtectionSetting = original.AdvancedThreatProtectionSetting
@@ -353,6 +428,7 @@ type AllowedConnectionsListIterator = original.AllowedConnectionsListIterator
type AllowedConnectionsListPage = original.AllowedConnectionsListPage
type AllowedConnectionsResource = original.AllowedConnectionsResource
type AllowedConnectionsResourceProperties = original.AllowedConnectionsResourceProperties
+type AllowlistCustomAlertRule = original.AllowlistCustomAlertRule
type AppWhitelistingGroup = original.AppWhitelistingGroup
type AppWhitelistingGroupData = original.AppWhitelistingGroupData
type AppWhitelistingGroups = original.AppWhitelistingGroups
@@ -370,8 +446,14 @@ type AutoProvisioningSettingListIterator = original.AutoProvisioningSettingListI
type AutoProvisioningSettingListPage = original.AutoProvisioningSettingListPage
type AutoProvisioningSettingProperties = original.AutoProvisioningSettingProperties
type AutoProvisioningSettingsClient = original.AutoProvisioningSettingsClient
+type AwsResourceDetails = original.AwsResourceDetails
+type AzureResourceDetails = original.AzureResourceDetails
type BaseClient = original.BaseClient
+type BasicAdditionalData = original.BasicAdditionalData
type BasicExternalSecuritySolution = original.BasicExternalSecuritySolution
+type BasicResourceDetails = original.BasicResourceDetails
+type CVE = original.CVE
+type CVSS = original.CVSS
type CefExternalSecuritySolution = original.CefExternalSecuritySolution
type CefSolutionProperties = original.CefSolutionProperties
type CloudError = original.CloudError
@@ -398,8 +480,17 @@ type ContactListIterator = original.ContactListIterator
type ContactListPage = original.ContactListPage
type ContactProperties = original.ContactProperties
type ContactsClient = original.ContactsClient
+type ContainerRegistryVulnerabilityProperties = original.ContainerRegistryVulnerabilityProperties
+type CustomAlertRule = original.CustomAlertRule
type DataExportSetting = original.DataExportSetting
type DataExportSettingProperties = original.DataExportSettingProperties
+type DenylistCustomAlertRule = original.DenylistCustomAlertRule
+type DeviceSecurityGroup = original.DeviceSecurityGroup
+type DeviceSecurityGroupList = original.DeviceSecurityGroupList
+type DeviceSecurityGroupListIterator = original.DeviceSecurityGroupListIterator
+type DeviceSecurityGroupListPage = original.DeviceSecurityGroupListPage
+type DeviceSecurityGroupProperties = original.DeviceSecurityGroupProperties
+type DeviceSecurityGroupsClient = original.DeviceSecurityGroupsClient
type DiscoveredSecuritySolution = original.DiscoveredSecuritySolution
type DiscoveredSecuritySolutionList = original.DiscoveredSecuritySolutionList
type DiscoveredSecuritySolutionListIterator = original.DiscoveredSecuritySolutionListIterator
@@ -433,29 +524,22 @@ type IoTSecurityAggregatedRecommendationListIterator = original.IoTSecurityAggre
type IoTSecurityAggregatedRecommendationListPage = original.IoTSecurityAggregatedRecommendationListPage
type IoTSecurityAggregatedRecommendationProperties = original.IoTSecurityAggregatedRecommendationProperties
type IoTSecurityAlertedDevice = original.IoTSecurityAlertedDevice
-type IoTSecurityAlertedDevicesList = original.IoTSecurityAlertedDevicesList
type IoTSecurityDeviceAlert = original.IoTSecurityDeviceAlert
-type IoTSecurityDeviceAlertsList = original.IoTSecurityDeviceAlertsList
type IoTSecurityDeviceRecommendation = original.IoTSecurityDeviceRecommendation
-type IoTSecurityDeviceRecommendationsList = original.IoTSecurityDeviceRecommendationsList
type IoTSecuritySolutionAnalyticsModel = original.IoTSecuritySolutionAnalyticsModel
type IoTSecuritySolutionAnalyticsModelList = original.IoTSecuritySolutionAnalyticsModelList
type IoTSecuritySolutionAnalyticsModelProperties = original.IoTSecuritySolutionAnalyticsModelProperties
type IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem = original.IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem
type IoTSecuritySolutionModel = original.IoTSecuritySolutionModel
type IoTSecuritySolutionProperties = original.IoTSecuritySolutionProperties
-type IoTSecuritySolutionsAnalyticsAggregatedAlertClient = original.IoTSecuritySolutionsAnalyticsAggregatedAlertClient
-type IoTSecuritySolutionsAnalyticsAggregatedAlertsClient = original.IoTSecuritySolutionsAnalyticsAggregatedAlertsClient
-type IoTSecuritySolutionsAnalyticsClient = original.IoTSecuritySolutionsAnalyticsClient
-type IoTSecuritySolutionsAnalyticsRecommendationClient = original.IoTSecuritySolutionsAnalyticsRecommendationClient
-type IoTSecuritySolutionsAnalyticsRecommendationsClient = original.IoTSecuritySolutionsAnalyticsRecommendationsClient
-type IoTSecuritySolutionsClient = original.IoTSecuritySolutionsClient
type IoTSecuritySolutionsList = original.IoTSecuritySolutionsList
type IoTSecuritySolutionsListIterator = original.IoTSecuritySolutionsListIterator
type IoTSecuritySolutionsListPage = original.IoTSecuritySolutionsListPage
-type IoTSecuritySolutionsResourceGroupClient = original.IoTSecuritySolutionsResourceGroupClient
type IoTSeverityMetrics = original.IoTSeverityMetrics
+type IotSecuritySolutionAnalyticsClient = original.IotSecuritySolutionAnalyticsClient
type IotSecuritySolutionClient = original.IotSecuritySolutionClient
+type IotSecuritySolutionsAnalyticsAggregatedAlertClient = original.IotSecuritySolutionsAnalyticsAggregatedAlertClient
+type IotSecuritySolutionsAnalyticsRecommendationClient = original.IotSecuritySolutionsAnalyticsRecommendationClient
type JitNetworkAccessPoliciesClient = original.JitNetworkAccessPoliciesClient
type JitNetworkAccessPoliciesList = original.JitNetworkAccessPoliciesList
type JitNetworkAccessPoliciesListIterator = original.JitNetworkAccessPoliciesListIterator
@@ -471,6 +555,7 @@ type JitNetworkAccessRequest = original.JitNetworkAccessRequest
type JitNetworkAccessRequestPort = original.JitNetworkAccessRequestPort
type JitNetworkAccessRequestVirtualMachine = original.JitNetworkAccessRequestVirtualMachine
type Kind = original.Kind
+type ListCustomAlertRule = original.ListCustomAlertRule
type Location = original.Location
type LocationsClient = original.LocationsClient
type Operation = original.Operation
@@ -484,6 +569,7 @@ type Pricing = original.Pricing
type PricingList = original.PricingList
type PricingProperties = original.PricingProperties
type PricingsClient = original.PricingsClient
+type ProtectionMode = original.ProtectionMode
type PublisherInfo = original.PublisherInfo
type RecommendationConfigurationProperties = original.RecommendationConfigurationProperties
type RegulatoryComplianceAssessment = original.RegulatoryComplianceAssessment
@@ -505,17 +591,27 @@ type RegulatoryComplianceStandardListPage = original.RegulatoryComplianceStandar
type RegulatoryComplianceStandardProperties = original.RegulatoryComplianceStandardProperties
type RegulatoryComplianceStandardsClient = original.RegulatoryComplianceStandardsClient
type Resource = original.Resource
+type ResourceDetails = original.ResourceDetails
+type SQLServerVulnerabilityProperties = original.SQLServerVulnerabilityProperties
type SensitivityLabel = original.SensitivityLabel
type ServerVulnerabilityAssessment = original.ServerVulnerabilityAssessment
type ServerVulnerabilityAssessmentClient = original.ServerVulnerabilityAssessmentClient
type ServerVulnerabilityAssessmentProperties = original.ServerVulnerabilityAssessmentProperties
type ServerVulnerabilityAssessmentsList = original.ServerVulnerabilityAssessmentsList
+type ServerVulnerabilityProperties = original.ServerVulnerabilityProperties
type Setting = original.Setting
type SettingResource = original.SettingResource
type SettingsClient = original.SettingsClient
type SettingsList = original.SettingsList
type SettingsListIterator = original.SettingsListIterator
type SettingsListPage = original.SettingsListPage
+type SubAssessment = original.SubAssessment
+type SubAssessmentList = original.SubAssessmentList
+type SubAssessmentListIterator = original.SubAssessmentListIterator
+type SubAssessmentListPage = original.SubAssessmentListPage
+type SubAssessmentProperties = original.SubAssessmentProperties
+type SubAssessmentStatus = original.SubAssessmentStatus
+type SubAssessmentsClient = original.SubAssessmentsClient
type TagsResource = original.TagsResource
type Task = original.Task
type TaskList = original.TaskList
@@ -524,6 +620,8 @@ type TaskListPage = original.TaskListPage
type TaskParameters = original.TaskParameters
type TaskProperties = original.TaskProperties
type TasksClient = original.TasksClient
+type ThresholdCustomAlertRule = original.ThresholdCustomAlertRule
+type TimeWindowCustomAlertRule = original.TimeWindowCustomAlertRule
type TopologyClient = original.TopologyClient
type TopologyList = original.TopologyList
type TopologyListIterator = original.TopologyListIterator
@@ -533,10 +631,12 @@ type TopologyResourceProperties = original.TopologyResourceProperties
type TopologySingleResource = original.TopologySingleResource
type TopologySingleResourceChild = original.TopologySingleResourceChild
type TopologySingleResourceParent = original.TopologySingleResourceParent
+type UpdateIoTSecuritySolutionProperties = original.UpdateIoTSecuritySolutionProperties
type UpdateIotSecuritySolutionData = original.UpdateIotSecuritySolutionData
type UserDefinedResourcesProperties = original.UserDefinedResourcesProperties
type UserRecommendation = original.UserRecommendation
type VMRecommendation = original.VMRecommendation
+type VendorReference = original.VendorReference
type WorkspaceSetting = original.WorkspaceSetting
type WorkspaceSettingList = original.WorkspaceSettingList
type WorkspaceSettingListIterator = original.WorkspaceSettingListIterator
@@ -637,6 +737,18 @@ func NewContactsClient(subscriptionID string, ascLocation string) ContactsClient
func NewContactsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) ContactsClient {
return original.NewContactsClientWithBaseURI(baseURI, subscriptionID, ascLocation)
}
+func NewDeviceSecurityGroupListIterator(page DeviceSecurityGroupListPage) DeviceSecurityGroupListIterator {
+ return original.NewDeviceSecurityGroupListIterator(page)
+}
+func NewDeviceSecurityGroupListPage(getNextPage func(context.Context, DeviceSecurityGroupList) (DeviceSecurityGroupList, error)) DeviceSecurityGroupListPage {
+ return original.NewDeviceSecurityGroupListPage(getNextPage)
+}
+func NewDeviceSecurityGroupsClient(subscriptionID string, ascLocation string) DeviceSecurityGroupsClient {
+ return original.NewDeviceSecurityGroupsClient(subscriptionID, ascLocation)
+}
+func NewDeviceSecurityGroupsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) DeviceSecurityGroupsClient {
+ return original.NewDeviceSecurityGroupsClientWithBaseURI(baseURI, subscriptionID, ascLocation)
+}
func NewDiscoveredSecuritySolutionListIterator(page DiscoveredSecuritySolutionListPage) DiscoveredSecuritySolutionListIterator {
return original.NewDiscoveredSecuritySolutionListIterator(page)
}
@@ -685,53 +797,17 @@ func NewIoTSecurityAggregatedRecommendationListIterator(page IoTSecurityAggregat
func NewIoTSecurityAggregatedRecommendationListPage(getNextPage func(context.Context, IoTSecurityAggregatedRecommendationList) (IoTSecurityAggregatedRecommendationList, error)) IoTSecurityAggregatedRecommendationListPage {
return original.NewIoTSecurityAggregatedRecommendationListPage(getNextPage)
}
-func NewIoTSecuritySolutionsAnalyticsAggregatedAlertClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsAggregatedAlertClient {
- return original.NewIoTSecuritySolutionsAnalyticsAggregatedAlertClient(subscriptionID, ascLocation)
-}
-func NewIoTSecuritySolutionsAnalyticsAggregatedAlertClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsAggregatedAlertClient {
- return original.NewIoTSecuritySolutionsAnalyticsAggregatedAlertClientWithBaseURI(baseURI, subscriptionID, ascLocation)
-}
-func NewIoTSecuritySolutionsAnalyticsAggregatedAlertsClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsAggregatedAlertsClient {
- return original.NewIoTSecuritySolutionsAnalyticsAggregatedAlertsClient(subscriptionID, ascLocation)
-}
-func NewIoTSecuritySolutionsAnalyticsAggregatedAlertsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsAggregatedAlertsClient {
- return original.NewIoTSecuritySolutionsAnalyticsAggregatedAlertsClientWithBaseURI(baseURI, subscriptionID, ascLocation)
-}
-func NewIoTSecuritySolutionsAnalyticsClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsClient {
- return original.NewIoTSecuritySolutionsAnalyticsClient(subscriptionID, ascLocation)
-}
-func NewIoTSecuritySolutionsAnalyticsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsClient {
- return original.NewIoTSecuritySolutionsAnalyticsClientWithBaseURI(baseURI, subscriptionID, ascLocation)
-}
-func NewIoTSecuritySolutionsAnalyticsRecommendationClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsRecommendationClient {
- return original.NewIoTSecuritySolutionsAnalyticsRecommendationClient(subscriptionID, ascLocation)
-}
-func NewIoTSecuritySolutionsAnalyticsRecommendationClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsRecommendationClient {
- return original.NewIoTSecuritySolutionsAnalyticsRecommendationClientWithBaseURI(baseURI, subscriptionID, ascLocation)
-}
-func NewIoTSecuritySolutionsAnalyticsRecommendationsClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsRecommendationsClient {
- return original.NewIoTSecuritySolutionsAnalyticsRecommendationsClient(subscriptionID, ascLocation)
-}
-func NewIoTSecuritySolutionsAnalyticsRecommendationsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsAnalyticsRecommendationsClient {
- return original.NewIoTSecuritySolutionsAnalyticsRecommendationsClientWithBaseURI(baseURI, subscriptionID, ascLocation)
-}
-func NewIoTSecuritySolutionsClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsClient {
- return original.NewIoTSecuritySolutionsClient(subscriptionID, ascLocation)
-}
-func NewIoTSecuritySolutionsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsClient {
- return original.NewIoTSecuritySolutionsClientWithBaseURI(baseURI, subscriptionID, ascLocation)
-}
func NewIoTSecuritySolutionsListIterator(page IoTSecuritySolutionsListPage) IoTSecuritySolutionsListIterator {
return original.NewIoTSecuritySolutionsListIterator(page)
}
func NewIoTSecuritySolutionsListPage(getNextPage func(context.Context, IoTSecuritySolutionsList) (IoTSecuritySolutionsList, error)) IoTSecuritySolutionsListPage {
return original.NewIoTSecuritySolutionsListPage(getNextPage)
}
-func NewIoTSecuritySolutionsResourceGroupClient(subscriptionID string, ascLocation string) IoTSecuritySolutionsResourceGroupClient {
- return original.NewIoTSecuritySolutionsResourceGroupClient(subscriptionID, ascLocation)
+func NewIotSecuritySolutionAnalyticsClient(subscriptionID string, ascLocation string) IotSecuritySolutionAnalyticsClient {
+ return original.NewIotSecuritySolutionAnalyticsClient(subscriptionID, ascLocation)
}
-func NewIoTSecuritySolutionsResourceGroupClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IoTSecuritySolutionsResourceGroupClient {
- return original.NewIoTSecuritySolutionsResourceGroupClientWithBaseURI(baseURI, subscriptionID, ascLocation)
+func NewIotSecuritySolutionAnalyticsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IotSecuritySolutionAnalyticsClient {
+ return original.NewIotSecuritySolutionAnalyticsClientWithBaseURI(baseURI, subscriptionID, ascLocation)
}
func NewIotSecuritySolutionClient(subscriptionID string, ascLocation string) IotSecuritySolutionClient {
return original.NewIotSecuritySolutionClient(subscriptionID, ascLocation)
@@ -739,6 +815,18 @@ func NewIotSecuritySolutionClient(subscriptionID string, ascLocation string) Iot
func NewIotSecuritySolutionClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IotSecuritySolutionClient {
return original.NewIotSecuritySolutionClientWithBaseURI(baseURI, subscriptionID, ascLocation)
}
+func NewIotSecuritySolutionsAnalyticsAggregatedAlertClient(subscriptionID string, ascLocation string) IotSecuritySolutionsAnalyticsAggregatedAlertClient {
+ return original.NewIotSecuritySolutionsAnalyticsAggregatedAlertClient(subscriptionID, ascLocation)
+}
+func NewIotSecuritySolutionsAnalyticsAggregatedAlertClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IotSecuritySolutionsAnalyticsAggregatedAlertClient {
+ return original.NewIotSecuritySolutionsAnalyticsAggregatedAlertClientWithBaseURI(baseURI, subscriptionID, ascLocation)
+}
+func NewIotSecuritySolutionsAnalyticsRecommendationClient(subscriptionID string, ascLocation string) IotSecuritySolutionsAnalyticsRecommendationClient {
+ return original.NewIotSecuritySolutionsAnalyticsRecommendationClient(subscriptionID, ascLocation)
+}
+func NewIotSecuritySolutionsAnalyticsRecommendationClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) IotSecuritySolutionsAnalyticsRecommendationClient {
+ return original.NewIotSecuritySolutionsAnalyticsRecommendationClientWithBaseURI(baseURI, subscriptionID, ascLocation)
+}
func NewJitNetworkAccessPoliciesClient(subscriptionID string, ascLocation string) JitNetworkAccessPoliciesClient {
return original.NewJitNetworkAccessPoliciesClient(subscriptionID, ascLocation)
}
@@ -829,6 +917,18 @@ func NewSettingsListIterator(page SettingsListPage) SettingsListIterator {
func NewSettingsListPage(getNextPage func(context.Context, SettingsList) (SettingsList, error)) SettingsListPage {
return original.NewSettingsListPage(getNextPage)
}
+func NewSubAssessmentListIterator(page SubAssessmentListPage) SubAssessmentListIterator {
+ return original.NewSubAssessmentListIterator(page)
+}
+func NewSubAssessmentListPage(getNextPage func(context.Context, SubAssessmentList) (SubAssessmentList, error)) SubAssessmentListPage {
+ return original.NewSubAssessmentListPage(getNextPage)
+}
+func NewSubAssessmentsClient(subscriptionID string, ascLocation string) SubAssessmentsClient {
+ return original.NewSubAssessmentsClient(subscriptionID, ascLocation)
+}
+func NewSubAssessmentsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SubAssessmentsClient {
+ return original.NewSubAssessmentsClientWithBaseURI(baseURI, subscriptionID, ascLocation)
+}
func NewTaskListIterator(page TaskListPage) TaskListIterator {
return original.NewTaskListIterator(page)
}
@@ -880,6 +980,9 @@ func PossibleAlertNotificationsValues() []AlertNotifications {
func PossibleAlertsToAdminsValues() []AlertsToAdmins {
return original.PossibleAlertsToAdminsValues()
}
+func PossibleAssessedResourceTypeValues() []AssessedResourceType {
+ return original.PossibleAssessedResourceTypeValues()
+}
func PossibleAutoProvisionValues() []AutoProvision {
return original.PossibleAutoProvisionValues()
}
@@ -904,6 +1007,12 @@ func PossibleEnforcementMode1Values() []EnforcementMode1 {
func PossibleEnforcementModeValues() []EnforcementMode {
return original.PossibleEnforcementModeValues()
}
+func PossibleExeValues() []Exe {
+ return original.PossibleExeValues()
+}
+func PossibleExecutableValues() []Executable {
+ return original.PossibleExecutableValues()
+}
func PossibleExportDataValues() []ExportData {
return original.PossibleExportDataValues()
}
@@ -922,6 +1031,9 @@ func PossibleIssueValues() []Issue {
func PossibleKindEnumValues() []KindEnum {
return original.PossibleKindEnumValues()
}
+func PossibleMsiValues() []Msi {
+ return original.PossibleMsiValues()
+}
func PossiblePricingTierValues() []PricingTier {
return original.PossiblePricingTierValues()
}
@@ -952,15 +1064,24 @@ func PossibleReportedSeverityValues() []ReportedSeverity {
func PossibleResourceStatusValues() []ResourceStatus {
return original.PossibleResourceStatusValues()
}
+func PossibleScriptValues() []Script {
+ return original.PossibleScriptValues()
+}
func PossibleSettingKindValues() []SettingKind {
return original.PossibleSettingKindValues()
}
+func PossibleSeverityValues() []Severity {
+ return original.PossibleSeverityValues()
+}
func PossibleSolutionStatusValues() []SolutionStatus {
return original.PossibleSolutionStatusValues()
}
func PossibleSourceSystemValues() []SourceSystem {
return original.PossibleSourceSystemValues()
}
+func PossibleSourceValues() []Source {
+ return original.PossibleSourceValues()
+}
func PossibleStateValues() []State {
return original.PossibleStateValues()
}
@@ -970,9 +1091,15 @@ func PossibleStatusReasonValues() []StatusReason {
func PossibleStatusValues() []Status {
return original.PossibleStatusValues()
}
+func PossibleSubAssessmentStatusCodeValues() []SubAssessmentStatusCode {
+ return original.PossibleSubAssessmentStatusCodeValues()
+}
func PossibleTypeValues() []Type {
return original.PossibleTypeValues()
}
+func PossibleValueTypeValues() []ValueType {
+ return original.PossibleValueTypeValues()
+}
func UserAgent() string {
return original.UserAgent() + " profiles/preview"
}
diff --git a/profiles/preview/preview/security/mgmt/security/securityapi/models.go b/profiles/preview/preview/security/mgmt/security/securityapi/models.go
index f3f1649c0b39..6291ca8035f2 100644
--- a/profiles/preview/preview/security/mgmt/security/securityapi/models.go
+++ b/profiles/preview/preview/security/mgmt/security/securityapi/models.go
@@ -29,17 +29,14 @@ type AutoProvisioningSettingsClientAPI = original.AutoProvisioningSettingsClient
type ComplianceResultsClientAPI = original.ComplianceResultsClientAPI
type CompliancesClientAPI = original.CompliancesClientAPI
type ContactsClientAPI = original.ContactsClientAPI
+type DeviceSecurityGroupsClientAPI = original.DeviceSecurityGroupsClientAPI
type DiscoveredSecuritySolutionsClientAPI = original.DiscoveredSecuritySolutionsClientAPI
type ExternalSecuritySolutionsClientAPI = original.ExternalSecuritySolutionsClientAPI
type InformationProtectionPoliciesClientAPI = original.InformationProtectionPoliciesClientAPI
-type IoTSecuritySolutionsAnalyticsAggregatedAlertClientAPI = original.IoTSecuritySolutionsAnalyticsAggregatedAlertClientAPI
-type IoTSecuritySolutionsAnalyticsAggregatedAlertsClientAPI = original.IoTSecuritySolutionsAnalyticsAggregatedAlertsClientAPI
-type IoTSecuritySolutionsAnalyticsClientAPI = original.IoTSecuritySolutionsAnalyticsClientAPI
-type IoTSecuritySolutionsAnalyticsRecommendationClientAPI = original.IoTSecuritySolutionsAnalyticsRecommendationClientAPI
-type IoTSecuritySolutionsAnalyticsRecommendationsClientAPI = original.IoTSecuritySolutionsAnalyticsRecommendationsClientAPI
-type IoTSecuritySolutionsClientAPI = original.IoTSecuritySolutionsClientAPI
-type IoTSecuritySolutionsResourceGroupClientAPI = original.IoTSecuritySolutionsResourceGroupClientAPI
+type IotSecuritySolutionAnalyticsClientAPI = original.IotSecuritySolutionAnalyticsClientAPI
type IotSecuritySolutionClientAPI = original.IotSecuritySolutionClientAPI
+type IotSecuritySolutionsAnalyticsAggregatedAlertClientAPI = original.IotSecuritySolutionsAnalyticsAggregatedAlertClientAPI
+type IotSecuritySolutionsAnalyticsRecommendationClientAPI = original.IotSecuritySolutionsAnalyticsRecommendationClientAPI
type JitNetworkAccessPoliciesClientAPI = original.JitNetworkAccessPoliciesClientAPI
type LocationsClientAPI = original.LocationsClientAPI
type OperationsClientAPI = original.OperationsClientAPI
@@ -49,6 +46,7 @@ type RegulatoryComplianceControlsClientAPI = original.RegulatoryComplianceContro
type RegulatoryComplianceStandardsClientAPI = original.RegulatoryComplianceStandardsClientAPI
type ServerVulnerabilityAssessmentClientAPI = original.ServerVulnerabilityAssessmentClientAPI
type SettingsClientAPI = original.SettingsClientAPI
+type SubAssessmentsClientAPI = original.SubAssessmentsClientAPI
type TasksClientAPI = original.TasksClientAPI
type TopologyClientAPI = original.TopologyClientAPI
type WorkspaceSettingsClientAPI = original.WorkspaceSettingsClientAPI
diff --git a/profiles/preview/preview/securityinsight/mgmt/securityinsight/models.go b/profiles/preview/preview/securityinsight/mgmt/securityinsight/models.go
index b3dbd8e93239..600b5eef0a5d 100644
--- a/profiles/preview/preview/securityinsight/mgmt/securityinsight/models.go
+++ b/profiles/preview/preview/securityinsight/mgmt/securityinsight/models.go
@@ -38,9 +38,9 @@ const (
type AlertRuleKind = original.AlertRuleKind
const (
- Filter AlertRuleKind = original.Filter
- Fusion AlertRuleKind = original.Fusion
- Scheduled AlertRuleKind = original.Scheduled
+ Fusion AlertRuleKind = original.Fusion
+ MicrosoftSecurityIncidentCreation AlertRuleKind = original.MicrosoftSecurityIncidentCreation
+ Scheduled AlertRuleKind = original.Scheduled
)
type AlertSeverity = original.AlertSeverity
@@ -72,6 +72,7 @@ const (
Discovery AttackTactic = original.Discovery
Execution AttackTactic = original.Execution
Exfiltration AttackTactic = original.Exfiltration
+ Impact AttackTactic = original.Impact
InitialAccess AttackTactic = original.InitialAccess
LateralMovement AttackTactic = original.LateralMovement
Persistence AttackTactic = original.Persistence
@@ -233,24 +234,26 @@ const (
type Kind = original.Kind
const (
- KindAlertRule Kind = original.KindAlertRule
- KindScheduled Kind = original.KindScheduled
+ KindAggregations Kind = original.KindAggregations
+ KindCasesAggregation Kind = original.KindCasesAggregation
)
-type KindBasicAggregations = original.KindBasicAggregations
+type KindBasicAlertRule = original.KindBasicAlertRule
const (
- KindAggregations KindBasicAggregations = original.KindAggregations
- KindCasesAggregation KindBasicAggregations = original.KindCasesAggregation
+ KindAlertRule KindBasicAlertRule = original.KindAlertRule
+ KindFusion KindBasicAlertRule = original.KindFusion
+ KindMicrosoftSecurityIncidentCreation KindBasicAlertRule = original.KindMicrosoftSecurityIncidentCreation
+ KindScheduled KindBasicAlertRule = original.KindScheduled
)
type KindBasicAlertRuleTemplate = original.KindBasicAlertRuleTemplate
const (
- KindBasicAlertRuleTemplateKindAlertRuleTemplate KindBasicAlertRuleTemplate = original.KindBasicAlertRuleTemplateKindAlertRuleTemplate
- KindBasicAlertRuleTemplateKindFilter KindBasicAlertRuleTemplate = original.KindBasicAlertRuleTemplateKindFilter
- KindBasicAlertRuleTemplateKindFusion KindBasicAlertRuleTemplate = original.KindBasicAlertRuleTemplateKindFusion
- KindBasicAlertRuleTemplateKindScheduled KindBasicAlertRuleTemplate = original.KindBasicAlertRuleTemplateKindScheduled
+ KindBasicAlertRuleTemplateKindAlertRuleTemplate KindBasicAlertRuleTemplate = original.KindBasicAlertRuleTemplateKindAlertRuleTemplate
+ KindBasicAlertRuleTemplateKindFusion KindBasicAlertRuleTemplate = original.KindBasicAlertRuleTemplateKindFusion
+ KindBasicAlertRuleTemplateKindMicrosoftSecurityIncidentCreation KindBasicAlertRuleTemplate = original.KindBasicAlertRuleTemplateKindMicrosoftSecurityIncidentCreation
+ KindBasicAlertRuleTemplateKindScheduled KindBasicAlertRuleTemplate = original.KindBasicAlertRuleTemplateKindScheduled
)
type KindBasicDataConnector = original.KindBasicDataConnector
@@ -303,6 +306,15 @@ const (
LicenseStatusEnabled LicenseStatus = original.LicenseStatusEnabled
)
+type MicrosoftSecurityProductName = original.MicrosoftSecurityProductName
+
+const (
+ AzureActiveDirectoryIdentityProtection MicrosoftSecurityProductName = original.AzureActiveDirectoryIdentityProtection
+ AzureAdvancedThreatProtection MicrosoftSecurityProductName = original.AzureAdvancedThreatProtection
+ AzureSecurityCenter MicrosoftSecurityProductName = original.AzureSecurityCenter
+ MicrosoftCloudAppSecurity MicrosoftSecurityProductName = original.MicrosoftCloudAppSecurity
+)
+
type OSFamily = original.OSFamily
const (
@@ -340,6 +352,19 @@ const (
RegistryValueKindUnknown RegistryValueKind = original.RegistryValueKindUnknown
)
+type RelationNodeKind = original.RelationNodeKind
+
+const (
+ RelationNodeKindBookmark RelationNodeKind = original.RelationNodeKindBookmark
+ RelationNodeKindCase RelationNodeKind = original.RelationNodeKindCase
+)
+
+type RelationTypes = original.RelationTypes
+
+const (
+ CasesToBookmarks RelationTypes = original.CasesToBookmarks
+)
+
type SettingKind = original.SettingKind
const (
@@ -379,8 +404,10 @@ type ASCDataConnector = original.ASCDataConnector
type ASCDataConnectorProperties = original.ASCDataConnectorProperties
type AccountEntity = original.AccountEntity
type AccountEntityProperties = original.AccountEntityProperties
-type Action = original.Action
-type ActionProperties = original.ActionProperties
+type ActionRequest = original.ActionRequest
+type ActionRequestProperties = original.ActionRequestProperties
+type ActionResponse = original.ActionResponse
+type ActionResponseProperties = original.ActionResponseProperties
type ActionsClient = original.ActionsClient
type ActionsList = original.ActionsList
type ActionsListIterator = original.ActionsListIterator
@@ -393,6 +420,7 @@ type AlertRuleKind1 = original.AlertRuleKind1
type AlertRuleModel = original.AlertRuleModel
type AlertRuleTemplate = original.AlertRuleTemplate
type AlertRuleTemplateModel = original.AlertRuleTemplateModel
+type AlertRuleTemplatePropertiesBase = original.AlertRuleTemplatePropertiesBase
type AlertRuleTemplatesClient = original.AlertRuleTemplatesClient
type AlertRuleTemplatesList = original.AlertRuleTemplatesList
type AlertRuleTemplatesListIterator = original.AlertRuleTemplatesListIterator
@@ -409,7 +437,6 @@ type AwsCloudTrailDataConnectorDataTypesLogs = original.AwsCloudTrailDataConnect
type AwsCloudTrailDataConnectorProperties = original.AwsCloudTrailDataConnectorProperties
type AzureResourceEntity = original.AzureResourceEntity
type AzureResourceEntityProperties = original.AzureResourceEntityProperties
-type BaseAlertRuleTemplateProperties = original.BaseAlertRuleTemplateProperties
type BaseClient = original.BaseClient
type BasicAggregations = original.BasicAggregations
type BasicAlertRule = original.BasicAlertRule
@@ -422,6 +449,12 @@ type BookmarkList = original.BookmarkList
type BookmarkListIterator = original.BookmarkListIterator
type BookmarkListPage = original.BookmarkListPage
type BookmarkProperties = original.BookmarkProperties
+type BookmarkRelation = original.BookmarkRelation
+type BookmarkRelationList = original.BookmarkRelationList
+type BookmarkRelationListIterator = original.BookmarkRelationListIterator
+type BookmarkRelationListPage = original.BookmarkRelationListPage
+type BookmarkRelationProperties = original.BookmarkRelationProperties
+type BookmarkRelationsClient = original.BookmarkRelationsClient
type BookmarksClient = original.BookmarksClient
type Case = original.Case
type CaseComment = original.CaseComment
@@ -434,6 +467,12 @@ type CaseList = original.CaseList
type CaseListIterator = original.CaseListIterator
type CaseListPage = original.CaseListPage
type CaseProperties = original.CaseProperties
+type CaseRelation = original.CaseRelation
+type CaseRelationList = original.CaseRelationList
+type CaseRelationListIterator = original.CaseRelationListIterator
+type CaseRelationListPage = original.CaseRelationListPage
+type CaseRelationProperties = original.CaseRelationProperties
+type CaseRelationsClient = original.CaseRelationsClient
type CasesAggregation = original.CasesAggregation
type CasesAggregationBySeverityProperties = original.CasesAggregationBySeverityProperties
type CasesAggregationByStatusProperties = original.CasesAggregationByStatusProperties
@@ -481,12 +520,10 @@ type FileEntity = original.FileEntity
type FileEntityProperties = original.FileEntityProperties
type FileHashEntity = original.FileHashEntity
type FileHashEntityProperties = original.FileHashEntityProperties
-type FilterAlertRuleTemplate = original.FilterAlertRuleTemplate
-type FilterAlertRuleTemplateProperties = original.FilterAlertRuleTemplateProperties
-type FilterAlertRuleTemplatePropertiesModel = original.FilterAlertRuleTemplatePropertiesModel
+type FusionAlertRule = original.FusionAlertRule
+type FusionAlertRuleProperties = original.FusionAlertRuleProperties
type FusionAlertRuleTemplate = original.FusionAlertRuleTemplate
type FusionAlertRuleTemplateProperties = original.FusionAlertRuleTemplateProperties
-type FusionAlertRuleTemplatePropertiesModel = original.FusionAlertRuleTemplatePropertiesModel
type GeoLocation = original.GeoLocation
type HostEntity = original.HostEntity
type HostEntityProperties = original.HostEntityProperties
@@ -500,6 +537,11 @@ type MDATPDataConnector = original.MDATPDataConnector
type MDATPDataConnectorProperties = original.MDATPDataConnectorProperties
type MalwareEntity = original.MalwareEntity
type MalwareEntityProperties = original.MalwareEntityProperties
+type MicrosoftSecurityIncidentCreationAlertRule = original.MicrosoftSecurityIncidentCreationAlertRule
+type MicrosoftSecurityIncidentCreationAlertRuleCommonProperties = original.MicrosoftSecurityIncidentCreationAlertRuleCommonProperties
+type MicrosoftSecurityIncidentCreationAlertRuleProperties = original.MicrosoftSecurityIncidentCreationAlertRuleProperties
+type MicrosoftSecurityIncidentCreationAlertRuleTemplate = original.MicrosoftSecurityIncidentCreationAlertRuleTemplate
+type MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties = original.MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties
type OfficeConsent = original.OfficeConsent
type OfficeConsentList = original.OfficeConsentList
type OfficeConsentListIterator = original.OfficeConsentListIterator
@@ -524,12 +566,17 @@ type RegistryKeyEntity = original.RegistryKeyEntity
type RegistryKeyEntityProperties = original.RegistryKeyEntityProperties
type RegistryValueEntity = original.RegistryValueEntity
type RegistryValueEntityProperties = original.RegistryValueEntityProperties
+type RelationBase = original.RelationBase
+type RelationNode = original.RelationNode
+type RelationsModelInput = original.RelationsModelInput
+type RelationsModelInputProperties = original.RelationsModelInputProperties
type Resource = original.Resource
+type ResourceWithEtag = original.ResourceWithEtag
type ScheduledAlertRule = original.ScheduledAlertRule
+type ScheduledAlertRuleCommonProperties = original.ScheduledAlertRuleCommonProperties
type ScheduledAlertRuleProperties = original.ScheduledAlertRuleProperties
type ScheduledAlertRuleTemplate = original.ScheduledAlertRuleTemplate
type ScheduledAlertRuleTemplateProperties = original.ScheduledAlertRuleTemplateProperties
-type ScheduledAlertRuleTemplatePropertiesModel = original.ScheduledAlertRuleTemplatePropertiesModel
type SecurityAlert = original.SecurityAlert
type SecurityAlertProperties = original.SecurityAlertProperties
type SecurityAlertPropertiesConfidenceReasonsItem = original.SecurityAlertPropertiesConfidenceReasonsItem
@@ -596,6 +643,18 @@ func NewBookmarkListIterator(page BookmarkListPage) BookmarkListIterator {
func NewBookmarkListPage(getNextPage func(context.Context, BookmarkList) (BookmarkList, error)) BookmarkListPage {
return original.NewBookmarkListPage(getNextPage)
}
+func NewBookmarkRelationListIterator(page BookmarkRelationListPage) BookmarkRelationListIterator {
+ return original.NewBookmarkRelationListIterator(page)
+}
+func NewBookmarkRelationListPage(getNextPage func(context.Context, BookmarkRelationList) (BookmarkRelationList, error)) BookmarkRelationListPage {
+ return original.NewBookmarkRelationListPage(getNextPage)
+}
+func NewBookmarkRelationsClient(subscriptionID string) BookmarkRelationsClient {
+ return original.NewBookmarkRelationsClient(subscriptionID)
+}
+func NewBookmarkRelationsClientWithBaseURI(baseURI string, subscriptionID string) BookmarkRelationsClient {
+ return original.NewBookmarkRelationsClientWithBaseURI(baseURI, subscriptionID)
+}
func NewBookmarksClient(subscriptionID string) BookmarksClient {
return original.NewBookmarksClient(subscriptionID)
}
@@ -620,6 +679,18 @@ func NewCaseListIterator(page CaseListPage) CaseListIterator {
func NewCaseListPage(getNextPage func(context.Context, CaseList) (CaseList, error)) CaseListPage {
return original.NewCaseListPage(getNextPage)
}
+func NewCaseRelationListIterator(page CaseRelationListPage) CaseRelationListIterator {
+ return original.NewCaseRelationListIterator(page)
+}
+func NewCaseRelationListPage(getNextPage func(context.Context, CaseRelationList) (CaseRelationList, error)) CaseRelationListPage {
+ return original.NewCaseRelationListPage(getNextPage)
+}
+func NewCaseRelationsClient(subscriptionID string) CaseRelationsClient {
+ return original.NewCaseRelationsClient(subscriptionID)
+}
+func NewCaseRelationsClientWithBaseURI(baseURI string, subscriptionID string) CaseRelationsClient {
+ return original.NewCaseRelationsClientWithBaseURI(baseURI, subscriptionID)
+}
func NewCasesAggregationsClient(subscriptionID string) CasesAggregationsClient {
return original.NewCasesAggregationsClient(subscriptionID)
}
@@ -761,12 +832,12 @@ func PossibleFileHashAlgorithmValues() []FileHashAlgorithm {
func PossibleKillChainIntentValues() []KillChainIntent {
return original.PossibleKillChainIntentValues()
}
-func PossibleKindBasicAggregationsValues() []KindBasicAggregations {
- return original.PossibleKindBasicAggregationsValues()
-}
func PossibleKindBasicAlertRuleTemplateValues() []KindBasicAlertRuleTemplate {
return original.PossibleKindBasicAlertRuleTemplateValues()
}
+func PossibleKindBasicAlertRuleValues() []KindBasicAlertRule {
+ return original.PossibleKindBasicAlertRuleValues()
+}
func PossibleKindBasicDataConnectorValues() []KindBasicDataConnector {
return original.PossibleKindBasicDataConnectorValues()
}
@@ -782,6 +853,9 @@ func PossibleKindValues() []Kind {
func PossibleLicenseStatusValues() []LicenseStatus {
return original.PossibleLicenseStatusValues()
}
+func PossibleMicrosoftSecurityProductNameValues() []MicrosoftSecurityProductName {
+ return original.PossibleMicrosoftSecurityProductNameValues()
+}
func PossibleOSFamilyValues() []OSFamily {
return original.PossibleOSFamilyValues()
}
@@ -791,6 +865,12 @@ func PossibleRegistryHiveValues() []RegistryHive {
func PossibleRegistryValueKindValues() []RegistryValueKind {
return original.PossibleRegistryValueKindValues()
}
+func PossibleRelationNodeKindValues() []RelationNodeKind {
+ return original.PossibleRelationNodeKindValues()
+}
+func PossibleRelationTypesValues() []RelationTypes {
+ return original.PossibleRelationTypesValues()
+}
func PossibleSettingKindValues() []SettingKind {
return original.PossibleSettingKindValues()
}
diff --git a/profiles/preview/preview/securityinsight/mgmt/securityinsight/securityinsightapi/models.go b/profiles/preview/preview/securityinsight/mgmt/securityinsight/securityinsightapi/models.go
index 8ab6cea80eac..bcfdeb4c208a 100644
--- a/profiles/preview/preview/securityinsight/mgmt/securityinsight/securityinsightapi/models.go
+++ b/profiles/preview/preview/securityinsight/mgmt/securityinsight/securityinsightapi/models.go
@@ -24,8 +24,10 @@ import original "github.com/Azure/azure-sdk-for-go/services/preview/securityinsi
type ActionsClientAPI = original.ActionsClientAPI
type AlertRuleTemplatesClientAPI = original.AlertRuleTemplatesClientAPI
type AlertRulesClientAPI = original.AlertRulesClientAPI
+type BookmarkRelationsClientAPI = original.BookmarkRelationsClientAPI
type BookmarksClientAPI = original.BookmarksClientAPI
type CaseCommentsClientAPI = original.CaseCommentsClientAPI
+type CaseRelationsClientAPI = original.CaseRelationsClientAPI
type CasesAggregationsClientAPI = original.CasesAggregationsClientAPI
type CasesClientAPI = original.CasesClientAPI
type CommentsClientAPI = original.CommentsClientAPI
diff --git a/profiles/preview/preview/servicefabric/mgmt/servicefabric/models.go b/profiles/preview/preview/servicefabric/mgmt/servicefabric/models.go
index 4799a26cb37b..6e2171d4fdc5 100644
--- a/profiles/preview/preview/servicefabric/mgmt/servicefabric/models.go
+++ b/profiles/preview/preview/servicefabric/mgmt/servicefabric/models.go
@@ -22,7 +22,7 @@ package servicefabric
import (
"context"
- original "github.com/Azure/azure-sdk-for-go/services/preview/servicefabric/mgmt/2019-03-01/servicefabric"
+ original "github.com/Azure/azure-sdk-for-go/services/preview/servicefabric/mgmt/2019-03-01-preview/servicefabric"
)
const (
diff --git a/profiles/preview/preview/servicefabric/mgmt/servicefabric/servicefabricapi/models.go b/profiles/preview/preview/servicefabric/mgmt/servicefabric/servicefabricapi/models.go
index 3432230e9701..92bebee141b6 100644
--- a/profiles/preview/preview/servicefabric/mgmt/servicefabric/servicefabricapi/models.go
+++ b/profiles/preview/preview/servicefabric/mgmt/servicefabric/servicefabricapi/models.go
@@ -19,7 +19,7 @@
package servicefabricapi
-import original "github.com/Azure/azure-sdk-for-go/services/preview/servicefabric/mgmt/2019-03-01/servicefabric/servicefabricapi"
+import original "github.com/Azure/azure-sdk-for-go/services/preview/servicefabric/mgmt/2019-03-01-preview/servicefabric/servicefabricapi"
type ApplicationTypeVersionsClientAPI = original.ApplicationTypeVersionsClientAPI
type ApplicationTypesClientAPI = original.ApplicationTypesClientAPI
diff --git a/profiles/preview/resources/mgmt/subscriptions/models.go b/profiles/preview/resources/mgmt/subscriptions/models.go
index 116a1e96c80d..614c49b0119d 100644
--- a/profiles/preview/resources/mgmt/subscriptions/models.go
+++ b/profiles/preview/resources/mgmt/subscriptions/models.go
@@ -22,7 +22,7 @@ package subscriptions
import (
"context"
- original "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-06-01/subscriptions"
+ original "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions"
)
const (
@@ -54,6 +54,7 @@ type ListResultIterator = original.ListResultIterator
type ListResultPage = original.ListResultPage
type Location = original.Location
type LocationListResult = original.LocationListResult
+type ManagedByTenant = original.ManagedByTenant
type Operation = original.Operation
type OperationDisplay = original.OperationDisplay
type OperationListResult = original.OperationListResult
diff --git a/profiles/preview/resources/mgmt/subscriptions/subscriptionsapi/models.go b/profiles/preview/resources/mgmt/subscriptions/subscriptionsapi/models.go
index 310ddf1a3680..160e7606fe40 100644
--- a/profiles/preview/resources/mgmt/subscriptions/subscriptionsapi/models.go
+++ b/profiles/preview/resources/mgmt/subscriptions/subscriptionsapi/models.go
@@ -19,7 +19,7 @@
package subscriptionsapi
-import original "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-06-01/subscriptions/subscriptionsapi"
+import original "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions/subscriptionsapi"
type ClientAPI = original.ClientAPI
type OperationsClientAPI = original.OperationsClientAPI
diff --git a/profiles/preview/servicebus/mgmt/servicebus/models.go b/profiles/preview/servicebus/mgmt/servicebus/models.go
index 76d678ad4ab6..be8dcde4933b 100644
--- a/profiles/preview/servicebus/mgmt/servicebus/models.go
+++ b/profiles/preview/servicebus/mgmt/servicebus/models.go
@@ -187,6 +187,9 @@ type NamespacesClient = original.NamespacesClient
type NamespacesCreateOrUpdateFuture = original.NamespacesCreateOrUpdateFuture
type NamespacesDeleteFuture = original.NamespacesDeleteFuture
type NetworkRuleSet = original.NetworkRuleSet
+type NetworkRuleSetListResult = original.NetworkRuleSetListResult
+type NetworkRuleSetListResultIterator = original.NetworkRuleSetListResultIterator
+type NetworkRuleSetListResultPage = original.NetworkRuleSetListResultPage
type NetworkRuleSetProperties = original.NetworkRuleSetProperties
type Operation = original.Operation
type OperationDisplay = original.OperationDisplay
@@ -296,6 +299,12 @@ func NewNamespacesClient(subscriptionID string) NamespacesClient {
func NewNamespacesClientWithBaseURI(baseURI string, subscriptionID string) NamespacesClient {
return original.NewNamespacesClientWithBaseURI(baseURI, subscriptionID)
}
+func NewNetworkRuleSetListResultIterator(page NetworkRuleSetListResultPage) NetworkRuleSetListResultIterator {
+ return original.NewNetworkRuleSetListResultIterator(page)
+}
+func NewNetworkRuleSetListResultPage(getNextPage func(context.Context, NetworkRuleSetListResult) (NetworkRuleSetListResult, error)) NetworkRuleSetListResultPage {
+ return original.NewNetworkRuleSetListResultPage(getNextPage)
+}
func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
return original.NewOperationListResultIterator(page)
}
diff --git a/profiles/preview/storage/datalake/storagedatalake/models.go b/profiles/preview/storage/datalake/storagedatalake/models.go
index d5962ab997f3..da811c3a9849 100644
--- a/profiles/preview/storage/datalake/storagedatalake/models.go
+++ b/profiles/preview/storage/datalake/storagedatalake/models.go
@@ -19,7 +19,7 @@
package storagedatalake
-import original "github.com/Azure/azure-sdk-for-go/services/storage/datalake/2018-11-09/storagedatalake"
+import original "github.com/Azure/azure-sdk-for-go/services/storage/datalake/2019-10-31/storagedatalake"
const (
DefaultDNSSuffix = original.DefaultDNSSuffix
@@ -28,6 +28,7 @@ const (
type PathGetPropertiesAction = original.PathGetPropertiesAction
const (
+ CheckAccess PathGetPropertiesAction = original.CheckAccess
GetAccessControl PathGetPropertiesAction = original.GetAccessControl
GetStatus PathGetPropertiesAction = original.GetStatus
)
diff --git a/profiles/preview/storage/datalake/storagedatalake/storagedatalakeapi/models.go b/profiles/preview/storage/datalake/storagedatalake/storagedatalakeapi/models.go
index 278b9df7f518..fe6cd4856f06 100644
--- a/profiles/preview/storage/datalake/storagedatalake/storagedatalakeapi/models.go
+++ b/profiles/preview/storage/datalake/storagedatalake/storagedatalakeapi/models.go
@@ -19,7 +19,7 @@
package storagedatalakeapi
-import original "github.com/Azure/azure-sdk-for-go/services/storage/datalake/2018-11-09/storagedatalake/storagedatalakeapi"
+import original "github.com/Azure/azure-sdk-for-go/services/storage/datalake/2019-10-31/storagedatalake/storagedatalakeapi"
type FilesystemClientAPI = original.FilesystemClientAPI
type PathClientAPI = original.PathClientAPI
diff --git a/profiles/preview/storage/mgmt/storage/models.go b/profiles/preview/storage/mgmt/storage/models.go
index e95058a8ae40..bd83eed0e792 100644
--- a/profiles/preview/storage/mgmt/storage/models.go
+++ b/profiles/preview/storage/mgmt/storage/models.go
@@ -142,6 +142,13 @@ const (
StorageV2 Kind = original.StorageV2
)
+type LargeFileSharesState = original.LargeFileSharesState
+
+const (
+ Disabled LargeFileSharesState = original.Disabled
+ Enabled LargeFileSharesState = original.Enabled
+)
+
type LeaseDuration = original.LeaseDuration
const (
@@ -282,6 +289,8 @@ type AccountCreateParameters = original.AccountCreateParameters
type AccountKey = original.AccountKey
type AccountListKeysResult = original.AccountListKeysResult
type AccountListResult = original.AccountListResult
+type AccountListResultIterator = original.AccountListResultIterator
+type AccountListResultPage = original.AccountListResultPage
type AccountProperties = original.AccountProperties
type AccountPropertiesCreateParameters = original.AccountPropertiesCreateParameters
type AccountPropertiesUpdateParameters = original.AccountPropertiesUpdateParameters
@@ -300,7 +309,10 @@ type BlobServiceItems = original.BlobServiceItems
type BlobServiceProperties = original.BlobServiceProperties
type BlobServicePropertiesProperties = original.BlobServicePropertiesProperties
type BlobServicesClient = original.BlobServicesClient
+type ChangeFeed = original.ChangeFeed
type CheckNameAvailabilityResult = original.CheckNameAvailabilityResult
+type CloudError = original.CloudError
+type CloudErrorBody = original.CloudErrorBody
type ContainerProperties = original.ContainerProperties
type CorsRule = original.CorsRule
type CorsRules = original.CorsRules
@@ -313,8 +325,6 @@ type Encryption = original.Encryption
type EncryptionService = original.EncryptionService
type EncryptionServices = original.EncryptionServices
type Endpoints = original.Endpoints
-type ErrorResponse = original.ErrorResponse
-type ErrorResponseBody = original.ErrorResponseBody
type FileServiceItems = original.FileServiceItems
type FileServiceProperties = original.FileServiceProperties
type FileServicePropertiesProperties = original.FileServicePropertiesProperties
@@ -381,6 +391,12 @@ type VirtualNetworkRule = original.VirtualNetworkRule
func New(subscriptionID string) BaseClient {
return original.New(subscriptionID)
}
+func NewAccountListResultIterator(page AccountListResultPage) AccountListResultIterator {
+ return original.NewAccountListResultIterator(page)
+}
+func NewAccountListResultPage(getNextPage func(context.Context, AccountListResult) (AccountListResult, error)) AccountListResultPage {
+ return original.NewAccountListResultPage(getNextPage)
+}
func NewAccountsClient(subscriptionID string) AccountsClient {
return original.NewAccountsClient(subscriptionID)
}
@@ -495,6 +511,9 @@ func PossibleKeySourceValues() []KeySource {
func PossibleKindValues() []Kind {
return original.PossibleKindValues()
}
+func PossibleLargeFileSharesStateValues() []LargeFileSharesState {
+ return original.PossibleLargeFileSharesStateValues()
+}
func PossibleLeaseDurationValues() []LeaseDuration {
return original.PossibleLeaseDurationValues()
}
diff --git a/services/apimanagement/mgmt/2019-01-01/apimanagement/models.go b/services/apimanagement/mgmt/2019-01-01/apimanagement/models.go
index c12845902b2f..5895c52c995c 100644
--- a/services/apimanagement/mgmt/2019-01-01/apimanagement/models.go
+++ b/services/apimanagement/mgmt/2019-01-01/apimanagement/models.go
@@ -2119,8 +2119,6 @@ type AuthenticationSettingsContract struct {
OAuth2 *OAuth2AuthenticationSettingsContract `json:"oAuth2,omitempty"`
// Openid - OpenID Connect Authentication Settings
Openid *OpenIDAuthenticationSettingsContract `json:"openid,omitempty"`
- // SubscriptionKeyRequired - Specifies whether subscription key is required during call to this API, true - API is included into closed products only, false - API is included into open products alone, null - there is a mix of products.
- SubscriptionKeyRequired *bool `json:"subscriptionKeyRequired,omitempty"`
}
// AuthorizationServerCollection paged OAuth2 Authorization Servers list representation.
diff --git a/services/appinsights/mgmt/2015-05-01/insights/components.go b/services/appinsights/mgmt/2015-05-01/insights/components.go
index e888411b04c6..12014255144e 100644
--- a/services/appinsights/mgmt/2015-05-01/insights/components.go
+++ b/services/appinsights/mgmt/2015-05-01/insights/components.go
@@ -636,6 +636,11 @@ func (client ComponentsClient) ListByResourceGroupComplete(ctx context.Context,
}
// Purge purges data in an Application Insights component by a set of user-defined filters.
+//
+// In order to manage system resources, purge requests are throttled at 50 requests per hour. You should batch the
+// execution of purge requests by sending a single command whose predicate includes all user identities that require
+// purging. Use the in operator to specify multiple identities. You should run the query prior to using for a purge
+// request to verify that the results are expected.
// Parameters:
// resourceGroupName - the name of the resource group. The name is case insensitive.
// resourceName - the name of the Application Insights component resource.
diff --git a/services/appinsights/v1/insights/client.go b/services/appinsights/v1/insights/client.go
deleted file mode 100644
index 49ccf5f10da4..000000000000
--- a/services/appinsights/v1/insights/client.go
+++ /dev/null
@@ -1,49 +0,0 @@
-// Package insights implements the Azure ARM Insights service API version v1.
-//
-// Composite Swagger for Application Insights Data Client
-package insights
-
-// 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"
-)
-
-const (
- // DefaultBaseURI is the default URI used for the service Insights
- DefaultBaseURI = "https://api.applicationinsights.io/v1"
-)
-
-// BaseClient is the base client for Insights.
-type BaseClient struct {
- autorest.Client
- BaseURI string
-}
-
-// New creates an instance of the BaseClient client.
-func New() BaseClient {
- return NewWithBaseURI(DefaultBaseURI)
-}
-
-// NewWithBaseURI creates an instance of the BaseClient client.
-func NewWithBaseURI(baseURI string) BaseClient {
- return BaseClient{
- Client: autorest.NewClientWithUserAgent(UserAgent()),
- BaseURI: baseURI,
- }
-}
diff --git a/services/appinsights/v1/insights/events.go b/services/appinsights/v1/insights/events.go
deleted file mode 100644
index 64825cbc74c6..000000000000
--- a/services/appinsights/v1/insights/events.go
+++ /dev/null
@@ -1,311 +0,0 @@
-package insights
-
-// 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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// EventsClient is the composite Swagger for Application Insights Data Client
-type EventsClient struct {
- BaseClient
-}
-
-// NewEventsClient creates an instance of the EventsClient client.
-func NewEventsClient() EventsClient {
- return NewEventsClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewEventsClientWithBaseURI creates an instance of the EventsClient client.
-func NewEventsClientWithBaseURI(baseURI string) EventsClient {
- return EventsClient{NewWithBaseURI(baseURI)}
-}
-
-// Get gets the data for a single event
-// Parameters:
-// appID - ID of the application. This is Application ID from the API Access settings blade in the Azure
-// portal.
-// eventType - the type of events to query; either a standard event type (`traces`, `customEvents`,
-// `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all
-// event types.
-// eventID - ID of event.
-// timespan - optional. The timespan over which to retrieve events. This is an ISO8601 time period value. This
-// timespan is applied in addition to any that are specified in the Odata expression.
-func (client EventsClient) Get(ctx context.Context, appID string, eventType EventType, eventID string, timespan string) (result EventsResults, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/EventsClient.Get")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.GetPreparer(ctx, appID, eventType, eventID, timespan)
- if err != nil {
- err = autorest.NewErrorWithError(err, "insights.EventsClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "insights.EventsClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "insights.EventsClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client EventsClient) GetPreparer(ctx context.Context, appID string, eventType EventType, eventID string, timespan string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "eventId": autorest.Encode("path", eventID),
- "eventType": autorest.Encode("path", eventType),
- }
-
- queryParameters := map[string]interface{}{}
- if len(timespan) > 0 {
- queryParameters["timespan"] = autorest.Encode("query", timespan)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/apps/{appId}/events/{eventType}/{eventId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client EventsClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client EventsClient) GetResponder(resp *http.Response) (result EventsResults, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetByType executes an OData query for events
-// Parameters:
-// appID - ID of the application. This is Application ID from the API Access settings blade in the Azure
-// portal.
-// eventType - the type of events to query; either a standard event type (`traces`, `customEvents`,
-// `pageViews`, `requests`, `dependencies`, `exceptions`, `availabilityResults`) or `$all` to query across all
-// event types.
-// timespan - optional. The timespan over which to retrieve events. This is an ISO8601 time period value. This
-// timespan is applied in addition to any that are specified in the Odata expression.
-// filter - an expression used to filter the returned events
-// search - a free-text search expression to match for whether a particular event should be returned
-// orderby - a comma-separated list of properties with \"asc\" (the default) or \"desc\" to control the order
-// of returned events
-// selectParameter - limits the properties to just those requested on each returned event
-// skip - the number of items to skip over before returning events
-// top - the number of events to return
-// formatParameter - format for the returned events
-// count - request a count of matching items included with the returned events
-// apply - an expression used for aggregation over returned events
-func (client EventsClient) GetByType(ctx context.Context, appID string, eventType EventType, timespan string, filter string, search string, orderby string, selectParameter string, skip *int32, top *int32, formatParameter string, count *bool, apply string) (result EventsResults, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/EventsClient.GetByType")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.GetByTypePreparer(ctx, appID, eventType, timespan, filter, search, orderby, selectParameter, skip, top, formatParameter, count, apply)
- if err != nil {
- err = autorest.NewErrorWithError(err, "insights.EventsClient", "GetByType", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetByTypeSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "insights.EventsClient", "GetByType", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetByTypeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "insights.EventsClient", "GetByType", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetByTypePreparer prepares the GetByType request.
-func (client EventsClient) GetByTypePreparer(ctx context.Context, appID string, eventType EventType, timespan string, filter string, search string, orderby string, selectParameter string, skip *int32, top *int32, formatParameter string, count *bool, apply string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "eventType": autorest.Encode("path", eventType),
- }
-
- queryParameters := map[string]interface{}{}
- if len(timespan) > 0 {
- queryParameters["timespan"] = autorest.Encode("query", timespan)
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(search) > 0 {
- queryParameters["$search"] = autorest.Encode("query", search)
- }
- if len(orderby) > 0 {
- queryParameters["$orderby"] = autorest.Encode("query", orderby)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if skip != nil {
- queryParameters["$skip"] = autorest.Encode("query", *skip)
- }
- if top != nil {
- queryParameters["$top"] = autorest.Encode("query", *top)
- }
- if len(formatParameter) > 0 {
- queryParameters["$format"] = autorest.Encode("query", formatParameter)
- }
- if count != nil {
- queryParameters["$count"] = autorest.Encode("query", *count)
- }
- if len(apply) > 0 {
- queryParameters["$apply"] = autorest.Encode("query", apply)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/apps/{appId}/events/{eventType}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetByTypeSender sends the GetByType request. The method will close the
-// http.Response Body if it receives an error.
-func (client EventsClient) GetByTypeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetByTypeResponder handles the response to the GetByType request. The method always
-// closes the http.Response Body.
-func (client EventsClient) GetByTypeResponder(resp *http.Response) (result EventsResults, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetOdataMetadata gets OData EDMX metadata describing the event data model
-// Parameters:
-// appID - ID of the application. This is Application ID from the API Access settings blade in the Azure
-// portal.
-func (client EventsClient) GetOdataMetadata(ctx context.Context, appID string) (result SetObject, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/EventsClient.GetOdataMetadata")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.GetOdataMetadataPreparer(ctx, appID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "insights.EventsClient", "GetOdataMetadata", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetOdataMetadataSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "insights.EventsClient", "GetOdataMetadata", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetOdataMetadataResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "insights.EventsClient", "GetOdataMetadata", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetOdataMetadataPreparer prepares the GetOdataMetadata request.
-func (client EventsClient) GetOdataMetadataPreparer(ctx context.Context, appID string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/apps/{appId}/events/$metadata", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetOdataMetadataSender sends the GetOdataMetadata request. The method will close the
-// http.Response Body if it receives an error.
-func (client EventsClient) GetOdataMetadataSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetOdataMetadataResponder handles the response to the GetOdataMetadata request. The method always
-// closes the http.Response Body.
-func (client EventsClient) GetOdataMetadataResponder(resp *http.Response) (result SetObject, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/services/appinsights/v1/insights/metrics.go b/services/appinsights/v1/insights/metrics.go
deleted file mode 100644
index 70f525fd57dc..000000000000
--- a/services/appinsights/v1/insights/metrics.go
+++ /dev/null
@@ -1,314 +0,0 @@
-package insights
-
-// 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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// MetricsClient is the composite Swagger for Application Insights Data Client
-type MetricsClient struct {
- BaseClient
-}
-
-// NewMetricsClient creates an instance of the MetricsClient client.
-func NewMetricsClient() MetricsClient {
- return NewMetricsClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewMetricsClientWithBaseURI creates an instance of the MetricsClient client.
-func NewMetricsClientWithBaseURI(baseURI string) MetricsClient {
- return MetricsClient{NewWithBaseURI(baseURI)}
-}
-
-// Get gets metric values for a single metric
-// Parameters:
-// appID - ID of the application. This is Application ID from the API Access settings blade in the Azure
-// portal.
-// metricID - ID of the metric. This is either a standard AI metric, or an application-specific custom metric.
-// timespan - the timespan over which to retrieve metric values. This is an ISO8601 time period value. If
-// timespan is omitted, a default time range of `PT12H` ("last 12 hours") is used. The actual timespan that is
-// queried may be adjusted by the server based. In all cases, the actual time span used for the query is
-// included in the response.
-// interval - the time interval to use when retrieving metric values. This is an ISO8601 duration. If interval
-// is omitted, the metric value is aggregated across the entire timespan. If interval is supplied, the server
-// may adjust the interval to a more appropriate size based on the timespan used for the query. In all cases,
-// the actual interval used for the query is included in the response.
-// aggregation - the aggregation to use when computing the metric values. To retrieve more than one aggregation
-// at a time, separate them with a comma. If no aggregation is specified, then the default aggregation for the
-// metric is used.
-// segment - the name of the dimension to segment the metric values by. This dimension must be applicable to
-// the metric you are retrieving. To segment by more than one dimension at a time, separate them with a comma
-// (,). In this case, the metric data will be segmented in the order the dimensions are listed in the
-// parameter.
-// top - the number of segments to return. This value is only valid when segment is specified.
-// orderby - the aggregation function and direction to sort the segments by. This value is only valid when
-// segment is specified.
-// filter - an expression used to filter the results. This value should be a valid OData filter expression
-// where the keys of each clause should be applicable dimensions for the metric you are retrieving.
-func (client MetricsClient) Get(ctx context.Context, appID string, metricID MetricID, timespan string, interval *string, aggregation []MetricsAggregation, segment []MetricsSegment, top *int32, orderby string, filter string) (result MetricsResult, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/MetricsClient.Get")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: aggregation,
- Constraints: []validation.Constraint{{Target: "aggregation", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "aggregation", Name: validation.MinItems, Rule: 1, Chain: nil}}}}},
- {TargetValue: segment,
- Constraints: []validation.Constraint{{Target: "segment", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "segment", Name: validation.MinItems, Rule: 1, Chain: nil}}}}}}); err != nil {
- return result, validation.NewError("insights.MetricsClient", "Get", err.Error())
- }
-
- req, err := client.GetPreparer(ctx, appID, metricID, timespan, interval, aggregation, segment, top, orderby, filter)
- if err != nil {
- err = autorest.NewErrorWithError(err, "insights.MetricsClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "insights.MetricsClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "insights.MetricsClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client MetricsClient) GetPreparer(ctx context.Context, appID string, metricID MetricID, timespan string, interval *string, aggregation []MetricsAggregation, segment []MetricsSegment, top *int32, orderby string, filter string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "metricId": autorest.Encode("path", metricID),
- }
-
- queryParameters := map[string]interface{}{}
- if len(timespan) > 0 {
- queryParameters["timespan"] = autorest.Encode("query", timespan)
- }
- if interval != nil {
- queryParameters["interval"] = autorest.Encode("query", *interval)
- }
- if aggregation != nil && len(aggregation) > 0 {
- queryParameters["aggregation"] = autorest.Encode("query", aggregation, ",")
- }
- if segment != nil && len(segment) > 0 {
- queryParameters["segment"] = autorest.Encode("query", segment, ",")
- }
- if top != nil {
- queryParameters["top"] = autorest.Encode("query", *top)
- }
- if len(orderby) > 0 {
- queryParameters["orderby"] = autorest.Encode("query", orderby)
- }
- if len(filter) > 0 {
- queryParameters["filter"] = autorest.Encode("query", filter)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/apps/{appId}/metrics/{metricId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client MetricsClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client MetricsClient) GetResponder(resp *http.Response) (result MetricsResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetMetadata gets metadata describing the available metrics
-// Parameters:
-// appID - ID of the application. This is Application ID from the API Access settings blade in the Azure
-// portal.
-func (client MetricsClient) GetMetadata(ctx context.Context, appID string) (result SetObject, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/MetricsClient.GetMetadata")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.GetMetadataPreparer(ctx, appID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "insights.MetricsClient", "GetMetadata", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetMetadataSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "insights.MetricsClient", "GetMetadata", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetMetadataResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "insights.MetricsClient", "GetMetadata", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetMetadataPreparer prepares the GetMetadata request.
-func (client MetricsClient) GetMetadataPreparer(ctx context.Context, appID string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/apps/{appId}/metrics/metadata", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetMetadataSender sends the GetMetadata request. The method will close the
-// http.Response Body if it receives an error.
-func (client MetricsClient) GetMetadataSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetMetadataResponder handles the response to the GetMetadata request. The method always
-// closes the http.Response Body.
-func (client MetricsClient) GetMetadataResponder(resp *http.Response) (result SetObject, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetMultiple gets metric values for multiple metrics
-// Parameters:
-// appID - ID of the application. This is Application ID from the API Access settings blade in the Azure
-// portal.
-// body - the batched metrics query.
-func (client MetricsClient) GetMultiple(ctx context.Context, appID string, body []MetricsPostBodySchema) (result ListMetricsResultsItem, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/MetricsClient.GetMultiple")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: body,
- Constraints: []validation.Constraint{{Target: "body", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("insights.MetricsClient", "GetMultiple", err.Error())
- }
-
- req, err := client.GetMultiplePreparer(ctx, appID, body)
- if err != nil {
- err = autorest.NewErrorWithError(err, "insights.MetricsClient", "GetMultiple", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetMultipleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "insights.MetricsClient", "GetMultiple", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetMultipleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "insights.MetricsClient", "GetMultiple", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetMultiplePreparer prepares the GetMultiple request.
-func (client MetricsClient) GetMultiplePreparer(ctx context.Context, appID string, body []MetricsPostBodySchema) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/apps/{appId}/metrics", pathParameters),
- autorest.WithJSON(body))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetMultipleSender sends the GetMultiple request. The method will close the
-// http.Response Body if it receives an error.
-func (client MetricsClient) GetMultipleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetMultipleResponder handles the response to the GetMultiple request. The method always
-// closes the http.Response Body.
-func (client MetricsClient) GetMultipleResponder(resp *http.Response) (result ListMetricsResultsItem, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/services/appinsights/v1/insights/models.go b/services/appinsights/v1/insights/models.go
deleted file mode 100644
index 5165da8b8723..000000000000
--- a/services/appinsights/v1/insights/models.go
+++ /dev/null
@@ -1,2554 +0,0 @@
-package insights
-
-// 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 (
- "encoding/json"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/date"
-)
-
-// The package's fully qualified name.
-const fqdn = "github.com/Azure/azure-sdk-for-go/services/appinsights/v1/insights"
-
-// EventType enumerates the values for event type.
-type EventType string
-
-const (
- // All ...
- All EventType = "$all"
- // AvailabilityResults ...
- AvailabilityResults EventType = "availabilityResults"
- // BrowserTimings ...
- BrowserTimings EventType = "browserTimings"
- // CustomEvents ...
- CustomEvents EventType = "customEvents"
- // CustomMetrics ...
- CustomMetrics EventType = "customMetrics"
- // Dependencies ...
- Dependencies EventType = "dependencies"
- // Exceptions ...
- Exceptions EventType = "exceptions"
- // PageViews ...
- PageViews EventType = "pageViews"
- // PerformanceCounters ...
- PerformanceCounters EventType = "performanceCounters"
- // Requests ...
- Requests EventType = "requests"
- // Traces ...
- Traces EventType = "traces"
-)
-
-// PossibleEventTypeValues returns an array of possible values for the EventType const type.
-func PossibleEventTypeValues() []EventType {
- return []EventType{All, AvailabilityResults, BrowserTimings, CustomEvents, CustomMetrics, Dependencies, Exceptions, PageViews, PerformanceCounters, Requests, Traces}
-}
-
-// MetricID enumerates the values for metric id.
-type MetricID string
-
-const (
- // AvailabilityResultsavailabilityPercentage ...
- AvailabilityResultsavailabilityPercentage MetricID = "availabilityResults/availabilityPercentage"
- // AvailabilityResultsduration ...
- AvailabilityResultsduration MetricID = "availabilityResults/duration"
- // BillingtelemetryCount ...
- BillingtelemetryCount MetricID = "billing/telemetryCount"
- // ClientnetworkDuration ...
- ClientnetworkDuration MetricID = "client/networkDuration"
- // ClientprocessingDuration ...
- ClientprocessingDuration MetricID = "client/processingDuration"
- // ClientreceiveDuration ...
- ClientreceiveDuration MetricID = "client/receiveDuration"
- // ClientsendDuration ...
- ClientsendDuration MetricID = "client/sendDuration"
- // ClienttotalDuration ...
- ClienttotalDuration MetricID = "client/totalDuration"
- // CustomEventscount ...
- CustomEventscount MetricID = "customEvents/count"
- // Dependenciescount ...
- Dependenciescount MetricID = "dependencies/count"
- // Dependenciesduration ...
- Dependenciesduration MetricID = "dependencies/duration"
- // Dependenciesfailed ...
- Dependenciesfailed MetricID = "dependencies/failed"
- // Exceptionsbrowser ...
- Exceptionsbrowser MetricID = "exceptions/browser"
- // Exceptionscount ...
- Exceptionscount MetricID = "exceptions/count"
- // Exceptionsserver ...
- Exceptionsserver MetricID = "exceptions/server"
- // PageViewscount ...
- PageViewscount MetricID = "pageViews/count"
- // PageViewsduration ...
- PageViewsduration MetricID = "pageViews/duration"
- // PerformanceCountersexceptionsPerSecond ...
- PerformanceCountersexceptionsPerSecond MetricID = "performanceCounters/exceptionsPerSecond"
- // PerformanceCountersmemoryAvailableBytes ...
- PerformanceCountersmemoryAvailableBytes MetricID = "performanceCounters/memoryAvailableBytes"
- // PerformanceCountersprocessCPUPercentage ...
- PerformanceCountersprocessCPUPercentage MetricID = "performanceCounters/processCpuPercentage"
- // PerformanceCountersprocessIOBytesPerSecond ...
- PerformanceCountersprocessIOBytesPerSecond MetricID = "performanceCounters/processIOBytesPerSecond"
- // PerformanceCountersprocessorCPUPercentage ...
- PerformanceCountersprocessorCPUPercentage MetricID = "performanceCounters/processorCpuPercentage"
- // PerformanceCountersprocessPrivateBytes ...
- PerformanceCountersprocessPrivateBytes MetricID = "performanceCounters/processPrivateBytes"
- // PerformanceCountersrequestExecutionTime ...
- PerformanceCountersrequestExecutionTime MetricID = "performanceCounters/requestExecutionTime"
- // PerformanceCountersrequestsInQueue ...
- PerformanceCountersrequestsInQueue MetricID = "performanceCounters/requestsInQueue"
- // PerformanceCountersrequestsPerSecond ...
- PerformanceCountersrequestsPerSecond MetricID = "performanceCounters/requestsPerSecond"
- // Requestscount ...
- Requestscount MetricID = "requests/count"
- // Requestsduration ...
- Requestsduration MetricID = "requests/duration"
- // Requestsfailed ...
- Requestsfailed MetricID = "requests/failed"
- // Sessionscount ...
- Sessionscount MetricID = "sessions/count"
- // Usersauthenticated ...
- Usersauthenticated MetricID = "users/authenticated"
- // Userscount ...
- Userscount MetricID = "users/count"
-)
-
-// PossibleMetricIDValues returns an array of possible values for the MetricID const type.
-func PossibleMetricIDValues() []MetricID {
- return []MetricID{AvailabilityResultsavailabilityPercentage, AvailabilityResultsduration, BillingtelemetryCount, ClientnetworkDuration, ClientprocessingDuration, ClientreceiveDuration, ClientsendDuration, ClienttotalDuration, CustomEventscount, Dependenciescount, Dependenciesduration, Dependenciesfailed, Exceptionsbrowser, Exceptionscount, Exceptionsserver, PageViewscount, PageViewsduration, PerformanceCountersexceptionsPerSecond, PerformanceCountersmemoryAvailableBytes, PerformanceCountersprocessCPUPercentage, PerformanceCountersprocessIOBytesPerSecond, PerformanceCountersprocessorCPUPercentage, PerformanceCountersprocessPrivateBytes, PerformanceCountersrequestExecutionTime, PerformanceCountersrequestsInQueue, PerformanceCountersrequestsPerSecond, Requestscount, Requestsduration, Requestsfailed, Sessionscount, Usersauthenticated, Userscount}
-}
-
-// MetricsAggregation enumerates the values for metrics aggregation.
-type MetricsAggregation string
-
-const (
- // Avg ...
- Avg MetricsAggregation = "avg"
- // Count ...
- Count MetricsAggregation = "count"
- // Max ...
- Max MetricsAggregation = "max"
- // Min ...
- Min MetricsAggregation = "min"
- // Sum ...
- Sum MetricsAggregation = "sum"
- // Unique ...
- Unique MetricsAggregation = "unique"
-)
-
-// PossibleMetricsAggregationValues returns an array of possible values for the MetricsAggregation const type.
-func PossibleMetricsAggregationValues() []MetricsAggregation {
- return []MetricsAggregation{Avg, Count, Max, Min, Sum, Unique}
-}
-
-// MetricsSegment enumerates the values for metrics segment.
-type MetricsSegment string
-
-const (
- // ApplicationBuild ...
- ApplicationBuild MetricsSegment = "applicationBuild"
- // ApplicationVersion ...
- ApplicationVersion MetricsSegment = "applicationVersion"
- // AuthenticatedOrAnonymousTraffic ...
- AuthenticatedOrAnonymousTraffic MetricsSegment = "authenticatedOrAnonymousTraffic"
- // Browser ...
- Browser MetricsSegment = "browser"
- // BrowserVersion ...
- BrowserVersion MetricsSegment = "browserVersion"
- // City ...
- City MetricsSegment = "city"
- // CloudRoleName ...
- CloudRoleName MetricsSegment = "cloudRoleName"
- // CloudServiceName ...
- CloudServiceName MetricsSegment = "cloudServiceName"
- // Continent ...
- Continent MetricsSegment = "continent"
- // CountryOrRegion ...
- CountryOrRegion MetricsSegment = "countryOrRegion"
- // DeploymentID ...
- DeploymentID MetricsSegment = "deploymentId"
- // DeploymentUnit ...
- DeploymentUnit MetricsSegment = "deploymentUnit"
- // DeviceType ...
- DeviceType MetricsSegment = "deviceType"
- // Environment ...
- Environment MetricsSegment = "environment"
- // HostingLocation ...
- HostingLocation MetricsSegment = "hostingLocation"
- // InstanceName ...
- InstanceName MetricsSegment = "instanceName"
-)
-
-// PossibleMetricsSegmentValues returns an array of possible values for the MetricsSegment const type.
-func PossibleMetricsSegmentValues() []MetricsSegment {
- return []MetricsSegment{ApplicationBuild, ApplicationVersion, AuthenticatedOrAnonymousTraffic, Browser, BrowserVersion, City, CloudRoleName, CloudServiceName, Continent, CountryOrRegion, DeploymentID, DeploymentUnit, DeviceType, Environment, HostingLocation, InstanceName}
-}
-
-// Type enumerates the values for type.
-type Type string
-
-const (
- // TypeAvailabilityResult ...
- TypeAvailabilityResult Type = "availabilityResult"
- // TypeBrowserTiming ...
- TypeBrowserTiming Type = "browserTiming"
- // TypeCustomEvent ...
- TypeCustomEvent Type = "customEvent"
- // TypeCustomMetric ...
- TypeCustomMetric Type = "customMetric"
- // TypeDependency ...
- TypeDependency Type = "dependency"
- // TypeEventsResultData ...
- TypeEventsResultData Type = "eventsResultData"
- // TypeException ...
- TypeException Type = "exception"
- // TypePageView ...
- TypePageView Type = "pageView"
- // TypePerformanceCounter ...
- TypePerformanceCounter Type = "performanceCounter"
- // TypeRequest ...
- TypeRequest Type = "request"
- // TypeTrace ...
- TypeTrace Type = "trace"
-)
-
-// PossibleTypeValues returns an array of possible values for the Type const type.
-func PossibleTypeValues() []Type {
- return []Type{TypeAvailabilityResult, TypeBrowserTiming, TypeCustomEvent, TypeCustomMetric, TypeDependency, TypeEventsResultData, TypeException, TypePageView, TypePerformanceCounter, TypeRequest, TypeTrace}
-}
-
-// Column a column in a table.
-type Column struct {
- // Name - The name of this column.
- Name *string `json:"name,omitempty"`
- // Type - The data type of this column.
- Type *string `json:"type,omitempty"`
-}
-
-// ErrorDetail ...
-type ErrorDetail struct {
- // Code - The error's code.
- Code *string `json:"code,omitempty"`
- // Message - A human readable error message.
- Message *string `json:"message,omitempty"`
- // Target - Indicates which property in the request is responsible for the error.
- Target *string `json:"target,omitempty"`
- // Value - Indicates which value in 'target' is responsible for the error.
- Value *string `json:"value,omitempty"`
- // Resources - Indicates resources which were responsible for the error.
- Resources *[]string `json:"resources,omitempty"`
- AdditionalProperties interface{} `json:"additionalProperties,omitempty"`
-}
-
-// ErrorInfo ...
-type ErrorInfo struct {
- // Code - A machine readable error code.
- Code *string `json:"code,omitempty"`
- // Message - A human readable error message.
- Message *string `json:"message,omitempty"`
- // Details - error details.
- Details *[]ErrorDetail `json:"details,omitempty"`
- // Innererror - Inner error details if they exist.
- Innererror *ErrorInfo `json:"innererror,omitempty"`
- AdditionalProperties interface{} `json:"additionalProperties,omitempty"`
-}
-
-// ErrorResponse contains details when the response code indicates an error.
-type ErrorResponse struct {
- // Error - The error details.
- Error *ErrorInfo `json:"error,omitempty"`
-}
-
-// EventsAiInfo AI related application info for an event result
-type EventsAiInfo struct {
- // IKey - iKey of the app
- IKey *string `json:"iKey,omitempty"`
- // AppName - Name of the application
- AppName *string `json:"appName,omitempty"`
- // AppID - ID of the application
- AppID *string `json:"appId,omitempty"`
- // SdkVersion - SDK version of the application
- SdkVersion *string `json:"sdkVersion,omitempty"`
-}
-
-// EventsApplicationInfo application info for an event result
-type EventsApplicationInfo struct {
- // Version - Version of the application
- Version *string `json:"version,omitempty"`
-}
-
-// EventsAvailabilityResultInfo the availability result info
-type EventsAvailabilityResultInfo struct {
- // Name - The name of the availability result
- Name *string `json:"name,omitempty"`
- // Success - Indicates if the availability result was successful
- Success *string `json:"success,omitempty"`
- // Duration - The duration of the availability result
- Duration *int64 `json:"duration,omitempty"`
- // PerformanceBucket - The performance bucket of the availability result
- PerformanceBucket *string `json:"performanceBucket,omitempty"`
- // Message - The message of the availability result
- Message *string `json:"message,omitempty"`
- // Location - The location of the availability result
- Location *string `json:"location,omitempty"`
- // ID - The ID of the availability result
- ID *string `json:"id,omitempty"`
- // Size - The size of the availability result
- Size *string `json:"size,omitempty"`
-}
-
-// EventsAvailabilityResultResult an availability result result
-type EventsAvailabilityResultResult struct {
- AvailabilityResult *EventsAvailabilityResultInfo `json:"availabilityResult,omitempty"`
- // ID - The unique ID for this event.
- ID *string `json:"id,omitempty"`
- // Count - Count of the event
- Count *int64 `json:"count,omitempty"`
- // Timestamp - Timestamp of the event
- Timestamp *date.Time `json:"timestamp,omitempty"`
- // CustomDimensions - Custom dimensions of the event
- CustomDimensions *EventsResultDataCustomDimensions `json:"customDimensions,omitempty"`
- // CustomMeasurements - Custom measurements of the event
- CustomMeasurements *EventsResultDataCustomMeasurements `json:"customMeasurements,omitempty"`
- // Operation - Operation info of the event
- Operation *EventsOperationInfo `json:"operation,omitempty"`
- // Session - Session info of the event
- Session *EventsSessionInfo `json:"session,omitempty"`
- // User - User info of the event
- User *EventsUserInfo `json:"user,omitempty"`
- // Cloud - Cloud info of the event
- Cloud *EventsCloudInfo `json:"cloud,omitempty"`
- // Ai - AI info of the event
- Ai *EventsAiInfo `json:"ai,omitempty"`
- // Application - Application info of the event
- Application *EventsApplicationInfo `json:"application,omitempty"`
- // Client - Client info of the event
- Client *EventsClientInfo `json:"client,omitempty"`
- // Type - Possible values include: 'TypeEventsResultData', 'TypeTrace', 'TypeCustomEvent', 'TypePageView', 'TypeBrowserTiming', 'TypeRequest', 'TypeDependency', 'TypeException', 'TypeAvailabilityResult', 'TypePerformanceCounter', 'TypeCustomMetric'
- Type Type `json:"type,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for EventsAvailabilityResultResult.
-func (earr EventsAvailabilityResultResult) MarshalJSON() ([]byte, error) {
- earr.Type = TypeAvailabilityResult
- objectMap := make(map[string]interface{})
- if earr.AvailabilityResult != nil {
- objectMap["availabilityResult"] = earr.AvailabilityResult
- }
- if earr.ID != nil {
- objectMap["id"] = earr.ID
- }
- if earr.Count != nil {
- objectMap["count"] = earr.Count
- }
- if earr.Timestamp != nil {
- objectMap["timestamp"] = earr.Timestamp
- }
- if earr.CustomDimensions != nil {
- objectMap["customDimensions"] = earr.CustomDimensions
- }
- if earr.CustomMeasurements != nil {
- objectMap["customMeasurements"] = earr.CustomMeasurements
- }
- if earr.Operation != nil {
- objectMap["operation"] = earr.Operation
- }
- if earr.Session != nil {
- objectMap["session"] = earr.Session
- }
- if earr.User != nil {
- objectMap["user"] = earr.User
- }
- if earr.Cloud != nil {
- objectMap["cloud"] = earr.Cloud
- }
- if earr.Ai != nil {
- objectMap["ai"] = earr.Ai
- }
- if earr.Application != nil {
- objectMap["application"] = earr.Application
- }
- if earr.Client != nil {
- objectMap["client"] = earr.Client
- }
- if earr.Type != "" {
- objectMap["type"] = earr.Type
- }
- return json.Marshal(objectMap)
-}
-
-// AsEventsTraceResult is the BasicEventsResultData implementation for EventsAvailabilityResultResult.
-func (earr EventsAvailabilityResultResult) AsEventsTraceResult() (*EventsTraceResult, bool) {
- return nil, false
-}
-
-// AsEventsCustomEventResult is the BasicEventsResultData implementation for EventsAvailabilityResultResult.
-func (earr EventsAvailabilityResultResult) AsEventsCustomEventResult() (*EventsCustomEventResult, bool) {
- return nil, false
-}
-
-// AsEventsPageViewResult is the BasicEventsResultData implementation for EventsAvailabilityResultResult.
-func (earr EventsAvailabilityResultResult) AsEventsPageViewResult() (*EventsPageViewResult, bool) {
- return nil, false
-}
-
-// AsEventsBrowserTimingResult is the BasicEventsResultData implementation for EventsAvailabilityResultResult.
-func (earr EventsAvailabilityResultResult) AsEventsBrowserTimingResult() (*EventsBrowserTimingResult, bool) {
- return nil, false
-}
-
-// AsEventsRequestResult is the BasicEventsResultData implementation for EventsAvailabilityResultResult.
-func (earr EventsAvailabilityResultResult) AsEventsRequestResult() (*EventsRequestResult, bool) {
- return nil, false
-}
-
-// AsEventsDependencyResult is the BasicEventsResultData implementation for EventsAvailabilityResultResult.
-func (earr EventsAvailabilityResultResult) AsEventsDependencyResult() (*EventsDependencyResult, bool) {
- return nil, false
-}
-
-// AsEventsExceptionResult is the BasicEventsResultData implementation for EventsAvailabilityResultResult.
-func (earr EventsAvailabilityResultResult) AsEventsExceptionResult() (*EventsExceptionResult, bool) {
- return nil, false
-}
-
-// AsEventsAvailabilityResultResult is the BasicEventsResultData implementation for EventsAvailabilityResultResult.
-func (earr EventsAvailabilityResultResult) AsEventsAvailabilityResultResult() (*EventsAvailabilityResultResult, bool) {
- return &earr, true
-}
-
-// AsEventsPerformanceCounterResult is the BasicEventsResultData implementation for EventsAvailabilityResultResult.
-func (earr EventsAvailabilityResultResult) AsEventsPerformanceCounterResult() (*EventsPerformanceCounterResult, bool) {
- return nil, false
-}
-
-// AsEventsCustomMetricResult is the BasicEventsResultData implementation for EventsAvailabilityResultResult.
-func (earr EventsAvailabilityResultResult) AsEventsCustomMetricResult() (*EventsCustomMetricResult, bool) {
- return nil, false
-}
-
-// AsEventsResultData is the BasicEventsResultData implementation for EventsAvailabilityResultResult.
-func (earr EventsAvailabilityResultResult) AsEventsResultData() (*EventsResultData, bool) {
- return nil, false
-}
-
-// AsBasicEventsResultData is the BasicEventsResultData implementation for EventsAvailabilityResultResult.
-func (earr EventsAvailabilityResultResult) AsBasicEventsResultData() (BasicEventsResultData, bool) {
- return &earr, true
-}
-
-// EventsBrowserTimingInfo the browser timing information
-type EventsBrowserTimingInfo struct {
- // URLPath - The path of the URL
- URLPath *string `json:"urlPath,omitempty"`
- // URLHost - The host of the URL
- URLHost *string `json:"urlHost,omitempty"`
- // Name - The name of the page
- Name *string `json:"name,omitempty"`
- // URL - The url of the page
- URL *string `json:"url,omitempty"`
- // TotalDuration - The total duration of the load
- TotalDuration *int64 `json:"totalDuration,omitempty"`
- // PerformanceBucket - The performance bucket of the load
- PerformanceBucket *string `json:"performanceBucket,omitempty"`
- // NetworkDuration - The network duration of the load
- NetworkDuration *int64 `json:"networkDuration,omitempty"`
- // SendDuration - The send duration of the load
- SendDuration *int64 `json:"sendDuration,omitempty"`
- // ReceiveDuration - The receive duration of the load
- ReceiveDuration *int64 `json:"receiveDuration,omitempty"`
- // ProcessingDuration - The processing duration of the load
- ProcessingDuration *int64 `json:"processingDuration,omitempty"`
-}
-
-// EventsBrowserTimingResult a browser timing result
-type EventsBrowserTimingResult struct {
- BrowserTiming *EventsBrowserTimingInfo `json:"browserTiming,omitempty"`
- ClientPerformance *EventsClientPerformanceInfo `json:"clientPerformance,omitempty"`
- // ID - The unique ID for this event.
- ID *string `json:"id,omitempty"`
- // Count - Count of the event
- Count *int64 `json:"count,omitempty"`
- // Timestamp - Timestamp of the event
- Timestamp *date.Time `json:"timestamp,omitempty"`
- // CustomDimensions - Custom dimensions of the event
- CustomDimensions *EventsResultDataCustomDimensions `json:"customDimensions,omitempty"`
- // CustomMeasurements - Custom measurements of the event
- CustomMeasurements *EventsResultDataCustomMeasurements `json:"customMeasurements,omitempty"`
- // Operation - Operation info of the event
- Operation *EventsOperationInfo `json:"operation,omitempty"`
- // Session - Session info of the event
- Session *EventsSessionInfo `json:"session,omitempty"`
- // User - User info of the event
- User *EventsUserInfo `json:"user,omitempty"`
- // Cloud - Cloud info of the event
- Cloud *EventsCloudInfo `json:"cloud,omitempty"`
- // Ai - AI info of the event
- Ai *EventsAiInfo `json:"ai,omitempty"`
- // Application - Application info of the event
- Application *EventsApplicationInfo `json:"application,omitempty"`
- // Client - Client info of the event
- Client *EventsClientInfo `json:"client,omitempty"`
- // Type - Possible values include: 'TypeEventsResultData', 'TypeTrace', 'TypeCustomEvent', 'TypePageView', 'TypeBrowserTiming', 'TypeRequest', 'TypeDependency', 'TypeException', 'TypeAvailabilityResult', 'TypePerformanceCounter', 'TypeCustomMetric'
- Type Type `json:"type,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for EventsBrowserTimingResult.
-func (ebtr EventsBrowserTimingResult) MarshalJSON() ([]byte, error) {
- ebtr.Type = TypeBrowserTiming
- objectMap := make(map[string]interface{})
- if ebtr.BrowserTiming != nil {
- objectMap["browserTiming"] = ebtr.BrowserTiming
- }
- if ebtr.ClientPerformance != nil {
- objectMap["clientPerformance"] = ebtr.ClientPerformance
- }
- if ebtr.ID != nil {
- objectMap["id"] = ebtr.ID
- }
- if ebtr.Count != nil {
- objectMap["count"] = ebtr.Count
- }
- if ebtr.Timestamp != nil {
- objectMap["timestamp"] = ebtr.Timestamp
- }
- if ebtr.CustomDimensions != nil {
- objectMap["customDimensions"] = ebtr.CustomDimensions
- }
- if ebtr.CustomMeasurements != nil {
- objectMap["customMeasurements"] = ebtr.CustomMeasurements
- }
- if ebtr.Operation != nil {
- objectMap["operation"] = ebtr.Operation
- }
- if ebtr.Session != nil {
- objectMap["session"] = ebtr.Session
- }
- if ebtr.User != nil {
- objectMap["user"] = ebtr.User
- }
- if ebtr.Cloud != nil {
- objectMap["cloud"] = ebtr.Cloud
- }
- if ebtr.Ai != nil {
- objectMap["ai"] = ebtr.Ai
- }
- if ebtr.Application != nil {
- objectMap["application"] = ebtr.Application
- }
- if ebtr.Client != nil {
- objectMap["client"] = ebtr.Client
- }
- if ebtr.Type != "" {
- objectMap["type"] = ebtr.Type
- }
- return json.Marshal(objectMap)
-}
-
-// AsEventsTraceResult is the BasicEventsResultData implementation for EventsBrowserTimingResult.
-func (ebtr EventsBrowserTimingResult) AsEventsTraceResult() (*EventsTraceResult, bool) {
- return nil, false
-}
-
-// AsEventsCustomEventResult is the BasicEventsResultData implementation for EventsBrowserTimingResult.
-func (ebtr EventsBrowserTimingResult) AsEventsCustomEventResult() (*EventsCustomEventResult, bool) {
- return nil, false
-}
-
-// AsEventsPageViewResult is the BasicEventsResultData implementation for EventsBrowserTimingResult.
-func (ebtr EventsBrowserTimingResult) AsEventsPageViewResult() (*EventsPageViewResult, bool) {
- return nil, false
-}
-
-// AsEventsBrowserTimingResult is the BasicEventsResultData implementation for EventsBrowserTimingResult.
-func (ebtr EventsBrowserTimingResult) AsEventsBrowserTimingResult() (*EventsBrowserTimingResult, bool) {
- return &ebtr, true
-}
-
-// AsEventsRequestResult is the BasicEventsResultData implementation for EventsBrowserTimingResult.
-func (ebtr EventsBrowserTimingResult) AsEventsRequestResult() (*EventsRequestResult, bool) {
- return nil, false
-}
-
-// AsEventsDependencyResult is the BasicEventsResultData implementation for EventsBrowserTimingResult.
-func (ebtr EventsBrowserTimingResult) AsEventsDependencyResult() (*EventsDependencyResult, bool) {
- return nil, false
-}
-
-// AsEventsExceptionResult is the BasicEventsResultData implementation for EventsBrowserTimingResult.
-func (ebtr EventsBrowserTimingResult) AsEventsExceptionResult() (*EventsExceptionResult, bool) {
- return nil, false
-}
-
-// AsEventsAvailabilityResultResult is the BasicEventsResultData implementation for EventsBrowserTimingResult.
-func (ebtr EventsBrowserTimingResult) AsEventsAvailabilityResultResult() (*EventsAvailabilityResultResult, bool) {
- return nil, false
-}
-
-// AsEventsPerformanceCounterResult is the BasicEventsResultData implementation for EventsBrowserTimingResult.
-func (ebtr EventsBrowserTimingResult) AsEventsPerformanceCounterResult() (*EventsPerformanceCounterResult, bool) {
- return nil, false
-}
-
-// AsEventsCustomMetricResult is the BasicEventsResultData implementation for EventsBrowserTimingResult.
-func (ebtr EventsBrowserTimingResult) AsEventsCustomMetricResult() (*EventsCustomMetricResult, bool) {
- return nil, false
-}
-
-// AsEventsResultData is the BasicEventsResultData implementation for EventsBrowserTimingResult.
-func (ebtr EventsBrowserTimingResult) AsEventsResultData() (*EventsResultData, bool) {
- return nil, false
-}
-
-// AsBasicEventsResultData is the BasicEventsResultData implementation for EventsBrowserTimingResult.
-func (ebtr EventsBrowserTimingResult) AsBasicEventsResultData() (BasicEventsResultData, bool) {
- return &ebtr, true
-}
-
-// EventsClientInfo client info for an event result
-type EventsClientInfo struct {
- // Model - Model of the client
- Model *string `json:"model,omitempty"`
- // Os - Operating system of the client
- Os *string `json:"os,omitempty"`
- // Type - Type of the client
- Type *string `json:"type,omitempty"`
- // Browser - Browser of the client
- Browser *string `json:"browser,omitempty"`
- // IP - IP address of the client
- IP *string `json:"ip,omitempty"`
- // City - City of the client
- City *string `json:"city,omitempty"`
- // StateOrProvince - State or province of the client
- StateOrProvince *string `json:"stateOrProvince,omitempty"`
- // CountryOrRegion - Country or region of the client
- CountryOrRegion *string `json:"countryOrRegion,omitempty"`
-}
-
-// EventsClientPerformanceInfo client performance information
-type EventsClientPerformanceInfo struct {
- // Name - The name of the client performance
- Name *string `json:"name,omitempty"`
-}
-
-// EventsCloudInfo cloud info for an event result
-type EventsCloudInfo struct {
- // RoleName - Role name of the cloud
- RoleName *string `json:"roleName,omitempty"`
- // RoleInstance - Role instance of the cloud
- RoleInstance *string `json:"roleInstance,omitempty"`
-}
-
-// EventsCustomEventInfo the custom event information
-type EventsCustomEventInfo struct {
- // Name - The name of the custom event
- Name *string `json:"name,omitempty"`
-}
-
-// EventsCustomEventResult a custom event result
-type EventsCustomEventResult struct {
- CustomEvent *EventsCustomEventInfo `json:"customEvent,omitempty"`
- // ID - The unique ID for this event.
- ID *string `json:"id,omitempty"`
- // Count - Count of the event
- Count *int64 `json:"count,omitempty"`
- // Timestamp - Timestamp of the event
- Timestamp *date.Time `json:"timestamp,omitempty"`
- // CustomDimensions - Custom dimensions of the event
- CustomDimensions *EventsResultDataCustomDimensions `json:"customDimensions,omitempty"`
- // CustomMeasurements - Custom measurements of the event
- CustomMeasurements *EventsResultDataCustomMeasurements `json:"customMeasurements,omitempty"`
- // Operation - Operation info of the event
- Operation *EventsOperationInfo `json:"operation,omitempty"`
- // Session - Session info of the event
- Session *EventsSessionInfo `json:"session,omitempty"`
- // User - User info of the event
- User *EventsUserInfo `json:"user,omitempty"`
- // Cloud - Cloud info of the event
- Cloud *EventsCloudInfo `json:"cloud,omitempty"`
- // Ai - AI info of the event
- Ai *EventsAiInfo `json:"ai,omitempty"`
- // Application - Application info of the event
- Application *EventsApplicationInfo `json:"application,omitempty"`
- // Client - Client info of the event
- Client *EventsClientInfo `json:"client,omitempty"`
- // Type - Possible values include: 'TypeEventsResultData', 'TypeTrace', 'TypeCustomEvent', 'TypePageView', 'TypeBrowserTiming', 'TypeRequest', 'TypeDependency', 'TypeException', 'TypeAvailabilityResult', 'TypePerformanceCounter', 'TypeCustomMetric'
- Type Type `json:"type,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for EventsCustomEventResult.
-func (ecer EventsCustomEventResult) MarshalJSON() ([]byte, error) {
- ecer.Type = TypeCustomEvent
- objectMap := make(map[string]interface{})
- if ecer.CustomEvent != nil {
- objectMap["customEvent"] = ecer.CustomEvent
- }
- if ecer.ID != nil {
- objectMap["id"] = ecer.ID
- }
- if ecer.Count != nil {
- objectMap["count"] = ecer.Count
- }
- if ecer.Timestamp != nil {
- objectMap["timestamp"] = ecer.Timestamp
- }
- if ecer.CustomDimensions != nil {
- objectMap["customDimensions"] = ecer.CustomDimensions
- }
- if ecer.CustomMeasurements != nil {
- objectMap["customMeasurements"] = ecer.CustomMeasurements
- }
- if ecer.Operation != nil {
- objectMap["operation"] = ecer.Operation
- }
- if ecer.Session != nil {
- objectMap["session"] = ecer.Session
- }
- if ecer.User != nil {
- objectMap["user"] = ecer.User
- }
- if ecer.Cloud != nil {
- objectMap["cloud"] = ecer.Cloud
- }
- if ecer.Ai != nil {
- objectMap["ai"] = ecer.Ai
- }
- if ecer.Application != nil {
- objectMap["application"] = ecer.Application
- }
- if ecer.Client != nil {
- objectMap["client"] = ecer.Client
- }
- if ecer.Type != "" {
- objectMap["type"] = ecer.Type
- }
- return json.Marshal(objectMap)
-}
-
-// AsEventsTraceResult is the BasicEventsResultData implementation for EventsCustomEventResult.
-func (ecer EventsCustomEventResult) AsEventsTraceResult() (*EventsTraceResult, bool) {
- return nil, false
-}
-
-// AsEventsCustomEventResult is the BasicEventsResultData implementation for EventsCustomEventResult.
-func (ecer EventsCustomEventResult) AsEventsCustomEventResult() (*EventsCustomEventResult, bool) {
- return &ecer, true
-}
-
-// AsEventsPageViewResult is the BasicEventsResultData implementation for EventsCustomEventResult.
-func (ecer EventsCustomEventResult) AsEventsPageViewResult() (*EventsPageViewResult, bool) {
- return nil, false
-}
-
-// AsEventsBrowserTimingResult is the BasicEventsResultData implementation for EventsCustomEventResult.
-func (ecer EventsCustomEventResult) AsEventsBrowserTimingResult() (*EventsBrowserTimingResult, bool) {
- return nil, false
-}
-
-// AsEventsRequestResult is the BasicEventsResultData implementation for EventsCustomEventResult.
-func (ecer EventsCustomEventResult) AsEventsRequestResult() (*EventsRequestResult, bool) {
- return nil, false
-}
-
-// AsEventsDependencyResult is the BasicEventsResultData implementation for EventsCustomEventResult.
-func (ecer EventsCustomEventResult) AsEventsDependencyResult() (*EventsDependencyResult, bool) {
- return nil, false
-}
-
-// AsEventsExceptionResult is the BasicEventsResultData implementation for EventsCustomEventResult.
-func (ecer EventsCustomEventResult) AsEventsExceptionResult() (*EventsExceptionResult, bool) {
- return nil, false
-}
-
-// AsEventsAvailabilityResultResult is the BasicEventsResultData implementation for EventsCustomEventResult.
-func (ecer EventsCustomEventResult) AsEventsAvailabilityResultResult() (*EventsAvailabilityResultResult, bool) {
- return nil, false
-}
-
-// AsEventsPerformanceCounterResult is the BasicEventsResultData implementation for EventsCustomEventResult.
-func (ecer EventsCustomEventResult) AsEventsPerformanceCounterResult() (*EventsPerformanceCounterResult, bool) {
- return nil, false
-}
-
-// AsEventsCustomMetricResult is the BasicEventsResultData implementation for EventsCustomEventResult.
-func (ecer EventsCustomEventResult) AsEventsCustomMetricResult() (*EventsCustomMetricResult, bool) {
- return nil, false
-}
-
-// AsEventsResultData is the BasicEventsResultData implementation for EventsCustomEventResult.
-func (ecer EventsCustomEventResult) AsEventsResultData() (*EventsResultData, bool) {
- return nil, false
-}
-
-// AsBasicEventsResultData is the BasicEventsResultData implementation for EventsCustomEventResult.
-func (ecer EventsCustomEventResult) AsBasicEventsResultData() (BasicEventsResultData, bool) {
- return &ecer, true
-}
-
-// EventsCustomMetricInfo the custom metric info
-type EventsCustomMetricInfo struct {
- // Name - The name of the custom metric
- Name *string `json:"name,omitempty"`
- // Value - The value of the custom metric
- Value *float64 `json:"value,omitempty"`
- // ValueSum - The sum of the custom metric
- ValueSum *float64 `json:"valueSum,omitempty"`
- // ValueCount - The count of the custom metric
- ValueCount *int32 `json:"valueCount,omitempty"`
- // ValueMin - The minimum value of the custom metric
- ValueMin *float64 `json:"valueMin,omitempty"`
- // ValueMax - The maximum value of the custom metric
- ValueMax *float64 `json:"valueMax,omitempty"`
- // ValueStdDev - The standard deviation of the custom metric
- ValueStdDev *float64 `json:"valueStdDev,omitempty"`
-}
-
-// EventsCustomMetricResult a custom metric result
-type EventsCustomMetricResult struct {
- CustomMetric *EventsCustomMetricInfo `json:"customMetric,omitempty"`
- // ID - The unique ID for this event.
- ID *string `json:"id,omitempty"`
- // Count - Count of the event
- Count *int64 `json:"count,omitempty"`
- // Timestamp - Timestamp of the event
- Timestamp *date.Time `json:"timestamp,omitempty"`
- // CustomDimensions - Custom dimensions of the event
- CustomDimensions *EventsResultDataCustomDimensions `json:"customDimensions,omitempty"`
- // CustomMeasurements - Custom measurements of the event
- CustomMeasurements *EventsResultDataCustomMeasurements `json:"customMeasurements,omitempty"`
- // Operation - Operation info of the event
- Operation *EventsOperationInfo `json:"operation,omitempty"`
- // Session - Session info of the event
- Session *EventsSessionInfo `json:"session,omitempty"`
- // User - User info of the event
- User *EventsUserInfo `json:"user,omitempty"`
- // Cloud - Cloud info of the event
- Cloud *EventsCloudInfo `json:"cloud,omitempty"`
- // Ai - AI info of the event
- Ai *EventsAiInfo `json:"ai,omitempty"`
- // Application - Application info of the event
- Application *EventsApplicationInfo `json:"application,omitempty"`
- // Client - Client info of the event
- Client *EventsClientInfo `json:"client,omitempty"`
- // Type - Possible values include: 'TypeEventsResultData', 'TypeTrace', 'TypeCustomEvent', 'TypePageView', 'TypeBrowserTiming', 'TypeRequest', 'TypeDependency', 'TypeException', 'TypeAvailabilityResult', 'TypePerformanceCounter', 'TypeCustomMetric'
- Type Type `json:"type,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for EventsCustomMetricResult.
-func (ecmr EventsCustomMetricResult) MarshalJSON() ([]byte, error) {
- ecmr.Type = TypeCustomMetric
- objectMap := make(map[string]interface{})
- if ecmr.CustomMetric != nil {
- objectMap["customMetric"] = ecmr.CustomMetric
- }
- if ecmr.ID != nil {
- objectMap["id"] = ecmr.ID
- }
- if ecmr.Count != nil {
- objectMap["count"] = ecmr.Count
- }
- if ecmr.Timestamp != nil {
- objectMap["timestamp"] = ecmr.Timestamp
- }
- if ecmr.CustomDimensions != nil {
- objectMap["customDimensions"] = ecmr.CustomDimensions
- }
- if ecmr.CustomMeasurements != nil {
- objectMap["customMeasurements"] = ecmr.CustomMeasurements
- }
- if ecmr.Operation != nil {
- objectMap["operation"] = ecmr.Operation
- }
- if ecmr.Session != nil {
- objectMap["session"] = ecmr.Session
- }
- if ecmr.User != nil {
- objectMap["user"] = ecmr.User
- }
- if ecmr.Cloud != nil {
- objectMap["cloud"] = ecmr.Cloud
- }
- if ecmr.Ai != nil {
- objectMap["ai"] = ecmr.Ai
- }
- if ecmr.Application != nil {
- objectMap["application"] = ecmr.Application
- }
- if ecmr.Client != nil {
- objectMap["client"] = ecmr.Client
- }
- if ecmr.Type != "" {
- objectMap["type"] = ecmr.Type
- }
- return json.Marshal(objectMap)
-}
-
-// AsEventsTraceResult is the BasicEventsResultData implementation for EventsCustomMetricResult.
-func (ecmr EventsCustomMetricResult) AsEventsTraceResult() (*EventsTraceResult, bool) {
- return nil, false
-}
-
-// AsEventsCustomEventResult is the BasicEventsResultData implementation for EventsCustomMetricResult.
-func (ecmr EventsCustomMetricResult) AsEventsCustomEventResult() (*EventsCustomEventResult, bool) {
- return nil, false
-}
-
-// AsEventsPageViewResult is the BasicEventsResultData implementation for EventsCustomMetricResult.
-func (ecmr EventsCustomMetricResult) AsEventsPageViewResult() (*EventsPageViewResult, bool) {
- return nil, false
-}
-
-// AsEventsBrowserTimingResult is the BasicEventsResultData implementation for EventsCustomMetricResult.
-func (ecmr EventsCustomMetricResult) AsEventsBrowserTimingResult() (*EventsBrowserTimingResult, bool) {
- return nil, false
-}
-
-// AsEventsRequestResult is the BasicEventsResultData implementation for EventsCustomMetricResult.
-func (ecmr EventsCustomMetricResult) AsEventsRequestResult() (*EventsRequestResult, bool) {
- return nil, false
-}
-
-// AsEventsDependencyResult is the BasicEventsResultData implementation for EventsCustomMetricResult.
-func (ecmr EventsCustomMetricResult) AsEventsDependencyResult() (*EventsDependencyResult, bool) {
- return nil, false
-}
-
-// AsEventsExceptionResult is the BasicEventsResultData implementation for EventsCustomMetricResult.
-func (ecmr EventsCustomMetricResult) AsEventsExceptionResult() (*EventsExceptionResult, bool) {
- return nil, false
-}
-
-// AsEventsAvailabilityResultResult is the BasicEventsResultData implementation for EventsCustomMetricResult.
-func (ecmr EventsCustomMetricResult) AsEventsAvailabilityResultResult() (*EventsAvailabilityResultResult, bool) {
- return nil, false
-}
-
-// AsEventsPerformanceCounterResult is the BasicEventsResultData implementation for EventsCustomMetricResult.
-func (ecmr EventsCustomMetricResult) AsEventsPerformanceCounterResult() (*EventsPerformanceCounterResult, bool) {
- return nil, false
-}
-
-// AsEventsCustomMetricResult is the BasicEventsResultData implementation for EventsCustomMetricResult.
-func (ecmr EventsCustomMetricResult) AsEventsCustomMetricResult() (*EventsCustomMetricResult, bool) {
- return &ecmr, true
-}
-
-// AsEventsResultData is the BasicEventsResultData implementation for EventsCustomMetricResult.
-func (ecmr EventsCustomMetricResult) AsEventsResultData() (*EventsResultData, bool) {
- return nil, false
-}
-
-// AsBasicEventsResultData is the BasicEventsResultData implementation for EventsCustomMetricResult.
-func (ecmr EventsCustomMetricResult) AsBasicEventsResultData() (BasicEventsResultData, bool) {
- return &ecmr, true
-}
-
-// EventsDependencyInfo the dependency info
-type EventsDependencyInfo struct {
- // Target - The target of the dependency
- Target *string `json:"target,omitempty"`
- // Data - The data of the dependency
- Data *string `json:"data,omitempty"`
- // Success - Indicates if the dependency was successful
- Success *string `json:"success,omitempty"`
- // Duration - The duration of the dependency
- Duration *int64 `json:"duration,omitempty"`
- // PerformanceBucket - The performance bucket of the dependency
- PerformanceBucket *string `json:"performanceBucket,omitempty"`
- // ResultCode - The result code of the dependency
- ResultCode *string `json:"resultCode,omitempty"`
- // Type - The type of the dependency
- Type *string `json:"type,omitempty"`
- // Name - The name of the dependency
- Name *string `json:"name,omitempty"`
- // ID - The ID of the dependency
- ID *string `json:"id,omitempty"`
-}
-
-// EventsDependencyResult a dependency result
-type EventsDependencyResult struct {
- Dependency *EventsDependencyInfo `json:"dependency,omitempty"`
- // ID - The unique ID for this event.
- ID *string `json:"id,omitempty"`
- // Count - Count of the event
- Count *int64 `json:"count,omitempty"`
- // Timestamp - Timestamp of the event
- Timestamp *date.Time `json:"timestamp,omitempty"`
- // CustomDimensions - Custom dimensions of the event
- CustomDimensions *EventsResultDataCustomDimensions `json:"customDimensions,omitempty"`
- // CustomMeasurements - Custom measurements of the event
- CustomMeasurements *EventsResultDataCustomMeasurements `json:"customMeasurements,omitempty"`
- // Operation - Operation info of the event
- Operation *EventsOperationInfo `json:"operation,omitempty"`
- // Session - Session info of the event
- Session *EventsSessionInfo `json:"session,omitempty"`
- // User - User info of the event
- User *EventsUserInfo `json:"user,omitempty"`
- // Cloud - Cloud info of the event
- Cloud *EventsCloudInfo `json:"cloud,omitempty"`
- // Ai - AI info of the event
- Ai *EventsAiInfo `json:"ai,omitempty"`
- // Application - Application info of the event
- Application *EventsApplicationInfo `json:"application,omitempty"`
- // Client - Client info of the event
- Client *EventsClientInfo `json:"client,omitempty"`
- // Type - Possible values include: 'TypeEventsResultData', 'TypeTrace', 'TypeCustomEvent', 'TypePageView', 'TypeBrowserTiming', 'TypeRequest', 'TypeDependency', 'TypeException', 'TypeAvailabilityResult', 'TypePerformanceCounter', 'TypeCustomMetric'
- Type Type `json:"type,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for EventsDependencyResult.
-func (edr EventsDependencyResult) MarshalJSON() ([]byte, error) {
- edr.Type = TypeDependency
- objectMap := make(map[string]interface{})
- if edr.Dependency != nil {
- objectMap["dependency"] = edr.Dependency
- }
- if edr.ID != nil {
- objectMap["id"] = edr.ID
- }
- if edr.Count != nil {
- objectMap["count"] = edr.Count
- }
- if edr.Timestamp != nil {
- objectMap["timestamp"] = edr.Timestamp
- }
- if edr.CustomDimensions != nil {
- objectMap["customDimensions"] = edr.CustomDimensions
- }
- if edr.CustomMeasurements != nil {
- objectMap["customMeasurements"] = edr.CustomMeasurements
- }
- if edr.Operation != nil {
- objectMap["operation"] = edr.Operation
- }
- if edr.Session != nil {
- objectMap["session"] = edr.Session
- }
- if edr.User != nil {
- objectMap["user"] = edr.User
- }
- if edr.Cloud != nil {
- objectMap["cloud"] = edr.Cloud
- }
- if edr.Ai != nil {
- objectMap["ai"] = edr.Ai
- }
- if edr.Application != nil {
- objectMap["application"] = edr.Application
- }
- if edr.Client != nil {
- objectMap["client"] = edr.Client
- }
- if edr.Type != "" {
- objectMap["type"] = edr.Type
- }
- return json.Marshal(objectMap)
-}
-
-// AsEventsTraceResult is the BasicEventsResultData implementation for EventsDependencyResult.
-func (edr EventsDependencyResult) AsEventsTraceResult() (*EventsTraceResult, bool) {
- return nil, false
-}
-
-// AsEventsCustomEventResult is the BasicEventsResultData implementation for EventsDependencyResult.
-func (edr EventsDependencyResult) AsEventsCustomEventResult() (*EventsCustomEventResult, bool) {
- return nil, false
-}
-
-// AsEventsPageViewResult is the BasicEventsResultData implementation for EventsDependencyResult.
-func (edr EventsDependencyResult) AsEventsPageViewResult() (*EventsPageViewResult, bool) {
- return nil, false
-}
-
-// AsEventsBrowserTimingResult is the BasicEventsResultData implementation for EventsDependencyResult.
-func (edr EventsDependencyResult) AsEventsBrowserTimingResult() (*EventsBrowserTimingResult, bool) {
- return nil, false
-}
-
-// AsEventsRequestResult is the BasicEventsResultData implementation for EventsDependencyResult.
-func (edr EventsDependencyResult) AsEventsRequestResult() (*EventsRequestResult, bool) {
- return nil, false
-}
-
-// AsEventsDependencyResult is the BasicEventsResultData implementation for EventsDependencyResult.
-func (edr EventsDependencyResult) AsEventsDependencyResult() (*EventsDependencyResult, bool) {
- return &edr, true
-}
-
-// AsEventsExceptionResult is the BasicEventsResultData implementation for EventsDependencyResult.
-func (edr EventsDependencyResult) AsEventsExceptionResult() (*EventsExceptionResult, bool) {
- return nil, false
-}
-
-// AsEventsAvailabilityResultResult is the BasicEventsResultData implementation for EventsDependencyResult.
-func (edr EventsDependencyResult) AsEventsAvailabilityResultResult() (*EventsAvailabilityResultResult, bool) {
- return nil, false
-}
-
-// AsEventsPerformanceCounterResult is the BasicEventsResultData implementation for EventsDependencyResult.
-func (edr EventsDependencyResult) AsEventsPerformanceCounterResult() (*EventsPerformanceCounterResult, bool) {
- return nil, false
-}
-
-// AsEventsCustomMetricResult is the BasicEventsResultData implementation for EventsDependencyResult.
-func (edr EventsDependencyResult) AsEventsCustomMetricResult() (*EventsCustomMetricResult, bool) {
- return nil, false
-}
-
-// AsEventsResultData is the BasicEventsResultData implementation for EventsDependencyResult.
-func (edr EventsDependencyResult) AsEventsResultData() (*EventsResultData, bool) {
- return nil, false
-}
-
-// AsBasicEventsResultData is the BasicEventsResultData implementation for EventsDependencyResult.
-func (edr EventsDependencyResult) AsBasicEventsResultData() (BasicEventsResultData, bool) {
- return &edr, true
-}
-
-// EventsExceptionDetail exception details
-type EventsExceptionDetail struct {
- // SeverityLevel - The severity level of the exception detail
- SeverityLevel *string `json:"severityLevel,omitempty"`
- // OuterID - The outer ID of the exception detail
- OuterID *string `json:"outerId,omitempty"`
- // Message - The message of the exception detail
- Message *string `json:"message,omitempty"`
- // Type - The type of the exception detail
- Type *string `json:"type,omitempty"`
- // ID - The ID of the exception detail
- ID *string `json:"id,omitempty"`
- // ParsedStack - The parsed stack
- ParsedStack *[]EventsExceptionDetailsParsedStack `json:"parsedStack,omitempty"`
-}
-
-// EventsExceptionDetailsParsedStack a parsed stack entry
-type EventsExceptionDetailsParsedStack struct {
- // Assembly - The assembly of the stack entry
- Assembly *string `json:"assembly,omitempty"`
- // Method - The method of the stack entry
- Method *string `json:"method,omitempty"`
- // Level - The level of the stack entry
- Level *int64 `json:"level,omitempty"`
- // Line - The line of the stack entry
- Line *int64 `json:"line,omitempty"`
-}
-
-// EventsExceptionInfo the exception info
-type EventsExceptionInfo struct {
- // SeverityLevel - The severity level of the exception
- SeverityLevel *int32 `json:"severityLevel,omitempty"`
- // ProblemID - The problem ID of the exception
- ProblemID *string `json:"problemId,omitempty"`
- // HandledAt - Indicates where the exception was handled at
- HandledAt *string `json:"handledAt,omitempty"`
- // Assembly - The assembly which threw the exception
- Assembly *string `json:"assembly,omitempty"`
- // Method - The method that threw the exception
- Method *string `json:"method,omitempty"`
- // Message - The message of the exception
- Message *string `json:"message,omitempty"`
- // Type - The type of the exception
- Type *string `json:"type,omitempty"`
- // OuterType - The outer type of the exception
- OuterType *string `json:"outerType,omitempty"`
- // OuterMethod - The outer method of the exception
- OuterMethod *string `json:"outerMethod,omitempty"`
- // OuterAssembly - The outer assmebly of the exception
- OuterAssembly *string `json:"outerAssembly,omitempty"`
- // OuterMessage - The outer message of the exception
- OuterMessage *string `json:"outerMessage,omitempty"`
- // InnermostType - The inner most type of the exception
- InnermostType *string `json:"innermostType,omitempty"`
- // InnermostMessage - The inner most message of the exception
- InnermostMessage *string `json:"innermostMessage,omitempty"`
- // InnermostMethod - The inner most method of the exception
- InnermostMethod *string `json:"innermostMethod,omitempty"`
- // InnermostAssembly - The inner most assembly of the exception
- InnermostAssembly *string `json:"innermostAssembly,omitempty"`
- // Details - The details of the exception
- Details *[]EventsExceptionDetail `json:"details,omitempty"`
-}
-
-// EventsExceptionResult an exception result
-type EventsExceptionResult struct {
- Exception *EventsExceptionInfo `json:"exception,omitempty"`
- // ID - The unique ID for this event.
- ID *string `json:"id,omitempty"`
- // Count - Count of the event
- Count *int64 `json:"count,omitempty"`
- // Timestamp - Timestamp of the event
- Timestamp *date.Time `json:"timestamp,omitempty"`
- // CustomDimensions - Custom dimensions of the event
- CustomDimensions *EventsResultDataCustomDimensions `json:"customDimensions,omitempty"`
- // CustomMeasurements - Custom measurements of the event
- CustomMeasurements *EventsResultDataCustomMeasurements `json:"customMeasurements,omitempty"`
- // Operation - Operation info of the event
- Operation *EventsOperationInfo `json:"operation,omitempty"`
- // Session - Session info of the event
- Session *EventsSessionInfo `json:"session,omitempty"`
- // User - User info of the event
- User *EventsUserInfo `json:"user,omitempty"`
- // Cloud - Cloud info of the event
- Cloud *EventsCloudInfo `json:"cloud,omitempty"`
- // Ai - AI info of the event
- Ai *EventsAiInfo `json:"ai,omitempty"`
- // Application - Application info of the event
- Application *EventsApplicationInfo `json:"application,omitempty"`
- // Client - Client info of the event
- Client *EventsClientInfo `json:"client,omitempty"`
- // Type - Possible values include: 'TypeEventsResultData', 'TypeTrace', 'TypeCustomEvent', 'TypePageView', 'TypeBrowserTiming', 'TypeRequest', 'TypeDependency', 'TypeException', 'TypeAvailabilityResult', 'TypePerformanceCounter', 'TypeCustomMetric'
- Type Type `json:"type,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for EventsExceptionResult.
-func (eer EventsExceptionResult) MarshalJSON() ([]byte, error) {
- eer.Type = TypeException
- objectMap := make(map[string]interface{})
- if eer.Exception != nil {
- objectMap["exception"] = eer.Exception
- }
- if eer.ID != nil {
- objectMap["id"] = eer.ID
- }
- if eer.Count != nil {
- objectMap["count"] = eer.Count
- }
- if eer.Timestamp != nil {
- objectMap["timestamp"] = eer.Timestamp
- }
- if eer.CustomDimensions != nil {
- objectMap["customDimensions"] = eer.CustomDimensions
- }
- if eer.CustomMeasurements != nil {
- objectMap["customMeasurements"] = eer.CustomMeasurements
- }
- if eer.Operation != nil {
- objectMap["operation"] = eer.Operation
- }
- if eer.Session != nil {
- objectMap["session"] = eer.Session
- }
- if eer.User != nil {
- objectMap["user"] = eer.User
- }
- if eer.Cloud != nil {
- objectMap["cloud"] = eer.Cloud
- }
- if eer.Ai != nil {
- objectMap["ai"] = eer.Ai
- }
- if eer.Application != nil {
- objectMap["application"] = eer.Application
- }
- if eer.Client != nil {
- objectMap["client"] = eer.Client
- }
- if eer.Type != "" {
- objectMap["type"] = eer.Type
- }
- return json.Marshal(objectMap)
-}
-
-// AsEventsTraceResult is the BasicEventsResultData implementation for EventsExceptionResult.
-func (eer EventsExceptionResult) AsEventsTraceResult() (*EventsTraceResult, bool) {
- return nil, false
-}
-
-// AsEventsCustomEventResult is the BasicEventsResultData implementation for EventsExceptionResult.
-func (eer EventsExceptionResult) AsEventsCustomEventResult() (*EventsCustomEventResult, bool) {
- return nil, false
-}
-
-// AsEventsPageViewResult is the BasicEventsResultData implementation for EventsExceptionResult.
-func (eer EventsExceptionResult) AsEventsPageViewResult() (*EventsPageViewResult, bool) {
- return nil, false
-}
-
-// AsEventsBrowserTimingResult is the BasicEventsResultData implementation for EventsExceptionResult.
-func (eer EventsExceptionResult) AsEventsBrowserTimingResult() (*EventsBrowserTimingResult, bool) {
- return nil, false
-}
-
-// AsEventsRequestResult is the BasicEventsResultData implementation for EventsExceptionResult.
-func (eer EventsExceptionResult) AsEventsRequestResult() (*EventsRequestResult, bool) {
- return nil, false
-}
-
-// AsEventsDependencyResult is the BasicEventsResultData implementation for EventsExceptionResult.
-func (eer EventsExceptionResult) AsEventsDependencyResult() (*EventsDependencyResult, bool) {
- return nil, false
-}
-
-// AsEventsExceptionResult is the BasicEventsResultData implementation for EventsExceptionResult.
-func (eer EventsExceptionResult) AsEventsExceptionResult() (*EventsExceptionResult, bool) {
- return &eer, true
-}
-
-// AsEventsAvailabilityResultResult is the BasicEventsResultData implementation for EventsExceptionResult.
-func (eer EventsExceptionResult) AsEventsAvailabilityResultResult() (*EventsAvailabilityResultResult, bool) {
- return nil, false
-}
-
-// AsEventsPerformanceCounterResult is the BasicEventsResultData implementation for EventsExceptionResult.
-func (eer EventsExceptionResult) AsEventsPerformanceCounterResult() (*EventsPerformanceCounterResult, bool) {
- return nil, false
-}
-
-// AsEventsCustomMetricResult is the BasicEventsResultData implementation for EventsExceptionResult.
-func (eer EventsExceptionResult) AsEventsCustomMetricResult() (*EventsCustomMetricResult, bool) {
- return nil, false
-}
-
-// AsEventsResultData is the BasicEventsResultData implementation for EventsExceptionResult.
-func (eer EventsExceptionResult) AsEventsResultData() (*EventsResultData, bool) {
- return nil, false
-}
-
-// AsBasicEventsResultData is the BasicEventsResultData implementation for EventsExceptionResult.
-func (eer EventsExceptionResult) AsBasicEventsResultData() (BasicEventsResultData, bool) {
- return &eer, true
-}
-
-// EventsOperationInfo operation info for an event result
-type EventsOperationInfo struct {
- // Name - Name of the operation
- Name *string `json:"name,omitempty"`
- // ID - ID of the operation
- ID *string `json:"id,omitempty"`
- // ParentID - Parent ID of the operation
- ParentID *string `json:"parentId,omitempty"`
- // SyntheticSource - Synthetic source of the operation
- SyntheticSource *string `json:"syntheticSource,omitempty"`
-}
-
-// EventsPageViewInfo the page view information
-type EventsPageViewInfo struct {
- // Name - The name of the page
- Name *string `json:"name,omitempty"`
- // URL - The URL of the page
- URL *string `json:"url,omitempty"`
- // Duration - The duration of the page view
- Duration *string `json:"duration,omitempty"`
- // PerformanceBucket - The performance bucket of the page view
- PerformanceBucket *string `json:"performanceBucket,omitempty"`
-}
-
-// EventsPageViewResult a page view result
-type EventsPageViewResult struct {
- PageView *EventsPageViewInfo `json:"pageView,omitempty"`
- // ID - The unique ID for this event.
- ID *string `json:"id,omitempty"`
- // Count - Count of the event
- Count *int64 `json:"count,omitempty"`
- // Timestamp - Timestamp of the event
- Timestamp *date.Time `json:"timestamp,omitempty"`
- // CustomDimensions - Custom dimensions of the event
- CustomDimensions *EventsResultDataCustomDimensions `json:"customDimensions,omitempty"`
- // CustomMeasurements - Custom measurements of the event
- CustomMeasurements *EventsResultDataCustomMeasurements `json:"customMeasurements,omitempty"`
- // Operation - Operation info of the event
- Operation *EventsOperationInfo `json:"operation,omitempty"`
- // Session - Session info of the event
- Session *EventsSessionInfo `json:"session,omitempty"`
- // User - User info of the event
- User *EventsUserInfo `json:"user,omitempty"`
- // Cloud - Cloud info of the event
- Cloud *EventsCloudInfo `json:"cloud,omitempty"`
- // Ai - AI info of the event
- Ai *EventsAiInfo `json:"ai,omitempty"`
- // Application - Application info of the event
- Application *EventsApplicationInfo `json:"application,omitempty"`
- // Client - Client info of the event
- Client *EventsClientInfo `json:"client,omitempty"`
- // Type - Possible values include: 'TypeEventsResultData', 'TypeTrace', 'TypeCustomEvent', 'TypePageView', 'TypeBrowserTiming', 'TypeRequest', 'TypeDependency', 'TypeException', 'TypeAvailabilityResult', 'TypePerformanceCounter', 'TypeCustomMetric'
- Type Type `json:"type,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for EventsPageViewResult.
-func (epvr EventsPageViewResult) MarshalJSON() ([]byte, error) {
- epvr.Type = TypePageView
- objectMap := make(map[string]interface{})
- if epvr.PageView != nil {
- objectMap["pageView"] = epvr.PageView
- }
- if epvr.ID != nil {
- objectMap["id"] = epvr.ID
- }
- if epvr.Count != nil {
- objectMap["count"] = epvr.Count
- }
- if epvr.Timestamp != nil {
- objectMap["timestamp"] = epvr.Timestamp
- }
- if epvr.CustomDimensions != nil {
- objectMap["customDimensions"] = epvr.CustomDimensions
- }
- if epvr.CustomMeasurements != nil {
- objectMap["customMeasurements"] = epvr.CustomMeasurements
- }
- if epvr.Operation != nil {
- objectMap["operation"] = epvr.Operation
- }
- if epvr.Session != nil {
- objectMap["session"] = epvr.Session
- }
- if epvr.User != nil {
- objectMap["user"] = epvr.User
- }
- if epvr.Cloud != nil {
- objectMap["cloud"] = epvr.Cloud
- }
- if epvr.Ai != nil {
- objectMap["ai"] = epvr.Ai
- }
- if epvr.Application != nil {
- objectMap["application"] = epvr.Application
- }
- if epvr.Client != nil {
- objectMap["client"] = epvr.Client
- }
- if epvr.Type != "" {
- objectMap["type"] = epvr.Type
- }
- return json.Marshal(objectMap)
-}
-
-// AsEventsTraceResult is the BasicEventsResultData implementation for EventsPageViewResult.
-func (epvr EventsPageViewResult) AsEventsTraceResult() (*EventsTraceResult, bool) {
- return nil, false
-}
-
-// AsEventsCustomEventResult is the BasicEventsResultData implementation for EventsPageViewResult.
-func (epvr EventsPageViewResult) AsEventsCustomEventResult() (*EventsCustomEventResult, bool) {
- return nil, false
-}
-
-// AsEventsPageViewResult is the BasicEventsResultData implementation for EventsPageViewResult.
-func (epvr EventsPageViewResult) AsEventsPageViewResult() (*EventsPageViewResult, bool) {
- return &epvr, true
-}
-
-// AsEventsBrowserTimingResult is the BasicEventsResultData implementation for EventsPageViewResult.
-func (epvr EventsPageViewResult) AsEventsBrowserTimingResult() (*EventsBrowserTimingResult, bool) {
- return nil, false
-}
-
-// AsEventsRequestResult is the BasicEventsResultData implementation for EventsPageViewResult.
-func (epvr EventsPageViewResult) AsEventsRequestResult() (*EventsRequestResult, bool) {
- return nil, false
-}
-
-// AsEventsDependencyResult is the BasicEventsResultData implementation for EventsPageViewResult.
-func (epvr EventsPageViewResult) AsEventsDependencyResult() (*EventsDependencyResult, bool) {
- return nil, false
-}
-
-// AsEventsExceptionResult is the BasicEventsResultData implementation for EventsPageViewResult.
-func (epvr EventsPageViewResult) AsEventsExceptionResult() (*EventsExceptionResult, bool) {
- return nil, false
-}
-
-// AsEventsAvailabilityResultResult is the BasicEventsResultData implementation for EventsPageViewResult.
-func (epvr EventsPageViewResult) AsEventsAvailabilityResultResult() (*EventsAvailabilityResultResult, bool) {
- return nil, false
-}
-
-// AsEventsPerformanceCounterResult is the BasicEventsResultData implementation for EventsPageViewResult.
-func (epvr EventsPageViewResult) AsEventsPerformanceCounterResult() (*EventsPerformanceCounterResult, bool) {
- return nil, false
-}
-
-// AsEventsCustomMetricResult is the BasicEventsResultData implementation for EventsPageViewResult.
-func (epvr EventsPageViewResult) AsEventsCustomMetricResult() (*EventsCustomMetricResult, bool) {
- return nil, false
-}
-
-// AsEventsResultData is the BasicEventsResultData implementation for EventsPageViewResult.
-func (epvr EventsPageViewResult) AsEventsResultData() (*EventsResultData, bool) {
- return nil, false
-}
-
-// AsBasicEventsResultData is the BasicEventsResultData implementation for EventsPageViewResult.
-func (epvr EventsPageViewResult) AsBasicEventsResultData() (BasicEventsResultData, bool) {
- return &epvr, true
-}
-
-// EventsPerformanceCounterInfo the performance counter info
-type EventsPerformanceCounterInfo struct {
- // Value - The value of the performance counter
- Value *float64 `json:"value,omitempty"`
- // Name - The name of the performance counter
- Name *string `json:"name,omitempty"`
- // Category - The category of the performance counter
- Category *string `json:"category,omitempty"`
- // Counter - The counter of the performance counter
- Counter *string `json:"counter,omitempty"`
- // InstanceName - The instance name of the performance counter
- InstanceName *string `json:"instanceName,omitempty"`
- // Instance - The instance of the performance counter
- Instance *string `json:"instance,omitempty"`
-}
-
-// EventsPerformanceCounterResult a performance counter result
-type EventsPerformanceCounterResult struct {
- PerformanceCounter *EventsPerformanceCounterInfo `json:"performanceCounter,omitempty"`
- // ID - The unique ID for this event.
- ID *string `json:"id,omitempty"`
- // Count - Count of the event
- Count *int64 `json:"count,omitempty"`
- // Timestamp - Timestamp of the event
- Timestamp *date.Time `json:"timestamp,omitempty"`
- // CustomDimensions - Custom dimensions of the event
- CustomDimensions *EventsResultDataCustomDimensions `json:"customDimensions,omitempty"`
- // CustomMeasurements - Custom measurements of the event
- CustomMeasurements *EventsResultDataCustomMeasurements `json:"customMeasurements,omitempty"`
- // Operation - Operation info of the event
- Operation *EventsOperationInfo `json:"operation,omitempty"`
- // Session - Session info of the event
- Session *EventsSessionInfo `json:"session,omitempty"`
- // User - User info of the event
- User *EventsUserInfo `json:"user,omitempty"`
- // Cloud - Cloud info of the event
- Cloud *EventsCloudInfo `json:"cloud,omitempty"`
- // Ai - AI info of the event
- Ai *EventsAiInfo `json:"ai,omitempty"`
- // Application - Application info of the event
- Application *EventsApplicationInfo `json:"application,omitempty"`
- // Client - Client info of the event
- Client *EventsClientInfo `json:"client,omitempty"`
- // Type - Possible values include: 'TypeEventsResultData', 'TypeTrace', 'TypeCustomEvent', 'TypePageView', 'TypeBrowserTiming', 'TypeRequest', 'TypeDependency', 'TypeException', 'TypeAvailabilityResult', 'TypePerformanceCounter', 'TypeCustomMetric'
- Type Type `json:"type,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for EventsPerformanceCounterResult.
-func (epcr EventsPerformanceCounterResult) MarshalJSON() ([]byte, error) {
- epcr.Type = TypePerformanceCounter
- objectMap := make(map[string]interface{})
- if epcr.PerformanceCounter != nil {
- objectMap["performanceCounter"] = epcr.PerformanceCounter
- }
- if epcr.ID != nil {
- objectMap["id"] = epcr.ID
- }
- if epcr.Count != nil {
- objectMap["count"] = epcr.Count
- }
- if epcr.Timestamp != nil {
- objectMap["timestamp"] = epcr.Timestamp
- }
- if epcr.CustomDimensions != nil {
- objectMap["customDimensions"] = epcr.CustomDimensions
- }
- if epcr.CustomMeasurements != nil {
- objectMap["customMeasurements"] = epcr.CustomMeasurements
- }
- if epcr.Operation != nil {
- objectMap["operation"] = epcr.Operation
- }
- if epcr.Session != nil {
- objectMap["session"] = epcr.Session
- }
- if epcr.User != nil {
- objectMap["user"] = epcr.User
- }
- if epcr.Cloud != nil {
- objectMap["cloud"] = epcr.Cloud
- }
- if epcr.Ai != nil {
- objectMap["ai"] = epcr.Ai
- }
- if epcr.Application != nil {
- objectMap["application"] = epcr.Application
- }
- if epcr.Client != nil {
- objectMap["client"] = epcr.Client
- }
- if epcr.Type != "" {
- objectMap["type"] = epcr.Type
- }
- return json.Marshal(objectMap)
-}
-
-// AsEventsTraceResult is the BasicEventsResultData implementation for EventsPerformanceCounterResult.
-func (epcr EventsPerformanceCounterResult) AsEventsTraceResult() (*EventsTraceResult, bool) {
- return nil, false
-}
-
-// AsEventsCustomEventResult is the BasicEventsResultData implementation for EventsPerformanceCounterResult.
-func (epcr EventsPerformanceCounterResult) AsEventsCustomEventResult() (*EventsCustomEventResult, bool) {
- return nil, false
-}
-
-// AsEventsPageViewResult is the BasicEventsResultData implementation for EventsPerformanceCounterResult.
-func (epcr EventsPerformanceCounterResult) AsEventsPageViewResult() (*EventsPageViewResult, bool) {
- return nil, false
-}
-
-// AsEventsBrowserTimingResult is the BasicEventsResultData implementation for EventsPerformanceCounterResult.
-func (epcr EventsPerformanceCounterResult) AsEventsBrowserTimingResult() (*EventsBrowserTimingResult, bool) {
- return nil, false
-}
-
-// AsEventsRequestResult is the BasicEventsResultData implementation for EventsPerformanceCounterResult.
-func (epcr EventsPerformanceCounterResult) AsEventsRequestResult() (*EventsRequestResult, bool) {
- return nil, false
-}
-
-// AsEventsDependencyResult is the BasicEventsResultData implementation for EventsPerformanceCounterResult.
-func (epcr EventsPerformanceCounterResult) AsEventsDependencyResult() (*EventsDependencyResult, bool) {
- return nil, false
-}
-
-// AsEventsExceptionResult is the BasicEventsResultData implementation for EventsPerformanceCounterResult.
-func (epcr EventsPerformanceCounterResult) AsEventsExceptionResult() (*EventsExceptionResult, bool) {
- return nil, false
-}
-
-// AsEventsAvailabilityResultResult is the BasicEventsResultData implementation for EventsPerformanceCounterResult.
-func (epcr EventsPerformanceCounterResult) AsEventsAvailabilityResultResult() (*EventsAvailabilityResultResult, bool) {
- return nil, false
-}
-
-// AsEventsPerformanceCounterResult is the BasicEventsResultData implementation for EventsPerformanceCounterResult.
-func (epcr EventsPerformanceCounterResult) AsEventsPerformanceCounterResult() (*EventsPerformanceCounterResult, bool) {
- return &epcr, true
-}
-
-// AsEventsCustomMetricResult is the BasicEventsResultData implementation for EventsPerformanceCounterResult.
-func (epcr EventsPerformanceCounterResult) AsEventsCustomMetricResult() (*EventsCustomMetricResult, bool) {
- return nil, false
-}
-
-// AsEventsResultData is the BasicEventsResultData implementation for EventsPerformanceCounterResult.
-func (epcr EventsPerformanceCounterResult) AsEventsResultData() (*EventsResultData, bool) {
- return nil, false
-}
-
-// AsBasicEventsResultData is the BasicEventsResultData implementation for EventsPerformanceCounterResult.
-func (epcr EventsPerformanceCounterResult) AsBasicEventsResultData() (BasicEventsResultData, bool) {
- return &epcr, true
-}
-
-// EventsRequestInfo the request info
-type EventsRequestInfo struct {
- // Name - The name of the request
- Name *string `json:"name,omitempty"`
- // URL - The URL of the request
- URL *string `json:"url,omitempty"`
- // Success - Indicates if the request was successful
- Success *string `json:"success,omitempty"`
- // Duration - The duration of the request
- Duration *float64 `json:"duration,omitempty"`
- // PerformanceBucket - The performance bucket of the request
- PerformanceBucket *string `json:"performanceBucket,omitempty"`
- // ResultCode - The result code of the request
- ResultCode *string `json:"resultCode,omitempty"`
- // Source - The source of the request
- Source *string `json:"source,omitempty"`
- // ID - The ID of the request
- ID *string `json:"id,omitempty"`
-}
-
-// EventsRequestResult a request result
-type EventsRequestResult struct {
- Request *EventsRequestInfo `json:"request,omitempty"`
- // ID - The unique ID for this event.
- ID *string `json:"id,omitempty"`
- // Count - Count of the event
- Count *int64 `json:"count,omitempty"`
- // Timestamp - Timestamp of the event
- Timestamp *date.Time `json:"timestamp,omitempty"`
- // CustomDimensions - Custom dimensions of the event
- CustomDimensions *EventsResultDataCustomDimensions `json:"customDimensions,omitempty"`
- // CustomMeasurements - Custom measurements of the event
- CustomMeasurements *EventsResultDataCustomMeasurements `json:"customMeasurements,omitempty"`
- // Operation - Operation info of the event
- Operation *EventsOperationInfo `json:"operation,omitempty"`
- // Session - Session info of the event
- Session *EventsSessionInfo `json:"session,omitempty"`
- // User - User info of the event
- User *EventsUserInfo `json:"user,omitempty"`
- // Cloud - Cloud info of the event
- Cloud *EventsCloudInfo `json:"cloud,omitempty"`
- // Ai - AI info of the event
- Ai *EventsAiInfo `json:"ai,omitempty"`
- // Application - Application info of the event
- Application *EventsApplicationInfo `json:"application,omitempty"`
- // Client - Client info of the event
- Client *EventsClientInfo `json:"client,omitempty"`
- // Type - Possible values include: 'TypeEventsResultData', 'TypeTrace', 'TypeCustomEvent', 'TypePageView', 'TypeBrowserTiming', 'TypeRequest', 'TypeDependency', 'TypeException', 'TypeAvailabilityResult', 'TypePerformanceCounter', 'TypeCustomMetric'
- Type Type `json:"type,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for EventsRequestResult.
-func (errVar EventsRequestResult) MarshalJSON() ([]byte, error) {
- errVar.Type = TypeRequest
- objectMap := make(map[string]interface{})
- if errVar.Request != nil {
- objectMap["request"] = errVar.Request
- }
- if errVar.ID != nil {
- objectMap["id"] = errVar.ID
- }
- if errVar.Count != nil {
- objectMap["count"] = errVar.Count
- }
- if errVar.Timestamp != nil {
- objectMap["timestamp"] = errVar.Timestamp
- }
- if errVar.CustomDimensions != nil {
- objectMap["customDimensions"] = errVar.CustomDimensions
- }
- if errVar.CustomMeasurements != nil {
- objectMap["customMeasurements"] = errVar.CustomMeasurements
- }
- if errVar.Operation != nil {
- objectMap["operation"] = errVar.Operation
- }
- if errVar.Session != nil {
- objectMap["session"] = errVar.Session
- }
- if errVar.User != nil {
- objectMap["user"] = errVar.User
- }
- if errVar.Cloud != nil {
- objectMap["cloud"] = errVar.Cloud
- }
- if errVar.Ai != nil {
- objectMap["ai"] = errVar.Ai
- }
- if errVar.Application != nil {
- objectMap["application"] = errVar.Application
- }
- if errVar.Client != nil {
- objectMap["client"] = errVar.Client
- }
- if errVar.Type != "" {
- objectMap["type"] = errVar.Type
- }
- return json.Marshal(objectMap)
-}
-
-// AsEventsTraceResult is the BasicEventsResultData implementation for EventsRequestResult.
-func (errVar EventsRequestResult) AsEventsTraceResult() (*EventsTraceResult, bool) {
- return nil, false
-}
-
-// AsEventsCustomEventResult is the BasicEventsResultData implementation for EventsRequestResult.
-func (errVar EventsRequestResult) AsEventsCustomEventResult() (*EventsCustomEventResult, bool) {
- return nil, false
-}
-
-// AsEventsPageViewResult is the BasicEventsResultData implementation for EventsRequestResult.
-func (errVar EventsRequestResult) AsEventsPageViewResult() (*EventsPageViewResult, bool) {
- return nil, false
-}
-
-// AsEventsBrowserTimingResult is the BasicEventsResultData implementation for EventsRequestResult.
-func (errVar EventsRequestResult) AsEventsBrowserTimingResult() (*EventsBrowserTimingResult, bool) {
- return nil, false
-}
-
-// AsEventsRequestResult is the BasicEventsResultData implementation for EventsRequestResult.
-func (errVar EventsRequestResult) AsEventsRequestResult() (*EventsRequestResult, bool) {
- return &errVar, true
-}
-
-// AsEventsDependencyResult is the BasicEventsResultData implementation for EventsRequestResult.
-func (errVar EventsRequestResult) AsEventsDependencyResult() (*EventsDependencyResult, bool) {
- return nil, false
-}
-
-// AsEventsExceptionResult is the BasicEventsResultData implementation for EventsRequestResult.
-func (errVar EventsRequestResult) AsEventsExceptionResult() (*EventsExceptionResult, bool) {
- return nil, false
-}
-
-// AsEventsAvailabilityResultResult is the BasicEventsResultData implementation for EventsRequestResult.
-func (errVar EventsRequestResult) AsEventsAvailabilityResultResult() (*EventsAvailabilityResultResult, bool) {
- return nil, false
-}
-
-// AsEventsPerformanceCounterResult is the BasicEventsResultData implementation for EventsRequestResult.
-func (errVar EventsRequestResult) AsEventsPerformanceCounterResult() (*EventsPerformanceCounterResult, bool) {
- return nil, false
-}
-
-// AsEventsCustomMetricResult is the BasicEventsResultData implementation for EventsRequestResult.
-func (errVar EventsRequestResult) AsEventsCustomMetricResult() (*EventsCustomMetricResult, bool) {
- return nil, false
-}
-
-// AsEventsResultData is the BasicEventsResultData implementation for EventsRequestResult.
-func (errVar EventsRequestResult) AsEventsResultData() (*EventsResultData, bool) {
- return nil, false
-}
-
-// AsBasicEventsResultData is the BasicEventsResultData implementation for EventsRequestResult.
-func (errVar EventsRequestResult) AsBasicEventsResultData() (BasicEventsResultData, bool) {
- return &errVar, true
-}
-
-// EventsResult an event query result.
-type EventsResult struct {
- // AiMessages - OData messages for this response.
- AiMessages *[]ErrorInfo `json:"@ai.messages,omitempty"`
- Value BasicEventsResultData `json:"value,omitempty"`
-}
-
-// UnmarshalJSON is the custom unmarshaler for EventsResult struct.
-func (er *EventsResult) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "@ai.messages":
- if v != nil {
- var aiMessages []ErrorInfo
- err = json.Unmarshal(*v, &aiMessages)
- if err != nil {
- return err
- }
- er.AiMessages = &aiMessages
- }
- case "value":
- if v != nil {
- value, err := unmarshalBasicEventsResultData(*v)
- if err != nil {
- return err
- }
- er.Value = value
- }
- }
- }
-
- return nil
-}
-
-// BasicEventsResultData events query result data.
-type BasicEventsResultData interface {
- AsEventsTraceResult() (*EventsTraceResult, bool)
- AsEventsCustomEventResult() (*EventsCustomEventResult, bool)
- AsEventsPageViewResult() (*EventsPageViewResult, bool)
- AsEventsBrowserTimingResult() (*EventsBrowserTimingResult, bool)
- AsEventsRequestResult() (*EventsRequestResult, bool)
- AsEventsDependencyResult() (*EventsDependencyResult, bool)
- AsEventsExceptionResult() (*EventsExceptionResult, bool)
- AsEventsAvailabilityResultResult() (*EventsAvailabilityResultResult, bool)
- AsEventsPerformanceCounterResult() (*EventsPerformanceCounterResult, bool)
- AsEventsCustomMetricResult() (*EventsCustomMetricResult, bool)
- AsEventsResultData() (*EventsResultData, bool)
-}
-
-// EventsResultData events query result data.
-type EventsResultData struct {
- // ID - The unique ID for this event.
- ID *string `json:"id,omitempty"`
- // Count - Count of the event
- Count *int64 `json:"count,omitempty"`
- // Timestamp - Timestamp of the event
- Timestamp *date.Time `json:"timestamp,omitempty"`
- // CustomDimensions - Custom dimensions of the event
- CustomDimensions *EventsResultDataCustomDimensions `json:"customDimensions,omitempty"`
- // CustomMeasurements - Custom measurements of the event
- CustomMeasurements *EventsResultDataCustomMeasurements `json:"customMeasurements,omitempty"`
- // Operation - Operation info of the event
- Operation *EventsOperationInfo `json:"operation,omitempty"`
- // Session - Session info of the event
- Session *EventsSessionInfo `json:"session,omitempty"`
- // User - User info of the event
- User *EventsUserInfo `json:"user,omitempty"`
- // Cloud - Cloud info of the event
- Cloud *EventsCloudInfo `json:"cloud,omitempty"`
- // Ai - AI info of the event
- Ai *EventsAiInfo `json:"ai,omitempty"`
- // Application - Application info of the event
- Application *EventsApplicationInfo `json:"application,omitempty"`
- // Client - Client info of the event
- Client *EventsClientInfo `json:"client,omitempty"`
- // Type - Possible values include: 'TypeEventsResultData', 'TypeTrace', 'TypeCustomEvent', 'TypePageView', 'TypeBrowserTiming', 'TypeRequest', 'TypeDependency', 'TypeException', 'TypeAvailabilityResult', 'TypePerformanceCounter', 'TypeCustomMetric'
- Type Type `json:"type,omitempty"`
-}
-
-func unmarshalBasicEventsResultData(body []byte) (BasicEventsResultData, error) {
- var m map[string]interface{}
- err := json.Unmarshal(body, &m)
- if err != nil {
- return nil, err
- }
-
- switch m["type"] {
- case string(TypeTrace):
- var etr EventsTraceResult
- err := json.Unmarshal(body, &etr)
- return etr, err
- case string(TypeCustomEvent):
- var ecer EventsCustomEventResult
- err := json.Unmarshal(body, &ecer)
- return ecer, err
- case string(TypePageView):
- var epvr EventsPageViewResult
- err := json.Unmarshal(body, &epvr)
- return epvr, err
- case string(TypeBrowserTiming):
- var ebtr EventsBrowserTimingResult
- err := json.Unmarshal(body, &ebtr)
- return ebtr, err
- case string(TypeRequest):
- var errVar EventsRequestResult
- err := json.Unmarshal(body, &errVar)
- return errVar, err
- case string(TypeDependency):
- var edr EventsDependencyResult
- err := json.Unmarshal(body, &edr)
- return edr, err
- case string(TypeException):
- var eer EventsExceptionResult
- err := json.Unmarshal(body, &eer)
- return eer, err
- case string(TypeAvailabilityResult):
- var earr EventsAvailabilityResultResult
- err := json.Unmarshal(body, &earr)
- return earr, err
- case string(TypePerformanceCounter):
- var epcr EventsPerformanceCounterResult
- err := json.Unmarshal(body, &epcr)
- return epcr, err
- case string(TypeCustomMetric):
- var ecmr EventsCustomMetricResult
- err := json.Unmarshal(body, &ecmr)
- return ecmr, err
- default:
- var erd EventsResultData
- err := json.Unmarshal(body, &erd)
- return erd, err
- }
-}
-func unmarshalBasicEventsResultDataArray(body []byte) ([]BasicEventsResultData, error) {
- var rawMessages []*json.RawMessage
- err := json.Unmarshal(body, &rawMessages)
- if err != nil {
- return nil, err
- }
-
- erdArray := make([]BasicEventsResultData, len(rawMessages))
-
- for index, rawMessage := range rawMessages {
- erd, err := unmarshalBasicEventsResultData(*rawMessage)
- if err != nil {
- return nil, err
- }
- erdArray[index] = erd
- }
- return erdArray, nil
-}
-
-// MarshalJSON is the custom marshaler for EventsResultData.
-func (erd EventsResultData) MarshalJSON() ([]byte, error) {
- erd.Type = TypeEventsResultData
- objectMap := make(map[string]interface{})
- if erd.ID != nil {
- objectMap["id"] = erd.ID
- }
- if erd.Count != nil {
- objectMap["count"] = erd.Count
- }
- if erd.Timestamp != nil {
- objectMap["timestamp"] = erd.Timestamp
- }
- if erd.CustomDimensions != nil {
- objectMap["customDimensions"] = erd.CustomDimensions
- }
- if erd.CustomMeasurements != nil {
- objectMap["customMeasurements"] = erd.CustomMeasurements
- }
- if erd.Operation != nil {
- objectMap["operation"] = erd.Operation
- }
- if erd.Session != nil {
- objectMap["session"] = erd.Session
- }
- if erd.User != nil {
- objectMap["user"] = erd.User
- }
- if erd.Cloud != nil {
- objectMap["cloud"] = erd.Cloud
- }
- if erd.Ai != nil {
- objectMap["ai"] = erd.Ai
- }
- if erd.Application != nil {
- objectMap["application"] = erd.Application
- }
- if erd.Client != nil {
- objectMap["client"] = erd.Client
- }
- if erd.Type != "" {
- objectMap["type"] = erd.Type
- }
- return json.Marshal(objectMap)
-}
-
-// AsEventsTraceResult is the BasicEventsResultData implementation for EventsResultData.
-func (erd EventsResultData) AsEventsTraceResult() (*EventsTraceResult, bool) {
- return nil, false
-}
-
-// AsEventsCustomEventResult is the BasicEventsResultData implementation for EventsResultData.
-func (erd EventsResultData) AsEventsCustomEventResult() (*EventsCustomEventResult, bool) {
- return nil, false
-}
-
-// AsEventsPageViewResult is the BasicEventsResultData implementation for EventsResultData.
-func (erd EventsResultData) AsEventsPageViewResult() (*EventsPageViewResult, bool) {
- return nil, false
-}
-
-// AsEventsBrowserTimingResult is the BasicEventsResultData implementation for EventsResultData.
-func (erd EventsResultData) AsEventsBrowserTimingResult() (*EventsBrowserTimingResult, bool) {
- return nil, false
-}
-
-// AsEventsRequestResult is the BasicEventsResultData implementation for EventsResultData.
-func (erd EventsResultData) AsEventsRequestResult() (*EventsRequestResult, bool) {
- return nil, false
-}
-
-// AsEventsDependencyResult is the BasicEventsResultData implementation for EventsResultData.
-func (erd EventsResultData) AsEventsDependencyResult() (*EventsDependencyResult, bool) {
- return nil, false
-}
-
-// AsEventsExceptionResult is the BasicEventsResultData implementation for EventsResultData.
-func (erd EventsResultData) AsEventsExceptionResult() (*EventsExceptionResult, bool) {
- return nil, false
-}
-
-// AsEventsAvailabilityResultResult is the BasicEventsResultData implementation for EventsResultData.
-func (erd EventsResultData) AsEventsAvailabilityResultResult() (*EventsAvailabilityResultResult, bool) {
- return nil, false
-}
-
-// AsEventsPerformanceCounterResult is the BasicEventsResultData implementation for EventsResultData.
-func (erd EventsResultData) AsEventsPerformanceCounterResult() (*EventsPerformanceCounterResult, bool) {
- return nil, false
-}
-
-// AsEventsCustomMetricResult is the BasicEventsResultData implementation for EventsResultData.
-func (erd EventsResultData) AsEventsCustomMetricResult() (*EventsCustomMetricResult, bool) {
- return nil, false
-}
-
-// AsEventsResultData is the BasicEventsResultData implementation for EventsResultData.
-func (erd EventsResultData) AsEventsResultData() (*EventsResultData, bool) {
- return &erd, true
-}
-
-// AsBasicEventsResultData is the BasicEventsResultData implementation for EventsResultData.
-func (erd EventsResultData) AsBasicEventsResultData() (BasicEventsResultData, bool) {
- return &erd, true
-}
-
-// EventsResultDataCustomDimensions custom dimensions of the event
-type EventsResultDataCustomDimensions struct {
- AdditionalProperties interface{} `json:"additionalProperties,omitempty"`
-}
-
-// EventsResultDataCustomMeasurements custom measurements of the event
-type EventsResultDataCustomMeasurements struct {
- AdditionalProperties interface{} `json:"additionalProperties,omitempty"`
-}
-
-// EventsResults an events query result.
-type EventsResults struct {
- autorest.Response `json:"-"`
- // OdataContext - OData context metadata endpoint for this response
- OdataContext *string `json:"@odata.context,omitempty"`
- // AiMessages - OData messages for this response.
- AiMessages *[]ErrorInfo `json:"@ai.messages,omitempty"`
- // Value - Contents of the events query result.
- Value *[]BasicEventsResultData `json:"value,omitempty"`
-}
-
-// UnmarshalJSON is the custom unmarshaler for EventsResults struct.
-func (er *EventsResults) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "@odata.context":
- if v != nil {
- var odataContext string
- err = json.Unmarshal(*v, &odataContext)
- if err != nil {
- return err
- }
- er.OdataContext = &odataContext
- }
- case "@ai.messages":
- if v != nil {
- var aiMessages []ErrorInfo
- err = json.Unmarshal(*v, &aiMessages)
- if err != nil {
- return err
- }
- er.AiMessages = &aiMessages
- }
- case "value":
- if v != nil {
- value, err := unmarshalBasicEventsResultDataArray(*v)
- if err != nil {
- return err
- }
- er.Value = &value
- }
- }
- }
-
- return nil
-}
-
-// EventsSessionInfo session info for an event result
-type EventsSessionInfo struct {
- // ID - ID of the session
- ID *string `json:"id,omitempty"`
-}
-
-// EventsTraceInfo the trace information
-type EventsTraceInfo struct {
- // Message - The trace message
- Message *string `json:"message,omitempty"`
- // SeverityLevel - The trace severity level
- SeverityLevel *int32 `json:"severityLevel,omitempty"`
-}
-
-// EventsTraceResult a trace result
-type EventsTraceResult struct {
- Trace *EventsTraceInfo `json:"trace,omitempty"`
- // ID - The unique ID for this event.
- ID *string `json:"id,omitempty"`
- // Count - Count of the event
- Count *int64 `json:"count,omitempty"`
- // Timestamp - Timestamp of the event
- Timestamp *date.Time `json:"timestamp,omitempty"`
- // CustomDimensions - Custom dimensions of the event
- CustomDimensions *EventsResultDataCustomDimensions `json:"customDimensions,omitempty"`
- // CustomMeasurements - Custom measurements of the event
- CustomMeasurements *EventsResultDataCustomMeasurements `json:"customMeasurements,omitempty"`
- // Operation - Operation info of the event
- Operation *EventsOperationInfo `json:"operation,omitempty"`
- // Session - Session info of the event
- Session *EventsSessionInfo `json:"session,omitempty"`
- // User - User info of the event
- User *EventsUserInfo `json:"user,omitempty"`
- // Cloud - Cloud info of the event
- Cloud *EventsCloudInfo `json:"cloud,omitempty"`
- // Ai - AI info of the event
- Ai *EventsAiInfo `json:"ai,omitempty"`
- // Application - Application info of the event
- Application *EventsApplicationInfo `json:"application,omitempty"`
- // Client - Client info of the event
- Client *EventsClientInfo `json:"client,omitempty"`
- // Type - Possible values include: 'TypeEventsResultData', 'TypeTrace', 'TypeCustomEvent', 'TypePageView', 'TypeBrowserTiming', 'TypeRequest', 'TypeDependency', 'TypeException', 'TypeAvailabilityResult', 'TypePerformanceCounter', 'TypeCustomMetric'
- Type Type `json:"type,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for EventsTraceResult.
-func (etr EventsTraceResult) MarshalJSON() ([]byte, error) {
- etr.Type = TypeTrace
- objectMap := make(map[string]interface{})
- if etr.Trace != nil {
- objectMap["trace"] = etr.Trace
- }
- if etr.ID != nil {
- objectMap["id"] = etr.ID
- }
- if etr.Count != nil {
- objectMap["count"] = etr.Count
- }
- if etr.Timestamp != nil {
- objectMap["timestamp"] = etr.Timestamp
- }
- if etr.CustomDimensions != nil {
- objectMap["customDimensions"] = etr.CustomDimensions
- }
- if etr.CustomMeasurements != nil {
- objectMap["customMeasurements"] = etr.CustomMeasurements
- }
- if etr.Operation != nil {
- objectMap["operation"] = etr.Operation
- }
- if etr.Session != nil {
- objectMap["session"] = etr.Session
- }
- if etr.User != nil {
- objectMap["user"] = etr.User
- }
- if etr.Cloud != nil {
- objectMap["cloud"] = etr.Cloud
- }
- if etr.Ai != nil {
- objectMap["ai"] = etr.Ai
- }
- if etr.Application != nil {
- objectMap["application"] = etr.Application
- }
- if etr.Client != nil {
- objectMap["client"] = etr.Client
- }
- if etr.Type != "" {
- objectMap["type"] = etr.Type
- }
- return json.Marshal(objectMap)
-}
-
-// AsEventsTraceResult is the BasicEventsResultData implementation for EventsTraceResult.
-func (etr EventsTraceResult) AsEventsTraceResult() (*EventsTraceResult, bool) {
- return &etr, true
-}
-
-// AsEventsCustomEventResult is the BasicEventsResultData implementation for EventsTraceResult.
-func (etr EventsTraceResult) AsEventsCustomEventResult() (*EventsCustomEventResult, bool) {
- return nil, false
-}
-
-// AsEventsPageViewResult is the BasicEventsResultData implementation for EventsTraceResult.
-func (etr EventsTraceResult) AsEventsPageViewResult() (*EventsPageViewResult, bool) {
- return nil, false
-}
-
-// AsEventsBrowserTimingResult is the BasicEventsResultData implementation for EventsTraceResult.
-func (etr EventsTraceResult) AsEventsBrowserTimingResult() (*EventsBrowserTimingResult, bool) {
- return nil, false
-}
-
-// AsEventsRequestResult is the BasicEventsResultData implementation for EventsTraceResult.
-func (etr EventsTraceResult) AsEventsRequestResult() (*EventsRequestResult, bool) {
- return nil, false
-}
-
-// AsEventsDependencyResult is the BasicEventsResultData implementation for EventsTraceResult.
-func (etr EventsTraceResult) AsEventsDependencyResult() (*EventsDependencyResult, bool) {
- return nil, false
-}
-
-// AsEventsExceptionResult is the BasicEventsResultData implementation for EventsTraceResult.
-func (etr EventsTraceResult) AsEventsExceptionResult() (*EventsExceptionResult, bool) {
- return nil, false
-}
-
-// AsEventsAvailabilityResultResult is the BasicEventsResultData implementation for EventsTraceResult.
-func (etr EventsTraceResult) AsEventsAvailabilityResultResult() (*EventsAvailabilityResultResult, bool) {
- return nil, false
-}
-
-// AsEventsPerformanceCounterResult is the BasicEventsResultData implementation for EventsTraceResult.
-func (etr EventsTraceResult) AsEventsPerformanceCounterResult() (*EventsPerformanceCounterResult, bool) {
- return nil, false
-}
-
-// AsEventsCustomMetricResult is the BasicEventsResultData implementation for EventsTraceResult.
-func (etr EventsTraceResult) AsEventsCustomMetricResult() (*EventsCustomMetricResult, bool) {
- return nil, false
-}
-
-// AsEventsResultData is the BasicEventsResultData implementation for EventsTraceResult.
-func (etr EventsTraceResult) AsEventsResultData() (*EventsResultData, bool) {
- return nil, false
-}
-
-// AsBasicEventsResultData is the BasicEventsResultData implementation for EventsTraceResult.
-func (etr EventsTraceResult) AsBasicEventsResultData() (BasicEventsResultData, bool) {
- return &etr, true
-}
-
-// EventsUserInfo user info for an event result
-type EventsUserInfo struct {
- // ID - ID of the user
- ID *string `json:"id,omitempty"`
- // AccountID - Account ID of the user
- AccountID *string `json:"accountId,omitempty"`
- // AuthenticatedID - Authenticated ID of the user
- AuthenticatedID *string `json:"authenticatedId,omitempty"`
-}
-
-// ListMetricsResultsItem ...
-type ListMetricsResultsItem struct {
- autorest.Response `json:"-"`
- Value *[]MetricsResultsItem `json:"value,omitempty"`
-}
-
-// MetricsPostBodySchema a metric request
-type MetricsPostBodySchema struct {
- // ID - An identifier for this query. Must be unique within the post body of the request. This identifier will be the 'id' property of the response object representing this query.
- ID *string `json:"id,omitempty"`
- // Parameters - The parameters for a single metrics query
- Parameters *MetricsPostBodySchemaParameters `json:"parameters,omitempty"`
-}
-
-// MetricsPostBodySchemaParameters the parameters for a single metrics query
-type MetricsPostBodySchemaParameters struct {
- // MetricID - Possible values include: 'Requestscount', 'Requestsduration', 'Requestsfailed', 'Userscount', 'Usersauthenticated', 'PageViewscount', 'PageViewsduration', 'ClientprocessingDuration', 'ClientreceiveDuration', 'ClientnetworkDuration', 'ClientsendDuration', 'ClienttotalDuration', 'Dependenciescount', 'Dependenciesfailed', 'Dependenciesduration', 'Exceptionscount', 'Exceptionsbrowser', 'Exceptionsserver', 'Sessionscount', 'PerformanceCountersrequestExecutionTime', 'PerformanceCountersrequestsPerSecond', 'PerformanceCountersrequestsInQueue', 'PerformanceCountersmemoryAvailableBytes', 'PerformanceCountersexceptionsPerSecond', 'PerformanceCountersprocessCPUPercentage', 'PerformanceCountersprocessIOBytesPerSecond', 'PerformanceCountersprocessPrivateBytes', 'PerformanceCountersprocessorCPUPercentage', 'AvailabilityResultsavailabilityPercentage', 'AvailabilityResultsduration', 'BillingtelemetryCount', 'CustomEventscount'
- MetricID MetricID `json:"metricId,omitempty"`
- Timespan *string `json:"timespan,omitempty"`
- Aggregation *[]MetricsAggregation `json:"aggregation,omitempty"`
- Interval *string `json:"interval,omitempty"`
- Segment *[]MetricsSegment `json:"segment,omitempty"`
- Top *int32 `json:"top,omitempty"`
- Orderby *string `json:"orderby,omitempty"`
- Filter *string `json:"filter,omitempty"`
-}
-
-// MetricsResult a metric result.
-type MetricsResult struct {
- autorest.Response `json:"-"`
- Value *MetricsResultInfo `json:"value,omitempty"`
-}
-
-// MetricsResultInfo a metric result data.
-type MetricsResultInfo struct {
- // AdditionalProperties - Unmatched properties from the message are deserialized this collection
- AdditionalProperties map[string]interface{} `json:""`
- // Start - Start time of the metric.
- Start *date.Time `json:"start,omitempty"`
- // End - Start time of the metric.
- End *date.Time `json:"end,omitempty"`
- // Interval - The interval used to segment the metric data.
- Interval *string `json:"interval,omitempty"`
- // Segments - Segmented metric data (if segmented).
- Segments *[]MetricsSegmentInfo `json:"segments,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for MetricsResultInfo.
-func (mri MetricsResultInfo) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if mri.Start != nil {
- objectMap["start"] = mri.Start
- }
- if mri.End != nil {
- objectMap["end"] = mri.End
- }
- if mri.Interval != nil {
- objectMap["interval"] = mri.Interval
- }
- if mri.Segments != nil {
- objectMap["segments"] = mri.Segments
- }
- for k, v := range mri.AdditionalProperties {
- objectMap[k] = v
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for MetricsResultInfo struct.
-func (mri *MetricsResultInfo) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- default:
- if v != nil {
- var additionalProperties interface{}
- err = json.Unmarshal(*v, &additionalProperties)
- if err != nil {
- return err
- }
- if mri.AdditionalProperties == nil {
- mri.AdditionalProperties = make(map[string]interface{})
- }
- mri.AdditionalProperties[k] = additionalProperties
- }
- case "start":
- if v != nil {
- var start date.Time
- err = json.Unmarshal(*v, &start)
- if err != nil {
- return err
- }
- mri.Start = &start
- }
- case "end":
- if v != nil {
- var end date.Time
- err = json.Unmarshal(*v, &end)
- if err != nil {
- return err
- }
- mri.End = &end
- }
- case "interval":
- if v != nil {
- var interval string
- err = json.Unmarshal(*v, &interval)
- if err != nil {
- return err
- }
- mri.Interval = &interval
- }
- case "segments":
- if v != nil {
- var segments []MetricsSegmentInfo
- err = json.Unmarshal(*v, &segments)
- if err != nil {
- return err
- }
- mri.Segments = &segments
- }
- }
- }
-
- return nil
-}
-
-// MetricsResultsItem ...
-type MetricsResultsItem struct {
- // ID - The specified ID for this metric.
- ID *string `json:"id,omitempty"`
- // Status - The HTTP status code of this metric query.
- Status *int32 `json:"status,omitempty"`
- // Body - The results of this metric query.
- Body *MetricsResult `json:"body,omitempty"`
-}
-
-// MetricsSegmentInfo a metric segment
-type MetricsSegmentInfo struct {
- // AdditionalProperties - Unmatched properties from the message are deserialized this collection
- AdditionalProperties map[string]interface{} `json:""`
- // Start - Start time of the metric segment (only when an interval was specified).
- Start *date.Time `json:"start,omitempty"`
- // End - Start time of the metric segment (only when an interval was specified).
- End *date.Time `json:"end,omitempty"`
- // Segments - Segmented metric data (if further segmented).
- Segments *[]MetricsSegmentInfo `json:"segments,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for MetricsSegmentInfo.
-func (msi MetricsSegmentInfo) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if msi.Start != nil {
- objectMap["start"] = msi.Start
- }
- if msi.End != nil {
- objectMap["end"] = msi.End
- }
- if msi.Segments != nil {
- objectMap["segments"] = msi.Segments
- }
- for k, v := range msi.AdditionalProperties {
- objectMap[k] = v
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for MetricsSegmentInfo struct.
-func (msi *MetricsSegmentInfo) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- default:
- if v != nil {
- var additionalProperties interface{}
- err = json.Unmarshal(*v, &additionalProperties)
- if err != nil {
- return err
- }
- if msi.AdditionalProperties == nil {
- msi.AdditionalProperties = make(map[string]interface{})
- }
- msi.AdditionalProperties[k] = additionalProperties
- }
- case "start":
- if v != nil {
- var start date.Time
- err = json.Unmarshal(*v, &start)
- if err != nil {
- return err
- }
- msi.Start = &start
- }
- case "end":
- if v != nil {
- var end date.Time
- err = json.Unmarshal(*v, &end)
- if err != nil {
- return err
- }
- msi.End = &end
- }
- case "segments":
- if v != nil {
- var segments []MetricsSegmentInfo
- err = json.Unmarshal(*v, &segments)
- if err != nil {
- return err
- }
- msi.Segments = &segments
- }
- }
- }
-
- return nil
-}
-
-// QueryBody the Analytics query. Learn more about the [Analytics query
-// syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/)
-type QueryBody struct {
- // Query - The query to execute.
- Query *string `json:"query,omitempty"`
- // Timespan - Optional. The timespan over which to query data. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the query expression.
- Timespan *string `json:"timespan,omitempty"`
- // Applications - A list of Application IDs for cross-application queries.
- Applications *[]string `json:"applications,omitempty"`
-}
-
-// QueryResults contains the tables, columns & rows resulting from a query.
-type QueryResults struct {
- autorest.Response `json:"-"`
- // Tables - The list of tables, columns and rows.
- Tables *[]Table `json:"tables,omitempty"`
-}
-
-// SetObject ...
-type SetObject struct {
- autorest.Response `json:"-"`
- Value interface{} `json:"value,omitempty"`
-}
-
-// Table contains the columns and rows for one table in a query response.
-type Table struct {
- // Name - The name of the table.
- Name *string `json:"name,omitempty"`
- // Columns - The list of columns in this table.
- Columns *[]Column `json:"columns,omitempty"`
- // Rows - The resulting rows from this query.
- Rows *[][]interface{} `json:"rows,omitempty"`
-}
diff --git a/services/appinsights/v1/insights/query.go b/services/appinsights/v1/insights/query.go
deleted file mode 100644
index ae9cd261f024..000000000000
--- a/services/appinsights/v1/insights/query.go
+++ /dev/null
@@ -1,123 +0,0 @@
-package insights
-
-// 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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// QueryClient is the composite Swagger for Application Insights Data Client
-type QueryClient struct {
- BaseClient
-}
-
-// NewQueryClient creates an instance of the QueryClient client.
-func NewQueryClient() QueryClient {
- return NewQueryClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewQueryClientWithBaseURI creates an instance of the QueryClient client.
-func NewQueryClientWithBaseURI(baseURI string) QueryClient {
- return QueryClient{NewWithBaseURI(baseURI)}
-}
-
-// Execute executes an Analytics query for data.
-// [Here](https://dev.applicationinsights.io/documentation/Using-the-API/Query) is an example for using POST with an
-// Analytics query.
-// Parameters:
-// appID - ID of the application. This is Application ID from the API Access settings blade in the Azure
-// portal.
-// body - the Analytics query. Learn more about the [Analytics query
-// syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/)
-func (client QueryClient) Execute(ctx context.Context, appID string, body QueryBody) (result QueryResults, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/QueryClient.Execute")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: body,
- Constraints: []validation.Constraint{{Target: "body.Query", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("insights.QueryClient", "Execute", err.Error())
- }
-
- req, err := client.ExecutePreparer(ctx, appID, body)
- if err != nil {
- err = autorest.NewErrorWithError(err, "insights.QueryClient", "Execute", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ExecuteSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "insights.QueryClient", "Execute", resp, "Failure sending request")
- return
- }
-
- result, err = client.ExecuteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "insights.QueryClient", "Execute", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ExecutePreparer prepares the Execute request.
-func (client QueryClient) ExecutePreparer(ctx context.Context, appID string, body QueryBody) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/apps/{appId}/query", pathParameters),
- autorest.WithJSON(body))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ExecuteSender sends the Execute request. The method will close the
-// http.Response Body if it receives an error.
-func (client QueryClient) ExecuteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ExecuteResponder handles the response to the Execute request. The method always
-// closes the http.Response Body.
-func (client QueryClient) ExecuteResponder(resp *http.Response) (result QueryResults, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/services/automation/mgmt/2015-10-31/automation/dsccompilationjob.go b/services/automation/mgmt/2015-10-31/automation/dsccompilationjob.go
index 239c0926be96..d82bca52bb16 100644
--- a/services/automation/mgmt/2015-10-31/automation/dsccompilationjob.go
+++ b/services/automation/mgmt/2015-10-31/automation/dsccompilationjob.go
@@ -46,7 +46,7 @@ func NewDscCompilationJobClientWithBaseURI(baseURI string, subscriptionID string
// Parameters:
// resourceGroupName - name of an Azure Resource group.
// automationAccountName - the name of the automation account.
-// compilationJobID - the the DSC configuration Id.
+// compilationJobID - the DSC configuration Id.
// parameters - the parameters supplied to the create compilation job operation.
func (client DscCompilationJobClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, compilationJobID uuid.UUID, parameters DscCompilationJobCreateParameters) (result DscCompilationJob, err error) {
if tracing.IsEnabled() {
diff --git a/services/automation/mgmt/2015-10-31/automation/dscconfiguration.go b/services/automation/mgmt/2015-10-31/automation/dscconfiguration.go
index 1336ef9e640c..1adb2650c6d0 100644
--- a/services/automation/mgmt/2015-10-31/automation/dscconfiguration.go
+++ b/services/automation/mgmt/2015-10-31/automation/dscconfiguration.go
@@ -405,7 +405,7 @@ func (client DscConfigurationClient) GetContentResponder(resp *http.Response) (r
// automationAccountName - the name of the automation account.
// filter - the filter to apply on the operation.
// skip - the number of rows to skip.
-// top - the the number of rows to take.
+// top - the number of rows to take.
// inlinecount - return total rows.
func (client DscConfigurationClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result DscConfigurationListResultPage, err error) {
if tracing.IsEnabled() {
diff --git a/services/batch/2015-12-01.2.2/batch/application.go b/services/batch/2015-12-01.2.2/batch/application.go
deleted file mode 100644
index 926b2b05a249..000000000000
--- a/services/batch/2015-12-01.2.2/batch/application.go
+++ /dev/null
@@ -1,240 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "net/http"
-)
-
-// ApplicationClient is the a client for issuing REST requests to the Azure Batch service.
-type ApplicationClient struct {
- BaseClient
-}
-
-// NewApplicationClient creates an instance of the ApplicationClient client.
-func NewApplicationClient() ApplicationClient {
- return NewApplicationClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewApplicationClientWithBaseURI creates an instance of the ApplicationClient client.
-func NewApplicationClientWithBaseURI(baseURI string) ApplicationClient {
- return ApplicationClient{NewWithBaseURI(baseURI)}
-}
-
-// Get gets information about the specified application.
-//
-// applicationID is the id of the application. timeout is sets the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is caller generated request
-// identity, in the form of a GUID with no decoration such as curly braces e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client ApplicationClient) Get(ctx context.Context, applicationID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationSummary, err error) {
- req, err := client.GetPreparer(ctx, applicationID, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client ApplicationClient) GetPreparer(ctx context.Context, applicationID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "applicationId": autorest.Encode("path", applicationID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/applications/{applicationId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client ApplicationClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client ApplicationClient) GetResponder(resp *http.Response) (result ApplicationSummary, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List lists all of the applications available in the specified account.
-//
-// maxResults is sets the maximum number of items to return in the response. timeout is sets the maximum time that
-// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is caller
-// generated request identity, in the form of a GUID with no decoration such as curly braces e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client ApplicationClient) List(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationListResultPage, err error) {
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.alr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "List", resp, "Failure sending request")
- return
- }
-
- result.alr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client ApplicationClient) ListPreparer(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/applications"),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client ApplicationClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client ApplicationClient) ListResponder(resp *http.Response) (result ApplicationListResult, 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 ApplicationClient) listNextResults(lastResults ApplicationListResult) (result ApplicationListResult, err error) {
- req, err := lastResults.applicationListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.ApplicationClient", "listNextResults", 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.ApplicationClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client ApplicationClient) ListComplete(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationListResultIterator, err error) {
- result.page, err = client.List(ctx, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
diff --git a/services/batch/2015-12-01.2.2/batch/certificate.go b/services/batch/2015-12-01.2.2/batch/certificate.go
deleted file mode 100644
index 76aa9b5d68b0..000000000000
--- a/services/batch/2015-12-01.2.2/batch/certificate.go
+++ /dev/null
@@ -1,518 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "net/http"
-)
-
-// CertificateClient is the a client for issuing REST requests to the Azure Batch service.
-type CertificateClient struct {
- BaseClient
-}
-
-// NewCertificateClient creates an instance of the CertificateClient client.
-func NewCertificateClient() CertificateClient {
- return NewCertificateClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewCertificateClientWithBaseURI creates an instance of the CertificateClient client.
-func NewCertificateClientWithBaseURI(baseURI string) CertificateClient {
- return CertificateClient{NewWithBaseURI(baseURI)}
-}
-
-// Add adds a certificate to the specified account.
-//
-// certificate is specifies the certificate to be added. timeout is sets the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is caller generated request
-// identity, in the form of a GUID with no decoration such as curly braces e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client CertificateClient) Add(ctx context.Context, certificate CertificateAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: certificate,
- Constraints: []validation.Constraint{{Target: "certificate.Thumbprint", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "certificate.ThumbprintAlgorithm", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "certificate.Data", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.CertificateClient", "Add", err.Error())
- }
-
- req, err := client.AddPreparer(ctx, certificate, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPreparer prepares the Add request.
-func (client CertificateClient) AddPreparer(ctx context.Context, certificate CertificateAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/certificates"),
- autorest.WithJSON(certificate),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSender sends the Add request. The method will close the
-// http.Response Body if it receives an error.
-func (client CertificateClient) AddSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddResponder handles the response to the Add request. The method always
-// closes the http.Response Body.
-func (client CertificateClient) AddResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// CancelDeletion cancels a failed deletion of a certificate from the specified account.
-//
-// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is
-// the thumbprint of the certificate being deleted. timeout is sets the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is caller generated request
-// identity, in the form of a GUID with no decoration such as curly braces e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client CertificateClient) CancelDeletion(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.CancelDeletionPreparer(ctx, thumbprintAlgorithm, thumbprint, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.CancelDeletionSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", resp, "Failure sending request")
- return
- }
-
- result, err = client.CancelDeletionResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", resp, "Failure responding to request")
- }
-
- return
-}
-
-// CancelDeletionPreparer prepares the CancelDeletion request.
-func (client CertificateClient) CancelDeletionPreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "thumbprint": autorest.Encode("path", thumbprint),
- "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})/canceldelete", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CancelDeletionSender sends the CancelDeletion request. The method will close the
-// http.Response Body if it receives an error.
-func (client CertificateClient) CancelDeletionSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// CancelDeletionResponder handles the response to the CancelDeletion request. The method always
-// closes the http.Response Body.
-func (client CertificateClient) CancelDeletionResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Delete deletes a certificate from the specified account.
-//
-// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is
-// the thumbprint of the certificate to be deleted. timeout is sets the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is caller generated request
-// identity, in the form of a GUID with no decoration such as curly braces e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client CertificateClient) Delete(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeletePreparer(ctx, thumbprintAlgorithm, thumbprint, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client CertificateClient) DeletePreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "thumbprint": autorest.Encode("path", thumbprint),
- "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client CertificateClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client CertificateClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get gets information about the specified certificate.
-//
-// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is
-// the thumbprint of the certificate to get. selectParameter is sets an OData $select clause. timeout is sets the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly
-// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return
-// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified,
-// this header will be automatically populated with the current system clock time.
-func (client CertificateClient) Get(ctx context.Context, thumbprintAlgorithm string, thumbprint string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result Certificate, err error) {
- req, err := client.GetPreparer(ctx, thumbprintAlgorithm, thumbprint, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client CertificateClient) GetPreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "thumbprint": autorest.Encode("path", thumbprint),
- "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client CertificateClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client CertificateClient) GetResponder(resp *http.Response) (result Certificate, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List lists all of the certificates that have been added to the specified account.
-//
-// filter is sets an OData $filter clause. selectParameter is sets an OData $select clause. maxResults is sets the
-// maximum number of items to return in the response. timeout is sets the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is caller generated request
-// identity, in the form of a GUID with no decoration such as curly braces e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client CertificateClient) List(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CertificateListResultPage, err error) {
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.clr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "List", resp, "Failure sending request")
- return
- }
-
- result.clr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client CertificateClient) ListPreparer(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/certificates"),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client CertificateClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client CertificateClient) ListResponder(resp *http.Response) (result CertificateListResult, 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 CertificateClient) listNextResults(lastResults CertificateListResult) (result CertificateListResult, err error) {
- req, err := lastResults.certificateListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.CertificateClient", "listNextResults", 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.CertificateClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client CertificateClient) ListComplete(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CertificateListResultIterator, err error) {
- result.page, err = client.List(ctx, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
diff --git a/services/batch/2015-12-01.2.2/batch/computenode.go b/services/batch/2015-12-01.2.2/batch/computenode.go
deleted file mode 100644
index 58dc476b7863..000000000000
--- a/services/batch/2015-12-01.2.2/batch/computenode.go
+++ /dev/null
@@ -1,988 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "net/http"
-)
-
-// ComputeNodeClient is the a client for issuing REST requests to the Azure Batch service.
-type ComputeNodeClient struct {
- BaseClient
-}
-
-// NewComputeNodeClient creates an instance of the ComputeNodeClient client.
-func NewComputeNodeClient() ComputeNodeClient {
- return NewComputeNodeClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewComputeNodeClientWithBaseURI creates an instance of the ComputeNodeClient client.
-func NewComputeNodeClientWithBaseURI(baseURI string) ComputeNodeClient {
- return ComputeNodeClient{NewWithBaseURI(baseURI)}
-}
-
-// AddUser adds a user account to the specified compute node.
-//
-// poolID is the id of the pool that contains the compute node. nodeID is the id of the machine on which you want
-// to create a user account. userParameter is specifies the user account to be created. timeout is sets the maximum
-// time that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is
-// caller generated request identity, in the form of a GUID with no decoration such as curly braces e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client ComputeNodeClient) AddUser(ctx context.Context, poolID string, nodeID string, userParameter ComputeNodeUser, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: userParameter,
- Constraints: []validation.Constraint{{Target: "userParameter.Name", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "userParameter.Password", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.ComputeNodeClient", "AddUser", err.Error())
- }
-
- req, err := client.AddUserPreparer(ctx, poolID, nodeID, userParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddUserSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddUserResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddUserPreparer prepares the AddUser request.
-func (client ComputeNodeClient) AddUserPreparer(ctx context.Context, poolID string, nodeID string, userParameter ComputeNodeUser, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users", pathParameters),
- autorest.WithJSON(userParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddUserSender sends the AddUser request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) AddUserSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddUserResponder handles the response to the AddUser request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) AddUserResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// DeleteUser deletes a user account from the specified compute node.
-//
-// poolID is the id of the pool that contains the compute node. nodeID is the id of the machine on which you want
-// to delete a user account. userName is the name of the user account to delete. timeout is sets the maximum time
-// that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is
-// caller generated request identity, in the form of a GUID with no decoration such as curly braces e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client ComputeNodeClient) DeleteUser(ctx context.Context, poolID string, nodeID string, userName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeleteUserPreparer(ctx, poolID, nodeID, userName, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteUserSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteUserResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteUserPreparer prepares the DeleteUser request.
-func (client ComputeNodeClient) DeleteUserPreparer(ctx context.Context, poolID string, nodeID string, userName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- "userName": autorest.Encode("path", userName),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users/{userName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteUserSender sends the DeleteUser request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) DeleteUserSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteUserResponder handles the response to the DeleteUser request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) DeleteUserResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// DisableScheduling disable task scheduling of the specified compute node.
-//
-// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node that you want
-// to disable task scheduling. nodeDisableSchedulingParameter is the parameters for the request. timeout is sets
-// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly
-// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return
-// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified,
-// this header will be automatically populated with the current system clock time.
-func (client ComputeNodeClient) DisableScheduling(ctx context.Context, poolID string, nodeID string, nodeDisableSchedulingParameter *NodeDisableSchedulingParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DisableSchedulingPreparer(ctx, poolID, nodeID, nodeDisableSchedulingParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DisableSchedulingSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", resp, "Failure sending request")
- return
- }
-
- result, err = client.DisableSchedulingResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DisableSchedulingPreparer prepares the DisableScheduling request.
-func (client ComputeNodeClient) DisableSchedulingPreparer(ctx context.Context, poolID string, nodeID string, nodeDisableSchedulingParameter *NodeDisableSchedulingParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/disablescheduling", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if nodeDisableSchedulingParameter != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(nodeDisableSchedulingParameter))
- }
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DisableSchedulingSender sends the DisableScheduling request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) DisableSchedulingSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DisableSchedulingResponder handles the response to the DisableScheduling request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) DisableSchedulingResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// EnableScheduling enable task scheduling of the specified compute node.
-//
-// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node that you want
-// to enable task scheduling. timeout is sets the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is caller generated request identity, in the form of a GUID
-// with no decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is
-// specifies if the server should return the client-request-id identifier in the response. ocpDate is the time the
-// request was issued. If not specified, this header will be automatically populated with the current system clock
-// time.
-func (client ComputeNodeClient) EnableScheduling(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.EnableSchedulingPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.EnableSchedulingSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", resp, "Failure sending request")
- return
- }
-
- result, err = client.EnableSchedulingResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", resp, "Failure responding to request")
- }
-
- return
-}
-
-// EnableSchedulingPreparer prepares the EnableScheduling request.
-func (client ComputeNodeClient) EnableSchedulingPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/enablescheduling", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// EnableSchedulingSender sends the EnableScheduling request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) EnableSchedulingSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// EnableSchedulingResponder handles the response to the EnableScheduling request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) EnableSchedulingResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get gets information about the specified compute node.
-//
-// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node that you want
-// to get information about. selectParameter is sets an OData $select clause. timeout is sets the maximum time that
-// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is caller
-// generated request identity, in the form of a GUID with no decoration such as curly braces e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client ComputeNodeClient) Get(ctx context.Context, poolID string, nodeID string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNode, err error) {
- req, err := client.GetPreparer(ctx, poolID, nodeID, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client ComputeNodeClient) GetPreparer(ctx context.Context, poolID string, nodeID string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) GetResponder(resp *http.Response) (result ComputeNode, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetRemoteDesktop gets the Remote Desktop Protocol file for the specified compute node.
-//
-// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node for which you
-// want to get the Remote Desktop Protocol file. timeout is sets the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is caller generated request
-// identity, in the form of a GUID with no decoration such as curly braces e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client ComputeNodeClient) GetRemoteDesktop(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ReadCloser, err error) {
- req, err := client.GetRemoteDesktopPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetRemoteDesktopSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetRemoteDesktopResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetRemoteDesktopPreparer prepares the GetRemoteDesktop request.
-func (client ComputeNodeClient) GetRemoteDesktopPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/rdp", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetRemoteDesktopSender sends the GetRemoteDesktop request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) GetRemoteDesktopSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetRemoteDesktopResponder handles the response to the GetRemoteDesktop request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) GetRemoteDesktopResponder(resp *http.Response) (result ReadCloser, err error) {
- result.Value = &resp.Body
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK))
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List lists the compute nodes in the specified pool.
-//
-// poolID is the id of the pool from which you want to list nodes. filter is sets an OData $filter clause.
-// selectParameter is sets an OData $select clause. maxResults is sets the maximum number of items to return in the
-// response. timeout is sets the maximum time that the server can spend processing the request, in seconds. The
-// default is 30 seconds. clientRequestID is caller generated request identity, in the form of a GUID with no
-// decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if
-// the server should return the client-request-id identifier in the response. ocpDate is the time the request was
-// issued. If not specified, this header will be automatically populated with the current system clock time.
-func (client ComputeNodeClient) List(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeListResultPage, err error) {
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, poolID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.cnlr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", resp, "Failure sending request")
- return
- }
-
- result.cnlr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client ComputeNodeClient) ListPreparer(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) ListResponder(resp *http.Response) (result ComputeNodeListResult, 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 ComputeNodeClient) listNextResults(lastResults ComputeNodeListResult) (result ComputeNodeListResult, err error) {
- req, err := lastResults.computeNodeListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "listNextResults", 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.ComputeNodeClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client ComputeNodeClient) ListComplete(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeListResultIterator, err error) {
- result.page, err = client.List(ctx, poolID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// Reboot restarts the specified compute node.
-//
-// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node that you want
-// to restart. nodeRebootParameter is the parameters for the request. timeout is sets the maximum time that the
-// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is caller
-// generated request identity, in the form of a GUID with no decoration such as curly braces e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client ComputeNodeClient) Reboot(ctx context.Context, poolID string, nodeID string, nodeRebootParameter *NodeRebootParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.RebootPreparer(ctx, poolID, nodeID, nodeRebootParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.RebootSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", resp, "Failure sending request")
- return
- }
-
- result, err = client.RebootResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", resp, "Failure responding to request")
- }
-
- return
-}
-
-// RebootPreparer prepares the Reboot request.
-func (client ComputeNodeClient) RebootPreparer(ctx context.Context, poolID string, nodeID string, nodeRebootParameter *NodeRebootParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/reboot", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if nodeRebootParameter != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(nodeRebootParameter))
- }
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// RebootSender sends the Reboot request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) RebootSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// RebootResponder handles the response to the Reboot request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) RebootResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Reimage reinstalls the operating system on the specified compute node.
-//
-// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node that you want
-// to restart. nodeReimageParameter is the parameters for the request. timeout is sets the maximum time that the
-// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is caller
-// generated request identity, in the form of a GUID with no decoration such as curly braces e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client ComputeNodeClient) Reimage(ctx context.Context, poolID string, nodeID string, nodeReimageParameter *NodeReimageParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.ReimagePreparer(ctx, poolID, nodeID, nodeReimageParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ReimageSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", resp, "Failure sending request")
- return
- }
-
- result, err = client.ReimageResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ReimagePreparer prepares the Reimage request.
-func (client ComputeNodeClient) ReimagePreparer(ctx context.Context, poolID string, nodeID string, nodeReimageParameter *NodeReimageParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/reimage", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if nodeReimageParameter != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(nodeReimageParameter))
- }
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ReimageSender sends the Reimage request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) ReimageSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ReimageResponder handles the response to the Reimage request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// UpdateUser updates the password or expiration time of a user account on the specified compute node.
-//
-// poolID is the id of the pool that contains the compute node. nodeID is the id of the machine on which you want
-// to update a user account. userName is the name of the user account to update. nodeUpdateUserParameter is the
-// parameters for the request. timeout is sets the maximum time that the server can spend processing the request,
-// in seconds. The default is 30 seconds. clientRequestID is caller generated request identity, in the form of a
-// GUID with no decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is
-// specifies if the server should return the client-request-id identifier in the response. ocpDate is the time the
-// request was issued. If not specified, this header will be automatically populated with the current system clock
-// time.
-func (client ComputeNodeClient) UpdateUser(ctx context.Context, poolID string, nodeID string, userName string, nodeUpdateUserParameter NodeUpdateUserParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: nodeUpdateUserParameter,
- Constraints: []validation.Constraint{{Target: "nodeUpdateUserParameter.Password", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.ComputeNodeClient", "UpdateUser", err.Error())
- }
-
- req, err := client.UpdateUserPreparer(ctx, poolID, nodeID, userName, nodeUpdateUserParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateUserSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateUserResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdateUserPreparer prepares the UpdateUser request.
-func (client ComputeNodeClient) UpdateUserPreparer(ctx context.Context, poolID string, nodeID string, userName string, nodeUpdateUserParameter NodeUpdateUserParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- "userName": autorest.Encode("path", userName),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users/{userName}", pathParameters),
- autorest.WithJSON(nodeUpdateUserParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateUserSender sends the UpdateUser request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) UpdateUserSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateUserResponder handles the response to the UpdateUser request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) UpdateUserResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff --git a/services/batch/2015-12-01.2.2/batch/file.go b/services/batch/2015-12-01.2.2/batch/file.go
deleted file mode 100644
index 1e8d9600094c..000000000000
--- a/services/batch/2015-12-01.2.2/batch/file.go
+++ /dev/null
@@ -1,887 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "net/http"
-)
-
-// FileClient is the a client for issuing REST requests to the Azure Batch service.
-type FileClient struct {
- BaseClient
-}
-
-// NewFileClient creates an instance of the FileClient client.
-func NewFileClient() FileClient {
- return NewFileClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewFileClientWithBaseURI creates an instance of the FileClient client.
-func NewFileClientWithBaseURI(baseURI string) FileClient {
- return FileClient{NewWithBaseURI(baseURI)}
-}
-
-// DeleteFromComputeNode deletes the specified task file from the compute node.
-//
-// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node from which you
-// want to delete the file. fileName is the path to the file that you want to delete. recursive is sets whether to
-// delete children of a directory. If the fileName parameter represents a directory instead of a file, you can set
-// Recursive to true to delete the directory and all of the files and subdirectories in it. If Recursive is false
-// then the directory must be empty or deletion will fail. timeout is sets the maximum time that the server can
-// spend processing the request, in seconds. The default is 30 seconds. clientRequestID is caller generated request
-// identity, in the form of a GUID with no decoration such as curly braces e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client FileClient) DeleteFromComputeNode(ctx context.Context, poolID string, nodeID string, fileName string, recursive *bool, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeleteFromComputeNodePreparer(ctx, poolID, nodeID, fileName, recursive, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteFromComputeNodeSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteFromComputeNodeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteFromComputeNodePreparer prepares the DeleteFromComputeNode request.
-func (client FileClient) DeleteFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, fileName string, recursive *bool, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "fileName": autorest.Encode("path", fileName),
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if recursive != nil {
- queryParameters["recursive"] = autorest.Encode("query", *recursive)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{fileName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteFromComputeNodeSender sends the DeleteFromComputeNode request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) DeleteFromComputeNodeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteFromComputeNodeResponder handles the response to the DeleteFromComputeNode request. The method always
-// closes the http.Response Body.
-func (client FileClient) DeleteFromComputeNodeResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// DeleteFromTask deletes the specified task file from the compute node where the task ran.
-//
-// jobID is the id of the job that contains the task. taskID is the id of the task whose file you want to delete.
-// fileName is the path to the task file that you want to delete. recursive is sets whether to delete children of a
-// directory. If the fileName parameter represents a directory instead of a file, you can set Recursive to true to
-// delete the directory and all of the files and subdirectories in it. If Recursive is false then the directory
-// must be empty or deletion will fail. timeout is sets the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is caller generated request identity, in the
-// form of a GUID with no decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is specifies if the server should return the client-request-id identifier in the response.
-// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with
-// the current system clock time.
-func (client FileClient) DeleteFromTask(ctx context.Context, jobID string, taskID string, fileName string, recursive *bool, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeleteFromTaskPreparer(ctx, jobID, taskID, fileName, recursive, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteFromTaskSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteFromTaskResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteFromTaskPreparer prepares the DeleteFromTask request.
-func (client FileClient) DeleteFromTaskPreparer(ctx context.Context, jobID string, taskID string, fileName string, recursive *bool, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "fileName": autorest.Encode("path", fileName),
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if recursive != nil {
- queryParameters["recursive"] = autorest.Encode("query", *recursive)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{fileName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteFromTaskSender sends the DeleteFromTask request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) DeleteFromTaskSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteFromTaskResponder handles the response to the DeleteFromTask request. The method always
-// closes the http.Response Body.
-func (client FileClient) DeleteFromTaskResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// GetFromComputeNode gets the content of the specified task file.
-//
-// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node that contains
-// the file. fileName is the path to the task file that you want to get the content of. timeout is sets the maximum
-// time that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is
-// caller generated request identity, in the form of a GUID with no decoration such as curly braces e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time. ocpRange is specifies the byte range
-// to be retrieved. The default is to retrieve the entire file. The format is startRange-endRange. ifModifiedSince
-// is specify this header to perform the operation only if the resource has been modified since the specified
-// date/time. ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been
-// modified since the specified date/time.
-func (client FileClient) GetFromComputeNode(ctx context.Context, poolID string, nodeID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result ReadCloser, err error) {
- req, err := client.GetFromComputeNodePreparer(ctx, poolID, nodeID, fileName, timeout, clientRequestID, returnClientRequestID, ocpDate, ocpRange, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetFromComputeNodeSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetFromComputeNodeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetFromComputeNodePreparer prepares the GetFromComputeNode request.
-func (client FileClient) GetFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "fileName": autorest.Encode("path", fileName),
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{fileName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ocpRange) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-range", autorest.String(ocpRange)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetFromComputeNodeSender sends the GetFromComputeNode request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) GetFromComputeNodeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetFromComputeNodeResponder handles the response to the GetFromComputeNode request. The method always
-// closes the http.Response Body.
-func (client FileClient) GetFromComputeNodeResponder(resp *http.Response) (result ReadCloser, err error) {
- result.Value = &resp.Body
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK))
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetFromTask gets the content of the specified task file.
-//
-// jobID is the id of the job that contains the task. taskID is the id of the task whose file you want to retrieve.
-// fileName is the path to the task file that you want to get the content of. timeout is sets the maximum time that
-// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is caller
-// generated request identity, in the form of a GUID with no decoration such as curly braces e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time. ocpRange is specifies the byte range
-// to be retrieved. The default is to retrieve the entire file. The format is startRange-endRange. ifModifiedSince
-// is specify this header to perform the operation only if the resource has been modified since the specified
-// date/time. ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been
-// modified since the specified date/time.
-func (client FileClient) GetFromTask(ctx context.Context, jobID string, taskID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result ReadCloser, err error) {
- req, err := client.GetFromTaskPreparer(ctx, jobID, taskID, fileName, timeout, clientRequestID, returnClientRequestID, ocpDate, ocpRange, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetFromTaskSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetFromTaskResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetFromTaskPreparer prepares the GetFromTask request.
-func (client FileClient) GetFromTaskPreparer(ctx context.Context, jobID string, taskID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "fileName": autorest.Encode("path", fileName),
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{fileName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ocpRange) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-range", autorest.String(ocpRange)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetFromTaskSender sends the GetFromTask request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) GetFromTaskSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetFromTaskResponder handles the response to the GetFromTask request. The method always
-// closes the http.Response Body.
-func (client FileClient) GetFromTaskResponder(resp *http.Response) (result ReadCloser, err error) {
- result.Value = &resp.Body
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK))
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetNodeFilePropertiesFromComputeNode gets the properties of the specified compute node file.
-//
-// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node that contains
-// the file. fileName is the path to the compute node file that you want to get the properties of. timeout is sets
-// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly
-// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return
-// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified,
-// this header will be automatically populated with the current system clock time. ifModifiedSince is specify this
-// header to perform the operation only if the resource has been modified since the specified date/time.
-// ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been modified
-// since the specified date/time.
-func (client FileClient) GetNodeFilePropertiesFromComputeNode(ctx context.Context, poolID string, nodeID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.GetNodeFilePropertiesFromComputeNodePreparer(ctx, poolID, nodeID, fileName, timeout, clientRequestID, returnClientRequestID, ocpDate, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromComputeNode", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetNodeFilePropertiesFromComputeNodeSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromComputeNode", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetNodeFilePropertiesFromComputeNodeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromComputeNode", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetNodeFilePropertiesFromComputeNodePreparer prepares the GetNodeFilePropertiesFromComputeNode request.
-func (client FileClient) GetNodeFilePropertiesFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "fileName": autorest.Encode("path", fileName),
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsHead(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{fileName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetNodeFilePropertiesFromComputeNodeSender sends the GetNodeFilePropertiesFromComputeNode request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) GetNodeFilePropertiesFromComputeNodeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetNodeFilePropertiesFromComputeNodeResponder handles the response to the GetNodeFilePropertiesFromComputeNode request. The method always
-// closes the http.Response Body.
-func (client FileClient) GetNodeFilePropertiesFromComputeNodeResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// GetNodeFilePropertiesFromTask gets the properties of the specified task file.
-//
-// jobID is the id of the job that contains the task. taskID is the id of the task whose file you want to get the
-// properties of. fileName is the path to the task file that you want to get the properties of. timeout is sets the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly
-// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return
-// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified,
-// this header will be automatically populated with the current system clock time. ifModifiedSince is specify this
-// header to perform the operation only if the resource has been modified since the specified date/time.
-// ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been modified
-// since the specified date/time.
-func (client FileClient) GetNodeFilePropertiesFromTask(ctx context.Context, jobID string, taskID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.GetNodeFilePropertiesFromTaskPreparer(ctx, jobID, taskID, fileName, timeout, clientRequestID, returnClientRequestID, ocpDate, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromTask", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetNodeFilePropertiesFromTaskSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromTask", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetNodeFilePropertiesFromTaskResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromTask", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetNodeFilePropertiesFromTaskPreparer prepares the GetNodeFilePropertiesFromTask request.
-func (client FileClient) GetNodeFilePropertiesFromTaskPreparer(ctx context.Context, jobID string, taskID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "fileName": autorest.Encode("path", fileName),
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsHead(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{fileName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetNodeFilePropertiesFromTaskSender sends the GetNodeFilePropertiesFromTask request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) GetNodeFilePropertiesFromTaskSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetNodeFilePropertiesFromTaskResponder handles the response to the GetNodeFilePropertiesFromTask request. The method always
-// closes the http.Response Body.
-func (client FileClient) GetNodeFilePropertiesFromTaskResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// ListFromComputeNode lists all of the files in task directories on the specified compute node.
-//
-// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node whose files
-// you want to list. filter is sets an OData $filter clause. recursive is sets whether to list children of a
-// directory. maxResults is sets the maximum number of items to return in the response. timeout is sets the maximum
-// time that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is
-// caller generated request identity, in the form of a GUID with no decoration such as curly braces e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client FileClient) ListFromComputeNode(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultPage, err error) {
- result.fn = client.listFromComputeNodeNextResults
- req, err := client.ListFromComputeNodePreparer(ctx, poolID, nodeID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListFromComputeNodeSender(req)
- if err != nil {
- result.nflr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", resp, "Failure sending request")
- return
- }
-
- result.nflr, err = client.ListFromComputeNodeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListFromComputeNodePreparer prepares the ListFromComputeNode request.
-func (client FileClient) ListFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if recursive != nil {
- queryParameters["recursive"] = autorest.Encode("query", *recursive)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListFromComputeNodeSender sends the ListFromComputeNode request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) ListFromComputeNodeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListFromComputeNodeResponder handles the response to the ListFromComputeNode request. The method always
-// closes the http.Response Body.
-func (client FileClient) ListFromComputeNodeResponder(resp *http.Response) (result NodeFileListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listFromComputeNodeNextResults retrieves the next set of results, if any.
-func (client FileClient) listFromComputeNodeNextResults(lastResults NodeFileListResult) (result NodeFileListResult, err error) {
- req, err := lastResults.nodeFileListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListFromComputeNodeSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListFromComputeNodeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListFromComputeNodeComplete enumerates all values, automatically crossing page boundaries as required.
-func (client FileClient) ListFromComputeNodeComplete(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultIterator, err error) {
- result.page, err = client.ListFromComputeNode(ctx, poolID, nodeID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// ListFromTask lists the files in a task's directory on its compute node.
-//
-// jobID is the id of the job that contains the task. taskID is the id of the task whose files you want to list.
-// filter is sets an OData $filter clause. recursive is sets whether to list children of a directory. maxResults is
-// sets the maximum number of items to return in the response. timeout is sets the maximum time that the server can
-// spend processing the request, in seconds. The default is 30 seconds. clientRequestID is caller generated request
-// identity, in the form of a GUID with no decoration such as curly braces e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client FileClient) ListFromTask(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultPage, err error) {
- result.fn = client.listFromTaskNextResults
- req, err := client.ListFromTaskPreparer(ctx, jobID, taskID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListFromTaskSender(req)
- if err != nil {
- result.nflr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", resp, "Failure sending request")
- return
- }
-
- result.nflr, err = client.ListFromTaskResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListFromTaskPreparer prepares the ListFromTask request.
-func (client FileClient) ListFromTaskPreparer(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if recursive != nil {
- queryParameters["recursive"] = autorest.Encode("query", *recursive)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListFromTaskSender sends the ListFromTask request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) ListFromTaskSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListFromTaskResponder handles the response to the ListFromTask request. The method always
-// closes the http.Response Body.
-func (client FileClient) ListFromTaskResponder(resp *http.Response) (result NodeFileListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listFromTaskNextResults retrieves the next set of results, if any.
-func (client FileClient) listFromTaskNextResults(lastResults NodeFileListResult) (result NodeFileListResult, err error) {
- req, err := lastResults.nodeFileListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListFromTaskSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListFromTaskResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListFromTaskComplete enumerates all values, automatically crossing page boundaries as required.
-func (client FileClient) ListFromTaskComplete(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultIterator, err error) {
- result.page, err = client.ListFromTask(ctx, jobID, taskID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
diff --git a/services/batch/2015-12-01.2.2/batch/job.go b/services/batch/2015-12-01.2.2/batch/job.go
deleted file mode 100644
index 36cb2d332cd5..000000000000
--- a/services/batch/2015-12-01.2.2/batch/job.go
+++ /dev/null
@@ -1,1336 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "net/http"
-)
-
-// JobClient is the a client for issuing REST requests to the Azure Batch service.
-type JobClient struct {
- BaseClient
-}
-
-// NewJobClient creates an instance of the JobClient client.
-func NewJobClient() JobClient {
- return NewJobClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewJobClientWithBaseURI creates an instance of the JobClient client.
-func NewJobClientWithBaseURI(baseURI string) JobClient {
- return JobClient{NewWithBaseURI(baseURI)}
-}
-
-// Add adds a job to the specified account.
-//
-// job is specifies the job to be added. timeout is sets the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is caller generated request identity, in the
-// form of a GUID with no decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is specifies if the server should return the client-request-id identifier in the response.
-// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with
-// the current system clock time.
-func (client JobClient) Add(ctx context.Context, job JobAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: job,
- Constraints: []validation.Constraint{{Target: "job.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.PoolInfo", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.JobClient", "Add", err.Error())
- }
-
- req, err := client.AddPreparer(ctx, job, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPreparer prepares the Add request.
-func (client JobClient) AddPreparer(ctx context.Context, job JobAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/jobs"),
- autorest.WithJSON(job),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSender sends the Add request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) AddSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddResponder handles the response to the Add request. The method always
-// closes the http.Response Body.
-func (client JobClient) AddResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Delete deletes a job.
-//
-// jobID is the id of the job to delete. timeout is sets the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is caller generated request identity, in the
-// form of a GUID with no decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is specifies if the server should return the client-request-id identifier in the response.
-// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with
-// the current system clock time. ifMatch is an ETag is specified. Specify this header to perform the operation
-// only if the resource's ETag is an exact match as specified. ifNoneMatch is an ETag is specified. Specify this
-// header to perform the operation only if the resource's ETag does not match the specified ETag. ifModifiedSince
-// is specify this header to perform the operation only if the resource has been modified since the specified
-// date/time. ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been
-// modified since the specified date/time.
-func (client JobClient) Delete(ctx context.Context, jobID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeletePreparer(ctx, jobID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client JobClient) DeletePreparer(ctx context.Context, jobID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client JobClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Disable disables the specified job, preventing new tasks from running.
-//
-// jobID is the id of the job to disable. jobDisableParameter is the parameters for the request. timeout is sets
-// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly
-// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return
-// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified,
-// this header will be automatically populated with the current system clock time. ifMatch is an ETag is specified.
-// Specify this header to perform the operation only if the resource's ETag is an exact match as specified.
-// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag
-// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the
-// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform
-// the operation only if the resource has not been modified since the specified date/time.
-func (client JobClient) Disable(ctx context.Context, jobID string, jobDisableParameter JobDisableParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DisablePreparer(ctx, jobID, jobDisableParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DisableSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", resp, "Failure sending request")
- return
- }
-
- result, err = client.DisableResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DisablePreparer prepares the Disable request.
-func (client JobClient) DisablePreparer(ctx context.Context, jobID string, jobDisableParameter JobDisableParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/disable", pathParameters),
- autorest.WithJSON(jobDisableParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DisableSender sends the Disable request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) DisableSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DisableResponder handles the response to the Disable request. The method always
-// closes the http.Response Body.
-func (client JobClient) DisableResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Enable enables the specified job, allowing new tasks to run.
-//
-// jobID is the id of the job to enable. timeout is sets the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is caller generated request identity, in the
-// form of a GUID with no decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is specifies if the server should return the client-request-id identifier in the response.
-// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with
-// the current system clock time. ifMatch is an ETag is specified. Specify this header to perform the operation
-// only if the resource's ETag is an exact match as specified. ifNoneMatch is an ETag is specified. Specify this
-// header to perform the operation only if the resource's ETag does not match the specified ETag. ifModifiedSince
-// is specify this header to perform the operation only if the resource has been modified since the specified
-// date/time. ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been
-// modified since the specified date/time.
-func (client JobClient) Enable(ctx context.Context, jobID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.EnablePreparer(ctx, jobID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.EnableSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", resp, "Failure sending request")
- return
- }
-
- result, err = client.EnableResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", resp, "Failure responding to request")
- }
-
- return
-}
-
-// EnablePreparer prepares the Enable request.
-func (client JobClient) EnablePreparer(ctx context.Context, jobID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/enable", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// EnableSender sends the Enable request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) EnableSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// EnableResponder handles the response to the Enable request. The method always
-// closes the http.Response Body.
-func (client JobClient) EnableResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get gets information about the specified job.
-//
-// jobID is the id of the job. selectParameter is sets an OData $select clause. expand is sets an OData $expand
-// clause. timeout is sets the maximum time that the server can spend processing the request, in seconds. The
-// default is 30 seconds. clientRequestID is caller generated request identity, in the form of a GUID with no
-// decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if
-// the server should return the client-request-id identifier in the response. ocpDate is the time the request was
-// issued. If not specified, this header will be automatically populated with the current system clock time.
-func (client JobClient) Get(ctx context.Context, jobID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJob, err error) {
- req, err := client.GetPreparer(ctx, jobID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client JobClient) GetPreparer(ctx context.Context, jobID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client JobClient) GetResponder(resp *http.Response) (result CloudJob, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetAllJobsLifetimeStatistics gets lifetime summary statistics for all of the jobs in the specified account.
-// Statistics are aggregated across all jobs that have ever existed in the account, from account creation to the last
-// update time of the statistics.
-//
-// timeout is sets the maximum time that the server can spend processing the request, in seconds. The default is 30
-// seconds. clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as
-// curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should
-// return the client-request-id identifier in the response. ocpDate is the time the request was issued. If not
-// specified, this header will be automatically populated with the current system clock time.
-func (client JobClient) GetAllJobsLifetimeStatistics(ctx context.Context, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result JobStatistics, err error) {
- req, err := client.GetAllJobsLifetimeStatisticsPreparer(ctx, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllJobsLifetimeStatistics", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetAllJobsLifetimeStatisticsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllJobsLifetimeStatistics", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetAllJobsLifetimeStatisticsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllJobsLifetimeStatistics", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetAllJobsLifetimeStatisticsPreparer prepares the GetAllJobsLifetimeStatistics request.
-func (client JobClient) GetAllJobsLifetimeStatisticsPreparer(ctx context.Context, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/lifetimejobstats"),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetAllJobsLifetimeStatisticsSender sends the GetAllJobsLifetimeStatistics request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) GetAllJobsLifetimeStatisticsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetAllJobsLifetimeStatisticsResponder handles the response to the GetAllJobsLifetimeStatistics request. The method always
-// closes the http.Response Body.
-func (client JobClient) GetAllJobsLifetimeStatisticsResponder(resp *http.Response) (result JobStatistics, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List lists all of the jobs in the specified account.
-//
-// filter is sets an OData $filter clause. selectParameter is sets an OData $select clause. expand is sets an OData
-// $expand clause. maxResults is sets the maximum number of items to return in the response. timeout is sets the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly
-// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return
-// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified,
-// this header will be automatically populated with the current system clock time.
-func (client JobClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultPage, err error) {
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.cjlr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobClient", "List", resp, "Failure sending request")
- return
- }
-
- result.cjlr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client JobClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/jobs"),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client JobClient) ListResponder(resp *http.Response) (result CloudJobListResult, 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 JobClient) listNextResults(lastResults CloudJobListResult) (result CloudJobListResult, err error) {
- req, err := lastResults.cloudJobListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.JobClient", "listNextResults", 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.JobClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client JobClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultIterator, err error) {
- result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// ListFromJobSchedule lists the jobs that have been created under the specified job schedule.
-//
-// jobScheduleID is the id of the job schedule from which you want to get a list of jobs. filter is sets an OData
-// $filter clause. selectParameter is sets an OData $select clause. expand is sets an OData $expand clause.
-// maxResults is sets the maximum number of items to return in the response. timeout is sets the maximum time that
-// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is caller
-// generated request identity, in the form of a GUID with no decoration such as curly braces e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client JobClient) ListFromJobSchedule(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultPage, err error) {
- result.fn = client.listFromJobScheduleNextResults
- req, err := client.ListFromJobSchedulePreparer(ctx, jobScheduleID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListFromJobScheduleSender(req)
- if err != nil {
- result.cjlr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", resp, "Failure sending request")
- return
- }
-
- result.cjlr, err = client.ListFromJobScheduleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListFromJobSchedulePreparer prepares the ListFromJobSchedule request.
-func (client JobClient) ListFromJobSchedulePreparer(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}/jobs", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListFromJobScheduleSender sends the ListFromJobSchedule request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) ListFromJobScheduleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListFromJobScheduleResponder handles the response to the ListFromJobSchedule request. The method always
-// closes the http.Response Body.
-func (client JobClient) ListFromJobScheduleResponder(resp *http.Response) (result CloudJobListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listFromJobScheduleNextResults retrieves the next set of results, if any.
-func (client JobClient) listFromJobScheduleNextResults(lastResults CloudJobListResult) (result CloudJobListResult, err error) {
- req, err := lastResults.cloudJobListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListFromJobScheduleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListFromJobScheduleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListFromJobScheduleComplete enumerates all values, automatically crossing page boundaries as required.
-func (client JobClient) ListFromJobScheduleComplete(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultIterator, err error) {
- result.page, err = client.ListFromJobSchedule(ctx, jobScheduleID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// ListPreparationAndReleaseTaskStatus lists the execution status of the Job Preparation and Job Release task for the
-// specified job across the compute nodes where the job has run.
-//
-// jobID is the id of the job. filter is sets an OData $filter clause. selectParameter is sets an OData $select
-// clause. maxResults is sets the maximum number of items to return in the response. timeout is sets the maximum
-// time that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is
-// caller generated request identity, in the form of a GUID with no decoration such as curly braces e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client JobClient) ListPreparationAndReleaseTaskStatus(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListPreparationAndReleaseTaskStatusResultPage, err error) {
- result.fn = client.listPreparationAndReleaseTaskStatusNextResults
- req, err := client.ListPreparationAndReleaseTaskStatusPreparer(ctx, jobID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListPreparationAndReleaseTaskStatusSender(req)
- if err != nil {
- result.cjlpartsr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", resp, "Failure sending request")
- return
- }
-
- result.cjlpartsr, err = client.ListPreparationAndReleaseTaskStatusResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparationAndReleaseTaskStatusPreparer prepares the ListPreparationAndReleaseTaskStatus request.
-func (client JobClient) ListPreparationAndReleaseTaskStatusPreparer(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/jobpreparationandreleasetaskstatus", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListPreparationAndReleaseTaskStatusSender sends the ListPreparationAndReleaseTaskStatus request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) ListPreparationAndReleaseTaskStatusSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListPreparationAndReleaseTaskStatusResponder handles the response to the ListPreparationAndReleaseTaskStatus request. The method always
-// closes the http.Response Body.
-func (client JobClient) ListPreparationAndReleaseTaskStatusResponder(resp *http.Response) (result CloudJobListPreparationAndReleaseTaskStatusResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listPreparationAndReleaseTaskStatusNextResults retrieves the next set of results, if any.
-func (client JobClient) listPreparationAndReleaseTaskStatusNextResults(lastResults CloudJobListPreparationAndReleaseTaskStatusResult) (result CloudJobListPreparationAndReleaseTaskStatusResult, err error) {
- req, err := lastResults.cloudJobListPreparationAndReleaseTaskStatusResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListPreparationAndReleaseTaskStatusSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListPreparationAndReleaseTaskStatusResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListPreparationAndReleaseTaskStatusComplete enumerates all values, automatically crossing page boundaries as required.
-func (client JobClient) ListPreparationAndReleaseTaskStatusComplete(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListPreparationAndReleaseTaskStatusResultIterator, err error) {
- result.page, err = client.ListPreparationAndReleaseTaskStatus(ctx, jobID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// Patch updates the properties of a job.
-//
-// jobID is the id of the job whose properties you want to update. jobPatchParameter is the parameters for the
-// request. timeout is sets the maximum time that the server can spend processing the request, in seconds. The
-// default is 30 seconds. clientRequestID is caller generated request identity, in the form of a GUID with no
-// decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if
-// the server should return the client-request-id identifier in the response. ocpDate is the time the request was
-// issued. If not specified, this header will be automatically populated with the current system clock time.
-// ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag is an
-// exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only
-// if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the
-// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify
-// this header to perform the operation only if the resource has not been modified since the specified date/time.
-func (client JobClient) Patch(ctx context.Context, jobID string, jobPatchParameter JobPatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.PatchPreparer(ctx, jobID, jobPatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.PatchSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", resp, "Failure sending request")
- return
- }
-
- result, err = client.PatchResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", resp, "Failure responding to request")
- }
-
- return
-}
-
-// PatchPreparer prepares the Patch request.
-func (client JobClient) PatchPreparer(ctx context.Context, jobID string, jobPatchParameter JobPatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
- autorest.AsPatch(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}", pathParameters),
- autorest.WithJSON(jobPatchParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// PatchSender sends the Patch request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) PatchSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// PatchResponder handles the response to the Patch request. The method always
-// closes the http.Response Body.
-func (client JobClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Terminate terminates the specified job, marking it as completed.
-//
-// jobID is the id of the job to terminate. jobTerminateParameter is the parameters for the request. timeout is
-// sets the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly
-// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return
-// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified,
-// this header will be automatically populated with the current system clock time. ifMatch is an ETag is specified.
-// Specify this header to perform the operation only if the resource's ETag is an exact match as specified.
-// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag
-// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the
-// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform
-// the operation only if the resource has not been modified since the specified date/time.
-func (client JobClient) Terminate(ctx context.Context, jobID string, jobTerminateParameter *JobTerminateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.TerminatePreparer(ctx, jobID, jobTerminateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.TerminateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", resp, "Failure sending request")
- return
- }
-
- result, err = client.TerminateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", resp, "Failure responding to request")
- }
-
- return
-}
-
-// TerminatePreparer prepares the Terminate request.
-func (client JobClient) TerminatePreparer(ctx context.Context, jobID string, jobTerminateParameter *JobTerminateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/terminate", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if jobTerminateParameter != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(jobTerminateParameter))
- }
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// TerminateSender sends the Terminate request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) TerminateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// TerminateResponder handles the response to the Terminate request. The method always
-// closes the http.Response Body.
-func (client JobClient) TerminateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Update updates the properties of a job.
-//
-// jobID is the id of the job whose properties you want to update. jobUpdateParameter is the parameters for the
-// request. timeout is sets the maximum time that the server can spend processing the request, in seconds. The
-// default is 30 seconds. clientRequestID is caller generated request identity, in the form of a GUID with no
-// decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if
-// the server should return the client-request-id identifier in the response. ocpDate is the time the request was
-// issued. If not specified, this header will be automatically populated with the current system clock time.
-// ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag is an
-// exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only
-// if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the
-// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify
-// this header to perform the operation only if the resource has not been modified since the specified date/time.
-func (client JobClient) Update(ctx context.Context, jobID string, jobUpdateParameter JobUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: jobUpdateParameter,
- Constraints: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.JobClient", "Update", err.Error())
- }
-
- req, err := client.UpdatePreparer(ctx, jobID, jobUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePreparer prepares the Update request.
-func (client JobClient) UpdatePreparer(ctx context.Context, jobID string, jobUpdateParameter JobUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}", pathParameters),
- autorest.WithJSON(jobUpdateParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSender sends the Update request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) UpdateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateResponder handles the response to the Update request. The method always
-// closes the http.Response Body.
-func (client JobClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff --git a/services/batch/2015-12-01.2.2/batch/jobschedule.go b/services/batch/2015-12-01.2.2/batch/jobschedule.go
deleted file mode 100644
index faf272a8ec74..000000000000
--- a/services/batch/2015-12-01.2.2/batch/jobschedule.go
+++ /dev/null
@@ -1,1126 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "net/http"
-)
-
-// JobScheduleClient is the a client for issuing REST requests to the Azure Batch service.
-type JobScheduleClient struct {
- BaseClient
-}
-
-// NewJobScheduleClient creates an instance of the JobScheduleClient client.
-func NewJobScheduleClient() JobScheduleClient {
- return NewJobScheduleClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewJobScheduleClientWithBaseURI creates an instance of the JobScheduleClient client.
-func NewJobScheduleClientWithBaseURI(baseURI string) JobScheduleClient {
- return JobScheduleClient{NewWithBaseURI(baseURI)}
-}
-
-// Add adds a job schedule to the specified account.
-//
-// cloudJobSchedule is specifies the job schedule to be added. timeout is sets the maximum time that the server can
-// spend processing the request, in seconds. The default is 30 seconds. clientRequestID is caller generated request
-// identity, in the form of a GUID with no decoration such as curly braces e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client JobScheduleClient) Add(ctx context.Context, cloudJobSchedule JobScheduleAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: cloudJobSchedule,
- Constraints: []validation.Constraint{{Target: "cloudJobSchedule.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.Schedule", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.JobScheduleClient", "Add", err.Error())
- }
-
- req, err := client.AddPreparer(ctx, cloudJobSchedule, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPreparer prepares the Add request.
-func (client JobScheduleClient) AddPreparer(ctx context.Context, cloudJobSchedule JobScheduleAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/jobschedules"),
- autorest.WithJSON(cloudJobSchedule),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSender sends the Add request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) AddSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddResponder handles the response to the Add request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) AddResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Delete deletes a job schedule from the specified account.
-//
-// jobScheduleID is the id of the job schedule to delete. timeout is sets the maximum time that the server can
-// spend processing the request, in seconds. The default is 30 seconds. clientRequestID is caller generated request
-// identity, in the form of a GUID with no decoration such as curly braces e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified.
-// Specify this header to perform the operation only if the resource's ETag is an exact match as specified.
-// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag
-// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the
-// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform
-// the operation only if the resource has not been modified since the specified date/time.
-func (client JobScheduleClient) Delete(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeletePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client JobScheduleClient) DeletePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Disable disables a job schedule.
-//
-// jobScheduleID is the id of the job schedule to disable. timeout is sets the maximum time that the server can
-// spend processing the request, in seconds. The default is 30 seconds. clientRequestID is caller generated request
-// identity, in the form of a GUID with no decoration such as curly braces e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified.
-// Specify this header to perform the operation only if the resource's ETag is an exact match as specified.
-// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag
-// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the
-// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform
-// the operation only if the resource has not been modified since the specified date/time.
-func (client JobScheduleClient) Disable(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DisablePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DisableSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", resp, "Failure sending request")
- return
- }
-
- result, err = client.DisableResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DisablePreparer prepares the Disable request.
-func (client JobScheduleClient) DisablePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}/disable", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DisableSender sends the Disable request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) DisableSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DisableResponder handles the response to the Disable request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) DisableResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Enable enables a job schedule.
-//
-// jobScheduleID is the id of the job schedule to enable. timeout is sets the maximum time that the server can
-// spend processing the request, in seconds. The default is 30 seconds. clientRequestID is caller generated request
-// identity, in the form of a GUID with no decoration such as curly braces e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified.
-// Specify this header to perform the operation only if the resource's ETag is an exact match as specified.
-// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag
-// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the
-// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform
-// the operation only if the resource has not been modified since the specified date/time.
-func (client JobScheduleClient) Enable(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.EnablePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.EnableSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", resp, "Failure sending request")
- return
- }
-
- result, err = client.EnableResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", resp, "Failure responding to request")
- }
-
- return
-}
-
-// EnablePreparer prepares the Enable request.
-func (client JobScheduleClient) EnablePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}/enable", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// EnableSender sends the Enable request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) EnableSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// EnableResponder handles the response to the Enable request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) EnableResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Exists checks the specified job schedule exists.
-//
-// jobScheduleID is the id of the job schedule which you want to check. selectParameter is sets an OData $select
-// clause. timeout is sets the maximum time that the server can spend processing the request, in seconds. The
-// default is 30 seconds. clientRequestID is caller generated request identity, in the form of a GUID with no
-// decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if
-// the server should return the client-request-id identifier in the response. ocpDate is the time the request was
-// issued. If not specified, this header will be automatically populated with the current system clock time.
-// ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag is an
-// exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only
-// if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the
-// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify
-// this header to perform the operation only if the resource has not been modified since the specified date/time.
-func (client JobScheduleClient) Exists(ctx context.Context, jobScheduleID string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.ExistsPreparer(ctx, jobScheduleID, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ExistsSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", resp, "Failure sending request")
- return
- }
-
- result, err = client.ExistsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ExistsPreparer prepares the Exists request.
-func (client JobScheduleClient) ExistsPreparer(ctx context.Context, jobScheduleID string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsHead(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ExistsSender sends the Exists request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) ExistsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ExistsResponder handles the response to the Exists request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) ExistsResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get gets information about the specified job schedule.
-//
-// jobScheduleID is the id of the job schedule to get. selectParameter is sets an OData $select clause. expand is
-// sets an OData $expand clause. timeout is sets the maximum time that the server can spend processing the request,
-// in seconds. The default is 30 seconds. clientRequestID is caller generated request identity, in the form of a
-// GUID with no decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is
-// specifies if the server should return the client-request-id identifier in the response. ocpDate is the time the
-// request was issued. If not specified, this header will be automatically populated with the current system clock
-// time. ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag
-// is an exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the
-// operation only if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header
-// to perform the operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince
-// is specify this header to perform the operation only if the resource has not been modified since the specified
-// date/time.
-func (client JobScheduleClient) Get(ctx context.Context, jobScheduleID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudJobSchedule, err error) {
- req, err := client.GetPreparer(ctx, jobScheduleID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client JobScheduleClient) GetPreparer(ctx context.Context, jobScheduleID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) GetResponder(resp *http.Response) (result CloudJobSchedule, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List lists all of the job schedules in the specified account.
-//
-// filter is sets an OData $filter clause. selectParameter is sets an OData $select clause. expand is sets an OData
-// $expand clause. maxResults is sets the maximum number of items to return in the response. timeout is sets the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly
-// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return
-// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified,
-// this header will be automatically populated with the current system clock time.
-func (client JobScheduleClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobScheduleListResultPage, err error) {
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.cjslr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", resp, "Failure sending request")
- return
- }
-
- result.cjslr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client JobScheduleClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/jobschedules"),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) ListResponder(resp *http.Response) (result CloudJobScheduleListResult, 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 JobScheduleClient) listNextResults(lastResults CloudJobScheduleListResult) (result CloudJobScheduleListResult, err error) {
- req, err := lastResults.cloudJobScheduleListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.JobScheduleClient", "listNextResults", 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.JobScheduleClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client JobScheduleClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobScheduleListResultIterator, err error) {
- result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// Patch updates the properties of the specified job schedule.
-//
-// jobScheduleID is the id of the job schedule to update. jobSchedulePatchParameter is the parameters for the
-// request. timeout is sets the maximum time that the server can spend processing the request, in seconds. The
-// default is 30 seconds. clientRequestID is caller generated request identity, in the form of a GUID with no
-// decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if
-// the server should return the client-request-id identifier in the response. ocpDate is the time the request was
-// issued. If not specified, this header will be automatically populated with the current system clock time.
-// ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag is an
-// exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only
-// if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the
-// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify
-// this header to perform the operation only if the resource has not been modified since the specified date/time.
-func (client JobScheduleClient) Patch(ctx context.Context, jobScheduleID string, jobSchedulePatchParameter JobSchedulePatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.PatchPreparer(ctx, jobScheduleID, jobSchedulePatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.PatchSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", resp, "Failure sending request")
- return
- }
-
- result, err = client.PatchResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", resp, "Failure responding to request")
- }
-
- return
-}
-
-// PatchPreparer prepares the Patch request.
-func (client JobScheduleClient) PatchPreparer(ctx context.Context, jobScheduleID string, jobSchedulePatchParameter JobSchedulePatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
- autorest.AsPatch(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters),
- autorest.WithJSON(jobSchedulePatchParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// PatchSender sends the Patch request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) PatchSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// PatchResponder handles the response to the Patch request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Terminate terminates a job schedule.
-//
-// jobScheduleID is the id of the job schedule to terminates. timeout is sets the maximum time that the server can
-// spend processing the request, in seconds. The default is 30 seconds. clientRequestID is caller generated request
-// identity, in the form of a GUID with no decoration such as curly braces e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified.
-// Specify this header to perform the operation only if the resource's ETag is an exact match as specified.
-// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag
-// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the
-// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform
-// the operation only if the resource has not been modified since the specified date/time.
-func (client JobScheduleClient) Terminate(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.TerminatePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.TerminateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", resp, "Failure sending request")
- return
- }
-
- result, err = client.TerminateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", resp, "Failure responding to request")
- }
-
- return
-}
-
-// TerminatePreparer prepares the Terminate request.
-func (client JobScheduleClient) TerminatePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}/terminate", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// TerminateSender sends the Terminate request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) TerminateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// TerminateResponder handles the response to the Terminate request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) TerminateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Update updates the properties of the specified job schedule.
-//
-// jobScheduleID is the id of the job schedule to update. jobScheduleUpdateParameter is the parameters for the
-// request. timeout is sets the maximum time that the server can spend processing the request, in seconds. The
-// default is 30 seconds. clientRequestID is caller generated request identity, in the form of a GUID with no
-// decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if
-// the server should return the client-request-id identifier in the response. ocpDate is the time the request was
-// issued. If not specified, this header will be automatically populated with the current system clock time.
-// ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag is an
-// exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only
-// if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the
-// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify
-// this header to perform the operation only if the resource has not been modified since the specified date/time.
-func (client JobScheduleClient) Update(ctx context.Context, jobScheduleID string, jobScheduleUpdateParameter JobScheduleUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: jobScheduleUpdateParameter,
- Constraints: []validation.Constraint{{Target: "jobScheduleUpdateParameter.Schedule", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.JobScheduleClient", "Update", err.Error())
- }
-
- req, err := client.UpdatePreparer(ctx, jobScheduleID, jobScheduleUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePreparer prepares the Update request.
-func (client JobScheduleClient) UpdatePreparer(ctx context.Context, jobScheduleID string, jobScheduleUpdateParameter JobScheduleUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters),
- autorest.WithJSON(jobScheduleUpdateParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSender sends the Update request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) UpdateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateResponder handles the response to the Update request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff --git a/services/batch/2015-12-01.2.2/batch/models.go b/services/batch/2015-12-01.2.2/batch/models.go
deleted file mode 100644
index 17ed12b8f2fc..000000000000
--- a/services/batch/2015-12-01.2.2/batch/models.go
+++ /dev/null
@@ -1,2647 +0,0 @@
-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/date"
- "github.com/Azure/go-autorest/autorest/to"
- "io"
- "net/http"
-)
-
-// AllocationState enumerates the values for allocation state.
-type AllocationState string
-
-const (
- // Resizing ...
- Resizing AllocationState = "resizing"
- // Steady ...
- Steady AllocationState = "steady"
- // Stopping ...
- Stopping AllocationState = "stopping"
-)
-
-// CertificateFormat enumerates the values for certificate format.
-type CertificateFormat string
-
-const (
- // Cer ...
- Cer CertificateFormat = "cer"
- // Pfx ...
- Pfx CertificateFormat = "pfx"
- // Unmapped ...
- Unmapped CertificateFormat = "unmapped"
-)
-
-// CertificateState enumerates the values for certificate state.
-type CertificateState string
-
-const (
- // Active ...
- Active CertificateState = "active"
- // Deletefailed ...
- Deletefailed CertificateState = "deletefailed"
- // Deleting ...
- Deleting CertificateState = "deleting"
-)
-
-// CertificateStoreLocation enumerates the values for certificate store location.
-type CertificateStoreLocation string
-
-const (
- // CertificateStoreLocationCurrentuser ...
- CertificateStoreLocationCurrentuser CertificateStoreLocation = "currentuser"
- // CertificateStoreLocationLocalmachine ...
- CertificateStoreLocationLocalmachine CertificateStoreLocation = "localmachine"
- // CertificateStoreLocationUnmapped ...
- CertificateStoreLocationUnmapped CertificateStoreLocation = "unmapped"
-)
-
-// ComputeNodeDeallocationOption enumerates the values for compute node deallocation option.
-type ComputeNodeDeallocationOption string
-
-const (
- // Requeue ...
- Requeue ComputeNodeDeallocationOption = "requeue"
- // Retaineddata ...
- Retaineddata ComputeNodeDeallocationOption = "retaineddata"
- // Taskcompletion ...
- Taskcompletion ComputeNodeDeallocationOption = "taskcompletion"
- // Terminate ...
- Terminate ComputeNodeDeallocationOption = "terminate"
-)
-
-// ComputeNodeFillType enumerates the values for compute node fill type.
-type ComputeNodeFillType string
-
-const (
- // ComputeNodeFillTypePack ...
- ComputeNodeFillTypePack ComputeNodeFillType = "pack"
- // ComputeNodeFillTypeSpread ...
- ComputeNodeFillTypeSpread ComputeNodeFillType = "spread"
- // ComputeNodeFillTypeUnmapped ...
- ComputeNodeFillTypeUnmapped ComputeNodeFillType = "unmapped"
-)
-
-// ComputeNodeRebootOption enumerates the values for compute node reboot option.
-type ComputeNodeRebootOption string
-
-const (
- // ComputeNodeRebootOptionRequeue ...
- ComputeNodeRebootOptionRequeue ComputeNodeRebootOption = "requeue"
- // ComputeNodeRebootOptionRetaineddata ...
- ComputeNodeRebootOptionRetaineddata ComputeNodeRebootOption = "retaineddata"
- // ComputeNodeRebootOptionTaskcompletion ...
- ComputeNodeRebootOptionTaskcompletion ComputeNodeRebootOption = "taskcompletion"
- // ComputeNodeRebootOptionTerminate ...
- ComputeNodeRebootOptionTerminate ComputeNodeRebootOption = "terminate"
-)
-
-// ComputeNodeReimageOption enumerates the values for compute node reimage option.
-type ComputeNodeReimageOption string
-
-const (
- // ComputeNodeReimageOptionRequeue ...
- ComputeNodeReimageOptionRequeue ComputeNodeReimageOption = "requeue"
- // ComputeNodeReimageOptionRetaineddata ...
- ComputeNodeReimageOptionRetaineddata ComputeNodeReimageOption = "retaineddata"
- // ComputeNodeReimageOptionTaskcompletion ...
- ComputeNodeReimageOptionTaskcompletion ComputeNodeReimageOption = "taskcompletion"
- // ComputeNodeReimageOptionTerminate ...
- ComputeNodeReimageOptionTerminate ComputeNodeReimageOption = "terminate"
-)
-
-// ComputeNodeState enumerates the values for compute node state.
-type ComputeNodeState string
-
-const (
- // Creating ...
- Creating ComputeNodeState = "creating"
- // Idle ...
- Idle ComputeNodeState = "idle"
- // Leavingpool ...
- Leavingpool ComputeNodeState = "leavingpool"
- // Offline ...
- Offline ComputeNodeState = "offline"
- // Rebooting ...
- Rebooting ComputeNodeState = "rebooting"
- // Reimaging ...
- Reimaging ComputeNodeState = "reimaging"
- // Running ...
- Running ComputeNodeState = "running"
- // Starting ...
- Starting ComputeNodeState = "starting"
- // Starttaskfailed ...
- Starttaskfailed ComputeNodeState = "starttaskfailed"
- // Unknown ...
- Unknown ComputeNodeState = "unknown"
- // Unusable ...
- Unusable ComputeNodeState = "unusable"
- // Waitingforstarttask ...
- Waitingforstarttask ComputeNodeState = "waitingforstarttask"
-)
-
-// DisableComputeNodeSchedulingOption enumerates the values for disable compute node scheduling option.
-type DisableComputeNodeSchedulingOption string
-
-const (
- // DisableComputeNodeSchedulingOptionRequeue ...
- DisableComputeNodeSchedulingOptionRequeue DisableComputeNodeSchedulingOption = "requeue"
- // DisableComputeNodeSchedulingOptionTaskcompletion ...
- DisableComputeNodeSchedulingOptionTaskcompletion DisableComputeNodeSchedulingOption = "taskcompletion"
- // DisableComputeNodeSchedulingOptionTerminate ...
- DisableComputeNodeSchedulingOptionTerminate DisableComputeNodeSchedulingOption = "terminate"
-)
-
-// DisableJobOption enumerates the values for disable job option.
-type DisableJobOption string
-
-const (
- // DisableJobOptionRequeue ...
- DisableJobOptionRequeue DisableJobOption = "requeue"
- // DisableJobOptionTerminate ...
- DisableJobOptionTerminate DisableJobOption = "terminate"
- // DisableJobOptionWait ...
- DisableJobOptionWait DisableJobOption = "wait"
-)
-
-// JobPreparationTaskState enumerates the values for job preparation task state.
-type JobPreparationTaskState string
-
-const (
- // JobPreparationTaskStateCompleted ...
- JobPreparationTaskStateCompleted JobPreparationTaskState = "completed"
- // JobPreparationTaskStateRunning ...
- JobPreparationTaskStateRunning JobPreparationTaskState = "running"
-)
-
-// JobReleaseTaskState enumerates the values for job release task state.
-type JobReleaseTaskState string
-
-const (
- // JobReleaseTaskStateCompleted ...
- JobReleaseTaskStateCompleted JobReleaseTaskState = "completed"
- // JobReleaseTaskStateRunning ...
- JobReleaseTaskStateRunning JobReleaseTaskState = "running"
-)
-
-// JobScheduleState enumerates the values for job schedule state.
-type JobScheduleState string
-
-const (
- // JobScheduleStateActive ...
- JobScheduleStateActive JobScheduleState = "active"
- // JobScheduleStateCompleted ...
- JobScheduleStateCompleted JobScheduleState = "completed"
- // JobScheduleStateDeleting ...
- JobScheduleStateDeleting JobScheduleState = "deleting"
- // JobScheduleStateDisabled ...
- JobScheduleStateDisabled JobScheduleState = "disabled"
- // JobScheduleStateTerminating ...
- JobScheduleStateTerminating JobScheduleState = "terminating"
-)
-
-// JobState enumerates the values for job state.
-type JobState string
-
-const (
- // JobStateActive ...
- JobStateActive JobState = "active"
- // JobStateCompleted ...
- JobStateCompleted JobState = "completed"
- // JobStateDeleting ...
- JobStateDeleting JobState = "deleting"
- // JobStateDisabled ...
- JobStateDisabled JobState = "disabled"
- // JobStateDisabling ...
- JobStateDisabling JobState = "disabling"
- // JobStateEnabling ...
- JobStateEnabling JobState = "enabling"
- // JobStateTerminating ...
- JobStateTerminating JobState = "terminating"
-)
-
-// PoolLifetimeOption enumerates the values for pool lifetime option.
-type PoolLifetimeOption string
-
-const (
- // PoolLifetimeOptionJob ...
- PoolLifetimeOptionJob PoolLifetimeOption = "job"
- // PoolLifetimeOptionJobschedule ...
- PoolLifetimeOptionJobschedule PoolLifetimeOption = "jobschedule"
- // PoolLifetimeOptionUnmapped ...
- PoolLifetimeOptionUnmapped PoolLifetimeOption = "unmapped"
-)
-
-// PoolState enumerates the values for pool state.
-type PoolState string
-
-const (
- // PoolStateActive ...
- PoolStateActive PoolState = "active"
- // PoolStateDeleting ...
- PoolStateDeleting PoolState = "deleting"
- // PoolStateUpgrading ...
- PoolStateUpgrading PoolState = "upgrading"
-)
-
-// SchedulingErrorCategory enumerates the values for scheduling error category.
-type SchedulingErrorCategory string
-
-const (
- // SchedulingErrorCategoryServererror ...
- SchedulingErrorCategoryServererror SchedulingErrorCategory = "servererror"
- // SchedulingErrorCategoryUnmapped ...
- SchedulingErrorCategoryUnmapped SchedulingErrorCategory = "unmapped"
- // SchedulingErrorCategoryUsererror ...
- SchedulingErrorCategoryUsererror SchedulingErrorCategory = "usererror"
-)
-
-// SchedulingState enumerates the values for scheduling state.
-type SchedulingState string
-
-const (
- // Disabled ...
- Disabled SchedulingState = "disabled"
- // Enabled ...
- Enabled SchedulingState = "enabled"
-)
-
-// StartTaskState enumerates the values for start task state.
-type StartTaskState string
-
-const (
- // StartTaskStateCompleted ...
- StartTaskStateCompleted StartTaskState = "completed"
- // StartTaskStateRunning ...
- StartTaskStateRunning StartTaskState = "running"
-)
-
-// TaskState enumerates the values for task state.
-type TaskState string
-
-const (
- // TaskStateActive ...
- TaskStateActive TaskState = "active"
- // TaskStateCompleted ...
- TaskStateCompleted TaskState = "completed"
- // TaskStatePreparing ...
- TaskStatePreparing TaskState = "preparing"
- // TaskStateRunning ...
- TaskStateRunning TaskState = "running"
-)
-
-// AffinityInformation a locality hint that can be used by the Batch service to select a compute node on which to
-// start a task.
-type AffinityInformation struct {
- // AffinityID - Gets or sets an opaque string representing the location of a compute node or a task that has run previously. You can pass the AffinityId of a compute node or task to indicate that this task needs to be placed close to the node or task.
- AffinityID *string `json:"affinityId,omitempty"`
-}
-
-// ApplicationListResult response to a ApplicationOperations.List request.
-type ApplicationListResult struct {
- autorest.Response `json:"-"`
- // Value - Gets or sets the list of applications available in the account.
- Value *[]ApplicationSummary `json:"value,omitempty"`
- // OdataNextLink - Gets or sets the URL to get the next set of results.
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// ApplicationListResultIterator provides access to a complete listing of ApplicationSummary values.
-type ApplicationListResultIterator struct {
- i int
- page ApplicationListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *ApplicationListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter ApplicationListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter ApplicationListResultIterator) Response() ApplicationListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter ApplicationListResultIterator) Value() ApplicationSummary {
- if !iter.page.NotDone() {
- return ApplicationSummary{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (alr ApplicationListResult) IsEmpty() bool {
- return alr.Value == nil || len(*alr.Value) == 0
-}
-
-// applicationListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (alr ApplicationListResult) applicationListResultPreparer() (*http.Request, error) {
- if alr.OdataNextLink == nil || len(to.String(alr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(alr.OdataNextLink)))
-}
-
-// ApplicationListResultPage contains a page of ApplicationSummary values.
-type ApplicationListResultPage struct {
- fn func(ApplicationListResult) (ApplicationListResult, error)
- alr ApplicationListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *ApplicationListResultPage) Next() error {
- next, err := page.fn(page.alr)
- if err != nil {
- return err
- }
- page.alr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page ApplicationListResultPage) NotDone() bool {
- return !page.alr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page ApplicationListResultPage) Response() ApplicationListResult {
- return page.alr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page ApplicationListResultPage) Values() []ApplicationSummary {
- if page.alr.IsEmpty() {
- return nil
- }
- return *page.alr.Value
-}
-
-// ApplicationPackageReference a reference to an application package to be installed on compute nodes in a pool.
-type ApplicationPackageReference struct {
- // ApplicationID - Gets or sets the application package id.
- ApplicationID *string `json:"applicationId,omitempty"`
- // Version - Gets or sets the application package version. If not specified, the default is used.
- Version *string `json:"version,omitempty"`
-}
-
-// ApplicationSummary contains information about an application in an Azure Batch account.
-type ApplicationSummary struct {
- autorest.Response `json:"-"`
- // ID - Gets or sets a string that uniquely identifies the application within the account.
- ID *string `json:"id,omitempty"`
- // DisplayName - Gets or sets the display name for the application.
- DisplayName *string `json:"displayName,omitempty"`
- Versions *[]string `json:"versions,omitempty"`
-}
-
-// AutoPoolSpecification specifies characteristics for a temporary 'auto pool'. The Batch service will create this
-// auto pool, run all the tasks for the job on it, and will delete the pool once the job has completed.
-type AutoPoolSpecification struct {
- // AutoPoolIDPrefix - Gets or sets a prefix to be added to the unique identifier when a pool is automatically created. The prefix can be up to 20 characters long.
- AutoPoolIDPrefix *string `json:"autoPoolIdPrefix,omitempty"`
- // PoolLifetimeOption - Gets or sets the minimum lifetime of created auto pools, and how multiple jobs on a schedule are assigned to pools. Possible values include: 'PoolLifetimeOptionJobschedule', 'PoolLifetimeOptionJob', 'PoolLifetimeOptionUnmapped'
- PoolLifetimeOption PoolLifetimeOption `json:"poolLifetimeOption,omitempty"`
- // KeepAlive - Gets or sets whether to keep an auto pool alive after its lifetime expires.
- KeepAlive *bool `json:"keepAlive,omitempty"`
- // Pool - Gets or sets the pool specification for the auto pool.
- Pool *PoolSpecification `json:"pool,omitempty"`
-}
-
-// AutoScaleRun the results and errors from an execution of a pool autoscale formula.
-type AutoScaleRun struct {
- autorest.Response `json:"-"`
- // Timestamp - Gets or sets the time at which the autoscale formula was last evaluated.
- Timestamp *date.Time `json:"timestamp,omitempty"`
- // Results - Gets or sets the final values of all variables used in the evaluation of the autoscale formula. Each variable value is returned in the form $variable=value, and variables are separated by semicolons.
- Results *string `json:"results,omitempty"`
- // Error - Gets or sets details of the error encountered evaluating the autoscale formula on the pool, if the evaluation was unsuccessful.
- Error *AutoScaleRunError `json:"error,omitempty"`
-}
-
-// AutoScaleRunError an error that occurred when executing or evaluating a pool autoscale formula.
-type AutoScaleRunError struct {
- // Code - Gets or sets an identifier for the autoscale error. Codes are invariant and are intended to be consumed programmatically.
- Code *string `json:"code,omitempty"`
- // Message - Gets or sets a message describing the autoscale error, intended to be suitable for display in a user interface.
- Message *string `json:"message,omitempty"`
- // Values - Gets or sets a list of additional error details related to the autoscale error.
- Values *[]NameValuePair `json:"values,omitempty"`
-}
-
-// Certificate a certificate that can be installed on compute nodes and can be used to authenticate operations on
-// the machine.
-type Certificate struct {
- autorest.Response `json:"-"`
- // Thumbprint - Get or sets the X.509 thumbprint of the certificate. This is a sequence of up to 40 hex digits (it may include spaces but these are removed).
- Thumbprint *string `json:"thumbprint,omitempty"`
- // ThumbprintAlgorithm - Gets or sets the algorithm used to derive the thumbprint. This must be sha1.
- ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"`
- // URL - Gets or sets the URL of the certificate.
- URL *string `json:"url,omitempty"`
- // State - Gets or sets the current state of the certificate. Possible values include: 'Active', 'Deleting', 'Deletefailed'
- State CertificateState `json:"state,omitempty"`
- // StateTransitionTime - Gets or sets the time at which the certificate entered its current state.
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // PreviousState - Gets or sets the previous state of the certificate. This property is not set if the certificate is in its initial Active state. Possible values include: 'Active', 'Deleting', 'Deletefailed'
- PreviousState CertificateState `json:"previousState,omitempty"`
- // PreviousStateTransitionTime - Gets or sets the time at which the certificate entered its previous state. This property is not set if the certificate is in its initial Active state.
- PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"`
- // PublicData - Gets or sets the public part of the certificate as a base-64 encoded .cer file.
- PublicData *string `json:"publicData,omitempty"`
- // DeleteCertificateError - Gets or sets the error that occurred on the last attempt to delete this certificate. This property is set only if the certificate is in the deletefailed state.
- DeleteCertificateError *DeleteCertificateError `json:"deleteCertificateError,omitempty"`
-}
-
-// CertificateAddParameter a certificate that can be installed on compute nodes and can be used to authenticate
-// operations on the machine.
-type CertificateAddParameter struct {
- // Thumbprint - Get or sets the X.509 thumbprint of the certificate. This is a sequence of up to 40 hex digits (it may include spaces but these are removed).
- Thumbprint *string `json:"thumbprint,omitempty"`
- // ThumbprintAlgorithm - Gets or sets the algorithm used to derive the thumbprint. This must be sha1.
- ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"`
- // Data - Gets or sets the base64-encoded contents of the .pfx file containing the certificate. The maximum size is 10KB. This property is not populated by the Get Certificate operation.
- Data *string `json:"data,omitempty"`
- // CertificateFormat - Gets or sets the format of the certificate data. This must be pfx. Possible values include: 'Pfx', 'Cer', 'Unmapped'
- CertificateFormat CertificateFormat `json:"certificateFormat,omitempty"`
- // Password - Gets or sets the password to access the certificate's private key. This property is not populated by the Get Certificate operation.
- Password *string `json:"password,omitempty"`
-}
-
-// CertificateListResult response to a CertificateOperations.List request.
-type CertificateListResult struct {
- autorest.Response `json:"-"`
- // Value - Gets or sets the list of certificates.
- Value *[]Certificate `json:"value,omitempty"`
- // OdataNextLink - Gets or sets the URL to get the next set of results.
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CertificateListResultIterator provides access to a complete listing of Certificate values.
-type CertificateListResultIterator struct {
- i int
- page CertificateListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CertificateListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CertificateListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CertificateListResultIterator) Response() CertificateListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CertificateListResultIterator) Value() Certificate {
- if !iter.page.NotDone() {
- return Certificate{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (clr CertificateListResult) IsEmpty() bool {
- return clr.Value == nil || len(*clr.Value) == 0
-}
-
-// certificateListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (clr CertificateListResult) certificateListResultPreparer() (*http.Request, error) {
- if clr.OdataNextLink == nil || len(to.String(clr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(clr.OdataNextLink)))
-}
-
-// CertificateListResultPage contains a page of Certificate values.
-type CertificateListResultPage struct {
- fn func(CertificateListResult) (CertificateListResult, error)
- clr CertificateListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CertificateListResultPage) Next() error {
- next, err := page.fn(page.clr)
- if err != nil {
- return err
- }
- page.clr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CertificateListResultPage) NotDone() bool {
- return !page.clr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CertificateListResultPage) Response() CertificateListResult {
- return page.clr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CertificateListResultPage) Values() []Certificate {
- if page.clr.IsEmpty() {
- return nil
- }
- return *page.clr.Value
-}
-
-// CertificateReference a reference to a certificate to be installed on compute nodes in a pool.
-type CertificateReference struct {
- // Thumbprint - Gets or sets the thumbprint of the certificate.
- Thumbprint *string `json:"thumbprint,omitempty"`
- // ThumbprintAlgorithm - Gets or sets the algorithm with which the thumbprint is associated. This must be sha1.
- ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"`
- // StoreLocation - Gets or sets the location of the certificate store on the compute node into which to install the certificate. The default value is CurrentUser. Possible values include: 'CertificateStoreLocationCurrentuser', 'CertificateStoreLocationLocalmachine', 'CertificateStoreLocationUnmapped'
- StoreLocation CertificateStoreLocation `json:"storeLocation,omitempty"`
- // StoreName - Gets or sets the name of the certificate store on the compute node into which to install the certificate. The default value is My.
- StoreName *string `json:"storeName,omitempty"`
- // Visibility - Gets or sets which user accounts on the compute node should have access to the private data of the certificate. This may be any subset of the values 'starttask', 'task' and 'rdp', separated by commas. The default is all accounts, corresponding to the string 'starttask,task,rdp'.
- Visibility *string `json:"visibility,omitempty"`
-}
-
-// CloudJob an Azure Batch job.
-type CloudJob struct {
- autorest.Response `json:"-"`
- // ID - Gets or sets a string that uniquely identifies the job within the account. The id can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. It is common to use a GUID for the id.
- ID *string `json:"id,omitempty"`
- // DisplayName - Gets or sets the display name for the job.
- DisplayName *string `json:"displayName,omitempty"`
- // UsesTaskDependencies - Gets or sets the flag that determines if this job will use tasks with dependencies.
- UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"`
- // URL - Gets or sets the URL of the job.
- URL *string `json:"url,omitempty"`
- // ETag - Gets or sets the ETag of the job.
- ETag *string `json:"eTag,omitempty"`
- // LastModified - Gets or sets the last modified time of the job.
- LastModified *date.Time `json:"lastModified,omitempty"`
- // CreationTime - Gets or sets the creation time of the job.
- CreationTime *date.Time `json:"creationTime,omitempty"`
- // State - Gets or sets the current state of the job. Possible values include: 'JobStateActive', 'JobStateDisabling', 'JobStateDisabled', 'JobStateEnabling', 'JobStateTerminating', 'JobStateCompleted', 'JobStateDeleting'
- State JobState `json:"state,omitempty"`
- // StateTransitionTime - Gets or sets the time at which the job entered its current state.
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // PreviousState - Gets or sets the previous state of the job. This property is not set if the job is in its initial Active state. Possible values include: 'JobStateActive', 'JobStateDisabling', 'JobStateDisabled', 'JobStateEnabling', 'JobStateTerminating', 'JobStateCompleted', 'JobStateDeleting'
- PreviousState JobState `json:"previousState,omitempty"`
- // PreviousStateTransitionTime - Gets or sets the time at which the job entered its previous state. This property is not set if the job is in its initial Active state.
- PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"`
- // Priority - Gets or sets the priority of the job. Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0.
- Priority *int32 `json:"priority,omitempty"`
- // Constraints - Gets or sets the execution constraints for the job.
- Constraints *JobConstraints `json:"constraints,omitempty"`
- // JobManagerTask - Gets or sets details of a Job Manager task to be launched when the job is started.
- JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"`
- // JobPreparationTask - Gets or sets the Job Preparation task.
- JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"`
- // JobReleaseTask - Gets or sets the Job Release task.
- JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"`
- // CommonEnvironmentSettings - Gets or sets the list of common environment variable settings. These environment variables are set for all tasks in the job (including the Job Manager, Job Preparation and Job Release tasks).
- CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"`
- // PoolInfo - Gets or sets the pool on which the Batch service runs the job’s tasks.
- PoolInfo *PoolInformation `json:"poolInfo,omitempty"`
- // Metadata - Gets or sets a list of name-value pairs associated with the job as metadata.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
- // ExecutionInfo - Gets or sets the execution information for the job.
- ExecutionInfo *JobExecutionInformation `json:"executionInfo,omitempty"`
- // Stats - Gets or sets resource usage statistics for the entire lifetime of the job.
- Stats *JobStatistics `json:"stats,omitempty"`
-}
-
-// CloudJobListPreparationAndReleaseTaskStatusResult response to a
-// CloudJobOperations.ListPreparationAndReleaseTaskStatus request.
-type CloudJobListPreparationAndReleaseTaskStatusResult struct {
- autorest.Response `json:"-"`
- // Value - Gets or sets a list of Job Preparation and Job Release task execution information.
- Value *[]JobPreparationAndReleaseTaskExecutionInformation `json:"value,omitempty"`
- // OdataNextLink - Gets or sets the URL to get the next set of results.
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CloudJobListPreparationAndReleaseTaskStatusResultIterator provides access to a complete listing of
-// JobPreparationAndReleaseTaskExecutionInformation values.
-type CloudJobListPreparationAndReleaseTaskStatusResultIterator struct {
- i int
- page CloudJobListPreparationAndReleaseTaskStatusResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CloudJobListPreparationAndReleaseTaskStatusResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CloudJobListPreparationAndReleaseTaskStatusResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CloudJobListPreparationAndReleaseTaskStatusResultIterator) Response() CloudJobListPreparationAndReleaseTaskStatusResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CloudJobListPreparationAndReleaseTaskStatusResultIterator) Value() JobPreparationAndReleaseTaskExecutionInformation {
- if !iter.page.NotDone() {
- return JobPreparationAndReleaseTaskExecutionInformation{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult) IsEmpty() bool {
- return cjlpartsr.Value == nil || len(*cjlpartsr.Value) == 0
-}
-
-// cloudJobListPreparationAndReleaseTaskStatusResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult) cloudJobListPreparationAndReleaseTaskStatusResultPreparer() (*http.Request, error) {
- if cjlpartsr.OdataNextLink == nil || len(to.String(cjlpartsr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(cjlpartsr.OdataNextLink)))
-}
-
-// CloudJobListPreparationAndReleaseTaskStatusResultPage contains a page of
-// JobPreparationAndReleaseTaskExecutionInformation values.
-type CloudJobListPreparationAndReleaseTaskStatusResultPage struct {
- fn func(CloudJobListPreparationAndReleaseTaskStatusResult) (CloudJobListPreparationAndReleaseTaskStatusResult, error)
- cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CloudJobListPreparationAndReleaseTaskStatusResultPage) Next() error {
- next, err := page.fn(page.cjlpartsr)
- if err != nil {
- return err
- }
- page.cjlpartsr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) NotDone() bool {
- return !page.cjlpartsr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) Response() CloudJobListPreparationAndReleaseTaskStatusResult {
- return page.cjlpartsr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) Values() []JobPreparationAndReleaseTaskExecutionInformation {
- if page.cjlpartsr.IsEmpty() {
- return nil
- }
- return *page.cjlpartsr.Value
-}
-
-// CloudJobListResult response to a CloudJobOperations.List or ListFromJobSchedule request.
-type CloudJobListResult struct {
- autorest.Response `json:"-"`
- // Value - Gets or sets the list of jobs.
- Value *[]CloudJob `json:"value,omitempty"`
- // OdataNextLink - Gets or sets the URL to get the next set of results.
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CloudJobListResultIterator provides access to a complete listing of CloudJob values.
-type CloudJobListResultIterator struct {
- i int
- page CloudJobListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CloudJobListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CloudJobListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CloudJobListResultIterator) Response() CloudJobListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CloudJobListResultIterator) Value() CloudJob {
- if !iter.page.NotDone() {
- return CloudJob{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (cjlr CloudJobListResult) IsEmpty() bool {
- return cjlr.Value == nil || len(*cjlr.Value) == 0
-}
-
-// cloudJobListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (cjlr CloudJobListResult) cloudJobListResultPreparer() (*http.Request, error) {
- if cjlr.OdataNextLink == nil || len(to.String(cjlr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(cjlr.OdataNextLink)))
-}
-
-// CloudJobListResultPage contains a page of CloudJob values.
-type CloudJobListResultPage struct {
- fn func(CloudJobListResult) (CloudJobListResult, error)
- cjlr CloudJobListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CloudJobListResultPage) Next() error {
- next, err := page.fn(page.cjlr)
- if err != nil {
- return err
- }
- page.cjlr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CloudJobListResultPage) NotDone() bool {
- return !page.cjlr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CloudJobListResultPage) Response() CloudJobListResult {
- return page.cjlr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CloudJobListResultPage) Values() []CloudJob {
- if page.cjlr.IsEmpty() {
- return nil
- }
- return *page.cjlr.Value
-}
-
-// CloudJobSchedule a job schedule that allows recurring jobs by specifying when to run jobs and a specification
-// used to create each job.
-type CloudJobSchedule struct {
- autorest.Response `json:"-"`
- // ID - Gets or sets a string that uniquely identifies the schedule within the account. A GUID is recommended.
- ID *string `json:"id,omitempty"`
- // DisplayName - Gets or sets the display name for the schedule.
- DisplayName *string `json:"displayName,omitempty"`
- // URL - Gets or sets the URL of the job schedule.
- URL *string `json:"url,omitempty"`
- // ETag - Gets or sets the ETag of the job schedule.
- ETag *string `json:"eTag,omitempty"`
- // LastModified - Gets or sets the last modified time of the job schedule.
- LastModified *date.Time `json:"lastModified,omitempty"`
- // CreationTime - Gets or sets the creation time of the job schedule.
- CreationTime *date.Time `json:"creationTime,omitempty"`
- // State - Gets or sets the current state of the job schedule. Possible values include: 'JobScheduleStateActive', 'JobScheduleStateCompleted', 'JobScheduleStateDisabled', 'JobScheduleStateTerminating', 'JobScheduleStateDeleting'
- State JobScheduleState `json:"state,omitempty"`
- // StateTransitionTime - Gets or sets the time at which the job schedule entered the current state.
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // PreviousState - Gets or sets the previous state of the job schedule. Possible values include: 'JobScheduleStateActive', 'JobScheduleStateCompleted', 'JobScheduleStateDisabled', 'JobScheduleStateTerminating', 'JobScheduleStateDeleting'
- PreviousState JobScheduleState `json:"previousState,omitempty"`
- // PreviousStateTransitionTime - Gets or sets the time at which the job schedule entered its previous state.
- PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"`
- // Schedule - Gets or sets the schedule according to which jobs will be created.
- Schedule *Schedule `json:"schedule,omitempty"`
- // JobSpecification - Gets or sets the details of the jobs to be created on this schedule.
- JobSpecification *JobSpecification `json:"jobSpecification,omitempty"`
- // ExecutionInfo - Gets or sets information about jobs that have been and will be run under this schedule.
- ExecutionInfo *JobScheduleExecutionInformation `json:"executionInfo,omitempty"`
- // Metadata - Gets or sets a list of name-value pairs associated with the schedule as metadata.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
- // Stats - Gets or sets the lifetime resource usage statistics for the job schedule.
- Stats *JobScheduleStatistics `json:"stats,omitempty"`
-}
-
-// CloudJobScheduleListResult response to a CloudJobScheduleOperations.List request.
-type CloudJobScheduleListResult struct {
- autorest.Response `json:"-"`
- // Value - Gets or sets the list of job schedules.
- Value *[]CloudJobSchedule `json:"value,omitempty"`
- // OdataNextLink - Gets or sets the URL to get the next set of results.
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CloudJobScheduleListResultIterator provides access to a complete listing of CloudJobSchedule values.
-type CloudJobScheduleListResultIterator struct {
- i int
- page CloudJobScheduleListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CloudJobScheduleListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CloudJobScheduleListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CloudJobScheduleListResultIterator) Response() CloudJobScheduleListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CloudJobScheduleListResultIterator) Value() CloudJobSchedule {
- if !iter.page.NotDone() {
- return CloudJobSchedule{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (cjslr CloudJobScheduleListResult) IsEmpty() bool {
- return cjslr.Value == nil || len(*cjslr.Value) == 0
-}
-
-// cloudJobScheduleListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (cjslr CloudJobScheduleListResult) cloudJobScheduleListResultPreparer() (*http.Request, error) {
- if cjslr.OdataNextLink == nil || len(to.String(cjslr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(cjslr.OdataNextLink)))
-}
-
-// CloudJobScheduleListResultPage contains a page of CloudJobSchedule values.
-type CloudJobScheduleListResultPage struct {
- fn func(CloudJobScheduleListResult) (CloudJobScheduleListResult, error)
- cjslr CloudJobScheduleListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CloudJobScheduleListResultPage) Next() error {
- next, err := page.fn(page.cjslr)
- if err != nil {
- return err
- }
- page.cjslr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CloudJobScheduleListResultPage) NotDone() bool {
- return !page.cjslr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CloudJobScheduleListResultPage) Response() CloudJobScheduleListResult {
- return page.cjslr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CloudJobScheduleListResultPage) Values() []CloudJobSchedule {
- if page.cjslr.IsEmpty() {
- return nil
- }
- return *page.cjslr.Value
-}
-
-// CloudPool a pool in the Azure Batch service.
-type CloudPool struct {
- autorest.Response `json:"-"`
- // ID - Gets or sets a string that uniquely identifies the pool within the account. The id can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters.
- ID *string `json:"id,omitempty"`
- // DisplayName - Gets or sets the display name for the pool.
- DisplayName *string `json:"displayName,omitempty"`
- // URL - Gets or sets the URL of the pool.
- URL *string `json:"url,omitempty"`
- // ETag - Gets or sets the ETag of the pool.
- ETag *string `json:"eTag,omitempty"`
- // LastModified - Gets or sets the last modified time of the pool.
- LastModified *date.Time `json:"lastModified,omitempty"`
- // CreationTime - Gets or sets the creation time of the pool.
- CreationTime *date.Time `json:"creationTime,omitempty"`
- // State - Gets or sets the current state of the pool. Possible values include: 'PoolStateActive', 'PoolStateDeleting', 'PoolStateUpgrading'
- State PoolState `json:"state,omitempty"`
- // StateTransitionTime - Gets or sets the time at which the pool entered its current state.
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // AllocationState - Gets or sets whether the pool is resizing. Possible values include: 'Steady', 'Resizing', 'Stopping'
- AllocationState AllocationState `json:"allocationState,omitempty"`
- // AllocationStateTransitionTime - Gets or sets the time at which the pool entered its current allocation state.
- AllocationStateTransitionTime *date.Time `json:"allocationStateTransitionTime,omitempty"`
- // VMSize - Gets or sets the size of virtual machines in the pool. All VMs in a pool are the same size.
- VMSize *string `json:"vmSize,omitempty"`
- // OsFamily - Gets or sets the Azure Guest OS family to be installed on the virtual machines in the pool.
- OsFamily *string `json:"osFamily,omitempty"`
- // TargetOSVersion - Gets or sets the Azure Guest OS version to be installed on the virtual machines in the pool. The default value is * which specifies the latest operating system version for the specified family.
- TargetOSVersion *string `json:"targetOSVersion,omitempty"`
- // CurrentOSVersion - Gets or sets the Azure Guest OS Version currently installed on the virtual machines in the pool. This may differ from TargetOSVersion if the pool state is Upgrading.
- CurrentOSVersion *string `json:"currentOSVersion,omitempty"`
- // ResizeTimeout - Gets or sets the timeout for allocation of compute nodes to the pool. In a Get Pool operation, this is the timeout for the most recent resize operation. The default value is 10 minutes.
- ResizeTimeout *string `json:"resizeTimeout,omitempty"`
- // ResizeError - Gets or sets details of any error encountered while performing the last resize on the pool. This property is set only if an error occurred during the last pool resize, and only when the pool AllocationState is Steady.
- ResizeError *ResizeError `json:"resizeError,omitempty"`
- // CurrentDedicated - Gets or sets the number of compute nodes currently in the pool.
- CurrentDedicated *int32 `json:"currentDedicated,omitempty"`
- // TargetDedicated - Gets or sets the desired number of compute nodes in the pool. This property must have the default value if EnableAutoScale is true. It is required if EnableAutoScale is false.
- TargetDedicated *int32 `json:"targetDedicated,omitempty"`
- // EnableAutoScale - Gets or sets whether the pool size should automatically adjust over time. If true, the AutoScaleFormula property must be set. If false, the TargetDedicated property must be set.
- EnableAutoScale *bool `json:"enableAutoScale,omitempty"`
- // AutoScaleFormula - Gets or sets a formula for the desired number of compute nodes in the pool.
- AutoScaleFormula *string `json:"autoScaleFormula,omitempty"`
- // AutoScaleEvaluationInterval - Gets or sets a time interval for the desired AutoScale evaluation period in the pool.
- AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"`
- // AutoScaleRun - Gets or sets the results and errors from the last execution of the autoscale formula.
- AutoScaleRun *AutoScaleRun `json:"autoScaleRun,omitempty"`
- // EnableInterNodeCommunication - Gets or sets whether the pool permits direct communication between nodes.
- EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"`
- // StartTask - Gets or sets a task specified to run on each compute node as it joins the pool.
- StartTask *StartTask `json:"startTask,omitempty"`
- // CertificateReferences - Gets or sets the list of certificates to be installed on each compute node in the pool.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- // ApplicationPackageReferences - Gets or sets the list of application packages to be installed on each compute node in the pool.
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // MaxTasksPerNode - Gets or sets the maximum number of tasks that can run concurrently on a single compute node in the pool.
- MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"`
- // TaskSchedulingPolicy - Gets or sets how the Batch service distributes tasks between compute nodes in the pool.
- TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"`
- // Metadata - Gets or sets a list of name-value pairs associated with the pool as metadata.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
- // Stats - Gets or sets utilization and resource usage statistics for the entire lifetime of the pool.
- Stats *PoolStatistics `json:"stats,omitempty"`
-}
-
-// CloudPoolListResult response to a CloudPoolOperations.List request.
-type CloudPoolListResult struct {
- autorest.Response `json:"-"`
- // Value - Gets or sets the list of pools.
- Value *[]CloudPool `json:"value,omitempty"`
- // OdataNextLink - Gets or sets the URL to get the next set of results.
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CloudPoolListResultIterator provides access to a complete listing of CloudPool values.
-type CloudPoolListResultIterator struct {
- i int
- page CloudPoolListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CloudPoolListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CloudPoolListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CloudPoolListResultIterator) Response() CloudPoolListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CloudPoolListResultIterator) Value() CloudPool {
- if !iter.page.NotDone() {
- return CloudPool{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (cplr CloudPoolListResult) IsEmpty() bool {
- return cplr.Value == nil || len(*cplr.Value) == 0
-}
-
-// cloudPoolListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (cplr CloudPoolListResult) cloudPoolListResultPreparer() (*http.Request, error) {
- if cplr.OdataNextLink == nil || len(to.String(cplr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(cplr.OdataNextLink)))
-}
-
-// CloudPoolListResultPage contains a page of CloudPool values.
-type CloudPoolListResultPage struct {
- fn func(CloudPoolListResult) (CloudPoolListResult, error)
- cplr CloudPoolListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CloudPoolListResultPage) Next() error {
- next, err := page.fn(page.cplr)
- if err != nil {
- return err
- }
- page.cplr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CloudPoolListResultPage) NotDone() bool {
- return !page.cplr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CloudPoolListResultPage) Response() CloudPoolListResult {
- return page.cplr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CloudPoolListResultPage) Values() []CloudPool {
- if page.cplr.IsEmpty() {
- return nil
- }
- return *page.cplr.Value
-}
-
-// CloudTask an Azure Batch task.
-type CloudTask struct {
- autorest.Response `json:"-"`
- // ID - Gets or sets a string that uniquely identifies the task within the job. The id can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters.
- ID *string `json:"id,omitempty"`
- // DisplayName - Gets or sets a display name for the task.
- DisplayName *string `json:"displayName,omitempty"`
- // URL - Gets or sets the URL of the task.
- URL *string `json:"url,omitempty"`
- // ETag - Gets or sets the ETag of the task.
- ETag *string `json:"eTag,omitempty"`
- // LastModified - Gets or sets the last modified time of the task.
- LastModified *date.Time `json:"lastModified,omitempty"`
- // CreationTime - Gets or sets the creation time of the task.
- CreationTime *date.Time `json:"creationTime,omitempty"`
- // State - Gets or sets the current state of the task. Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted'
- State TaskState `json:"state,omitempty"`
- // StateTransitionTime - Gets or sets the time at which the task entered its current state.
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // PreviousState - Gets or sets the previous state of the task. This property is not set if the task is in its initial Active state. Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted'
- PreviousState TaskState `json:"previousState,omitempty"`
- // PreviousStateTransitionTime - Gets or sets the time at which the task entered its previous state. This property is not set if the task is in its initial Active state.
- PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"`
- // CommandLine - Gets or sets the command line of the task. For multi-instance tasks, the command line is executed on the primary subtask after all the subtasks have finished executing the coordianation command line.
- CommandLine *string `json:"commandLine,omitempty"`
- // ResourceFiles - Gets or sets a list of files that Batch will download to the compute node before running the command line. For multi-instance tasks, the resource files will only be downloaded to the compute node on which the primary subtask is executed.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- // EnvironmentSettings - Gets or sets a list of environment variable settings for the task.
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- // AffinityInfo - Gets or sets a locality hint that can be used by the Batch service to select a compute node on which to start the new task.
- AffinityInfo *AffinityInformation `json:"affinityInfo,omitempty"`
- // Constraints - Gets or sets the execution constraints that apply to this task.
- Constraints *TaskConstraints `json:"constraints,omitempty"`
- // RunElevated - Gets or sets whether to run the task in elevated mode.
- RunElevated *bool `json:"runElevated,omitempty"`
- // ExecutionInfo - Gets or sets information about the execution of the task.
- ExecutionInfo *TaskExecutionInformation `json:"executionInfo,omitempty"`
- // NodeInfo - Gets or sets information about the compute node on which the task ran.
- NodeInfo *ComputeNodeInformation `json:"nodeInfo,omitempty"`
- // MultiInstanceSettings - Gets or sets information about how to run the multi-instance task.
- MultiInstanceSettings *MultiInstanceSettings `json:"multiInstanceSettings,omitempty"`
- // Stats - Gets or sets resource usage statistics for the task.
- Stats *TaskStatistics `json:"stats,omitempty"`
- // DependsOn - Gets or sets any dependencies this task has.
- DependsOn *TaskDependencies `json:"dependsOn,omitempty"`
-}
-
-// CloudTaskListResult response to a CloudTaskOperations.List request.
-type CloudTaskListResult struct {
- autorest.Response `json:"-"`
- // Value - Gets or sets the list of tasks.
- Value *[]CloudTask `json:"value,omitempty"`
- // OdataNextLink - Gets or sets the URL to get the next set of results.
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CloudTaskListResultIterator provides access to a complete listing of CloudTask values.
-type CloudTaskListResultIterator struct {
- i int
- page CloudTaskListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CloudTaskListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CloudTaskListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CloudTaskListResultIterator) Response() CloudTaskListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CloudTaskListResultIterator) Value() CloudTask {
- if !iter.page.NotDone() {
- return CloudTask{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (ctlr CloudTaskListResult) IsEmpty() bool {
- return ctlr.Value == nil || len(*ctlr.Value) == 0
-}
-
-// cloudTaskListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (ctlr CloudTaskListResult) cloudTaskListResultPreparer() (*http.Request, error) {
- if ctlr.OdataNextLink == nil || len(to.String(ctlr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(ctlr.OdataNextLink)))
-}
-
-// CloudTaskListResultPage contains a page of CloudTask values.
-type CloudTaskListResultPage struct {
- fn func(CloudTaskListResult) (CloudTaskListResult, error)
- ctlr CloudTaskListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CloudTaskListResultPage) Next() error {
- next, err := page.fn(page.ctlr)
- if err != nil {
- return err
- }
- page.ctlr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CloudTaskListResultPage) NotDone() bool {
- return !page.ctlr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CloudTaskListResultPage) Response() CloudTaskListResult {
- return page.ctlr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CloudTaskListResultPage) Values() []CloudTask {
- if page.ctlr.IsEmpty() {
- return nil
- }
- return *page.ctlr.Value
-}
-
-// CloudTaskListSubtasksResult response to a CloudTaskOperations.ListSubtasks request.
-type CloudTaskListSubtasksResult struct {
- autorest.Response `json:"-"`
- // Value - Gets or sets the list of information of subtasks.
- Value *[]SubtaskInformation `json:"value,omitempty"`
-}
-
-// ComputeNode a compute node in the Batch service.
-type ComputeNode struct {
- autorest.Response `json:"-"`
- // ID - Gets or sets the id of the compute node.
- ID *string `json:"id,omitempty"`
- // URL - Gets or sets the URL of the compute node.
- URL *string `json:"url,omitempty"`
- // State - Gets or sets the current state of the compute node. Possible values include: 'Idle', 'Rebooting', 'Reimaging', 'Running', 'Unusable', 'Creating', 'Starting', 'Waitingforstarttask', 'Starttaskfailed', 'Unknown', 'Leavingpool', 'Offline'
- State ComputeNodeState `json:"state,omitempty"`
- // SchedulingState - Gets or sets whether the compute node should be available for task scheduling. Possible values include: 'Enabled', 'Disabled'
- SchedulingState SchedulingState `json:"schedulingState,omitempty"`
- // StateTransitionTime - Gets or sets the time at which the compute node entered its current state.
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // LastBootTime - Gets or sets the time at which the compute node was started.
- LastBootTime *date.Time `json:"lastBootTime,omitempty"`
- // AllocationTime - Gets or sets the time at which this compute node was allocated to the pool.
- AllocationTime *date.Time `json:"allocationTime,omitempty"`
- // IPAddress - Gets or sets the IP address that other compute nodes can use to communicate with this compute node.
- IPAddress *string `json:"ipAddress,omitempty"`
- // AffinityID - Gets or sets an identifier which can be passed in the Add Task API to request that the task be scheduled close to this compute node.
- AffinityID *string `json:"affinityId,omitempty"`
- // VMSize - Gets or sets the size of the virtual machine hosting the compute node.
- VMSize *string `json:"vmSize,omitempty"`
- // TotalTasksRun - Gets or sets the total number of job tasks completed on the compute node. This includes Job Preparation, Job Release and Job Manager tasks, but not the pool start task.
- TotalTasksRun *int32 `json:"totalTasksRun,omitempty"`
- // RecentTasks - Gets or sets the list of tasks that are currently running on the compute node.
- RecentTasks *[]TaskInformation `json:"recentTasks,omitempty"`
- // StartTask - Gets or sets the task specified to run on the compute node as it joins the pool.
- StartTask *StartTask `json:"startTask,omitempty"`
- // StartTaskInfo - Gets or sets runtime information about the execution of the start task on the compute node.
- StartTaskInfo *StartTaskInformation `json:"startTaskInfo,omitempty"`
- // CertificateReferences - Gets or sets the list of certificates installed on the compute node.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- // Errors - Gets or sets the list of errors that are currently being encountered by the compute node.
- Errors *[]ComputeNodeError `json:"errors,omitempty"`
-}
-
-// ComputeNodeError an error encountered by a compute node.
-type ComputeNodeError struct {
- // Code - Gets or sets an identifier for the compute node error. Codes are invariant and are intended to be consumed programmatically.
- Code *string `json:"code,omitempty"`
- // Message - Gets or sets a message describing the compute node error, intended to be suitable for display in a user interface.
- Message *string `json:"message,omitempty"`
- // ErrorDetails - Gets or sets the list of additional error details related to the compute node error.
- ErrorDetails *[]NameValuePair `json:"errorDetails,omitempty"`
-}
-
-// ComputeNodeInformation information about the compute node on which a task ran.
-type ComputeNodeInformation struct {
- // AffinityID - Gets or sets an identifier for the compute node on which the task ran, which can be passed when adding a task to request that the task be scheduled close to this compute node.
- AffinityID *string `json:"affinityId,omitempty"`
- // NodeURL - Gets or sets the URL of the node on which the task ran.
- NodeURL *string `json:"nodeUrl,omitempty"`
- // PoolID - Gets or sets the id of the pool on which the task ran.
- PoolID *string `json:"poolId,omitempty"`
- // NodeID - Gets or sets the id of the node on which the task ran.
- NodeID *string `json:"nodeId,omitempty"`
- // TaskRootDirectory - Gets or sets the root directory of the task on the compute node.
- TaskRootDirectory *string `json:"taskRootDirectory,omitempty"`
- // TaskRootDirectoryURL - Gets or sets the URL to the root directory of the task on the compute node.
- TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"`
-}
-
-// ComputeNodeListResult response to a ComputeNodeOperations.List request.
-type ComputeNodeListResult struct {
- autorest.Response `json:"-"`
- // Value - Gets or sets the list of compute nodes.
- Value *[]ComputeNode `json:"value,omitempty"`
- // OdataNextLink - Gets or sets the URL to get the next set of results.
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// ComputeNodeListResultIterator provides access to a complete listing of ComputeNode values.
-type ComputeNodeListResultIterator struct {
- i int
- page ComputeNodeListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *ComputeNodeListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter ComputeNodeListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter ComputeNodeListResultIterator) Response() ComputeNodeListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter ComputeNodeListResultIterator) Value() ComputeNode {
- if !iter.page.NotDone() {
- return ComputeNode{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (cnlr ComputeNodeListResult) IsEmpty() bool {
- return cnlr.Value == nil || len(*cnlr.Value) == 0
-}
-
-// computeNodeListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (cnlr ComputeNodeListResult) computeNodeListResultPreparer() (*http.Request, error) {
- if cnlr.OdataNextLink == nil || len(to.String(cnlr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(cnlr.OdataNextLink)))
-}
-
-// ComputeNodeListResultPage contains a page of ComputeNode values.
-type ComputeNodeListResultPage struct {
- fn func(ComputeNodeListResult) (ComputeNodeListResult, error)
- cnlr ComputeNodeListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *ComputeNodeListResultPage) Next() error {
- next, err := page.fn(page.cnlr)
- if err != nil {
- return err
- }
- page.cnlr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page ComputeNodeListResultPage) NotDone() bool {
- return !page.cnlr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page ComputeNodeListResultPage) Response() ComputeNodeListResult {
- return page.cnlr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page ComputeNodeListResultPage) Values() []ComputeNode {
- if page.cnlr.IsEmpty() {
- return nil
- }
- return *page.cnlr.Value
-}
-
-// ComputeNodeUser an user account on a compute node.
-type ComputeNodeUser struct {
- // Name - Gets or sets the user name of the account.
- Name *string `json:"name,omitempty"`
- // IsAdmin - Gets or sets whether the account should be an administrator on the compute node.
- IsAdmin *bool `json:"isAdmin,omitempty"`
- // ExpiryTime - Gets or sets the time at which the account should expire. If omitted, the default is 1 day from the current time.
- ExpiryTime *date.Time `json:"expiryTime,omitempty"`
- // Password - Gets or sets the password of the account.
- Password *string `json:"password,omitempty"`
-}
-
-// DeleteCertificateError an error encountered by the Batch service when deleting a certificate.
-type DeleteCertificateError struct {
- // Code - Gets or sets an identifier for the certificate deletion error. Codes are invariant and are intended to be consumed programmatically.
- Code *string `json:"code,omitempty"`
- // Message - Gets or sets a message describing the certificate deletion error, intended to be suitable for display in a user interface.
- Message *string `json:"message,omitempty"`
- // Values - Gets or sets a list of additional error details related to the certificate deletion error.
- Values *[]NameValuePair `json:"values,omitempty"`
-}
-
-// EnvironmentSetting an environment variable to be set on a task process.
-type EnvironmentSetting struct {
- // Name - Gets or sets the name of the environment variable.
- Name *string `json:"name,omitempty"`
- // Value - Gets or sets the value of the environment variable.
- Value *string `json:"value,omitempty"`
-}
-
-// Error an error response received from the Azure Batch service.
-type Error struct {
- // Code - Gets or sets an identifier for the error. Codes are invariant and are intended to be consumed programmatically.
- Code *string `json:"code,omitempty"`
- // Message - Gets or sets a message describing the error, intended to be suitable for display in a user interface.
- Message *ErrorMessage `json:"message,omitempty"`
- // Values - Gets or sets a collection of key-value pairs containing additional details about the error.
- Values *[]ErrorDetail `json:"values,omitempty"`
-}
-
-// ErrorDetail an item of additional information included in an Azure Batch error response.
-type ErrorDetail struct {
- // Key - Gets or sets an identifier specifying the meaning of the Value property.
- Key *string `json:"key,omitempty"`
- // Value - Gets or sets the additional information included with the error response.
- Value *string `json:"value,omitempty"`
-}
-
-// ErrorMessage an error message received in an Azure Batch error response.
-type ErrorMessage struct {
- // Lang - Gets or sets the language code of the error message
- Lang *string `json:"lang,omitempty"`
- // Value - Gets or sets the text of the message.
- Value *string `json:"value,omitempty"`
-}
-
-// FileProperties the properties of a file on a compute node.
-type FileProperties struct {
- // CreationTime - Gets or sets the file creation time.
- CreationTime *date.Time `json:"creationTime,omitempty"`
- // LastModified - Gets or sets the time at which the file was last modified.
- LastModified *date.Time `json:"lastModified,omitempty"`
- // ContentLength - Gets or sets the length of the file.
- ContentLength *int64 `json:"contentLength,omitempty"`
- // ContentType - Gets or sets the content type of the file.
- ContentType *string `json:"contentType,omitempty"`
-}
-
-// JobAddParameter an Azure Batch job to add.
-type JobAddParameter struct {
- // ID - Gets or sets a string that uniquely identifies the job within the account. The id can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. It is common to use a GUID for the id.
- ID *string `json:"id,omitempty"`
- // DisplayName - Gets or sets the display name for the job.
- DisplayName *string `json:"displayName,omitempty"`
- // Priority - Gets or sets the priority of the job. Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0.
- Priority *int32 `json:"priority,omitempty"`
- // Constraints - Gets or sets the execution constraints for the job.
- Constraints *JobConstraints `json:"constraints,omitempty"`
- // JobManagerTask - Gets or sets details of a Job Manager task to be launched when the job is started.
- JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"`
- // JobPreparationTask - Gets or sets the Job Preparation task.
- JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"`
- // JobReleaseTask - Gets or sets the Job Release task.
- JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"`
- // CommonEnvironmentSettings - Gets or sets the list of common environment variable settings. These environment variables are set for all tasks in the job (including the Job Manager, Job Preparation and Job Release tasks).
- CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"`
- // PoolInfo - Gets or sets the pool on which the Batch service runs the job’s tasks.
- PoolInfo *PoolInformation `json:"poolInfo,omitempty"`
- // Metadata - Gets or sets a list of name-value pairs associated with the job as metadata.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
- // UsesTaskDependencies - Gets or sets the flag that determines if this job will use tasks with dependencies.
- UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"`
-}
-
-// JobConstraints specifies the execution constraints for jobs created on a schedule.
-type JobConstraints struct {
- // MaxWallClockTime - Gets or sets the maximum elapsed time that the job may run, measured from the time the job starts. If the job does not complete within the time limit, the Batch service terminates it and any tasks that are still running.
- MaxWallClockTime *string `json:"maxWallClockTime,omitempty"`
- // MaxTaskRetryCount - Gets or sets the maximum number of times each task may be retried. The Batch service retries a task if its exit code is nonzero.
- MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"`
-}
-
-// JobDisableParameter parameters for a CloudJobOperations.Disable request.
-type JobDisableParameter struct {
- // DisableTasks - Sets what to do with active tasks associated with the job. Possible values include: 'DisableJobOptionRequeue', 'DisableJobOptionTerminate', 'DisableJobOptionWait'
- DisableTasks DisableJobOption `json:"disableTasks,omitempty"`
-}
-
-// JobExecutionInformation contains information about the execution of a job in the Azure Batch service.
-type JobExecutionInformation struct {
- // StartTime - Gets or sets the start time of the job.
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - Gets or sets the completion time of the job. This property is set only if the job is in the completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
- // PoolID - Gets or sets the id of the pool to which this job is assigned.
- PoolID *string `json:"poolId,omitempty"`
- // SchedulingError - Gets or sets details of any error encountered by the service in starting the job.
- SchedulingError *JobSchedulingError `json:"schedulingError,omitempty"`
- // TerminateReason - Gets or sets a string describing the reason the job ended.
- TerminateReason *string `json:"terminateReason,omitempty"`
-}
-
-// JobManagerTask specifies details of a Job Manager task.
-type JobManagerTask struct {
- // ID - Gets or sets a string that uniquely identifies the Job Manager task. A GUID is recommended.
- ID *string `json:"id,omitempty"`
- // DisplayName - Gets or sets the display name of the Job Manager task.
- DisplayName *string `json:"displayName,omitempty"`
- // CommandLine - Gets or sets the command line of the Job Manager task.
- CommandLine *string `json:"commandLine,omitempty"`
- // ResourceFiles - Gets or sets a list of files that Batch will download to the compute node before running the command line.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- // EnvironmentSettings - Gets or sets a list of environment variable settings for the Job Manager task.
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- // Constraints - Gets or sets constraints that apply to the Job Manager task.
- Constraints *TaskConstraints `json:"constraints,omitempty"`
- // KillJobOnCompletion - Gets or sets whether completion of the Job Manager task signifies completion of the entire job.
- KillJobOnCompletion *bool `json:"killJobOnCompletion,omitempty"`
- // RunElevated - Gets or sets whether to run the Job Manager task in elevated mode. The default value is false.
- RunElevated *bool `json:"runElevated,omitempty"`
- // RunExclusive - Gets or sets whether the Job Manager task requires exclusive use of the compute node where it runs.
- RunExclusive *bool `json:"runExclusive,omitempty"`
-}
-
-// JobPatchParameter parameters for a CloudJobOperations.Patch request.
-type JobPatchParameter struct {
- // Priority - Sets the priority of the job. Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. If omitted, the priority of the job is left unchanged.
- Priority *int32 `json:"priority,omitempty"`
- // Constraints - Sets the execution constraints for the job. If omitted, the existing execution constraints are left unchanged.
- Constraints *JobConstraints `json:"constraints,omitempty"`
- // PoolInfo - Sets the pool on which the Batch service runs the job's tasks. If omitted, the job continues to run on its current pool.
- PoolInfo *PoolInformation `json:"poolInfo,omitempty"`
- // Metadata - Sets a list of name-value pairs associated with the job as metadata. If omitted, the existing job metadata is left unchanged.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// JobPreparationAndReleaseTaskExecutionInformation the status of the Job Preparation and Job Release tasks on a
-// particular compute node.
-type JobPreparationAndReleaseTaskExecutionInformation struct {
- // PoolID - Gets or sets the id of the pool containing the compute node to which this entry refers.
- PoolID *string `json:"poolId,omitempty"`
- // NodeID - Gets or sets the id of the compute node to which this entry refers.
- NodeID *string `json:"nodeId,omitempty"`
- // NodeURL - Gets or sets the URL of the compute node to which this entry refers.
- NodeURL *string `json:"nodeUrl,omitempty"`
- // JobPreparationTaskExecutionInfo - Gets or sets information about the execution status of the Job Preparation task on this compute node.
- JobPreparationTaskExecutionInfo *JobPreparationTaskExecutionInformation `json:"jobPreparationTaskExecutionInfo,omitempty"`
- // JobReleaseTaskExecutionInfo - Gets or sets information about the execution status of the Job Release task on this compute node. This property is set only if the Job Release task has run on the node.
- JobReleaseTaskExecutionInfo *JobReleaseTaskExecutionInformation `json:"jobReleaseTaskExecutionInfo,omitempty"`
-}
-
-// JobPreparationTask a Job Preparation task to run before any tasks of the job on any given compute node.
-type JobPreparationTask struct {
- // ID - Gets or sets a string that uniquely identifies the job preparation task within the job. The id can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters.
- ID *string `json:"id,omitempty"`
- // CommandLine - Gets or sets the command line of the Job Preparation task.
- CommandLine *string `json:"commandLine,omitempty"`
- // ResourceFiles - Gets or sets a list of files that Batch will download to the compute node before running the command line.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- // EnvironmentSettings - Gets or sets a list of environment variable settings for the Job Preparation task.
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- // Constraints - Gets or sets constraints that apply to the Job Preparation task..
- Constraints *TaskConstraints `json:"constraints,omitempty"`
- // WaitForSuccess - Gets or sets whether the Batch Service should wait for the Job Preparation task to complete successfully before scheduling any other tasks of the job on the compute node.
- WaitForSuccess *bool `json:"waitForSuccess,omitempty"`
- // RunElevated - Gets or sets whether to run the Job Preparation task in elevated mode. The default value is false.
- RunElevated *bool `json:"runElevated,omitempty"`
- // RerunOnNodeRebootAfterSuccess - Gets or sets whether the Batch service should rerun the Job Preparation task after a compute node reboots. The default value is true.
- RerunOnNodeRebootAfterSuccess *bool `json:"rerunOnNodeRebootAfterSuccess,omitempty"`
-}
-
-// JobPreparationTaskExecutionInformation contains information about the execution of a Job Preparation task on a
-// compute node.
-type JobPreparationTaskExecutionInformation struct {
- // StartTime - Gets or sets the time at which the Job Preparation task started running.
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - Gets or sets the time at which the Job Preparation task completed. This property is set only if the task is in the Completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
- // State - Gets or sets the current running state of the Job Preparation task on the compute node. Possible values include: 'JobPreparationTaskStateRunning', 'JobPreparationTaskStateCompleted'
- State JobPreparationTaskState `json:"state,omitempty"`
- // TaskRootDirectory - Gets or sets the root directory of the Job Preparation task on the compute node.
- TaskRootDirectory *string `json:"taskRootDirectory,omitempty"`
- // TaskRootDirectoryURL - Gets or sets the URL to the root directory of the Job Preparation task on the compute node.
- TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"`
- // ExitCode - Gets or sets the exit code of the Job Preparation task. This property is set only if the task is in the Completed state.
- ExitCode *int32 `json:"exitCode,omitempty"`
- // SchedulingError - Gets or sets any error starting the Job Preparation task.
- SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"`
- // RetryCount - Gets or sets the number of times the Job Preparation task has been retried by the Batch service.
- RetryCount *int32 `json:"retryCount,omitempty"`
- // LastRetryTime - Gets or sets the most recent time at which a retry of the Job Preparation task started running. This property is set only if the task was retried (i.e. retryCount is nonzero).
- LastRetryTime *date.Time `json:"lastRetryTime,omitempty"`
-}
-
-// JobReleaseTask a Job Release task to run on job completion on any compute node where the job has run.
-type JobReleaseTask struct {
- // ID - Gets or sets a string that uniquely identifies the Job Release task within the job. The id can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters.
- ID *string `json:"id,omitempty"`
- // CommandLine - Gets or sets the command line of the Job Release task.
- CommandLine *string `json:"commandLine,omitempty"`
- // ResourceFiles - Gets or sets a list of files that Batch will download to the compute node before running the command line.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- // EnvironmentSettings - Gets or sets a list of environment variable settings for the Job Release task.
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- // MaxWallClockTime - Gets or sets the maximum elapsed time that the Job Release task may run on a given compute node, measured from the time the task starts. If the task does not complete within the time limit, the Batch service terminates it. The default value is 15 minutes.
- MaxWallClockTime *string `json:"maxWallClockTime,omitempty"`
- // RetentionTime - Gets or sets the minimum time to retain the working directory for the Job Release task on the compute node. After this time, the Batch service may delete the working directory and all its contents. The default is infinite.
- RetentionTime *string `json:"retentionTime,omitempty"`
- // RunElevated - Gets or sets whether to run the Job Release task in elevated mode. The default value is false.
- RunElevated *bool `json:"runElevated,omitempty"`
-}
-
-// JobReleaseTaskExecutionInformation contains information about the execution of a Job Release task on a compute
-// node.
-type JobReleaseTaskExecutionInformation struct {
- // StartTime - Gets or sets the time at which the Job Release task started running.
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - Gets or sets the time at which the Job Release task completed. This property is set only if the task is in the Completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
- // State - Gets or sets the current running state of the Job Release task on the compute node. Possible values include: 'JobReleaseTaskStateRunning', 'JobReleaseTaskStateCompleted'
- State JobReleaseTaskState `json:"state,omitempty"`
- // TaskRootDirectory - Gets or sets the root directory of the Job Release task on the compute node.
- TaskRootDirectory *string `json:"taskRootDirectory,omitempty"`
- // TaskRootDirectoryURL - Gets or sets the URL to the root directory of the Job Release task on the compute node.
- TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"`
- // ExitCode - Gets or sets the exit code of the Job Release task. This property is set only if the task is in the Completed state.
- ExitCode *int32 `json:"exitCode,omitempty"`
- // SchedulingError - Gets or sets any error starting the Job Release task.
- SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"`
-}
-
-// JobScheduleAddParameter a job schedule that allows recurring jobs by specifying when to run jobs and a
-// specification used to create each job.
-type JobScheduleAddParameter struct {
- // ID - Gets or sets a string that uniquely identifies the schedule within the account. A GUID is recommended.
- ID *string `json:"id,omitempty"`
- // DisplayName - Gets or sets the display name for the schedule.
- DisplayName *string `json:"displayName,omitempty"`
- // Schedule - Gets or sets the schedule according to which jobs will be created.
- Schedule *Schedule `json:"schedule,omitempty"`
- // JobSpecification - Gets or sets the details of the jobs to be created on this schedule.
- JobSpecification *JobSpecification `json:"jobSpecification,omitempty"`
- // Metadata - Gets or sets a list of name-value pairs associated with the schedule as metadata.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// JobScheduleExecutionInformation specifies how tasks should be run in a job associated with a job schedule.
-type JobScheduleExecutionInformation struct {
- // NextRunTime - Gets or sets the next time at which a job will be created under this schedule.
- NextRunTime *date.Time `json:"nextRunTime,omitempty"`
- // RecentJob - Gets or sets information about the most recent job under the job schedule.
- RecentJob *RecentJob `json:"recentJob,omitempty"`
- // EndTime - Gets or sets the time at which the schedule ended. This property is set only if the job schedule is in the completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
-}
-
-// JobSchedulePatchParameter parameters for a CloudJobScheduleOperations.Patch request.
-type JobSchedulePatchParameter struct {
- // Schedule - Sets the schedule according to which jobs will be created. If you do not specify this element, the existing schedule is not modified.
- Schedule *Schedule `json:"schedule,omitempty"`
- // JobSpecification - Sets the details of the jobs to be created on this schedule.
- JobSpecification *JobSpecification `json:"jobSpecification,omitempty"`
- // Metadata - Sets a list of name-value pairs associated with the job schedule as metadata.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// JobScheduleStatistics the lifetime resource usage statistics for a job schedule.
-type JobScheduleStatistics struct {
- // URL - Gets or sets the URL for the statistics.
- URL *string `json:"url,omitempty"`
- // StartTime - Gets or sets the start time of the time range covered by the statistics.
- StartTime *date.Time `json:"startTime,omitempty"`
- // LastUpdateTime - Gets or sets the time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime.
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- // UserCPUTime - Gets or sets the total user mode CPU time (summed across all cores and all compute nodes) consumed by all the tasks in all the jobs created under the schedule.
- UserCPUTime *string `json:"userCPUTime,omitempty"`
- // KernelCPUTime - Gets or sets the total kernel mode CPU time (summed across all cores and all compute nodes) consumed by all the tasks in all the jobs created under the schedule.
- KernelCPUTime *string `json:"kernelCPUTime,omitempty"`
- // WallClockTime - Gets or sets the total wall clock time of all the tasks in all the jobs created under the schedule.
- WallClockTime *string `json:"wallClockTime,omitempty"`
- // ReadIOps - Gets or sets the total number of I/O read operations performed by all the tasks in all the jobs created under the schedule.
- ReadIOps *int64 `json:"readIOps,omitempty"`
- // WriteIOps - Gets or sets the total number of I/O write operations performed by all the tasks in all the jobs created under the schedule.
- WriteIOps *int64 `json:"writeIOps,omitempty"`
- // ReadIOGiB - Gets or sets the total amount of data in GiB of I/O read by all the tasks in all the jobs created under the schedule.
- ReadIOGiB *float64 `json:"readIOGiB,omitempty"`
- // WriteIOGiB - Gets or sets the total amount of data in GiB of I/O written by all the tasks in all the jobs created under the schedule.
- WriteIOGiB *float64 `json:"writeIOGiB,omitempty"`
- // NumSucceededTasks - Gets or sets the total number of tasks successfully completed during the given time range in jobs created under the schedule. A task completes successfully if it returns exit code 0.
- NumSucceededTasks *int64 `json:"numSucceededTasks,omitempty"`
- // NumFailedTasks - Gets or sets the total number of tasks that failed during the given time range in jobs created under the schedule. A task fails if it exhausts its maximum retry count without returning exit code 0.
- NumFailedTasks *int64 `json:"numFailedTasks,omitempty"`
- // NumTaskRetries - Gets or sets the total number of retries during the given time range on all the tasks in jobs created under the schedule.
- NumTaskRetries *int64 `json:"numTaskRetries,omitempty"`
- // WaitTime - Gets or sets the total wait time of all the tasks in jobs created under the schedule.
- WaitTime *string `json:"waitTime,omitempty"`
-}
-
-// JobScheduleUpdateParameter parameters for a CloudJobScheduleOperations.Update request.
-type JobScheduleUpdateParameter struct {
- // Schedule - Sets the schedule according to which jobs will be created. If you do not specify this element, it is equivalent to passing the default schedule: that is, a single job scheduled to run immediately.
- Schedule *Schedule `json:"schedule,omitempty"`
- // JobSpecification - Sets details of the jobs to be created on this schedule.
- JobSpecification *JobSpecification `json:"jobSpecification,omitempty"`
- // Metadata - Sets a list of name-value pairs associated with the job schedule as metadata. If you do not specify this element, it takes the default value of an empty list; in effect, any existing metadata is deleted.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// JobSchedulingError an error encountered by the Batch service when scheduling a job.
-type JobSchedulingError struct {
- // Category - Gets or sets the category of the job scheduling error. Possible values include: 'SchedulingErrorCategoryUsererror', 'SchedulingErrorCategoryServererror', 'SchedulingErrorCategoryUnmapped'
- Category SchedulingErrorCategory `json:"category,omitempty"`
- // Code - Gets or sets an identifier for the job scheduling error. Codes are invariant and are intended to be consumed programmatically.
- Code *string `json:"code,omitempty"`
- // Message - Gets or sets a message describing the job scheduling error, intended to be suitable for display in a user interface.
- Message *string `json:"message,omitempty"`
- // Details - Gets or sets a list of additional error details related to the scheduling error.
- Details *[]NameValuePair `json:"details,omitempty"`
-}
-
-// JobSpecification specifies details of the jobs to be created on a schedule.
-type JobSpecification struct {
- // Priority - Gets or sets the priority of jobs created under this schedule. Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0.
- Priority *int32 `json:"priority,omitempty"`
- // DisplayName - Gets or sets the display name for jobs created under this schedule. It need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- // UsesTaskDependencies - Gets or sets the flag that determines if this job will use tasks with dependencies.
- UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"`
- // Constraints - Gets or sets the execution constraints for jobs created under this schedule.
- Constraints *JobConstraints `json:"constraints,omitempty"`
- // JobManagerTask - Gets or sets the details of a Job Manager task to be launched when a job is started under this schedule.
- JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"`
- // JobPreparationTask - Gets or sets the Job Preparation task for jobs created under this schedule.
- JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"`
- // JobReleaseTask - Gets or sets the Job Release task for jobs created under this schedule.
- JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"`
- // CommonEnvironmentSettings - Gets or sets a list of common environment variable settings. These environment variables are set for all tasks in jobs created under this schedule (including the Job Manager, Job Preparation and Job Release tasks).
- CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"`
- // PoolInfo - Gets or sets the pool on which the Batch service runs the tasks of jobs created under this schedule.
- PoolInfo *PoolInformation `json:"poolInfo,omitempty"`
- // Metadata - Gets or sets a list of name-value pairs associated with each job created under this schedule as metadata.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// JobStatistics resource usage statistics for a job.
-type JobStatistics struct {
- autorest.Response `json:"-"`
- // URL - Gets or sets the URL for the statistics.
- URL *string `json:"url,omitempty"`
- // StartTime - Gets or sets the start time of the time range covered by the statistics.
- StartTime *date.Time `json:"startTime,omitempty"`
- // LastUpdateTime - Gets or sets the time at which the statistics were last updated. All statistics are limited to the range between StartTime and LastUpdateTime.
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- // UserCPUTime - Gets or sets the total user mode CPU time (summed across all cores and all compute nodes) consumed by all the tasks in the job.
- UserCPUTime *string `json:"userCPUTime,omitempty"`
- // KernelCPUTime - Gets or sets the total kernel mode CPU time (summed across all cores and all compute nodes) consumed by all the tasks in the job.
- KernelCPUTime *string `json:"kernelCPUTime,omitempty"`
- // WallClockTime - Gets or sets the total wall clock time of all the tasks in the job.
- WallClockTime *string `json:"wallClockTime,omitempty"`
- // ReadIOps - Gets or sets the total number of I/O read operations performed by all the tasks in the job.
- ReadIOps *int64 `json:"readIOps,omitempty"`
- // WriteIOps - Gets or sets the total number of I/O write operations performed by all the tasks in the job.
- WriteIOps *int64 `json:"writeIOps,omitempty"`
- // ReadIOGiB - Gets or sets the total amount of data in GiB of I/O read by all the tasks in the job.
- ReadIOGiB *float64 `json:"readIOGiB,omitempty"`
- // WriteIOGiB - Gets or sets the total amount of data in GiB of I/O written by all the tasks in the job.
- WriteIOGiB *float64 `json:"writeIOGiB,omitempty"`
- // NumSucceededTasks - Gets or sets the total number of tasks successfully completed in the job during the given time range.
- NumSucceededTasks *int64 `json:"numSucceededTasks,omitempty"`
- // NumFailedTasks - Gets or sets the total number of tasks in the job that failed during the given time range.
- NumFailedTasks *int64 `json:"numFailedTasks,omitempty"`
- // NumTaskRetries - Gets or sets the total number of retries on all the tasks in the job during the given time range.
- NumTaskRetries *int64 `json:"numTaskRetries,omitempty"`
- // WaitTime - Gets or sets the total wait time of all the tasks in the job. The wait time for a task is defined as the elapsed time between the creation of the task creation and the start of task execution. This value is reported only in the account lifetime statistics; it is not included in individual job statistics.
- WaitTime *string `json:"waitTime,omitempty"`
-}
-
-// JobTerminateParameter parameters for a CloudJobOperations.Terminate request.
-type JobTerminateParameter struct {
- // TerminateReason - Sets the text you want to appear as the job's TerminateReason. The default is 'UserTerminate'.
- TerminateReason *string `json:"terminateReason,omitempty"`
-}
-
-// JobUpdateParameter parameters for a CloudJobOperations.Update request.
-type JobUpdateParameter struct {
- // Priority - Sets the priority of the job. Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. If omitted, the priority of the job is left unchanged.
- Priority *int32 `json:"priority,omitempty"`
- // Constraints - Sets the execution constraints for the job. If omitted, the existing execution constraints are left unchanged.
- Constraints *JobConstraints `json:"constraints,omitempty"`
- // PoolInfo - Sets the pool on which the Batch service runs the job's tasks. If omitted, the job continues to run on its current pool.
- PoolInfo *PoolInformation `json:"poolInfo,omitempty"`
- // Metadata - Sets a list of name-value pairs associated with the job as metadata. If omitted, the existing job metadata is left unchanged.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// MetadataItem a metadata item associated with an Azure Batch resource. The Batch service does not assign any
-// meaning to metadata; it is solely for the use of user code.
-type MetadataItem struct {
- // Name - Gets or sets the name of the metadata item.
- Name *string `json:"name,omitempty"`
- // Value - Gets or sets the value of the metadata item.
- Value *string `json:"value,omitempty"`
-}
-
-// MultiInstanceSettings information about the settings required for multi-instance task.
-type MultiInstanceSettings struct {
- // NumberOfInstances - Gets or sets the number of compute node instances used for multi-instance task.
- NumberOfInstances *int32 `json:"numberOfInstances,omitempty"`
- // CoordinationCommandLine - Gets or sets the command to be run on the compute node instances to setup coordination among the subtasks.
- CoordinationCommandLine *string `json:"coordinationCommandLine,omitempty"`
- // CommonResourceFiles - Gets or sets a list of files that Batch will download on all subtasks.
- CommonResourceFiles *[]ResourceFile `json:"commonResourceFiles,omitempty"`
-}
-
-// NameValuePair represents a name-value pair.
-type NameValuePair struct {
- // Name - Gets or sets the name in the name-value pair.
- Name *string `json:"name,omitempty"`
- // Value - Gets or sets the value in the name-value pair.
- Value *string `json:"value,omitempty"`
-}
-
-// NodeDisableSchedulingParameter parameters for a ComputeNodeOperations.DisableScheduling request.
-type NodeDisableSchedulingParameter struct {
- // NodeDisableSchedulingOption - Gets or sets what to do with currently running tasks when disable task scheduling on the compute node. The default value is requeue. Possible values include: 'DisableComputeNodeSchedulingOptionRequeue', 'DisableComputeNodeSchedulingOptionTerminate', 'DisableComputeNodeSchedulingOptionTaskcompletion'
- NodeDisableSchedulingOption DisableComputeNodeSchedulingOption `json:"nodeDisableSchedulingOption,omitempty"`
-}
-
-// NodeFile information about a file or directory on a compute node.
-type NodeFile struct {
- // Name - Gets or sets the file path.
- Name *string `json:"name,omitempty"`
- // URL - Gets or sets the URL of the file.
- URL *string `json:"url,omitempty"`
- // IsDirectory - Gets or sets whether the object represents a directory.
- IsDirectory *bool `json:"isDirectory,omitempty"`
- // Properties - Gets or sets the file properties.
- Properties *FileProperties `json:"properties,omitempty"`
-}
-
-// NodeFileListResult response to a NodeFileOperations.ListFromComputeNode or NodeFileOperations.ListFromTask
-// request.
-type NodeFileListResult struct {
- autorest.Response `json:"-"`
- // Value - Gets or sets the list of files.
- Value *[]NodeFile `json:"value,omitempty"`
- // OdataNextLink - Gets or sets the URL to get the next set of results.
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// NodeFileListResultIterator provides access to a complete listing of NodeFile values.
-type NodeFileListResultIterator struct {
- i int
- page NodeFileListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *NodeFileListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter NodeFileListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter NodeFileListResultIterator) Response() NodeFileListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter NodeFileListResultIterator) Value() NodeFile {
- if !iter.page.NotDone() {
- return NodeFile{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (nflr NodeFileListResult) IsEmpty() bool {
- return nflr.Value == nil || len(*nflr.Value) == 0
-}
-
-// nodeFileListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (nflr NodeFileListResult) nodeFileListResultPreparer() (*http.Request, error) {
- if nflr.OdataNextLink == nil || len(to.String(nflr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(nflr.OdataNextLink)))
-}
-
-// NodeFileListResultPage contains a page of NodeFile values.
-type NodeFileListResultPage struct {
- fn func(NodeFileListResult) (NodeFileListResult, error)
- nflr NodeFileListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *NodeFileListResultPage) Next() error {
- next, err := page.fn(page.nflr)
- if err != nil {
- return err
- }
- page.nflr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page NodeFileListResultPage) NotDone() bool {
- return !page.nflr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page NodeFileListResultPage) Response() NodeFileListResult {
- return page.nflr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page NodeFileListResultPage) Values() []NodeFile {
- if page.nflr.IsEmpty() {
- return nil
- }
- return *page.nflr.Value
-}
-
-// NodeRebootParameter parameters for a ComputeNodeOperations.Reboot request.
-type NodeRebootParameter struct {
- // NodeRebootOption - Sets when to reboot the compute node and what to do with currently running tasks. The default value is requeue. Possible values include: 'ComputeNodeRebootOptionRequeue', 'ComputeNodeRebootOptionTerminate', 'ComputeNodeRebootOptionTaskcompletion', 'ComputeNodeRebootOptionRetaineddata'
- NodeRebootOption ComputeNodeRebootOption `json:"nodeRebootOption,omitempty"`
-}
-
-// NodeReimageParameter parameters for a ComputeNodeOperations.Reimage request.
-type NodeReimageParameter struct {
- // NodeReimageOption - Sets when to reimage the compute node and what to do with currently running tasks. The default value is requeue. Possible values include: 'ComputeNodeReimageOptionRequeue', 'ComputeNodeReimageOptionTerminate', 'ComputeNodeReimageOptionTaskcompletion', 'ComputeNodeReimageOptionRetaineddata'
- NodeReimageOption ComputeNodeReimageOption `json:"nodeReimageOption,omitempty"`
-}
-
-// NodeRemoveParameter parameters for a ComputeNodeOperations.Remove request.
-type NodeRemoveParameter struct {
- // NodeList - Sets a list containing the id of the compute nodes to be removed from the specified pool.
- NodeList *[]string `json:"nodeList,omitempty"`
- // ResizeTimeout - Sets the timeout for removal of compute nodes to the pool. The default value is 10 minutes.
- ResizeTimeout *string `json:"resizeTimeout,omitempty"`
- // NodeDeallocationOption - Sets when compute nodes may be removed from the pool. Possible values include: 'Requeue', 'Terminate', 'Taskcompletion', 'Retaineddata'
- NodeDeallocationOption ComputeNodeDeallocationOption `json:"nodeDeallocationOption,omitempty"`
-}
-
-// NodeUpdateUserParameter parameters for a ComputeNodeOperations.UpdateUser request.
-type NodeUpdateUserParameter struct {
- // Password - Sets the password of the account.
- Password *string `json:"password,omitempty"`
- // ExpiryTime - Sets the time at which the account should expire. If omitted, the default is 1 day from the current time.
- ExpiryTime *date.Time `json:"expiryTime,omitempty"`
-}
-
-// PoolAddParameter a pool in the Azure Batch service to add.
-type PoolAddParameter struct {
- // ID - Gets or sets a string that uniquely identifies the pool within the account. The id can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters.
- ID *string `json:"id,omitempty"`
- // DisplayName - Gets or sets the display name for the pool.
- DisplayName *string `json:"displayName,omitempty"`
- // VMSize - Gets or sets the size of virtual machines in the pool. All VMs in a pool are the same size.
- VMSize *string `json:"vmSize,omitempty"`
- // OsFamily - Gets or sets the Azure Guest OS family to be installed on the virtual machines in the pool.
- OsFamily *string `json:"osFamily,omitempty"`
- // TargetOSVersion - Gets or sets the Azure Guest OS version to be installed on the virtual machines in the pool. The default value is * which specifies the latest operating system version for the specified family.
- TargetOSVersion *string `json:"targetOSVersion,omitempty"`
- // ResizeTimeout - Gets or sets the timeout for allocation of compute nodes to the pool. In a Get Pool operation, this is the timeout for the most recent resize operation. The default value is 10 minutes.
- ResizeTimeout *string `json:"resizeTimeout,omitempty"`
- // TargetDedicated - Gets or sets the desired number of compute nodes in the pool. This property must have the default value if EnableAutoScale is true. It is required if EnableAutoScale is false.
- TargetDedicated *int32 `json:"targetDedicated,omitempty"`
- // EnableAutoScale - Gets or sets whether the pool size should automatically adjust over time. If true, the AutoScaleFormula property must be set. If false, the TargetDedicated property must be set.
- EnableAutoScale *bool `json:"enableAutoScale,omitempty"`
- // AutoScaleFormula - Gets or sets a formula for the desired number of compute nodes in the pool.
- AutoScaleFormula *string `json:"autoScaleFormula,omitempty"`
- // AutoScaleEvaluationInterval - Gets or sets a time interval for the desired autoscale evaluation period in the pool.
- AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"`
- // EnableInterNodeCommunication - Gets or sets whether the pool permits direct communication between nodes.
- EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"`
- // StartTask - Gets or sets a task specified to run on each compute node as it joins the pool.
- StartTask *StartTask `json:"startTask,omitempty"`
- // CertificateReferences - Gets or sets the list of certificates to be installed on each compute node in the pool.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- // ApplicationPackageReferences - Gets or sets the list of application packages to be installed on each compute node in the pool.
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // MaxTasksPerNode - Gets or sets the maximum number of tasks that can run concurrently on a single compute node in the pool.
- MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"`
- // TaskSchedulingPolicy - Gets or sets how the Batch service distributes tasks between compute nodes in the pool.
- TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"`
- // Metadata - Gets or sets a list of name-value pairs associated with the pool as metadata.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// PoolEnableAutoScaleParameter parameters for a CloudPoolOperations.EnableAutoScale request.
-type PoolEnableAutoScaleParameter struct {
- // AutoScaleFormula - Sets the formula for the desired number of compute nodes in the pool.
- AutoScaleFormula *string `json:"autoScaleFormula,omitempty"`
- // AutoScaleEvaluationInterval - Gets or sets a time interval for the desired autoscale evaluation period in the pool.
- AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"`
-}
-
-// PoolEvaluateAutoScaleParameter parameters for a CloudJobOperations.EvaluateAutoScale request.
-type PoolEvaluateAutoScaleParameter struct {
- // AutoScaleFormula - Sets a formula for the desired number of compute nodes in the pool.
- AutoScaleFormula *string `json:"autoScaleFormula,omitempty"`
-}
-
-// PoolInformation specifies how a job should be assigned to a pool.
-type PoolInformation struct {
- // PoolID - Gets or sets the id of an existing pool. All the tasks of the job will run on the specified pool. You must specify either PoolId or AutoPoolSpecification, but not both.
- PoolID *string `json:"poolId,omitempty"`
- // AutoPoolSpecification - Gets or sets characteristics for a temporary 'auto pool.' The Batch service will create this auto pool and run all the tasks of the job on it, and will delete the pool once the job has completed. You must specify either PoolId or AutoPoolSpecification, but not both.
- AutoPoolSpecification *AutoPoolSpecification `json:"autoPoolSpecification,omitempty"`
-}
-
-// PoolListPoolUsageMetricsResult response to an AccountOperations.ListPoolUsageMetrics request.
-type PoolListPoolUsageMetricsResult struct {
- autorest.Response `json:"-"`
- // Value - Gets or sets the pool usage metrics data.
- Value *[]PoolUsageMetrics `json:"value,omitempty"`
- // OdataNextLink - Gets or sets the URL to get the next set of results.
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// PoolListPoolUsageMetricsResultIterator provides access to a complete listing of PoolUsageMetrics values.
-type PoolListPoolUsageMetricsResultIterator struct {
- i int
- page PoolListPoolUsageMetricsResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *PoolListPoolUsageMetricsResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter PoolListPoolUsageMetricsResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter PoolListPoolUsageMetricsResultIterator) Response() PoolListPoolUsageMetricsResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter PoolListPoolUsageMetricsResultIterator) Value() PoolUsageMetrics {
- if !iter.page.NotDone() {
- return PoolUsageMetrics{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (plpumr PoolListPoolUsageMetricsResult) IsEmpty() bool {
- return plpumr.Value == nil || len(*plpumr.Value) == 0
-}
-
-// poolListPoolUsageMetricsResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (plpumr PoolListPoolUsageMetricsResult) poolListPoolUsageMetricsResultPreparer() (*http.Request, error) {
- if plpumr.OdataNextLink == nil || len(to.String(plpumr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(plpumr.OdataNextLink)))
-}
-
-// PoolListPoolUsageMetricsResultPage contains a page of PoolUsageMetrics values.
-type PoolListPoolUsageMetricsResultPage struct {
- fn func(PoolListPoolUsageMetricsResult) (PoolListPoolUsageMetricsResult, error)
- plpumr PoolListPoolUsageMetricsResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *PoolListPoolUsageMetricsResultPage) Next() error {
- next, err := page.fn(page.plpumr)
- if err != nil {
- return err
- }
- page.plpumr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page PoolListPoolUsageMetricsResultPage) NotDone() bool {
- return !page.plpumr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page PoolListPoolUsageMetricsResultPage) Response() PoolListPoolUsageMetricsResult {
- return page.plpumr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page PoolListPoolUsageMetricsResultPage) Values() []PoolUsageMetrics {
- if page.plpumr.IsEmpty() {
- return nil
- }
- return *page.plpumr.Value
-}
-
-// PoolPatchParameter parameters for a CloudPoolOperations.Patch request.
-type PoolPatchParameter struct {
- // StartTask - Sets a task to run on each compute node as it joins the pool. If omitted, any existing start task is left unchanged.
- StartTask *StartTask `json:"startTask,omitempty"`
- // CertificateReferences - Sets a list of certificates to be installed on each compute node in the pool. If omitted, any existing certificate references are left unchanged.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- // ApplicationPackageReferences - Sets a list of application packages to be installed on each compute node in the pool. If omitted, any existing application package references are left unchanged.
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // Metadata - Sets a list of name-value pairs associated with the pool as metadata. If omitted, any existing metadata is left unchanged.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// PoolResizeParameter parameters for a CloudPoolOperations.Resize request.
-type PoolResizeParameter struct {
- // TargetDedicated - Sets the desired number of compute nodes in the pool.
- TargetDedicated *int32 `json:"targetDedicated,omitempty"`
- // ResizeTimeout - Sets the timeout for allocation of compute nodes to the pool or removal of compute nodes from the pool. The default value is 10 minutes.
- ResizeTimeout *string `json:"resizeTimeout,omitempty"`
- // NodeDeallocationOption - Sets when nodes may be removed from the pool, if the pool size is decreasing. Possible values include: 'Requeue', 'Terminate', 'Taskcompletion', 'Retaineddata'
- NodeDeallocationOption ComputeNodeDeallocationOption `json:"nodeDeallocationOption,omitempty"`
-}
-
-// PoolSpecification specification for creating a new pool.
-type PoolSpecification struct {
- // DisplayName - Gets or sets the display name for the pool.
- DisplayName *string `json:"displayName,omitempty"`
- // VMSize - Gets or sets the size of the virtual machines in the pool. All VMs in a pool are the same size.
- VMSize *string `json:"vmSize,omitempty"`
- // OsFamily - Gets or sets the Azure Guest OS family to be installed on the virtual machines in the pool.
- OsFamily *string `json:"osFamily,omitempty"`
- // TargetOSVersion - Gets or sets the Azure Guest OS version to be installed on the virtual machines in the pool.
- TargetOSVersion *string `json:"targetOSVersion,omitempty"`
- // MaxTasksPerNode - Gets or sets the maximum number of tasks that can run concurrently on a single compute node in the pool.
- MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"`
- // TaskSchedulingPolicy - Gets or sets how tasks are distributed among compute nodes in the pool.
- TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"`
- // ResizeTimeout - Gets or sets the timeout for allocation of compute nodes to the pool.
- ResizeTimeout *string `json:"resizeTimeout,omitempty"`
- // TargetDedicated - Gets or sets the desired number of compute nodes in the pool.
- TargetDedicated *int32 `json:"targetDedicated,omitempty"`
- // EnableAutoScale - Gets or sets whether the pool size should automatically adjust over time.
- EnableAutoScale *bool `json:"enableAutoScale,omitempty"`
- // AutoScaleFormula - Gets or sets the formula for the desired number of compute nodes in the pool.
- AutoScaleFormula *string `json:"autoScaleFormula,omitempty"`
- // AutoScaleEvaluationInterval - Gets or sets a time interval for the desired AutoScale evaluation period in the pool.
- AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"`
- // EnableInterNodeCommunication - Gets or sets whether the pool permits direct communication between nodes.
- EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"`
- // StartTask - Gets or sets a task to run on each compute node as it joins the pool. The task runs when the node is added to the pool or when the node is restarted.
- StartTask *StartTask `json:"startTask,omitempty"`
- // CertificateReferences - Gets or sets a list of certificates to be installed on each compute node in the pool.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- // ApplicationPackageReferences - Gets or sets the list of application packages to be installed on each compute node in the pool.
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // Metadata - Gets or sets a list of name-value pairs associated with the pool as metadata.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// PoolStatistics contains utilization and resource usage statistics for the lifetime of a pool.
-type PoolStatistics struct {
- autorest.Response `json:"-"`
- // URL - Gets or sets the URL for the statistics.
- URL *string `json:"url,omitempty"`
- // StartTime - Gets or sets the start time of the time range covered by the statistics.
- StartTime *date.Time `json:"startTime,omitempty"`
- // LastUpdateTime - Gets or sets the time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime.
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- // UsageStats - Gets or sets statistics related to pool usage information, such as the amount of core-time used.
- UsageStats *UsageStatistics `json:"usageStats,omitempty"`
- // ResourceStats - Gets or sets statistics related to resource consumption by compute nodes in the pool.
- ResourceStats *ResourceStatistics `json:"resourceStats,omitempty"`
-}
-
-// PoolUpdatePropertiesParameter parameters for a CloudPoolOperations.UpdateProperties request.
-type PoolUpdatePropertiesParameter struct {
- // StartTask - Sets a task to run on each compute node as it joins the pool. If omitted, any existing start task is removed from the pool.
- StartTask *StartTask `json:"startTask,omitempty"`
- // CertificateReferences - Sets a list of certificates to be installed on each compute node in the pool. If you specify an empty collection, any existing certificate references are removed from the pool.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- // ApplicationPackageReferences - Sets a list of application packages to be installed on each compute node in the pool. If you specify an empty collection, any existing application packages references are removed from the pool.
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // Metadata - Sets a list of name-value pairs associated with the pool as metadata. If you specify an empty collection, any existing metadata is removed from the pool.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// PoolUpgradeOSParameter parameters for a CloudPoolOperations.UpgradeOS request.
-type PoolUpgradeOSParameter struct {
- // TargetOSVersion - Sets the Azure Guest OS version to be installed on the virtual machines in the pool.
- TargetOSVersion *string `json:"targetOSVersion,omitempty"`
-}
-
-// PoolUsageMetrics usage metrics for a pool across an aggregation interval.
-type PoolUsageMetrics struct {
- // PoolID - Gets or sets the id of the pool whose metrics are being aggregated.
- PoolID *string `json:"poolId,omitempty"`
- // StartTime - Gets or sets the start time of the aggregation interval.
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - Gets or sets the end time of the aggregation interval.
- EndTime *date.Time `json:"endTime,omitempty"`
- // VMSize - Gets or sets the size of virtual machines in the pool. All VMs in a pool are the same size.
- VMSize *string `json:"vmSize,omitempty"`
- // TotalCoreHours - Gets or sets the total core hours used in the pool during this aggregation interval.
- TotalCoreHours *float64 `json:"totalCoreHours,omitempty"`
- // DataIngressGiB - Gets or sets the cross data center network ingress in GiB to the pool during this interval.
- DataIngressGiB *float64 `json:"dataIngressGiB,omitempty"`
- // DataEgressGiB - Gets or sets the cross data center network egress in GiB from the pool during this interval.
- DataEgressGiB *float64 `json:"dataEgressGiB,omitempty"`
-}
-
-// ReadCloser ...
-type ReadCloser struct {
- autorest.Response `json:"-"`
- Value *io.ReadCloser `json:"value,omitempty"`
-}
-
-// RecentJob information about the most recent job to run under the job schedule.
-type RecentJob struct {
- // ID - Gets or sets the id of the job.
- ID *string `json:"id,omitempty"`
- // URL - Gets or sets the URL of the job.
- URL *string `json:"url,omitempty"`
-}
-
-// ResizeError an error that occurred when resizing a pool.
-type ResizeError struct {
- // Code - Gets or sets an identifier for the pool resize error. Codes are invariant and are intended to be consumed programmatically.
- Code *string `json:"code,omitempty"`
- // Message - Gets or sets a message describing the pool resize error, intended to be suitable for display in a user interface.
- Message *string `json:"message,omitempty"`
- // Values - Gets or sets a list of additional error details related to the pool resize error.
- Values *[]NameValuePair `json:"values,omitempty"`
-}
-
-// ResourceFile a file to be downloaded from Azure blob storage to a compute node.
-type ResourceFile struct {
- // BlobSource - Gets or sets the URL of a blob in Azure storage. The Batch service downloads the blob to the specified file path. The URL must be readable using anonymous access.
- BlobSource *string `json:"blobSource,omitempty"`
- // FilePath - Gets or sets the location on the compute node to which the file should be downloaded.
- FilePath *string `json:"filePath,omitempty"`
-}
-
-// ResourceStatistics statistics related to resource consumption by compute nodes in a pool.
-type ResourceStatistics struct {
- // StartTime - Gets or sets the start time of the time range covered by the statistics.
- StartTime *date.Time `json:"startTime,omitempty"`
- // LastUpdateTime - Gets or sets the time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime.
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- // AvgCPUPercentage - Gets or sets the average CPU usage across all nodes in the pool (percentage per node).
- AvgCPUPercentage *float64 `json:"avgCPUPercentage,omitempty"`
- // AvgMemoryGiB - Gets or sets the average memory usage in GiB across all nodes in the pool.
- AvgMemoryGiB *float64 `json:"avgMemoryGiB,omitempty"`
- // PeakMemoryGiB - Gets or sets the peak memory usage in GiB across all nodes in the pool.
- PeakMemoryGiB *float64 `json:"peakMemoryGiB,omitempty"`
- // AvgDiskGiB - Gets or sets the average used disk space in GiB across all nodes in the pool.
- AvgDiskGiB *float64 `json:"avgDiskGiB,omitempty"`
- // PeakDiskGiB - Gets or sets the peak used disk space in GiB across all nodes in the pool.
- PeakDiskGiB *float64 `json:"peakDiskGiB,omitempty"`
- // DiskReadIOps - Gets or sets the total number of disk read operations across all nodes in the pool.
- DiskReadIOps *int64 `json:"diskReadIOps,omitempty"`
- // DiskWriteIOps - Gets or sets the total number of disk write operations across all nodes in the pool.
- DiskWriteIOps *int64 `json:"diskWriteIOps,omitempty"`
- // DiskReadGiB - Gets or sets the total amount of data in GiB of disk reads across all nodes in the pool.
- DiskReadGiB *float64 `json:"diskReadGiB,omitempty"`
- // DiskWriteGiB - Gets or sets the total amount of data in GiB of disk writes across all nodes in the pool.
- DiskWriteGiB *float64 `json:"diskWriteGiB,omitempty"`
- // NetworkReadGiB - Gets or sets the total amount of data in GiB of network reads across all nodes in the pool.
- NetworkReadGiB *float64 `json:"networkReadGiB,omitempty"`
- // NetworkWriteGiB - Gets or sets the total amount of data in GiB of network writes across all nodes in the pool.
- NetworkWriteGiB *float64 `json:"networkWriteGiB,omitempty"`
-}
-
-// Schedule the schedule according to which jobs will be created
-type Schedule struct {
- // DoNotRunUntil - Gets or sets the earliest time at which any job may be created under this job schedule. If you do not specify a doNotRunUntil time, the schedule becomes ready to create jobs immediately.
- DoNotRunUntil *date.Time `json:"doNotRunUntil,omitempty"`
- // DoNotRunAfter - Gets or sets a time after which no job will be created under this job schedule. The schedule will move to the completed state as soon as this deadline is past and there is no active job under this job schedule.
- DoNotRunAfter *date.Time `json:"doNotRunAfter,omitempty"`
- // StartWindow - Gets or sets the time interval, starting from the time at which the schedule indicates a job should be created, within which a job must be created. If a job is not created within the startWindow interval, then the 'opportunity' is lost; no job will be created until the next recurrence of the schedule.
- StartWindow *string `json:"startWindow,omitempty"`
- // RecurrenceInterval - Gets or sets the time interval between the start times of two successive jobs under the job schedule. A job schedule can have at most one active job under it at any given time.
- RecurrenceInterval *string `json:"recurrenceInterval,omitempty"`
-}
-
-// StartTask a task defined on a pool and run by compute nodes when they join the pool.
-type StartTask struct {
- // CommandLine - Gets or sets the command line of the start task.
- CommandLine *string `json:"commandLine,omitempty"`
- // ResourceFiles - Gets or sets a list of files that Batch will download to the compute node before running the command line.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- // EnvironmentSettings - Gets or sets a list of environment variable settings for the start task.
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- // RunElevated - Gets or sets whether to run the start task in elevated mode. The default value is false.
- RunElevated *bool `json:"runElevated,omitempty"`
- // MaxTaskRetryCount - Gets or sets the maximum number of times the task may be retried.
- MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"`
- // WaitForSuccess - Gets or sets whether the Batch Service should wait for the start task to complete successfully (that is, to exit with exit code 0) before scheduling any tasks on the compute node.
- WaitForSuccess *bool `json:"waitForSuccess,omitempty"`
-}
-
-// StartTaskInformation information about a start task running on a compute node.
-type StartTaskInformation struct {
- // State - Gets or sets the state of the start task on the compute node. Possible values include: 'StartTaskStateRunning', 'StartTaskStateCompleted'
- State StartTaskState `json:"state,omitempty"`
- // StartTime - Gets or sets the time at which the start task started running.
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - Gets or sets the time at which the start task stopped running.
- EndTime *date.Time `json:"endTime,omitempty"`
- // ExitCode - Gets or sets the exit code of the start task.
- ExitCode *int32 `json:"exitCode,omitempty"`
- // SchedulingError - Gets or sets any error encountered scheduling the start task.
- SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"`
- // RetryCount - Gets or sets the number of times the task has been retried by the Batch service.
- RetryCount *int32 `json:"retryCount,omitempty"`
- // LastRetryTime - Gets or sets the most recent time at which a retry of the task started running.
- LastRetryTime *date.Time `json:"lastRetryTime,omitempty"`
-}
-
-// SubtaskInformation information about an Azure Batch subtask.
-type SubtaskInformation struct {
- // ID - Gets or sets the id of the subtask.
- ID *int32 `json:"id,omitempty"`
- // NodeInfo - Gets or sets information about the compute node on which the subtask ran.
- NodeInfo *ComputeNodeInformation `json:"nodeInfo,omitempty"`
- // StartTime - Gets or sets the time at which the subtask started running. If the subtask has been restarted or retried, this is the most recent time at which the subtask started running.
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - Gets or sets the time at which the subtask completed. This property is set only if the subtask is in the Completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
- // ExitCode - Gets or sets the exit code of the subtask. This property is set only if the subtask is in the Completed state.
- ExitCode *int32 `json:"exitCode,omitempty"`
- // SchedulingError - Gets or sets details of any error encountered scheduling the subtask.
- SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"`
- // State - Gets or sets the current state of the subtask. Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted'
- State TaskState `json:"state,omitempty"`
- // StateTransitionTime - Gets or sets the time at which the subtask entered its current state.
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // PreviousState - Gets or sets the previous state of the subtask. This property is not set if the subtask is in its initial Active state. Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted'
- PreviousState TaskState `json:"previousState,omitempty"`
- // PreviousStateTransitionTime - Gets or sets the time at which the subtask entered its previous state. This property is not set if the subtask is in its initial Active state.
- PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"`
-}
-
-// TaskAddParameter an Azure Batch task to add.
-type TaskAddParameter struct {
- // ID - Gets or sets a string that uniquely identifies the task within the job. The id can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters.
- ID *string `json:"id,omitempty"`
- // DisplayName - Gets or sets a display name for the task.
- DisplayName *string `json:"displayName,omitempty"`
- // CommandLine - Gets or sets the command line of the task. For multi-instance tasks, the command line is executed on the primary subtask after all the subtasks have finished executing the coordianation command line.
- CommandLine *string `json:"commandLine,omitempty"`
- // ResourceFiles - Gets or sets a list of files that Batch will download to the compute node before running the command line. For multi-instance tasks, the resource files will only be downloaded to the compute node on which the primary subtask is executed.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- // EnvironmentSettings - Gets or sets a list of environment variable settings for the task.
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- // AffinityInfo - Gets or sets a locality hint that can be used by the Batch service to select a compute node on which to start the new task.
- AffinityInfo *AffinityInformation `json:"affinityInfo,omitempty"`
- // Constraints - Gets or sets the execution constraints that apply to this task.
- Constraints *TaskConstraints `json:"constraints,omitempty"`
- // RunElevated - Gets or sets whether to run the task in elevated mode.
- RunElevated *bool `json:"runElevated,omitempty"`
- // MultiInstanceSettings - Gets or sets information about how to run the multi-instance task.
- MultiInstanceSettings *MultiInstanceSettings `json:"multiInstanceSettings,omitempty"`
- // DependsOn - Gets or sets any dependencies this task has.
- DependsOn *TaskDependencies `json:"dependsOn,omitempty"`
-}
-
-// TaskConstraints constraints to apply to the Job Manager task.
-type TaskConstraints struct {
- // MaxWallClockTime - Gets or sets the maximum elapsed time that the task may run, measured from the time the task starts. If the task does not complete within the time limit, the Batch service terminates it.
- MaxWallClockTime *string `json:"maxWallClockTime,omitempty"`
- // RetentionTime - Gets or sets the minimum time to retain the working directory for the task on the compute node where it ran. After this time, the Batch service may delete the working directory and all its contents. The default is infinite.
- RetentionTime *string `json:"retentionTime,omitempty"`
- // MaxTaskRetryCount - Gets or sets the maximum number of times the task may be retried. The Batch service retries a task if its exit code is nonzero.
- MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"`
-}
-
-// TaskDependencies specifies any dependencies of a task. Any task that is explicitly specified or within a
-// dependency range must complete before the dependant task will be scheduled.
-type TaskDependencies struct {
- // TaskIds - Gets or sets the list of task ids that must complete before this task can be scheduled.
- TaskIds *[]string `json:"taskIds,omitempty"`
- // TaskIDRanges - Gets or sets the list of task ranges that must complete before this task can be scheduled.
- TaskIDRanges *[]TaskIDRange `json:"taskIdRanges,omitempty"`
-}
-
-// TaskExecutionInformation information about the execution of a task.
-type TaskExecutionInformation struct {
- // StartTime - Gets or sets the time at which the task started running. If the task has been restarted or retried, this is the most recent time at which the task started running.
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - Gets or sets the time at which the task completed. This property is set only if the task is in the Completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
- // ExitCode - Gets or sets the exit code of the task. This property is set only if the task is in completed state.
- ExitCode *int32 `json:"exitCode,omitempty"`
- // SchedulingError - Gets or sets details of any error encountered scheduling the task.
- SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"`
- // RetryCount - Gets or sets the number of times the task has been retried by the Batch service.
- RetryCount *int32 `json:"retryCount,omitempty"`
- // LastRetryTime - Gets or sets the most recent time at which a retry of the task started running.
- LastRetryTime *date.Time `json:"lastRetryTime,omitempty"`
- // RequeueCount - Gets or sets the number of times the task has been requeued by the Batch service as the result of a user request.
- RequeueCount *int32 `json:"requeueCount,omitempty"`
- // LastRequeueTime - Gets or sets the most recent time at which the task has been requeued by the Batch service as the result of a user request.
- LastRequeueTime *date.Time `json:"lastRequeueTime,omitempty"`
-}
-
-// TaskIDRange ...
-type TaskIDRange struct {
- // Start - Gets or sets the first task id in the range.
- Start *int32 `json:"start,omitempty"`
- // End - Gets or sets the last task id in the range.
- End *int32 `json:"end,omitempty"`
-}
-
-// TaskInformation information about a task running on a compute node.
-type TaskInformation struct {
- // TaskURL - Gets or sets the URL of the task.
- TaskURL *string `json:"taskUrl,omitempty"`
- // JobID - Gets or sets the id of the job to which the task belongs.
- JobID *string `json:"jobId,omitempty"`
- // TaskID - Gets or sets the id of the task.
- TaskID *string `json:"taskId,omitempty"`
- // SubtaskID - Gets or sets the id of the subtask if the task is a multi-instance task.
- SubtaskID *int32 `json:"subtaskId,omitempty"`
- // TaskState - Gets or sets the current state of the task. Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted'
- TaskState TaskState `json:"taskState,omitempty"`
- // ExecutionInfo - Gets or sets information about the execution of the task.
- ExecutionInfo *TaskExecutionInformation `json:"executionInfo,omitempty"`
-}
-
-// TaskSchedulingError information about an error when scheduling a task.
-type TaskSchedulingError struct {
- // Category - Gets or sets the category of the task scheduling error. Possible values include: 'SchedulingErrorCategoryUsererror', 'SchedulingErrorCategoryServererror', 'SchedulingErrorCategoryUnmapped'
- Category SchedulingErrorCategory `json:"category,omitempty"`
- // Code - Gets or sets an identifier for the task scheduling error. Codes are invariant and are intended to be consumed programmatically.
- Code *string `json:"code,omitempty"`
- // Message - Gets or sets a message describing the task scheduling error, intended to be suitable for display in a user interface.
- Message *string `json:"message,omitempty"`
- // Details - Gets or sets the list of additional error details related to the scheduling error.
- Details *[]NameValuePair `json:"details,omitempty"`
-}
-
-// TaskSchedulingPolicy specifies how tasks should be distributed across compute nodes.
-type TaskSchedulingPolicy struct {
- // NodeFillType - Gets or sets how tasks should be distributed across compute nodes. Possible values include: 'ComputeNodeFillTypeSpread', 'ComputeNodeFillTypePack', 'ComputeNodeFillTypeUnmapped'
- NodeFillType ComputeNodeFillType `json:"nodeFillType,omitempty"`
-}
-
-// TaskStatistics resource usage statistics for a task.
-type TaskStatistics struct {
- // URL - Gets or sets the URL for the statistics.
- URL *string `json:"url,omitempty"`
- // StartTime - Gets or sets the start time of the time range covered by the statistics.
- StartTime *date.Time `json:"startTime,omitempty"`
- // LastUpdateTime - Gets or sets the time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime.
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- // UserCPUTime - Gets or sets the total user mode CPU time (summed across all cores and all compute nodes) consumed by the task.
- UserCPUTime *string `json:"userCPUTime,omitempty"`
- // KernelCPUTime - Gets or sets the total kernel mode CPU time (summed across all cores and all compute nodes) consumed by the task.
- KernelCPUTime *string `json:"kernelCPUTime,omitempty"`
- // WallClockTime - Gets or sets the total wall clock time of the task.
- WallClockTime *string `json:"wallClockTime,omitempty"`
- // ReadIOps - Gets or sets the total number of I/O read operations performed by the task.
- ReadIOps *int64 `json:"readIOps,omitempty"`
- // WriteIOps - Gets or sets the total number of I/O write operations performed by the task.
- WriteIOps *int64 `json:"writeIOps,omitempty"`
- // ReadIOGiB - Gets or sets the total amount of data in GiB of I/O read by the task.
- ReadIOGiB *float64 `json:"readIOGiB,omitempty"`
- // WriteIOGiB - Gets or sets the total amount of data in GiB of I/O written by the task.
- WriteIOGiB *float64 `json:"writeIOGiB,omitempty"`
- // WaitTime - Gets or sets the elapsed time between the creation of the task and the start of task execution.
- WaitTime *string `json:"waitTime,omitempty"`
-}
-
-// TaskUpdateParameter parameters for a CloudTaskOperations.Update request.
-type TaskUpdateParameter struct {
- // Constraints - Sets constraints that apply to this task. If omitted, the task is given the default constraints.
- Constraints *TaskConstraints `json:"constraints,omitempty"`
-}
-
-// UsageStatistics statistics related to pool usage information.
-type UsageStatistics struct {
- // StartTime - Gets or sets the start time of the time range covered by the statistics.
- StartTime *date.Time `json:"startTime,omitempty"`
- // LastUpdateTime - Gets or sets the time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime.
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- // DedicatedCoreTime - Gets or sets the aggregated wall-clock time of the dedicated compute node cores being part of the pool.
- DedicatedCoreTime *string `json:"dedicatedCoreTime,omitempty"`
-}
diff --git a/services/batch/2015-12-01.2.2/batch/pool.go b/services/batch/2015-12-01.2.2/batch/pool.go
deleted file mode 100644
index 7c8de2397578..000000000000
--- a/services/batch/2015-12-01.2.2/batch/pool.go
+++ /dev/null
@@ -1,1734 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "net/http"
-)
-
-// PoolClient is the a client for issuing REST requests to the Azure Batch service.
-type PoolClient struct {
- BaseClient
-}
-
-// NewPoolClient creates an instance of the PoolClient client.
-func NewPoolClient() PoolClient {
- return NewPoolClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewPoolClientWithBaseURI creates an instance of the PoolClient client.
-func NewPoolClientWithBaseURI(baseURI string) PoolClient {
- return PoolClient{NewWithBaseURI(baseURI)}
-}
-
-// Add adds a pool to the specified account.
-//
-// pool is specifies the pool to be added. timeout is sets the maximum time that the server can spend processing
-// the request, in seconds. The default is 30 seconds. clientRequestID is caller generated request identity, in the
-// form of a GUID with no decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is specifies if the server should return the client-request-id identifier in the response.
-// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with
-// the current system clock time.
-func (client PoolClient) Add(ctx context.Context, pool PoolAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: pool,
- Constraints: []validation.Constraint{{Target: "pool.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "pool.VMSize", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "pool.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "Add", err.Error())
- }
-
- req, err := client.AddPreparer(ctx, pool, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPreparer prepares the Add request.
-func (client PoolClient) AddPreparer(ctx context.Context, pool PoolAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/pools"),
- autorest.WithJSON(pool),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSender sends the Add request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) AddSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddResponder handles the response to the Add request. The method always
-// closes the http.Response Body.
-func (client PoolClient) AddResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Delete deletes a pool from the specified account.
-//
-// poolID is the id of the pool to delete. timeout is sets the maximum time that the server can spend processing
-// the request, in seconds. The default is 30 seconds. clientRequestID is caller generated request identity, in the
-// form of a GUID with no decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is specifies if the server should return the client-request-id identifier in the response.
-// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with
-// the current system clock time. ifMatch is an ETag is specified. Specify this header to perform the operation
-// only if the resource's ETag is an exact match as specified. ifNoneMatch is an ETag is specified. Specify this
-// header to perform the operation only if the resource's ETag does not match the specified ETag. ifModifiedSince
-// is specify this header to perform the operation only if the resource has been modified since the specified
-// date/time. ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been
-// modified since the specified date/time.
-func (client PoolClient) Delete(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeletePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client PoolClient) DeletePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client PoolClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// DisableAutoScale disables automatic scaling for a pool.
-//
-// poolID is the id of the pool on which to disable automatic scaling. timeout is sets the maximum time that the
-// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is caller
-// generated request identity, in the form of a GUID with no decoration such as curly braces e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client PoolClient) DisableAutoScale(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DisableAutoScalePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DisableAutoScaleSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", resp, "Failure sending request")
- return
- }
-
- result, err = client.DisableAutoScaleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DisableAutoScalePreparer prepares the DisableAutoScale request.
-func (client PoolClient) DisableAutoScalePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/disableautoscale", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DisableAutoScaleSender sends the DisableAutoScale request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) DisableAutoScaleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DisableAutoScaleResponder handles the response to the DisableAutoScale request. The method always
-// closes the http.Response Body.
-func (client PoolClient) DisableAutoScaleResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// EnableAutoScale enables automatic scaling for a pool.
-//
-// poolID is the id of the pool on which to enable automatic scaling. poolEnableAutoScaleParameter is the
-// parameters for the request. timeout is sets the maximum time that the server can spend processing the request,
-// in seconds. The default is 30 seconds. clientRequestID is caller generated request identity, in the form of a
-// GUID with no decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is
-// specifies if the server should return the client-request-id identifier in the response. ocpDate is the time the
-// request was issued. If not specified, this header will be automatically populated with the current system clock
-// time. ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag
-// is an exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the
-// operation only if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header
-// to perform the operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince
-// is specify this header to perform the operation only if the resource has not been modified since the specified
-// date/time.
-func (client PoolClient) EnableAutoScale(ctx context.Context, poolID string, poolEnableAutoScaleParameter PoolEnableAutoScaleParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.EnableAutoScalePreparer(ctx, poolID, poolEnableAutoScaleParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.EnableAutoScaleSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", resp, "Failure sending request")
- return
- }
-
- result, err = client.EnableAutoScaleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", resp, "Failure responding to request")
- }
-
- return
-}
-
-// EnableAutoScalePreparer prepares the EnableAutoScale request.
-func (client PoolClient) EnableAutoScalePreparer(ctx context.Context, poolID string, poolEnableAutoScaleParameter PoolEnableAutoScaleParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/enableautoscale", pathParameters),
- autorest.WithJSON(poolEnableAutoScaleParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// EnableAutoScaleSender sends the EnableAutoScale request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) EnableAutoScaleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// EnableAutoScaleResponder handles the response to the EnableAutoScale request. The method always
-// closes the http.Response Body.
-func (client PoolClient) EnableAutoScaleResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// EvaluateAutoScale gets the result of evaluating an automatic scaling formula on the pool.
-//
-// poolID is the id of the pool on which to evaluate the automatic scaling formula. poolEvaluateAutoScaleParameter
-// is the parameters for the request. timeout is sets the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is caller generated request identity, in the
-// form of a GUID with no decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is specifies if the server should return the client-request-id identifier in the response.
-// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with
-// the current system clock time.
-func (client PoolClient) EvaluateAutoScale(ctx context.Context, poolID string, poolEvaluateAutoScaleParameter PoolEvaluateAutoScaleParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result AutoScaleRun, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: poolEvaluateAutoScaleParameter,
- Constraints: []validation.Constraint{{Target: "poolEvaluateAutoScaleParameter.AutoScaleFormula", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "EvaluateAutoScale", err.Error())
- }
-
- req, err := client.EvaluateAutoScalePreparer(ctx, poolID, poolEvaluateAutoScaleParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.EvaluateAutoScaleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", resp, "Failure sending request")
- return
- }
-
- result, err = client.EvaluateAutoScaleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", resp, "Failure responding to request")
- }
-
- return
-}
-
-// EvaluateAutoScalePreparer prepares the EvaluateAutoScale request.
-func (client PoolClient) EvaluateAutoScalePreparer(ctx context.Context, poolID string, poolEvaluateAutoScaleParameter PoolEvaluateAutoScaleParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/evaluateautoscale", pathParameters),
- autorest.WithJSON(poolEvaluateAutoScaleParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// EvaluateAutoScaleSender sends the EvaluateAutoScale request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) EvaluateAutoScaleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// EvaluateAutoScaleResponder handles the response to the EvaluateAutoScale request. The method always
-// closes the http.Response Body.
-func (client PoolClient) EvaluateAutoScaleResponder(resp *http.Response) (result AutoScaleRun, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Exists gets basic properties of a pool.
-//
-// poolID is the id of the pool to get. selectParameter is sets an OData $select clause. timeout is sets the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly
-// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return
-// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified,
-// this header will be automatically populated with the current system clock time. ifMatch is an ETag is specified.
-// Specify this header to perform the operation only if the resource's ETag is an exact match as specified.
-// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag
-// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the
-// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform
-// the operation only if the resource has not been modified since the specified date/time.
-func (client PoolClient) Exists(ctx context.Context, poolID string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.ExistsPreparer(ctx, poolID, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ExistsSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", resp, "Failure sending request")
- return
- }
-
- result, err = client.ExistsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ExistsPreparer prepares the Exists request.
-func (client PoolClient) ExistsPreparer(ctx context.Context, poolID string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsHead(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ExistsSender sends the Exists request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) ExistsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ExistsResponder handles the response to the Exists request. The method always
-// closes the http.Response Body.
-func (client PoolClient) ExistsResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get gets information about the specified pool.
-//
-// poolID is the id of the pool to get. selectParameter is sets an OData $select clause. expand is sets an OData
-// $expand clause. timeout is sets the maximum time that the server can spend processing the request, in seconds.
-// The default is 30 seconds. clientRequestID is caller generated request identity, in the form of a GUID with no
-// decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if
-// the server should return the client-request-id identifier in the response. ocpDate is the time the request was
-// issued. If not specified, this header will be automatically populated with the current system clock time.
-// ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag is an
-// exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only
-// if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the
-// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify
-// this header to perform the operation only if the resource has not been modified since the specified date/time.
-func (client PoolClient) Get(ctx context.Context, poolID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudPool, err error) {
- req, err := client.GetPreparer(ctx, poolID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client PoolClient) GetPreparer(ctx context.Context, poolID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client PoolClient) GetResponder(resp *http.Response) (result CloudPool, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetAllPoolsLifetimeStatistics gets lifetime summary statistics for all of the pools in the specified account.
-// Statistics are aggregated across all pools that have ever existed in the account, from account creation to the last
-// update time of the statistics.
-//
-// timeout is sets the maximum time that the server can spend processing the request, in seconds. The default is 30
-// seconds. clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as
-// curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should
-// return the client-request-id identifier in the response. ocpDate is the time the request was issued. If not
-// specified, this header will be automatically populated with the current system clock time.
-func (client PoolClient) GetAllPoolsLifetimeStatistics(ctx context.Context, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolStatistics, err error) {
- req, err := client.GetAllPoolsLifetimeStatisticsPreparer(ctx, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllPoolsLifetimeStatistics", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetAllPoolsLifetimeStatisticsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllPoolsLifetimeStatistics", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetAllPoolsLifetimeStatisticsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllPoolsLifetimeStatistics", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetAllPoolsLifetimeStatisticsPreparer prepares the GetAllPoolsLifetimeStatistics request.
-func (client PoolClient) GetAllPoolsLifetimeStatisticsPreparer(ctx context.Context, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/lifetimepoolstats"),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetAllPoolsLifetimeStatisticsSender sends the GetAllPoolsLifetimeStatistics request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) GetAllPoolsLifetimeStatisticsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetAllPoolsLifetimeStatisticsResponder handles the response to the GetAllPoolsLifetimeStatistics request. The method always
-// closes the http.Response Body.
-func (client PoolClient) GetAllPoolsLifetimeStatisticsResponder(resp *http.Response) (result PoolStatistics, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List lists all of the pools in the specified account.
-//
-// filter is sets an OData $filter clause. selectParameter is sets an OData $select clause. expand is sets an OData
-// $expand clause. maxResults is sets the maximum number of items to return in the response. timeout is sets the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly
-// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return
-// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified,
-// this header will be automatically populated with the current system clock time.
-func (client PoolClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudPoolListResultPage, err error) {
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.cplr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", resp, "Failure sending request")
- return
- }
-
- result.cplr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client PoolClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/pools"),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client PoolClient) ListResponder(resp *http.Response) (result CloudPoolListResult, 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 PoolClient) listNextResults(lastResults CloudPoolListResult) (result CloudPoolListResult, err error) {
- req, err := lastResults.cloudPoolListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.PoolClient", "listNextResults", 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.PoolClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client PoolClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudPoolListResultIterator, err error) {
- result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// ListPoolUsageMetrics lists the usage metrics, aggregated by pool across individual time intervals, for the specified
-// account.
-//
-// startTime is the earliest time from which to include metrics. This must be at least two and a half hours before
-// the current time. endTime is the latest time from which to include metrics. This must be at least two hours
-// before the current time. filter is sets an OData $filter clause. maxResults is sets the maximum number of items
-// to return in the response. timeout is sets the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is caller generated request identity, in the form of a GUID
-// with no decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is
-// specifies if the server should return the client-request-id identifier in the response. ocpDate is the time the
-// request was issued. If not specified, this header will be automatically populated with the current system clock
-// time.
-func (client PoolClient) ListPoolUsageMetrics(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolListPoolUsageMetricsResultPage, err error) {
- result.fn = client.listPoolUsageMetricsNextResults
- req, err := client.ListPoolUsageMetricsPreparer(ctx, startTime, endTime, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListPoolUsageMetrics", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListPoolUsageMetricsSender(req)
- if err != nil {
- result.plpumr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListPoolUsageMetrics", resp, "Failure sending request")
- return
- }
-
- result.plpumr, err = client.ListPoolUsageMetricsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListPoolUsageMetrics", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPoolUsageMetricsPreparer prepares the ListPoolUsageMetrics request.
-func (client PoolClient) ListPoolUsageMetricsPreparer(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if startTime != nil {
- queryParameters["starttime"] = autorest.Encode("query", *startTime)
- }
- if endTime != nil {
- queryParameters["endtime"] = autorest.Encode("query", *endTime)
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/poolusagemetrics"),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListPoolUsageMetricsSender sends the ListPoolUsageMetrics request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) ListPoolUsageMetricsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListPoolUsageMetricsResponder handles the response to the ListPoolUsageMetrics request. The method always
-// closes the http.Response Body.
-func (client PoolClient) ListPoolUsageMetricsResponder(resp *http.Response) (result PoolListPoolUsageMetricsResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listPoolUsageMetricsNextResults retrieves the next set of results, if any.
-func (client PoolClient) listPoolUsageMetricsNextResults(lastResults PoolListPoolUsageMetricsResult) (result PoolListPoolUsageMetricsResult, err error) {
- req, err := lastResults.poolListPoolUsageMetricsResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.PoolClient", "listPoolUsageMetricsNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListPoolUsageMetricsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.PoolClient", "listPoolUsageMetricsNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListPoolUsageMetricsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "listPoolUsageMetricsNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListPoolUsageMetricsComplete enumerates all values, automatically crossing page boundaries as required.
-func (client PoolClient) ListPoolUsageMetricsComplete(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolListPoolUsageMetricsResultIterator, err error) {
- result.page, err = client.ListPoolUsageMetrics(ctx, startTime, endTime, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// Patch updates the properties of a pool.
-//
-// poolID is the id of the pool to update. poolPatchParameter is the parameters for the request. timeout is sets
-// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly
-// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return
-// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified,
-// this header will be automatically populated with the current system clock time. ifMatch is an ETag is specified.
-// Specify this header to perform the operation only if the resource's ETag is an exact match as specified.
-// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag
-// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the
-// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform
-// the operation only if the resource has not been modified since the specified date/time.
-func (client PoolClient) Patch(ctx context.Context, poolID string, poolPatchParameter PoolPatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.PatchPreparer(ctx, poolID, poolPatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.PatchSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", resp, "Failure sending request")
- return
- }
-
- result, err = client.PatchResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", resp, "Failure responding to request")
- }
-
- return
-}
-
-// PatchPreparer prepares the Patch request.
-func (client PoolClient) PatchPreparer(ctx context.Context, poolID string, poolPatchParameter PoolPatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
- autorest.AsPatch(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}", pathParameters),
- autorest.WithJSON(poolPatchParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// PatchSender sends the Patch request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) PatchSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// PatchResponder handles the response to the Patch request. The method always
-// closes the http.Response Body.
-func (client PoolClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// RemoveNodes removes compute nodes from the specified pool.
-//
-// poolID is the id of the pool from which you want to remove nodes. nodeRemoveParameter is the parameters for the
-// request. timeout is sets the maximum time that the server can spend processing the request, in seconds. The
-// default is 30 seconds. clientRequestID is caller generated request identity, in the form of a GUID with no
-// decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if
-// the server should return the client-request-id identifier in the response. ocpDate is the time the request was
-// issued. If not specified, this header will be automatically populated with the current system clock time.
-// ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag is an
-// exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only
-// if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the
-// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify
-// this header to perform the operation only if the resource has not been modified since the specified date/time.
-func (client PoolClient) RemoveNodes(ctx context.Context, poolID string, nodeRemoveParameter NodeRemoveParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: nodeRemoveParameter,
- Constraints: []validation.Constraint{{Target: "nodeRemoveParameter.NodeList", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "RemoveNodes", err.Error())
- }
-
- req, err := client.RemoveNodesPreparer(ctx, poolID, nodeRemoveParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.RemoveNodesSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", resp, "Failure sending request")
- return
- }
-
- result, err = client.RemoveNodesResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", resp, "Failure responding to request")
- }
-
- return
-}
-
-// RemoveNodesPreparer prepares the RemoveNodes request.
-func (client PoolClient) RemoveNodesPreparer(ctx context.Context, poolID string, nodeRemoveParameter NodeRemoveParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/removenodes", pathParameters),
- autorest.WithJSON(nodeRemoveParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// RemoveNodesSender sends the RemoveNodes request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) RemoveNodesSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// RemoveNodesResponder handles the response to the RemoveNodes request. The method always
-// closes the http.Response Body.
-func (client PoolClient) RemoveNodesResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Resize changes the number of compute nodes that are assigned to a pool.
-//
-// poolID is the id of the pool to resize. poolResizeParameter is the parameters for the request. timeout is sets
-// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly
-// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return
-// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified,
-// this header will be automatically populated with the current system clock time. ifMatch is an ETag is specified.
-// Specify this header to perform the operation only if the resource's ETag is an exact match as specified.
-// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag
-// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the
-// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform
-// the operation only if the resource has not been modified since the specified date/time.
-func (client PoolClient) Resize(ctx context.Context, poolID string, poolResizeParameter PoolResizeParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: poolResizeParameter,
- Constraints: []validation.Constraint{{Target: "poolResizeParameter.TargetDedicated", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "Resize", err.Error())
- }
-
- req, err := client.ResizePreparer(ctx, poolID, poolResizeParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ResizeSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", resp, "Failure sending request")
- return
- }
-
- result, err = client.ResizeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ResizePreparer prepares the Resize request.
-func (client PoolClient) ResizePreparer(ctx context.Context, poolID string, poolResizeParameter PoolResizeParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/resize", pathParameters),
- autorest.WithJSON(poolResizeParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ResizeSender sends the Resize request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) ResizeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ResizeResponder handles the response to the Resize request. The method always
-// closes the http.Response Body.
-func (client PoolClient) ResizeResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// StopResize stops an ongoing resize operation on the pool. This does not restore the pool to its previous state
-// before the resize operation: it only stops any further changes being made, and the pool maintains its current state.
-//
-// poolID is the id of the pool whose resizing you want to stop. timeout is sets the maximum time that the server
-// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is caller generated
-// request identity, in the form of a GUID with no decoration such as curly braces e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified.
-// Specify this header to perform the operation only if the resource's ETag is an exact match as specified.
-// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag
-// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the
-// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform
-// the operation only if the resource has not been modified since the specified date/time.
-func (client PoolClient) StopResize(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.StopResizePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.StopResizeSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", resp, "Failure sending request")
- return
- }
-
- result, err = client.StopResizeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", resp, "Failure responding to request")
- }
-
- return
-}
-
-// StopResizePreparer prepares the StopResize request.
-func (client PoolClient) StopResizePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/stopresize", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// StopResizeSender sends the StopResize request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) StopResizeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// StopResizeResponder handles the response to the StopResize request. The method always
-// closes the http.Response Body.
-func (client PoolClient) StopResizeResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// UpdateProperties updates the properties of a pool.
-//
-// poolID is the id of the pool to update. poolUpdatePropertiesParameter is the parameters for the request. timeout
-// is sets the maximum time that the server can spend processing the request, in seconds. The default is 30
-// seconds. clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as
-// curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should
-// return the client-request-id identifier in the response. ocpDate is the time the request was issued. If not
-// specified, this header will be automatically populated with the current system clock time.
-func (client PoolClient) UpdateProperties(ctx context.Context, poolID string, poolUpdatePropertiesParameter PoolUpdatePropertiesParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: poolUpdatePropertiesParameter,
- Constraints: []validation.Constraint{{Target: "poolUpdatePropertiesParameter.CertificateReferences", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "poolUpdatePropertiesParameter.ApplicationPackageReferences", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "poolUpdatePropertiesParameter.Metadata", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "UpdateProperties", err.Error())
- }
-
- req, err := client.UpdatePropertiesPreparer(ctx, poolID, poolUpdatePropertiesParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdatePropertiesSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdatePropertiesResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePropertiesPreparer prepares the UpdateProperties request.
-func (client PoolClient) UpdatePropertiesPreparer(ctx context.Context, poolID string, poolUpdatePropertiesParameter PoolUpdatePropertiesParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/updateproperties", pathParameters),
- autorest.WithJSON(poolUpdatePropertiesParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdatePropertiesSender sends the UpdateProperties request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) UpdatePropertiesSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdatePropertiesResponder handles the response to the UpdateProperties request. The method always
-// closes the http.Response Body.
-func (client PoolClient) UpdatePropertiesResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// UpgradeOS upgrades the operating system of the specified pool.
-//
-// poolID is the id of the pool to upgrade. poolUpgradeOSParameter is the parameters for the request. timeout is
-// sets the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly
-// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return
-// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified,
-// this header will be automatically populated with the current system clock time. ifMatch is an ETag is specified.
-// Specify this header to perform the operation only if the resource's ETag is an exact match as specified.
-// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag
-// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the
-// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform
-// the operation only if the resource has not been modified since the specified date/time.
-func (client PoolClient) UpgradeOS(ctx context.Context, poolID string, poolUpgradeOSParameter PoolUpgradeOSParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: poolUpgradeOSParameter,
- Constraints: []validation.Constraint{{Target: "poolUpgradeOSParameter.TargetOSVersion", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "UpgradeOS", err.Error())
- }
-
- req, err := client.UpgradeOSPreparer(ctx, poolID, poolUpgradeOSParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpgradeOSSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpgradeOSResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpgradeOSPreparer prepares the UpgradeOS request.
-func (client PoolClient) UpgradeOSPreparer(ctx context.Context, poolID string, poolUpgradeOSParameter PoolUpgradeOSParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/upgradeos", pathParameters),
- autorest.WithJSON(poolUpgradeOSParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpgradeOSSender sends the UpgradeOS request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) UpgradeOSSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpgradeOSResponder handles the response to the UpgradeOS request. The method always
-// closes the http.Response Body.
-func (client PoolClient) UpgradeOSResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff --git a/services/batch/2015-12-01.2.2/batch/task.go b/services/batch/2015-12-01.2.2/batch/task.go
deleted file mode 100644
index 16ee482579bd..000000000000
--- a/services/batch/2015-12-01.2.2/batch/task.go
+++ /dev/null
@@ -1,794 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "net/http"
-)
-
-// TaskClient is the a client for issuing REST requests to the Azure Batch service.
-type TaskClient struct {
- BaseClient
-}
-
-// NewTaskClient creates an instance of the TaskClient client.
-func NewTaskClient() TaskClient {
- return NewTaskClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewTaskClientWithBaseURI creates an instance of the TaskClient client.
-func NewTaskClientWithBaseURI(baseURI string) TaskClient {
- return TaskClient{NewWithBaseURI(baseURI)}
-}
-
-// Add adds a task to the specified job.
-//
-// jobID is the id of the job to which the task is to be added. task is specifies the task to be added. timeout is
-// sets the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly
-// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return
-// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified,
-// this header will be automatically populated with the current system clock time.
-func (client TaskClient) Add(ctx context.Context, jobID string, task TaskAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: task,
- Constraints: []validation.Constraint{{Target: "task.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "task.CommandLine", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "task.MultiInstanceSettings", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "task.MultiInstanceSettings.NumberOfInstances", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil {
- return result, validation.NewError("batch.TaskClient", "Add", err.Error())
- }
-
- req, err := client.AddPreparer(ctx, jobID, task, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPreparer prepares the Add request.
-func (client TaskClient) AddPreparer(ctx context.Context, jobID string, task TaskAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks", pathParameters),
- autorest.WithJSON(task),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSender sends the Add request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) AddSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddResponder handles the response to the Add request. The method always
-// closes the http.Response Body.
-func (client TaskClient) AddResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Delete deletes a task from the specified job.
-//
-// jobID is the id of the job from which to delete the task. taskID is the id of the task to delete. timeout is
-// sets the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly
-// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return
-// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified,
-// this header will be automatically populated with the current system clock time. ifMatch is an ETag is specified.
-// Specify this header to perform the operation only if the resource's ETag is an exact match as specified.
-// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag
-// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the
-// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform
-// the operation only if the resource has not been modified since the specified date/time.
-func (client TaskClient) Delete(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeletePreparer(ctx, jobID, taskID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client TaskClient) DeletePreparer(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client TaskClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get gets information about the specified task.
-//
-// jobID is the id of the job that contains the task. taskID is the id of the task to get information about.
-// selectParameter is sets an OData $select clause. expand is sets an OData $expand clause. timeout is sets the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly
-// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return
-// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified,
-// this header will be automatically populated with the current system clock time. ifMatch is an ETag is specified.
-// Specify this header to perform the operation only if the resource's ETag is an exact match as specified.
-// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag
-// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the
-// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform
-// the operation only if the resource has not been modified since the specified date/time.
-func (client TaskClient) Get(ctx context.Context, jobID string, taskID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudTask, err error) {
- req, err := client.GetPreparer(ctx, jobID, taskID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client TaskClient) GetPreparer(ctx context.Context, jobID string, taskID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client TaskClient) GetResponder(resp *http.Response) (result CloudTask, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List lists all of the tasks that are associated with the specified job.
-//
-// jobID is the id of the job. filter is sets an OData $filter clause. selectParameter is sets an OData $select
-// clause. expand is sets an OData $expand clause. maxResults is sets the maximum number of items to return in the
-// response. timeout is sets the maximum time that the server can spend processing the request, in seconds. The
-// default is 30 seconds. clientRequestID is caller generated request identity, in the form of a GUID with no
-// decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if
-// the server should return the client-request-id identifier in the response. ocpDate is the time the request was
-// issued. If not specified, this header will be automatically populated with the current system clock time.
-func (client TaskClient) List(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListResultPage, err error) {
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, jobID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.ctlr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", resp, "Failure sending request")
- return
- }
-
- result.ctlr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client TaskClient) ListPreparer(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client TaskClient) ListResponder(resp *http.Response) (result CloudTaskListResult, 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 TaskClient) listNextResults(lastResults CloudTaskListResult) (result CloudTaskListResult, err error) {
- req, err := lastResults.cloudTaskListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.TaskClient", "listNextResults", 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.TaskClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client TaskClient) ListComplete(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListResultIterator, err error) {
- result.page, err = client.List(ctx, jobID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// ListSubtasks lists all of the subtasks that are associated with the specified multi-instance task.
-//
-// jobID is the id of the job. taskID is the id of the task. selectParameter is sets an OData $select clause.
-// timeout is sets the maximum time that the server can spend processing the request, in seconds. The default is 30
-// seconds. clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as
-// curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should
-// return the client-request-id identifier in the response. ocpDate is the time the request was issued. If not
-// specified, this header will be automatically populated with the current system clock time.
-func (client TaskClient) ListSubtasks(ctx context.Context, jobID string, taskID string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListSubtasksResult, err error) {
- req, err := client.ListSubtasksPreparer(ctx, jobID, taskID, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSubtasksSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListSubtasksResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListSubtasksPreparer prepares the ListSubtasks request.
-func (client TaskClient) ListSubtasksPreparer(ctx context.Context, jobID string, taskID string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/subtasksinfo", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSubtasksSender sends the ListSubtasks request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) ListSubtasksSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListSubtasksResponder handles the response to the ListSubtasks request. The method always
-// closes the http.Response Body.
-func (client TaskClient) ListSubtasksResponder(resp *http.Response) (result CloudTaskListSubtasksResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Terminate terminates the specified task.
-//
-// jobID is the id of the job containing the task. taskID is the id of the task to terminate. timeout is sets the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is caller generated request identity, in the form of a GUID with no decoration such as curly
-// braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is specifies if the server should return
-// the client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified,
-// this header will be automatically populated with the current system clock time. ifMatch is an ETag is specified.
-// Specify this header to perform the operation only if the resource's ETag is an exact match as specified.
-// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag
-// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the
-// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform
-// the operation only if the resource has not been modified since the specified date/time.
-func (client TaskClient) Terminate(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.TerminatePreparer(ctx, jobID, taskID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.TerminateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", resp, "Failure sending request")
- return
- }
-
- result, err = client.TerminateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", resp, "Failure responding to request")
- }
-
- return
-}
-
-// TerminatePreparer prepares the Terminate request.
-func (client TaskClient) TerminatePreparer(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/terminate", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// TerminateSender sends the Terminate request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) TerminateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// TerminateResponder handles the response to the Terminate request. The method always
-// closes the http.Response Body.
-func (client TaskClient) TerminateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Update updates the properties of the specified task.
-//
-// jobID is the id of the job containing the task. taskID is the id of the task to update. taskUpdateParameter is
-// the parameters for the request. timeout is sets the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is caller generated request identity, in the
-// form of a GUID with no decoration such as curly braces e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is specifies if the server should return the client-request-id identifier in the response.
-// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with
-// the current system clock time. ifMatch is an ETag is specified. Specify this header to perform the operation
-// only if the resource's ETag is an exact match as specified. ifNoneMatch is an ETag is specified. Specify this
-// header to perform the operation only if the resource's ETag does not match the specified ETag. ifModifiedSince
-// is specify this header to perform the operation only if the resource has been modified since the specified
-// date/time. ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been
-// modified since the specified date/time.
-func (client TaskClient) Update(ctx context.Context, jobID string, taskID string, taskUpdateParameter TaskUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.UpdatePreparer(ctx, jobID, taskID, taskUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePreparer prepares the Update request.
-func (client TaskClient) UpdatePreparer(ctx context.Context, jobID string, taskID string, taskUpdateParameter TaskUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2015-12-01.2.2"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters),
- autorest.WithJSON(taskUpdateParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSender sends the Update request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) UpdateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateResponder handles the response to the Update request. The method always
-// closes the http.Response Body.
-func (client TaskClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff --git a/services/batch/2016-02-01.3.0/batch/account.go b/services/batch/2016-02-01.3.0/batch/account.go
deleted file mode 100644
index 27490de07747..000000000000
--- a/services/batch/2016-02-01.3.0/batch/account.go
+++ /dev/null
@@ -1,157 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "net/http"
-)
-
-// AccountClient is the a client for issuing REST requests to the Azure Batch service.
-type AccountClient struct {
- BaseClient
-}
-
-// NewAccountClient creates an instance of the AccountClient client.
-func NewAccountClient() AccountClient {
- return NewAccountClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewAccountClientWithBaseURI creates an instance of the AccountClient client.
-func NewAccountClientWithBaseURI(baseURI string) AccountClient {
- return AccountClient{NewWithBaseURI(baseURI)}
-}
-
-// ListNodeAgentSkus lists all node agent SKUs supported by the Azure Batch service.
-//
-// filter is an OData $filter clause. maxResults is the maximum number of items to return in the response. timeout
-// is the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client AccountClient) ListNodeAgentSkus(ctx context.Context, filter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result AccountListNodeAgentSkusResultPage, err error) {
- result.fn = client.listNodeAgentSkusNextResults
- req, err := client.ListNodeAgentSkusPreparer(ctx, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListNodeAgentSkus", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListNodeAgentSkusSender(req)
- if err != nil {
- result.alnasr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListNodeAgentSkus", resp, "Failure sending request")
- return
- }
-
- result.alnasr, err = client.ListNodeAgentSkusResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListNodeAgentSkus", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListNodeAgentSkusPreparer prepares the ListNodeAgentSkus request.
-func (client AccountClient) ListNodeAgentSkusPreparer(ctx context.Context, filter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/nodeagentskus"),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListNodeAgentSkusSender sends the ListNodeAgentSkus request. The method will close the
-// http.Response Body if it receives an error.
-func (client AccountClient) ListNodeAgentSkusSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListNodeAgentSkusResponder handles the response to the ListNodeAgentSkus request. The method always
-// closes the http.Response Body.
-func (client AccountClient) ListNodeAgentSkusResponder(resp *http.Response) (result AccountListNodeAgentSkusResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listNodeAgentSkusNextResults retrieves the next set of results, if any.
-func (client AccountClient) listNodeAgentSkusNextResults(lastResults AccountListNodeAgentSkusResult) (result AccountListNodeAgentSkusResult, err error) {
- req, err := lastResults.accountListNodeAgentSkusResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.AccountClient", "listNodeAgentSkusNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListNodeAgentSkusSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.AccountClient", "listNodeAgentSkusNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListNodeAgentSkusResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.AccountClient", "listNodeAgentSkusNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListNodeAgentSkusComplete enumerates all values, automatically crossing page boundaries as required.
-func (client AccountClient) ListNodeAgentSkusComplete(ctx context.Context, filter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result AccountListNodeAgentSkusResultIterator, err error) {
- result.page, err = client.ListNodeAgentSkus(ctx, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
diff --git a/services/batch/2016-02-01.3.0/batch/application.go b/services/batch/2016-02-01.3.0/batch/application.go
deleted file mode 100644
index b69f0c0a3907..000000000000
--- a/services/batch/2016-02-01.3.0/batch/application.go
+++ /dev/null
@@ -1,240 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "net/http"
-)
-
-// ApplicationClient is the a client for issuing REST requests to the Azure Batch service.
-type ApplicationClient struct {
- BaseClient
-}
-
-// NewApplicationClient creates an instance of the ApplicationClient client.
-func NewApplicationClient() ApplicationClient {
- return NewApplicationClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewApplicationClientWithBaseURI creates an instance of the ApplicationClient client.
-func NewApplicationClientWithBaseURI(baseURI string) ApplicationClient {
- return ApplicationClient{NewWithBaseURI(baseURI)}
-}
-
-// Get gets information about the specified application.
-//
-// applicationID is the id of the application. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id identifier in the response.
-// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with
-// the current system clock time.
-func (client ApplicationClient) Get(ctx context.Context, applicationID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationSummary, err error) {
- req, err := client.GetPreparer(ctx, applicationID, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client ApplicationClient) GetPreparer(ctx context.Context, applicationID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "applicationId": autorest.Encode("path", applicationID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/applications/{applicationId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client ApplicationClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client ApplicationClient) GetResponder(resp *http.Response) (result ApplicationSummary, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List lists all of the applications available in the specified account.
-//
-// maxResults is the maximum number of items to return in the response. timeout is the maximum time that the server
-// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated
-// request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client ApplicationClient) List(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationListResultPage, err error) {
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.alr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "List", resp, "Failure sending request")
- return
- }
-
- result.alr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client ApplicationClient) ListPreparer(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/applications"),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client ApplicationClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client ApplicationClient) ListResponder(resp *http.Response) (result ApplicationListResult, 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 ApplicationClient) listNextResults(lastResults ApplicationListResult) (result ApplicationListResult, err error) {
- req, err := lastResults.applicationListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.ApplicationClient", "listNextResults", 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.ApplicationClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client ApplicationClient) ListComplete(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationListResultIterator, err error) {
- result.page, err = client.List(ctx, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
diff --git a/services/batch/2016-02-01.3.0/batch/certificate.go b/services/batch/2016-02-01.3.0/batch/certificate.go
deleted file mode 100644
index 4cb6e2f0c218..000000000000
--- a/services/batch/2016-02-01.3.0/batch/certificate.go
+++ /dev/null
@@ -1,518 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "net/http"
-)
-
-// CertificateClient is the a client for issuing REST requests to the Azure Batch service.
-type CertificateClient struct {
- BaseClient
-}
-
-// NewCertificateClient creates an instance of the CertificateClient client.
-func NewCertificateClient() CertificateClient {
- return NewCertificateClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewCertificateClientWithBaseURI creates an instance of the CertificateClient client.
-func NewCertificateClientWithBaseURI(baseURI string) CertificateClient {
- return CertificateClient{NewWithBaseURI(baseURI)}
-}
-
-// Add adds a certificate to the specified account.
-//
-// certificate is the certificate to be added. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id identifier in the response.
-// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with
-// the current system clock time.
-func (client CertificateClient) Add(ctx context.Context, certificate CertificateAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: certificate,
- Constraints: []validation.Constraint{{Target: "certificate.Thumbprint", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "certificate.ThumbprintAlgorithm", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "certificate.Data", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.CertificateClient", "Add", err.Error())
- }
-
- req, err := client.AddPreparer(ctx, certificate, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPreparer prepares the Add request.
-func (client CertificateClient) AddPreparer(ctx context.Context, certificate CertificateAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/certificates"),
- autorest.WithJSON(certificate),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSender sends the Add request. The method will close the
-// http.Response Body if it receives an error.
-func (client CertificateClient) AddSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddResponder handles the response to the Add request. The method always
-// closes the http.Response Body.
-func (client CertificateClient) AddResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// CancelDeletion cancels a failed deletion of a certificate from the specified account.
-//
-// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is
-// the thumbprint of the certificate being deleted. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client CertificateClient) CancelDeletion(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.CancelDeletionPreparer(ctx, thumbprintAlgorithm, thumbprint, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.CancelDeletionSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", resp, "Failure sending request")
- return
- }
-
- result, err = client.CancelDeletionResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", resp, "Failure responding to request")
- }
-
- return
-}
-
-// CancelDeletionPreparer prepares the CancelDeletion request.
-func (client CertificateClient) CancelDeletionPreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "thumbprint": autorest.Encode("path", thumbprint),
- "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})/canceldelete", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CancelDeletionSender sends the CancelDeletion request. The method will close the
-// http.Response Body if it receives an error.
-func (client CertificateClient) CancelDeletionSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// CancelDeletionResponder handles the response to the CancelDeletion request. The method always
-// closes the http.Response Body.
-func (client CertificateClient) CancelDeletionResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Delete deletes a certificate from the specified account.
-//
-// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is
-// the thumbprint of the certificate to be deleted. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client CertificateClient) Delete(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeletePreparer(ctx, thumbprintAlgorithm, thumbprint, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client CertificateClient) DeletePreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "thumbprint": autorest.Encode("path", thumbprint),
- "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client CertificateClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client CertificateClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get gets information about the specified certificate.
-//
-// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is
-// the thumbprint of the certificate to get. selectParameter is an OData $select clause. timeout is the maximum
-// time that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is
-// the caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client CertificateClient) Get(ctx context.Context, thumbprintAlgorithm string, thumbprint string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result Certificate, err error) {
- req, err := client.GetPreparer(ctx, thumbprintAlgorithm, thumbprint, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client CertificateClient) GetPreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "thumbprint": autorest.Encode("path", thumbprint),
- "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client CertificateClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client CertificateClient) GetResponder(resp *http.Response) (result Certificate, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List lists all of the certificates that have been added to the specified account.
-//
-// filter is an OData $filter clause. selectParameter is an OData $select clause. maxResults is the maximum number
-// of items to return in the response. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id identifier in the response.
-// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with
-// the current system clock time.
-func (client CertificateClient) List(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CertificateListResultPage, err error) {
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.clr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "List", resp, "Failure sending request")
- return
- }
-
- result.clr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client CertificateClient) ListPreparer(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/certificates"),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client CertificateClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client CertificateClient) ListResponder(resp *http.Response) (result CertificateListResult, 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 CertificateClient) listNextResults(lastResults CertificateListResult) (result CertificateListResult, err error) {
- req, err := lastResults.certificateListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.CertificateClient", "listNextResults", 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.CertificateClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client CertificateClient) ListComplete(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CertificateListResultIterator, err error) {
- result.page, err = client.List(ctx, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
diff --git a/services/batch/2016-02-01.3.0/batch/client.go b/services/batch/2016-02-01.3.0/batch/client.go
deleted file mode 100644
index 3a4e46951ac4..000000000000
--- a/services/batch/2016-02-01.3.0/batch/client.go
+++ /dev/null
@@ -1,49 +0,0 @@
-// Package batch implements the Azure ARM Batch service API version 2016-02-01.3.0.
-//
-// A client for issuing REST requests to the Azure Batch service.
-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"
-)
-
-const (
- // DefaultBaseURI is the default URI used for the service Batch
- DefaultBaseURI = "https://batch.core.windows.net"
-)
-
-// BaseClient is the base client for Batch.
-type BaseClient struct {
- autorest.Client
- BaseURI string
-}
-
-// New creates an instance of the BaseClient client.
-func New() BaseClient {
- return NewWithBaseURI(DefaultBaseURI)
-}
-
-// NewWithBaseURI creates an instance of the BaseClient client.
-func NewWithBaseURI(baseURI string) BaseClient {
- return BaseClient{
- Client: autorest.NewClientWithUserAgent(UserAgent()),
- BaseURI: baseURI,
- }
-}
diff --git a/services/batch/2016-02-01.3.0/batch/computenode.go b/services/batch/2016-02-01.3.0/batch/computenode.go
deleted file mode 100644
index 9960b36d80d9..000000000000
--- a/services/batch/2016-02-01.3.0/batch/computenode.go
+++ /dev/null
@@ -1,1069 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "net/http"
-)
-
-// ComputeNodeClient is the a client for issuing REST requests to the Azure Batch service.
-type ComputeNodeClient struct {
- BaseClient
-}
-
-// NewComputeNodeClient creates an instance of the ComputeNodeClient client.
-func NewComputeNodeClient() ComputeNodeClient {
- return NewComputeNodeClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewComputeNodeClientWithBaseURI creates an instance of the ComputeNodeClient client.
-func NewComputeNodeClientWithBaseURI(baseURI string) ComputeNodeClient {
- return ComputeNodeClient{NewWithBaseURI(baseURI)}
-}
-
-// AddUser adds a user account to the specified compute node.
-//
-// poolID is the id of the pool that contains the compute node. nodeID is the id of the machine on which you want
-// to create a user account. userParameter is the user account to be created. timeout is the maximum time that the
-// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client ComputeNodeClient) AddUser(ctx context.Context, poolID string, nodeID string, userParameter ComputeNodeUser, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: userParameter,
- Constraints: []validation.Constraint{{Target: "userParameter.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.ComputeNodeClient", "AddUser", err.Error())
- }
-
- req, err := client.AddUserPreparer(ctx, poolID, nodeID, userParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddUserSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddUserResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddUserPreparer prepares the AddUser request.
-func (client ComputeNodeClient) AddUserPreparer(ctx context.Context, poolID string, nodeID string, userParameter ComputeNodeUser, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users", pathParameters),
- autorest.WithJSON(userParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddUserSender sends the AddUser request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) AddUserSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddUserResponder handles the response to the AddUser request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) AddUserResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// DeleteUser deletes a user account from the specified compute node.
-//
-// poolID is the id of the pool that contains the compute node. nodeID is the id of the machine on which you want
-// to delete a user account. userName is the name of the user account to delete. timeout is the maximum time that
-// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client ComputeNodeClient) DeleteUser(ctx context.Context, poolID string, nodeID string, userName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeleteUserPreparer(ctx, poolID, nodeID, userName, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteUserSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteUserResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteUserPreparer prepares the DeleteUser request.
-func (client ComputeNodeClient) DeleteUserPreparer(ctx context.Context, poolID string, nodeID string, userName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- "userName": autorest.Encode("path", userName),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users/{userName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteUserSender sends the DeleteUser request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) DeleteUserSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteUserResponder handles the response to the DeleteUser request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) DeleteUserResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// DisableScheduling disable task scheduling of the specified compute node.
-//
-// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node that you want
-// to disable task scheduling. nodeDisableSchedulingParameter is the parameters for the request. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client ComputeNodeClient) DisableScheduling(ctx context.Context, poolID string, nodeID string, nodeDisableSchedulingParameter *NodeDisableSchedulingParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DisableSchedulingPreparer(ctx, poolID, nodeID, nodeDisableSchedulingParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DisableSchedulingSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", resp, "Failure sending request")
- return
- }
-
- result, err = client.DisableSchedulingResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DisableSchedulingPreparer prepares the DisableScheduling request.
-func (client ComputeNodeClient) DisableSchedulingPreparer(ctx context.Context, poolID string, nodeID string, nodeDisableSchedulingParameter *NodeDisableSchedulingParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/disablescheduling", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if nodeDisableSchedulingParameter != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(nodeDisableSchedulingParameter))
- }
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DisableSchedulingSender sends the DisableScheduling request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) DisableSchedulingSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DisableSchedulingResponder handles the response to the DisableScheduling request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) DisableSchedulingResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// EnableScheduling enable task scheduling of the specified compute node.
-//
-// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node that you want
-// to enable task scheduling. timeout is the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a
-// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id identifier in the response. ocpDate is the time the
-// request was issued. If not specified, this header will be automatically populated with the current system clock
-// time.
-func (client ComputeNodeClient) EnableScheduling(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.EnableSchedulingPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.EnableSchedulingSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", resp, "Failure sending request")
- return
- }
-
- result, err = client.EnableSchedulingResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", resp, "Failure responding to request")
- }
-
- return
-}
-
-// EnableSchedulingPreparer prepares the EnableScheduling request.
-func (client ComputeNodeClient) EnableSchedulingPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/enablescheduling", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// EnableSchedulingSender sends the EnableScheduling request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) EnableSchedulingSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// EnableSchedulingResponder handles the response to the EnableScheduling request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) EnableSchedulingResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get gets information about the specified compute node.
-//
-// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node that you want
-// to get information about. selectParameter is an OData $select clause. timeout is the maximum time that the
-// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client ComputeNodeClient) Get(ctx context.Context, poolID string, nodeID string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNode, err error) {
- req, err := client.GetPreparer(ctx, poolID, nodeID, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client ComputeNodeClient) GetPreparer(ctx context.Context, poolID string, nodeID string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) GetResponder(resp *http.Response) (result ComputeNode, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetRemoteDesktop gets the Remote Desktop Protocol file for the specified compute node.
-//
-// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node for which you
-// want to get the Remote Desktop Protocol file. timeout is the maximum time that the server can spend processing
-// the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in
-// the form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id identifier in the response.
-// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with
-// the current system clock time.
-func (client ComputeNodeClient) GetRemoteDesktop(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ReadCloser, err error) {
- req, err := client.GetRemoteDesktopPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetRemoteDesktopSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetRemoteDesktopResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetRemoteDesktopPreparer prepares the GetRemoteDesktop request.
-func (client ComputeNodeClient) GetRemoteDesktopPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/rdp", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetRemoteDesktopSender sends the GetRemoteDesktop request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) GetRemoteDesktopSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetRemoteDesktopResponder handles the response to the GetRemoteDesktop request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) GetRemoteDesktopResponder(resp *http.Response) (result ReadCloser, err error) {
- result.Value = &resp.Body
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK))
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetRemoteLoginSettings gets the settings required for remote login to a compute node.
-//
-// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node for which to
-// obtain the remote login settings. timeout is the maximum time that the server can spend processing the request,
-// in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of
-// a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id identifier in the response. ocpDate is the time the
-// request was issued. If not specified, this header will be automatically populated with the current system clock
-// time.
-func (client ComputeNodeClient) GetRemoteLoginSettings(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeGetRemoteLoginSettingsResult, err error) {
- req, err := client.GetRemoteLoginSettingsPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteLoginSettings", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetRemoteLoginSettingsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteLoginSettings", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetRemoteLoginSettingsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteLoginSettings", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetRemoteLoginSettingsPreparer prepares the GetRemoteLoginSettings request.
-func (client ComputeNodeClient) GetRemoteLoginSettingsPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/remoteloginsettings", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetRemoteLoginSettingsSender sends the GetRemoteLoginSettings request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) GetRemoteLoginSettingsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetRemoteLoginSettingsResponder handles the response to the GetRemoteLoginSettings request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) GetRemoteLoginSettingsResponder(resp *http.Response) (result ComputeNodeGetRemoteLoginSettingsResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List lists the compute nodes in the specified pool.
-//
-// poolID is the id of the pool from which you want to list nodes. filter is an OData $filter clause.
-// selectParameter is an OData $select clause. maxResults is the maximum number of items to return in the response.
-// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30
-// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such
-// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should
-// return the client-request-id identifier in the response. ocpDate is the time the request was issued. If not
-// specified, this header will be automatically populated with the current system clock time.
-func (client ComputeNodeClient) List(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeListResultPage, err error) {
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, poolID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.cnlr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", resp, "Failure sending request")
- return
- }
-
- result.cnlr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client ComputeNodeClient) ListPreparer(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) ListResponder(resp *http.Response) (result ComputeNodeListResult, 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 ComputeNodeClient) listNextResults(lastResults ComputeNodeListResult) (result ComputeNodeListResult, err error) {
- req, err := lastResults.computeNodeListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "listNextResults", 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.ComputeNodeClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client ComputeNodeClient) ListComplete(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeListResultIterator, err error) {
- result.page, err = client.List(ctx, poolID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// Reboot restarts the specified compute node.
-//
-// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node that you want
-// to restart. nodeRebootParameter is the parameters for the request. timeout is the maximum time that the server
-// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated
-// request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client ComputeNodeClient) Reboot(ctx context.Context, poolID string, nodeID string, nodeRebootParameter *NodeRebootParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.RebootPreparer(ctx, poolID, nodeID, nodeRebootParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.RebootSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", resp, "Failure sending request")
- return
- }
-
- result, err = client.RebootResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", resp, "Failure responding to request")
- }
-
- return
-}
-
-// RebootPreparer prepares the Reboot request.
-func (client ComputeNodeClient) RebootPreparer(ctx context.Context, poolID string, nodeID string, nodeRebootParameter *NodeRebootParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/reboot", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if nodeRebootParameter != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(nodeRebootParameter))
- }
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// RebootSender sends the Reboot request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) RebootSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// RebootResponder handles the response to the Reboot request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) RebootResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Reimage reinstalls the operating system on the specified compute node.
-//
-// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node that you want
-// to restart. nodeReimageParameter is the parameters for the request. timeout is the maximum time that the server
-// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated
-// request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client ComputeNodeClient) Reimage(ctx context.Context, poolID string, nodeID string, nodeReimageParameter *NodeReimageParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.ReimagePreparer(ctx, poolID, nodeID, nodeReimageParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ReimageSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", resp, "Failure sending request")
- return
- }
-
- result, err = client.ReimageResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ReimagePreparer prepares the Reimage request.
-func (client ComputeNodeClient) ReimagePreparer(ctx context.Context, poolID string, nodeID string, nodeReimageParameter *NodeReimageParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/reimage", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if nodeReimageParameter != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(nodeReimageParameter))
- }
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ReimageSender sends the Reimage request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) ReimageSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ReimageResponder handles the response to the Reimage request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// UpdateUser updates the password or expiration time of a user account on the specified compute node.
-//
-// poolID is the id of the pool that contains the compute node. nodeID is the id of the machine on which you want
-// to update a user account. userName is the name of the user account to update. nodeUpdateUserParameter is the
-// parameters for the request. timeout is the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a
-// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id identifier in the response. ocpDate is the time the
-// request was issued. If not specified, this header will be automatically populated with the current system clock
-// time.
-func (client ComputeNodeClient) UpdateUser(ctx context.Context, poolID string, nodeID string, userName string, nodeUpdateUserParameter NodeUpdateUserParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.UpdateUserPreparer(ctx, poolID, nodeID, userName, nodeUpdateUserParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateUserSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateUserResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdateUserPreparer prepares the UpdateUser request.
-func (client ComputeNodeClient) UpdateUserPreparer(ctx context.Context, poolID string, nodeID string, userName string, nodeUpdateUserParameter NodeUpdateUserParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- "userName": autorest.Encode("path", userName),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users/{userName}", pathParameters),
- autorest.WithJSON(nodeUpdateUserParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateUserSender sends the UpdateUser request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) UpdateUserSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateUserResponder handles the response to the UpdateUser request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) UpdateUserResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff --git a/services/batch/2016-02-01.3.0/batch/file.go b/services/batch/2016-02-01.3.0/batch/file.go
deleted file mode 100644
index 925425078c27..000000000000
--- a/services/batch/2016-02-01.3.0/batch/file.go
+++ /dev/null
@@ -1,887 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "net/http"
-)
-
-// FileClient is the a client for issuing REST requests to the Azure Batch service.
-type FileClient struct {
- BaseClient
-}
-
-// NewFileClient creates an instance of the FileClient client.
-func NewFileClient() FileClient {
- return NewFileClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewFileClientWithBaseURI creates an instance of the FileClient client.
-func NewFileClientWithBaseURI(baseURI string) FileClient {
- return FileClient{NewWithBaseURI(baseURI)}
-}
-
-// DeleteFromComputeNode deletes the specified task file from the compute node.
-//
-// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node from which you
-// want to delete the file. fileName is the path to the file that you want to delete. recursive is whether to
-// delete children of a directory. If the fileName parameter represents a directory instead of a file, you can set
-// Recursive to true to delete the directory and all of the files and subdirectories in it. If Recursive is false
-// then the directory must be empty or deletion will fail. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client FileClient) DeleteFromComputeNode(ctx context.Context, poolID string, nodeID string, fileName string, recursive *bool, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeleteFromComputeNodePreparer(ctx, poolID, nodeID, fileName, recursive, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteFromComputeNodeSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteFromComputeNodeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteFromComputeNodePreparer prepares the DeleteFromComputeNode request.
-func (client FileClient) DeleteFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, fileName string, recursive *bool, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "fileName": autorest.Encode("path", fileName),
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if recursive != nil {
- queryParameters["recursive"] = autorest.Encode("query", *recursive)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{fileName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteFromComputeNodeSender sends the DeleteFromComputeNode request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) DeleteFromComputeNodeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteFromComputeNodeResponder handles the response to the DeleteFromComputeNode request. The method always
-// closes the http.Response Body.
-func (client FileClient) DeleteFromComputeNodeResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// DeleteFromTask deletes the specified task file from the compute node where the task ran.
-//
-// jobID is the id of the job that contains the task. taskID is the id of the task whose file you want to delete.
-// fileName is the path to the task file that you want to delete. recursive is whether to delete children of a
-// directory. If the fileName parameter represents a directory instead of a file, you can set Recursive to true to
-// delete the directory and all of the files and subdirectories in it. If Recursive is false then the directory
-// must be empty or deletion will fail. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id identifier in the response.
-// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with
-// the current system clock time.
-func (client FileClient) DeleteFromTask(ctx context.Context, jobID string, taskID string, fileName string, recursive *bool, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeleteFromTaskPreparer(ctx, jobID, taskID, fileName, recursive, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteFromTaskSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteFromTaskResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteFromTaskPreparer prepares the DeleteFromTask request.
-func (client FileClient) DeleteFromTaskPreparer(ctx context.Context, jobID string, taskID string, fileName string, recursive *bool, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "fileName": autorest.Encode("path", fileName),
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if recursive != nil {
- queryParameters["recursive"] = autorest.Encode("query", *recursive)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{fileName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteFromTaskSender sends the DeleteFromTask request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) DeleteFromTaskSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteFromTaskResponder handles the response to the DeleteFromTask request. The method always
-// closes the http.Response Body.
-func (client FileClient) DeleteFromTaskResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// GetFromComputeNode returns the content of the specified task file.
-//
-// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node that contains
-// the file. fileName is the path to the task file that you want to get the content of. timeout is the maximum time
-// that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time. ocpRange is the byte range to be
-// retrieved. The default is to retrieve the entire file. The format is startRange-endRange. ifModifiedSince is
-// specify this header to perform the operation only if the resource has been modified since the specified
-// date/time. ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been
-// modified since the specified date/time.
-func (client FileClient) GetFromComputeNode(ctx context.Context, poolID string, nodeID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result ReadCloser, err error) {
- req, err := client.GetFromComputeNodePreparer(ctx, poolID, nodeID, fileName, timeout, clientRequestID, returnClientRequestID, ocpDate, ocpRange, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetFromComputeNodeSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetFromComputeNodeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetFromComputeNodePreparer prepares the GetFromComputeNode request.
-func (client FileClient) GetFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "fileName": autorest.Encode("path", fileName),
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{fileName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ocpRange) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-range", autorest.String(ocpRange)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetFromComputeNodeSender sends the GetFromComputeNode request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) GetFromComputeNodeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetFromComputeNodeResponder handles the response to the GetFromComputeNode request. The method always
-// closes the http.Response Body.
-func (client FileClient) GetFromComputeNodeResponder(resp *http.Response) (result ReadCloser, err error) {
- result.Value = &resp.Body
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK))
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetFromTask returns the content of the specified task file.
-//
-// jobID is the id of the job that contains the task. taskID is the id of the task whose file you want to retrieve.
-// fileName is the path to the task file that you want to get the content of. timeout is the maximum time that the
-// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time. ocpRange is the byte range to be
-// retrieved. The default is to retrieve the entire file. The format is startRange-endRange. ifModifiedSince is
-// specify this header to perform the operation only if the resource has been modified since the specified
-// date/time. ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been
-// modified since the specified date/time.
-func (client FileClient) GetFromTask(ctx context.Context, jobID string, taskID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result ReadCloser, err error) {
- req, err := client.GetFromTaskPreparer(ctx, jobID, taskID, fileName, timeout, clientRequestID, returnClientRequestID, ocpDate, ocpRange, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetFromTaskSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetFromTaskResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetFromTaskPreparer prepares the GetFromTask request.
-func (client FileClient) GetFromTaskPreparer(ctx context.Context, jobID string, taskID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "fileName": autorest.Encode("path", fileName),
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{fileName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ocpRange) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-range", autorest.String(ocpRange)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetFromTaskSender sends the GetFromTask request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) GetFromTaskSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetFromTaskResponder handles the response to the GetFromTask request. The method always
-// closes the http.Response Body.
-func (client FileClient) GetFromTaskResponder(resp *http.Response) (result ReadCloser, err error) {
- result.Value = &resp.Body
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK))
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetNodeFilePropertiesFromComputeNode gets the properties of the specified compute node file.
-//
-// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node that contains
-// the file. fileName is the path to the compute node file that you want to get the properties of. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time. ifModifiedSince is specify this
-// header to perform the operation only if the resource has been modified since the specified date/time.
-// ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been modified
-// since the specified date/time.
-func (client FileClient) GetNodeFilePropertiesFromComputeNode(ctx context.Context, poolID string, nodeID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.GetNodeFilePropertiesFromComputeNodePreparer(ctx, poolID, nodeID, fileName, timeout, clientRequestID, returnClientRequestID, ocpDate, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromComputeNode", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetNodeFilePropertiesFromComputeNodeSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromComputeNode", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetNodeFilePropertiesFromComputeNodeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromComputeNode", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetNodeFilePropertiesFromComputeNodePreparer prepares the GetNodeFilePropertiesFromComputeNode request.
-func (client FileClient) GetNodeFilePropertiesFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "fileName": autorest.Encode("path", fileName),
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsHead(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{fileName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetNodeFilePropertiesFromComputeNodeSender sends the GetNodeFilePropertiesFromComputeNode request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) GetNodeFilePropertiesFromComputeNodeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetNodeFilePropertiesFromComputeNodeResponder handles the response to the GetNodeFilePropertiesFromComputeNode request. The method always
-// closes the http.Response Body.
-func (client FileClient) GetNodeFilePropertiesFromComputeNodeResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// GetNodeFilePropertiesFromTask gets the properties of the specified task file.
-//
-// jobID is the id of the job that contains the task. taskID is the id of the task whose file you want to get the
-// properties of. fileName is the path to the task file that you want to get the properties of. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time. ifModifiedSince is specify this
-// header to perform the operation only if the resource has been modified since the specified date/time.
-// ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been modified
-// since the specified date/time.
-func (client FileClient) GetNodeFilePropertiesFromTask(ctx context.Context, jobID string, taskID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.GetNodeFilePropertiesFromTaskPreparer(ctx, jobID, taskID, fileName, timeout, clientRequestID, returnClientRequestID, ocpDate, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromTask", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetNodeFilePropertiesFromTaskSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromTask", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetNodeFilePropertiesFromTaskResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromTask", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetNodeFilePropertiesFromTaskPreparer prepares the GetNodeFilePropertiesFromTask request.
-func (client FileClient) GetNodeFilePropertiesFromTaskPreparer(ctx context.Context, jobID string, taskID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "fileName": autorest.Encode("path", fileName),
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsHead(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{fileName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetNodeFilePropertiesFromTaskSender sends the GetNodeFilePropertiesFromTask request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) GetNodeFilePropertiesFromTaskSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetNodeFilePropertiesFromTaskResponder handles the response to the GetNodeFilePropertiesFromTask request. The method always
-// closes the http.Response Body.
-func (client FileClient) GetNodeFilePropertiesFromTaskResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// ListFromComputeNode lists all of the files in task directories on the specified compute node.
-//
-// poolID is the id of the pool that contains the compute node. nodeID is the id of the compute node whose files
-// you want to list. filter is an OData $filter clause. recursive is whether to list children of a directory.
-// maxResults is the maximum number of items to return in the response. timeout is the maximum time that the server
-// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated
-// request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client FileClient) ListFromComputeNode(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultPage, err error) {
- result.fn = client.listFromComputeNodeNextResults
- req, err := client.ListFromComputeNodePreparer(ctx, poolID, nodeID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListFromComputeNodeSender(req)
- if err != nil {
- result.nflr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", resp, "Failure sending request")
- return
- }
-
- result.nflr, err = client.ListFromComputeNodeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListFromComputeNodePreparer prepares the ListFromComputeNode request.
-func (client FileClient) ListFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if recursive != nil {
- queryParameters["recursive"] = autorest.Encode("query", *recursive)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListFromComputeNodeSender sends the ListFromComputeNode request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) ListFromComputeNodeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListFromComputeNodeResponder handles the response to the ListFromComputeNode request. The method always
-// closes the http.Response Body.
-func (client FileClient) ListFromComputeNodeResponder(resp *http.Response) (result NodeFileListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listFromComputeNodeNextResults retrieves the next set of results, if any.
-func (client FileClient) listFromComputeNodeNextResults(lastResults NodeFileListResult) (result NodeFileListResult, err error) {
- req, err := lastResults.nodeFileListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListFromComputeNodeSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListFromComputeNodeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListFromComputeNodeComplete enumerates all values, automatically crossing page boundaries as required.
-func (client FileClient) ListFromComputeNodeComplete(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultIterator, err error) {
- result.page, err = client.ListFromComputeNode(ctx, poolID, nodeID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// ListFromTask lists the files in a task's directory on its compute node.
-//
-// jobID is the id of the job that contains the task. taskID is the id of the task whose files you want to list.
-// filter is an OData $filter clause. recursive is whether to list children of a directory. maxResults is the
-// maximum number of items to return in the response. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client FileClient) ListFromTask(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultPage, err error) {
- result.fn = client.listFromTaskNextResults
- req, err := client.ListFromTaskPreparer(ctx, jobID, taskID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListFromTaskSender(req)
- if err != nil {
- result.nflr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", resp, "Failure sending request")
- return
- }
-
- result.nflr, err = client.ListFromTaskResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListFromTaskPreparer prepares the ListFromTask request.
-func (client FileClient) ListFromTaskPreparer(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if recursive != nil {
- queryParameters["recursive"] = autorest.Encode("query", *recursive)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListFromTaskSender sends the ListFromTask request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) ListFromTaskSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListFromTaskResponder handles the response to the ListFromTask request. The method always
-// closes the http.Response Body.
-func (client FileClient) ListFromTaskResponder(resp *http.Response) (result NodeFileListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listFromTaskNextResults retrieves the next set of results, if any.
-func (client FileClient) listFromTaskNextResults(lastResults NodeFileListResult) (result NodeFileListResult, err error) {
- req, err := lastResults.nodeFileListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListFromTaskSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListFromTaskResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListFromTaskComplete enumerates all values, automatically crossing page boundaries as required.
-func (client FileClient) ListFromTaskComplete(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultIterator, err error) {
- result.page, err = client.ListFromTask(ctx, jobID, taskID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
diff --git a/services/batch/2016-02-01.3.0/batch/job.go b/services/batch/2016-02-01.3.0/batch/job.go
deleted file mode 100644
index 936189dc2f66..000000000000
--- a/services/batch/2016-02-01.3.0/batch/job.go
+++ /dev/null
@@ -1,1366 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "net/http"
-)
-
-// JobClient is the a client for issuing REST requests to the Azure Batch service.
-type JobClient struct {
- BaseClient
-}
-
-// NewJobClient creates an instance of the JobClient client.
-func NewJobClient() JobClient {
- return NewJobClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewJobClientWithBaseURI creates an instance of the JobClient client.
-func NewJobClientWithBaseURI(baseURI string) JobClient {
- return JobClient{NewWithBaseURI(baseURI)}
-}
-
-// Add adds a job to the specified account.
-//
-// job is the job to be added. timeout is the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a
-// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id identifier in the response. ocpDate is the time the
-// request was issued. If not specified, this header will be automatically populated with the current system clock
-// time.
-func (client JobClient) Add(ctx context.Context, job JobAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: job,
- Constraints: []validation.Constraint{{Target: "job.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.PoolInfo", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil},
- }},
- }},
- }},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobClient", "Add", err.Error())
- }
-
- req, err := client.AddPreparer(ctx, job, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPreparer prepares the Add request.
-func (client JobClient) AddPreparer(ctx context.Context, job JobAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/jobs"),
- autorest.WithJSON(job),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSender sends the Add request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) AddSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddResponder handles the response to the Add request. The method always
-// closes the http.Response Body.
-func (client JobClient) AddResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Delete deletes a job.
-//
-// jobID is the id of the job to delete. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id identifier in the response.
-// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with
-// the current system clock time. ifMatch is an ETag is specified. Specify this header to perform the operation
-// only if the resource's ETag is an exact match as specified. ifNoneMatch is an ETag is specified. Specify this
-// header to perform the operation only if the resource's ETag does not match the specified ETag. ifModifiedSince
-// is specify this header to perform the operation only if the resource has been modified since the specified
-// date/time. ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been
-// modified since the specified date/time.
-func (client JobClient) Delete(ctx context.Context, jobID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeletePreparer(ctx, jobID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client JobClient) DeletePreparer(ctx context.Context, jobID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client JobClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Disable disables the specified job, preventing new tasks from running.
-//
-// jobID is the id of the job to disable. jobDisableParameter is the parameters for the request. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified.
-// Specify this header to perform the operation only if the resource's ETag is an exact match as specified.
-// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag
-// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the
-// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform
-// the operation only if the resource has not been modified since the specified date/time.
-func (client JobClient) Disable(ctx context.Context, jobID string, jobDisableParameter JobDisableParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DisablePreparer(ctx, jobID, jobDisableParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DisableSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", resp, "Failure sending request")
- return
- }
-
- result, err = client.DisableResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DisablePreparer prepares the Disable request.
-func (client JobClient) DisablePreparer(ctx context.Context, jobID string, jobDisableParameter JobDisableParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/disable", pathParameters),
- autorest.WithJSON(jobDisableParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DisableSender sends the Disable request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) DisableSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DisableResponder handles the response to the Disable request. The method always
-// closes the http.Response Body.
-func (client JobClient) DisableResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Enable enables the specified job, allowing new tasks to run.
-//
-// jobID is the id of the job to enable. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id identifier in the response.
-// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with
-// the current system clock time. ifMatch is an ETag is specified. Specify this header to perform the operation
-// only if the resource's ETag is an exact match as specified. ifNoneMatch is an ETag is specified. Specify this
-// header to perform the operation only if the resource's ETag does not match the specified ETag. ifModifiedSince
-// is specify this header to perform the operation only if the resource has been modified since the specified
-// date/time. ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been
-// modified since the specified date/time.
-func (client JobClient) Enable(ctx context.Context, jobID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.EnablePreparer(ctx, jobID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.EnableSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", resp, "Failure sending request")
- return
- }
-
- result, err = client.EnableResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", resp, "Failure responding to request")
- }
-
- return
-}
-
-// EnablePreparer prepares the Enable request.
-func (client JobClient) EnablePreparer(ctx context.Context, jobID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/enable", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// EnableSender sends the Enable request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) EnableSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// EnableResponder handles the response to the Enable request. The method always
-// closes the http.Response Body.
-func (client JobClient) EnableResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get gets information about the specified job.
-//
-// jobID is the id of the job. selectParameter is an OData $select clause. expand is an OData $expand clause.
-// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30
-// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such
-// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should
-// return the client-request-id identifier in the response. ocpDate is the time the request was issued. If not
-// specified, this header will be automatically populated with the current system clock time.
-func (client JobClient) Get(ctx context.Context, jobID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJob, err error) {
- req, err := client.GetPreparer(ctx, jobID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client JobClient) GetPreparer(ctx context.Context, jobID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client JobClient) GetResponder(resp *http.Response) (result CloudJob, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetAllJobsLifetimeStatistics gets lifetime summary statistics for all of the jobs in the specified account.
-// Statistics are aggregated across all jobs that have ever existed in the account, from account creation to the last
-// update time of the statistics.
-//
-// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30
-// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such
-// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should
-// return the client-request-id identifier in the response. ocpDate is the time the request was issued. If not
-// specified, this header will be automatically populated with the current system clock time.
-func (client JobClient) GetAllJobsLifetimeStatistics(ctx context.Context, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result JobStatistics, err error) {
- req, err := client.GetAllJobsLifetimeStatisticsPreparer(ctx, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllJobsLifetimeStatistics", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetAllJobsLifetimeStatisticsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllJobsLifetimeStatistics", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetAllJobsLifetimeStatisticsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllJobsLifetimeStatistics", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetAllJobsLifetimeStatisticsPreparer prepares the GetAllJobsLifetimeStatistics request.
-func (client JobClient) GetAllJobsLifetimeStatisticsPreparer(ctx context.Context, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/lifetimejobstats"),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetAllJobsLifetimeStatisticsSender sends the GetAllJobsLifetimeStatistics request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) GetAllJobsLifetimeStatisticsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetAllJobsLifetimeStatisticsResponder handles the response to the GetAllJobsLifetimeStatistics request. The method always
-// closes the http.Response Body.
-func (client JobClient) GetAllJobsLifetimeStatisticsResponder(resp *http.Response) (result JobStatistics, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List lists all of the jobs in the specified account.
-//
-// filter is an OData $filter clause. selectParameter is an OData $select clause. expand is an OData $expand
-// clause. maxResults is the maximum number of items to return in the response. timeout is the maximum time that
-// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client JobClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultPage, err error) {
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.cjlr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobClient", "List", resp, "Failure sending request")
- return
- }
-
- result.cjlr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client JobClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/jobs"),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client JobClient) ListResponder(resp *http.Response) (result CloudJobListResult, 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 JobClient) listNextResults(lastResults CloudJobListResult) (result CloudJobListResult, err error) {
- req, err := lastResults.cloudJobListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.JobClient", "listNextResults", 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.JobClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client JobClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultIterator, err error) {
- result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// ListFromJobSchedule lists the jobs that have been created under the specified job schedule.
-//
-// jobScheduleID is the id of the job schedule from which you want to get a list of jobs. filter is an OData
-// $filter clause. selectParameter is an OData $select clause. expand is an OData $expand clause. maxResults is the
-// maximum number of items to return in the response. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client JobClient) ListFromJobSchedule(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultPage, err error) {
- result.fn = client.listFromJobScheduleNextResults
- req, err := client.ListFromJobSchedulePreparer(ctx, jobScheduleID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListFromJobScheduleSender(req)
- if err != nil {
- result.cjlr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", resp, "Failure sending request")
- return
- }
-
- result.cjlr, err = client.ListFromJobScheduleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListFromJobSchedulePreparer prepares the ListFromJobSchedule request.
-func (client JobClient) ListFromJobSchedulePreparer(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}/jobs", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListFromJobScheduleSender sends the ListFromJobSchedule request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) ListFromJobScheduleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListFromJobScheduleResponder handles the response to the ListFromJobSchedule request. The method always
-// closes the http.Response Body.
-func (client JobClient) ListFromJobScheduleResponder(resp *http.Response) (result CloudJobListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listFromJobScheduleNextResults retrieves the next set of results, if any.
-func (client JobClient) listFromJobScheduleNextResults(lastResults CloudJobListResult) (result CloudJobListResult, err error) {
- req, err := lastResults.cloudJobListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListFromJobScheduleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListFromJobScheduleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListFromJobScheduleComplete enumerates all values, automatically crossing page boundaries as required.
-func (client JobClient) ListFromJobScheduleComplete(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultIterator, err error) {
- result.page, err = client.ListFromJobSchedule(ctx, jobScheduleID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// ListPreparationAndReleaseTaskStatus lists the execution status of the Job Preparation and Job Release task for the
-// specified job across the compute nodes where the job has run.
-//
-// jobID is the id of the job. filter is an OData $filter clause. selectParameter is an OData $select clause.
-// maxResults is the maximum number of items to return in the response. timeout is the maximum time that the server
-// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated
-// request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client JobClient) ListPreparationAndReleaseTaskStatus(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListPreparationAndReleaseTaskStatusResultPage, err error) {
- result.fn = client.listPreparationAndReleaseTaskStatusNextResults
- req, err := client.ListPreparationAndReleaseTaskStatusPreparer(ctx, jobID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListPreparationAndReleaseTaskStatusSender(req)
- if err != nil {
- result.cjlpartsr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", resp, "Failure sending request")
- return
- }
-
- result.cjlpartsr, err = client.ListPreparationAndReleaseTaskStatusResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparationAndReleaseTaskStatusPreparer prepares the ListPreparationAndReleaseTaskStatus request.
-func (client JobClient) ListPreparationAndReleaseTaskStatusPreparer(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/jobpreparationandreleasetaskstatus", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListPreparationAndReleaseTaskStatusSender sends the ListPreparationAndReleaseTaskStatus request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) ListPreparationAndReleaseTaskStatusSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListPreparationAndReleaseTaskStatusResponder handles the response to the ListPreparationAndReleaseTaskStatus request. The method always
-// closes the http.Response Body.
-func (client JobClient) ListPreparationAndReleaseTaskStatusResponder(resp *http.Response) (result CloudJobListPreparationAndReleaseTaskStatusResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listPreparationAndReleaseTaskStatusNextResults retrieves the next set of results, if any.
-func (client JobClient) listPreparationAndReleaseTaskStatusNextResults(lastResults CloudJobListPreparationAndReleaseTaskStatusResult) (result CloudJobListPreparationAndReleaseTaskStatusResult, err error) {
- req, err := lastResults.cloudJobListPreparationAndReleaseTaskStatusResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListPreparationAndReleaseTaskStatusSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListPreparationAndReleaseTaskStatusResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListPreparationAndReleaseTaskStatusComplete enumerates all values, automatically crossing page boundaries as required.
-func (client JobClient) ListPreparationAndReleaseTaskStatusComplete(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListPreparationAndReleaseTaskStatusResultIterator, err error) {
- result.page, err = client.ListPreparationAndReleaseTaskStatus(ctx, jobID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// Patch updates the properties of a job.
-//
-// jobID is the id of the job whose properties you want to update. jobPatchParameter is the parameters for the
-// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id identifier in the response. ocpDate is the time the request was
-// issued. If not specified, this header will be automatically populated with the current system clock time.
-// ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag is an
-// exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only
-// if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the
-// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify
-// this header to perform the operation only if the resource has not been modified since the specified date/time.
-func (client JobClient) Patch(ctx context.Context, jobID string, jobPatchParameter JobPatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.PatchPreparer(ctx, jobID, jobPatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.PatchSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", resp, "Failure sending request")
- return
- }
-
- result, err = client.PatchResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", resp, "Failure responding to request")
- }
-
- return
-}
-
-// PatchPreparer prepares the Patch request.
-func (client JobClient) PatchPreparer(ctx context.Context, jobID string, jobPatchParameter JobPatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPatch(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}", pathParameters),
- autorest.WithJSON(jobPatchParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// PatchSender sends the Patch request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) PatchSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// PatchResponder handles the response to the Patch request. The method always
-// closes the http.Response Body.
-func (client JobClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Terminate terminates the specified job, marking it as completed.
-//
-// jobID is the id of the job to terminate. jobTerminateParameter is the parameters for the request. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified.
-// Specify this header to perform the operation only if the resource's ETag is an exact match as specified.
-// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag
-// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the
-// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform
-// the operation only if the resource has not been modified since the specified date/time.
-func (client JobClient) Terminate(ctx context.Context, jobID string, jobTerminateParameter *JobTerminateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.TerminatePreparer(ctx, jobID, jobTerminateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.TerminateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", resp, "Failure sending request")
- return
- }
-
- result, err = client.TerminateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", resp, "Failure responding to request")
- }
-
- return
-}
-
-// TerminatePreparer prepares the Terminate request.
-func (client JobClient) TerminatePreparer(ctx context.Context, jobID string, jobTerminateParameter *JobTerminateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/terminate", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if jobTerminateParameter != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(jobTerminateParameter))
- }
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// TerminateSender sends the Terminate request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) TerminateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// TerminateResponder handles the response to the Terminate request. The method always
-// closes the http.Response Body.
-func (client JobClient) TerminateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Update updates the properties of a job.
-//
-// jobID is the id of the job whose properties you want to update. jobUpdateParameter is the parameters for the
-// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id identifier in the response. ocpDate is the time the request was
-// issued. If not specified, this header will be automatically populated with the current system clock time.
-// ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag is an
-// exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only
-// if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the
-// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify
-// this header to perform the operation only if the resource has not been modified since the specified date/time.
-func (client JobClient) Update(ctx context.Context, jobID string, jobUpdateParameter JobUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: jobUpdateParameter,
- Constraints: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil},
- }},
- }},
- }},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobClient", "Update", err.Error())
- }
-
- req, err := client.UpdatePreparer(ctx, jobID, jobUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePreparer prepares the Update request.
-func (client JobClient) UpdatePreparer(ctx context.Context, jobID string, jobUpdateParameter JobUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}", pathParameters),
- autorest.WithJSON(jobUpdateParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSender sends the Update request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) UpdateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateResponder handles the response to the Update request. The method always
-// closes the http.Response Body.
-func (client JobClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff --git a/services/batch/2016-02-01.3.0/batch/jobschedule.go b/services/batch/2016-02-01.3.0/batch/jobschedule.go
deleted file mode 100644
index 65831800c3d4..000000000000
--- a/services/batch/2016-02-01.3.0/batch/jobschedule.go
+++ /dev/null
@@ -1,1156 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "net/http"
-)
-
-// JobScheduleClient is the a client for issuing REST requests to the Azure Batch service.
-type JobScheduleClient struct {
- BaseClient
-}
-
-// NewJobScheduleClient creates an instance of the JobScheduleClient client.
-func NewJobScheduleClient() JobScheduleClient {
- return NewJobScheduleClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewJobScheduleClientWithBaseURI creates an instance of the JobScheduleClient client.
-func NewJobScheduleClientWithBaseURI(baseURI string) JobScheduleClient {
- return JobScheduleClient{NewWithBaseURI(baseURI)}
-}
-
-// Add adds a job schedule to the specified account.
-//
-// cloudJobSchedule is the job schedule to be added. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client JobScheduleClient) Add(ctx context.Context, cloudJobSchedule JobScheduleAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: cloudJobSchedule,
- Constraints: []validation.Constraint{{Target: "cloudJobSchedule.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.Schedule", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil},
- }},
- }},
- }},
- }},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobScheduleClient", "Add", err.Error())
- }
-
- req, err := client.AddPreparer(ctx, cloudJobSchedule, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPreparer prepares the Add request.
-func (client JobScheduleClient) AddPreparer(ctx context.Context, cloudJobSchedule JobScheduleAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/jobschedules"),
- autorest.WithJSON(cloudJobSchedule),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSender sends the Add request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) AddSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddResponder handles the response to the Add request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) AddResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Delete deletes a job schedule from the specified account.
-//
-// jobScheduleID is the id of the job schedule to delete. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified.
-// Specify this header to perform the operation only if the resource's ETag is an exact match as specified.
-// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag
-// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the
-// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform
-// the operation only if the resource has not been modified since the specified date/time.
-func (client JobScheduleClient) Delete(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeletePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client JobScheduleClient) DeletePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Disable disables a job schedule.
-//
-// jobScheduleID is the id of the job schedule to disable. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified.
-// Specify this header to perform the operation only if the resource's ETag is an exact match as specified.
-// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag
-// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the
-// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform
-// the operation only if the resource has not been modified since the specified date/time.
-func (client JobScheduleClient) Disable(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DisablePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DisableSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", resp, "Failure sending request")
- return
- }
-
- result, err = client.DisableResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DisablePreparer prepares the Disable request.
-func (client JobScheduleClient) DisablePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}/disable", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DisableSender sends the Disable request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) DisableSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DisableResponder handles the response to the Disable request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) DisableResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Enable enables a job schedule.
-//
-// jobScheduleID is the id of the job schedule to enable. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified.
-// Specify this header to perform the operation only if the resource's ETag is an exact match as specified.
-// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag
-// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the
-// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform
-// the operation only if the resource has not been modified since the specified date/time.
-func (client JobScheduleClient) Enable(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.EnablePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.EnableSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", resp, "Failure sending request")
- return
- }
-
- result, err = client.EnableResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", resp, "Failure responding to request")
- }
-
- return
-}
-
-// EnablePreparer prepares the Enable request.
-func (client JobScheduleClient) EnablePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}/enable", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// EnableSender sends the Enable request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) EnableSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// EnableResponder handles the response to the Enable request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) EnableResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Exists checks the specified job schedule exists.
-//
-// jobScheduleID is the id of the job schedule which you want to check. timeout is the maximum time that the server
-// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated
-// request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified.
-// Specify this header to perform the operation only if the resource's ETag is an exact match as specified.
-// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag
-// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the
-// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform
-// the operation only if the resource has not been modified since the specified date/time.
-func (client JobScheduleClient) Exists(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.ExistsPreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ExistsSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", resp, "Failure sending request")
- return
- }
-
- result, err = client.ExistsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ExistsPreparer prepares the Exists request.
-func (client JobScheduleClient) ExistsPreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsHead(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ExistsSender sends the Exists request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) ExistsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ExistsResponder handles the response to the Exists request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) ExistsResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get gets information about the specified job schedule.
-//
-// jobScheduleID is the id of the job schedule to get. selectParameter is an OData $select clause. expand is an
-// OData $expand clause. timeout is the maximum time that the server can spend processing the request, in seconds.
-// The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with
-// no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether
-// the server should return the client-request-id identifier in the response. ocpDate is the time the request was
-// issued. If not specified, this header will be automatically populated with the current system clock time.
-// ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag is an
-// exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only
-// if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the
-// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify
-// this header to perform the operation only if the resource has not been modified since the specified date/time.
-func (client JobScheduleClient) Get(ctx context.Context, jobScheduleID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudJobSchedule, err error) {
- req, err := client.GetPreparer(ctx, jobScheduleID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client JobScheduleClient) GetPreparer(ctx context.Context, jobScheduleID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) GetResponder(resp *http.Response) (result CloudJobSchedule, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List lists all of the job schedules in the specified account.
-//
-// filter is an OData $filter clause. selectParameter is an OData $select clause. expand is an OData $expand
-// clause. maxResults is the maximum number of items to return in the response. timeout is the maximum time that
-// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client JobScheduleClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobScheduleListResultPage, err error) {
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.cjslr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", resp, "Failure sending request")
- return
- }
-
- result.cjslr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client JobScheduleClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/jobschedules"),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) ListResponder(resp *http.Response) (result CloudJobScheduleListResult, 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 JobScheduleClient) listNextResults(lastResults CloudJobScheduleListResult) (result CloudJobScheduleListResult, err error) {
- req, err := lastResults.cloudJobScheduleListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.JobScheduleClient", "listNextResults", 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.JobScheduleClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client JobScheduleClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobScheduleListResultIterator, err error) {
- result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// Patch updates the properties of the specified job schedule.
-//
-// jobScheduleID is the id of the job schedule to update. jobSchedulePatchParameter is the parameters for the
-// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id identifier in the response. ocpDate is the time the request was
-// issued. If not specified, this header will be automatically populated with the current system clock time.
-// ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag is an
-// exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only
-// if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the
-// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify
-// this header to perform the operation only if the resource has not been modified since the specified date/time.
-func (client JobScheduleClient) Patch(ctx context.Context, jobScheduleID string, jobSchedulePatchParameter JobSchedulePatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.PatchPreparer(ctx, jobScheduleID, jobSchedulePatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.PatchSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", resp, "Failure sending request")
- return
- }
-
- result, err = client.PatchResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", resp, "Failure responding to request")
- }
-
- return
-}
-
-// PatchPreparer prepares the Patch request.
-func (client JobScheduleClient) PatchPreparer(ctx context.Context, jobScheduleID string, jobSchedulePatchParameter JobSchedulePatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPatch(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters),
- autorest.WithJSON(jobSchedulePatchParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// PatchSender sends the Patch request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) PatchSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// PatchResponder handles the response to the Patch request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Terminate terminates a job schedule.
-//
-// jobScheduleID is the id of the job schedule to terminates. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified.
-// Specify this header to perform the operation only if the resource's ETag is an exact match as specified.
-// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag
-// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the
-// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform
-// the operation only if the resource has not been modified since the specified date/time.
-func (client JobScheduleClient) Terminate(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.TerminatePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.TerminateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", resp, "Failure sending request")
- return
- }
-
- result, err = client.TerminateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", resp, "Failure responding to request")
- }
-
- return
-}
-
-// TerminatePreparer prepares the Terminate request.
-func (client JobScheduleClient) TerminatePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}/terminate", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// TerminateSender sends the Terminate request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) TerminateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// TerminateResponder handles the response to the Terminate request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) TerminateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Update updates the properties of the specified job schedule.
-//
-// jobScheduleID is the id of the job schedule to update. jobScheduleUpdateParameter is the parameters for the
-// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id identifier in the response. ocpDate is the time the request was
-// issued. If not specified, this header will be automatically populated with the current system clock time.
-// ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag is an
-// exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only
-// if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the
-// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify
-// this header to perform the operation only if the resource has not been modified since the specified date/time.
-func (client JobScheduleClient) Update(ctx context.Context, jobScheduleID string, jobScheduleUpdateParameter JobScheduleUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: jobScheduleUpdateParameter,
- Constraints: []validation.Constraint{{Target: "jobScheduleUpdateParameter.Schedule", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil},
- }},
- }},
- }},
- }},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobScheduleClient", "Update", err.Error())
- }
-
- req, err := client.UpdatePreparer(ctx, jobScheduleID, jobScheduleUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePreparer prepares the Update request.
-func (client JobScheduleClient) UpdatePreparer(ctx context.Context, jobScheduleID string, jobScheduleUpdateParameter JobScheduleUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters),
- autorest.WithJSON(jobScheduleUpdateParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSender sends the Update request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) UpdateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateResponder handles the response to the Update request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff --git a/services/batch/2016-02-01.3.0/batch/models.go b/services/batch/2016-02-01.3.0/batch/models.go
deleted file mode 100644
index 739d159e7032..000000000000
--- a/services/batch/2016-02-01.3.0/batch/models.go
+++ /dev/null
@@ -1,3010 +0,0 @@
-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/date"
- "github.com/Azure/go-autorest/autorest/to"
- "io"
- "net/http"
-)
-
-// AllocationState enumerates the values for allocation state.
-type AllocationState string
-
-const (
- // Resizing ...
- Resizing AllocationState = "resizing"
- // Steady ...
- Steady AllocationState = "steady"
- // Stopping ...
- Stopping AllocationState = "stopping"
-)
-
-// PossibleAllocationStateValues returns an array of possible values for the AllocationState const type.
-func PossibleAllocationStateValues() []AllocationState {
- return []AllocationState{Resizing, Steady, Stopping}
-}
-
-// CertificateFormat enumerates the values for certificate format.
-type CertificateFormat string
-
-const (
- // Cer ...
- Cer CertificateFormat = "cer"
- // Pfx ...
- Pfx CertificateFormat = "pfx"
- // Unmapped ...
- Unmapped CertificateFormat = "unmapped"
-)
-
-// PossibleCertificateFormatValues returns an array of possible values for the CertificateFormat const type.
-func PossibleCertificateFormatValues() []CertificateFormat {
- return []CertificateFormat{Cer, Pfx, Unmapped}
-}
-
-// CertificateState enumerates the values for certificate state.
-type CertificateState string
-
-const (
- // Active ...
- Active CertificateState = "active"
- // Deletefailed ...
- Deletefailed CertificateState = "deletefailed"
- // Deleting ...
- Deleting CertificateState = "deleting"
-)
-
-// PossibleCertificateStateValues returns an array of possible values for the CertificateState const type.
-func PossibleCertificateStateValues() []CertificateState {
- return []CertificateState{Active, Deletefailed, Deleting}
-}
-
-// CertificateStoreLocation enumerates the values for certificate store location.
-type CertificateStoreLocation string
-
-const (
- // CertificateStoreLocationCurrentuser ...
- CertificateStoreLocationCurrentuser CertificateStoreLocation = "currentuser"
- // CertificateStoreLocationLocalmachine ...
- CertificateStoreLocationLocalmachine CertificateStoreLocation = "localmachine"
- // CertificateStoreLocationUnmapped ...
- CertificateStoreLocationUnmapped CertificateStoreLocation = "unmapped"
-)
-
-// PossibleCertificateStoreLocationValues returns an array of possible values for the CertificateStoreLocation const type.
-func PossibleCertificateStoreLocationValues() []CertificateStoreLocation {
- return []CertificateStoreLocation{CertificateStoreLocationCurrentuser, CertificateStoreLocationLocalmachine, CertificateStoreLocationUnmapped}
-}
-
-// CertificateVisibility enumerates the values for certificate visibility.
-type CertificateVisibility string
-
-const (
- // CertificateVisibilityRemoteuser ...
- CertificateVisibilityRemoteuser CertificateVisibility = "remoteuser"
- // CertificateVisibilityStarttask ...
- CertificateVisibilityStarttask CertificateVisibility = "starttask"
- // CertificateVisibilityTask ...
- CertificateVisibilityTask CertificateVisibility = "task"
- // CertificateVisibilityUnmapped ...
- CertificateVisibilityUnmapped CertificateVisibility = "unmapped"
-)
-
-// PossibleCertificateVisibilityValues returns an array of possible values for the CertificateVisibility const type.
-func PossibleCertificateVisibilityValues() []CertificateVisibility {
- return []CertificateVisibility{CertificateVisibilityRemoteuser, CertificateVisibilityStarttask, CertificateVisibilityTask, CertificateVisibilityUnmapped}
-}
-
-// ComputeNodeDeallocationOption enumerates the values for compute node deallocation option.
-type ComputeNodeDeallocationOption string
-
-const (
- // Requeue ...
- Requeue ComputeNodeDeallocationOption = "requeue"
- // Retaineddata ...
- Retaineddata ComputeNodeDeallocationOption = "retaineddata"
- // Taskcompletion ...
- Taskcompletion ComputeNodeDeallocationOption = "taskcompletion"
- // Terminate ...
- Terminate ComputeNodeDeallocationOption = "terminate"
-)
-
-// PossibleComputeNodeDeallocationOptionValues returns an array of possible values for the ComputeNodeDeallocationOption const type.
-func PossibleComputeNodeDeallocationOptionValues() []ComputeNodeDeallocationOption {
- return []ComputeNodeDeallocationOption{Requeue, Retaineddata, Taskcompletion, Terminate}
-}
-
-// ComputeNodeFillType enumerates the values for compute node fill type.
-type ComputeNodeFillType string
-
-const (
- // ComputeNodeFillTypePack ...
- ComputeNodeFillTypePack ComputeNodeFillType = "pack"
- // ComputeNodeFillTypeSpread ...
- ComputeNodeFillTypeSpread ComputeNodeFillType = "spread"
- // ComputeNodeFillTypeUnmapped ...
- ComputeNodeFillTypeUnmapped ComputeNodeFillType = "unmapped"
-)
-
-// PossibleComputeNodeFillTypeValues returns an array of possible values for the ComputeNodeFillType const type.
-func PossibleComputeNodeFillTypeValues() []ComputeNodeFillType {
- return []ComputeNodeFillType{ComputeNodeFillTypePack, ComputeNodeFillTypeSpread, ComputeNodeFillTypeUnmapped}
-}
-
-// ComputeNodeRebootOption enumerates the values for compute node reboot option.
-type ComputeNodeRebootOption string
-
-const (
- // ComputeNodeRebootOptionRequeue ...
- ComputeNodeRebootOptionRequeue ComputeNodeRebootOption = "requeue"
- // ComputeNodeRebootOptionRetaineddata ...
- ComputeNodeRebootOptionRetaineddata ComputeNodeRebootOption = "retaineddata"
- // ComputeNodeRebootOptionTaskcompletion ...
- ComputeNodeRebootOptionTaskcompletion ComputeNodeRebootOption = "taskcompletion"
- // ComputeNodeRebootOptionTerminate ...
- ComputeNodeRebootOptionTerminate ComputeNodeRebootOption = "terminate"
-)
-
-// PossibleComputeNodeRebootOptionValues returns an array of possible values for the ComputeNodeRebootOption const type.
-func PossibleComputeNodeRebootOptionValues() []ComputeNodeRebootOption {
- return []ComputeNodeRebootOption{ComputeNodeRebootOptionRequeue, ComputeNodeRebootOptionRetaineddata, ComputeNodeRebootOptionTaskcompletion, ComputeNodeRebootOptionTerminate}
-}
-
-// ComputeNodeReimageOption enumerates the values for compute node reimage option.
-type ComputeNodeReimageOption string
-
-const (
- // ComputeNodeReimageOptionRequeue ...
- ComputeNodeReimageOptionRequeue ComputeNodeReimageOption = "requeue"
- // ComputeNodeReimageOptionRetaineddata ...
- ComputeNodeReimageOptionRetaineddata ComputeNodeReimageOption = "retaineddata"
- // ComputeNodeReimageOptionTaskcompletion ...
- ComputeNodeReimageOptionTaskcompletion ComputeNodeReimageOption = "taskcompletion"
- // ComputeNodeReimageOptionTerminate ...
- ComputeNodeReimageOptionTerminate ComputeNodeReimageOption = "terminate"
-)
-
-// PossibleComputeNodeReimageOptionValues returns an array of possible values for the ComputeNodeReimageOption const type.
-func PossibleComputeNodeReimageOptionValues() []ComputeNodeReimageOption {
- return []ComputeNodeReimageOption{ComputeNodeReimageOptionRequeue, ComputeNodeReimageOptionRetaineddata, ComputeNodeReimageOptionTaskcompletion, ComputeNodeReimageOptionTerminate}
-}
-
-// ComputeNodeState enumerates the values for compute node state.
-type ComputeNodeState string
-
-const (
- // Creating ...
- Creating ComputeNodeState = "creating"
- // Idle ...
- Idle ComputeNodeState = "idle"
- // Leavingpool ...
- Leavingpool ComputeNodeState = "leavingpool"
- // Offline ...
- Offline ComputeNodeState = "offline"
- // Rebooting ...
- Rebooting ComputeNodeState = "rebooting"
- // Reimaging ...
- Reimaging ComputeNodeState = "reimaging"
- // Running ...
- Running ComputeNodeState = "running"
- // Starting ...
- Starting ComputeNodeState = "starting"
- // Starttaskfailed ...
- Starttaskfailed ComputeNodeState = "starttaskfailed"
- // Unknown ...
- Unknown ComputeNodeState = "unknown"
- // Unusable ...
- Unusable ComputeNodeState = "unusable"
- // Waitingforstarttask ...
- Waitingforstarttask ComputeNodeState = "waitingforstarttask"
-)
-
-// PossibleComputeNodeStateValues returns an array of possible values for the ComputeNodeState const type.
-func PossibleComputeNodeStateValues() []ComputeNodeState {
- return []ComputeNodeState{Creating, Idle, Leavingpool, Offline, Rebooting, Reimaging, Running, Starting, Starttaskfailed, Unknown, Unusable, Waitingforstarttask}
-}
-
-// DisableComputeNodeSchedulingOption enumerates the values for disable compute node scheduling option.
-type DisableComputeNodeSchedulingOption string
-
-const (
- // DisableComputeNodeSchedulingOptionRequeue ...
- DisableComputeNodeSchedulingOptionRequeue DisableComputeNodeSchedulingOption = "requeue"
- // DisableComputeNodeSchedulingOptionTaskcompletion ...
- DisableComputeNodeSchedulingOptionTaskcompletion DisableComputeNodeSchedulingOption = "taskcompletion"
- // DisableComputeNodeSchedulingOptionTerminate ...
- DisableComputeNodeSchedulingOptionTerminate DisableComputeNodeSchedulingOption = "terminate"
-)
-
-// PossibleDisableComputeNodeSchedulingOptionValues returns an array of possible values for the DisableComputeNodeSchedulingOption const type.
-func PossibleDisableComputeNodeSchedulingOptionValues() []DisableComputeNodeSchedulingOption {
- return []DisableComputeNodeSchedulingOption{DisableComputeNodeSchedulingOptionRequeue, DisableComputeNodeSchedulingOptionTaskcompletion, DisableComputeNodeSchedulingOptionTerminate}
-}
-
-// DisableJobOption enumerates the values for disable job option.
-type DisableJobOption string
-
-const (
- // DisableJobOptionRequeue ...
- DisableJobOptionRequeue DisableJobOption = "requeue"
- // DisableJobOptionTerminate ...
- DisableJobOptionTerminate DisableJobOption = "terminate"
- // DisableJobOptionWait ...
- DisableJobOptionWait DisableJobOption = "wait"
-)
-
-// PossibleDisableJobOptionValues returns an array of possible values for the DisableJobOption const type.
-func PossibleDisableJobOptionValues() []DisableJobOption {
- return []DisableJobOption{DisableJobOptionRequeue, DisableJobOptionTerminate, DisableJobOptionWait}
-}
-
-// JobPreparationTaskState enumerates the values for job preparation task state.
-type JobPreparationTaskState string
-
-const (
- // JobPreparationTaskStateCompleted ...
- JobPreparationTaskStateCompleted JobPreparationTaskState = "completed"
- // JobPreparationTaskStateRunning ...
- JobPreparationTaskStateRunning JobPreparationTaskState = "running"
-)
-
-// PossibleJobPreparationTaskStateValues returns an array of possible values for the JobPreparationTaskState const type.
-func PossibleJobPreparationTaskStateValues() []JobPreparationTaskState {
- return []JobPreparationTaskState{JobPreparationTaskStateCompleted, JobPreparationTaskStateRunning}
-}
-
-// JobReleaseTaskState enumerates the values for job release task state.
-type JobReleaseTaskState string
-
-const (
- // JobReleaseTaskStateCompleted ...
- JobReleaseTaskStateCompleted JobReleaseTaskState = "completed"
- // JobReleaseTaskStateRunning ...
- JobReleaseTaskStateRunning JobReleaseTaskState = "running"
-)
-
-// PossibleJobReleaseTaskStateValues returns an array of possible values for the JobReleaseTaskState const type.
-func PossibleJobReleaseTaskStateValues() []JobReleaseTaskState {
- return []JobReleaseTaskState{JobReleaseTaskStateCompleted, JobReleaseTaskStateRunning}
-}
-
-// JobScheduleState enumerates the values for job schedule state.
-type JobScheduleState string
-
-const (
- // JobScheduleStateActive ...
- JobScheduleStateActive JobScheduleState = "active"
- // JobScheduleStateCompleted ...
- JobScheduleStateCompleted JobScheduleState = "completed"
- // JobScheduleStateDeleting ...
- JobScheduleStateDeleting JobScheduleState = "deleting"
- // JobScheduleStateDisabled ...
- JobScheduleStateDisabled JobScheduleState = "disabled"
- // JobScheduleStateTerminating ...
- JobScheduleStateTerminating JobScheduleState = "terminating"
-)
-
-// PossibleJobScheduleStateValues returns an array of possible values for the JobScheduleState const type.
-func PossibleJobScheduleStateValues() []JobScheduleState {
- return []JobScheduleState{JobScheduleStateActive, JobScheduleStateCompleted, JobScheduleStateDeleting, JobScheduleStateDisabled, JobScheduleStateTerminating}
-}
-
-// JobState enumerates the values for job state.
-type JobState string
-
-const (
- // JobStateActive ...
- JobStateActive JobState = "active"
- // JobStateCompleted ...
- JobStateCompleted JobState = "completed"
- // JobStateDeleting ...
- JobStateDeleting JobState = "deleting"
- // JobStateDisabled ...
- JobStateDisabled JobState = "disabled"
- // JobStateDisabling ...
- JobStateDisabling JobState = "disabling"
- // JobStateEnabling ...
- JobStateEnabling JobState = "enabling"
- // JobStateTerminating ...
- JobStateTerminating JobState = "terminating"
-)
-
-// PossibleJobStateValues returns an array of possible values for the JobState const type.
-func PossibleJobStateValues() []JobState {
- return []JobState{JobStateActive, JobStateCompleted, JobStateDeleting, JobStateDisabled, JobStateDisabling, JobStateEnabling, JobStateTerminating}
-}
-
-// OSType enumerates the values for os type.
-type OSType string
-
-const (
- // OSTypeLinux ...
- OSTypeLinux OSType = "linux"
- // OSTypeUnmapped ...
- OSTypeUnmapped OSType = "unmapped"
- // OSTypeWindows ...
- OSTypeWindows OSType = "windows"
-)
-
-// PossibleOSTypeValues returns an array of possible values for the OSType const type.
-func PossibleOSTypeValues() []OSType {
- return []OSType{OSTypeLinux, OSTypeUnmapped, OSTypeWindows}
-}
-
-// PoolLifetimeOption enumerates the values for pool lifetime option.
-type PoolLifetimeOption string
-
-const (
- // PoolLifetimeOptionJob ...
- PoolLifetimeOptionJob PoolLifetimeOption = "job"
- // PoolLifetimeOptionJobschedule ...
- PoolLifetimeOptionJobschedule PoolLifetimeOption = "jobschedule"
- // PoolLifetimeOptionUnmapped ...
- PoolLifetimeOptionUnmapped PoolLifetimeOption = "unmapped"
-)
-
-// PossiblePoolLifetimeOptionValues returns an array of possible values for the PoolLifetimeOption const type.
-func PossiblePoolLifetimeOptionValues() []PoolLifetimeOption {
- return []PoolLifetimeOption{PoolLifetimeOptionJob, PoolLifetimeOptionJobschedule, PoolLifetimeOptionUnmapped}
-}
-
-// PoolState enumerates the values for pool state.
-type PoolState string
-
-const (
- // PoolStateActive ...
- PoolStateActive PoolState = "active"
- // PoolStateDeleting ...
- PoolStateDeleting PoolState = "deleting"
- // PoolStateUpgrading ...
- PoolStateUpgrading PoolState = "upgrading"
-)
-
-// PossiblePoolStateValues returns an array of possible values for the PoolState const type.
-func PossiblePoolStateValues() []PoolState {
- return []PoolState{PoolStateActive, PoolStateDeleting, PoolStateUpgrading}
-}
-
-// SchedulingErrorCategory enumerates the values for scheduling error category.
-type SchedulingErrorCategory string
-
-const (
- // SchedulingErrorCategoryServererror ...
- SchedulingErrorCategoryServererror SchedulingErrorCategory = "servererror"
- // SchedulingErrorCategoryUnmapped ...
- SchedulingErrorCategoryUnmapped SchedulingErrorCategory = "unmapped"
- // SchedulingErrorCategoryUsererror ...
- SchedulingErrorCategoryUsererror SchedulingErrorCategory = "usererror"
-)
-
-// PossibleSchedulingErrorCategoryValues returns an array of possible values for the SchedulingErrorCategory const type.
-func PossibleSchedulingErrorCategoryValues() []SchedulingErrorCategory {
- return []SchedulingErrorCategory{SchedulingErrorCategoryServererror, SchedulingErrorCategoryUnmapped, SchedulingErrorCategoryUsererror}
-}
-
-// SchedulingState enumerates the values for scheduling state.
-type SchedulingState string
-
-const (
- // Disabled ...
- Disabled SchedulingState = "disabled"
- // Enabled ...
- Enabled SchedulingState = "enabled"
-)
-
-// PossibleSchedulingStateValues returns an array of possible values for the SchedulingState const type.
-func PossibleSchedulingStateValues() []SchedulingState {
- return []SchedulingState{Disabled, Enabled}
-}
-
-// StartTaskState enumerates the values for start task state.
-type StartTaskState string
-
-const (
- // StartTaskStateCompleted ...
- StartTaskStateCompleted StartTaskState = "completed"
- // StartTaskStateRunning ...
- StartTaskStateRunning StartTaskState = "running"
-)
-
-// PossibleStartTaskStateValues returns an array of possible values for the StartTaskState const type.
-func PossibleStartTaskStateValues() []StartTaskState {
- return []StartTaskState{StartTaskStateCompleted, StartTaskStateRunning}
-}
-
-// TaskAddStatus enumerates the values for task add status.
-type TaskAddStatus string
-
-const (
- // TaskAddStatusClienterror ...
- TaskAddStatusClienterror TaskAddStatus = "clienterror"
- // TaskAddStatusServererror ...
- TaskAddStatusServererror TaskAddStatus = "servererror"
- // TaskAddStatusSuccess ...
- TaskAddStatusSuccess TaskAddStatus = "success"
- // TaskAddStatusUnmapped ...
- TaskAddStatusUnmapped TaskAddStatus = "unmapped"
-)
-
-// PossibleTaskAddStatusValues returns an array of possible values for the TaskAddStatus const type.
-func PossibleTaskAddStatusValues() []TaskAddStatus {
- return []TaskAddStatus{TaskAddStatusClienterror, TaskAddStatusServererror, TaskAddStatusSuccess, TaskAddStatusUnmapped}
-}
-
-// TaskState enumerates the values for task state.
-type TaskState string
-
-const (
- // TaskStateActive ...
- TaskStateActive TaskState = "active"
- // TaskStateCompleted ...
- TaskStateCompleted TaskState = "completed"
- // TaskStatePreparing ...
- TaskStatePreparing TaskState = "preparing"
- // TaskStateRunning ...
- TaskStateRunning TaskState = "running"
-)
-
-// PossibleTaskStateValues returns an array of possible values for the TaskState const type.
-func PossibleTaskStateValues() []TaskState {
- return []TaskState{TaskStateActive, TaskStateCompleted, TaskStatePreparing, TaskStateRunning}
-}
-
-// AccountListNodeAgentSkusResult response to an AccountOperation.ListNodeAgentSkus request.
-type AccountListNodeAgentSkusResult struct {
- autorest.Response `json:"-"`
- // Value - The list of supported node agent SKUs.
- Value *[]NodeAgentSku `json:"value,omitempty"`
- // OdataNextLink - The URL to get the next set of results.
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// AccountListNodeAgentSkusResultIterator provides access to a complete listing of NodeAgentSku values.
-type AccountListNodeAgentSkusResultIterator struct {
- i int
- page AccountListNodeAgentSkusResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *AccountListNodeAgentSkusResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter AccountListNodeAgentSkusResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter AccountListNodeAgentSkusResultIterator) Response() AccountListNodeAgentSkusResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter AccountListNodeAgentSkusResultIterator) Value() NodeAgentSku {
- if !iter.page.NotDone() {
- return NodeAgentSku{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (alnasr AccountListNodeAgentSkusResult) IsEmpty() bool {
- return alnasr.Value == nil || len(*alnasr.Value) == 0
-}
-
-// accountListNodeAgentSkusResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (alnasr AccountListNodeAgentSkusResult) accountListNodeAgentSkusResultPreparer() (*http.Request, error) {
- if alnasr.OdataNextLink == nil || len(to.String(alnasr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(alnasr.OdataNextLink)))
-}
-
-// AccountListNodeAgentSkusResultPage contains a page of NodeAgentSku values.
-type AccountListNodeAgentSkusResultPage struct {
- fn func(AccountListNodeAgentSkusResult) (AccountListNodeAgentSkusResult, error)
- alnasr AccountListNodeAgentSkusResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *AccountListNodeAgentSkusResultPage) Next() error {
- next, err := page.fn(page.alnasr)
- if err != nil {
- return err
- }
- page.alnasr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page AccountListNodeAgentSkusResultPage) NotDone() bool {
- return !page.alnasr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page AccountListNodeAgentSkusResultPage) Response() AccountListNodeAgentSkusResult {
- return page.alnasr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page AccountListNodeAgentSkusResultPage) Values() []NodeAgentSku {
- if page.alnasr.IsEmpty() {
- return nil
- }
- return *page.alnasr.Value
-}
-
-// AffinityInformation a locality hint that can be used by the Batch service to select a compute node on which to
-// start a task.
-type AffinityInformation struct {
- // AffinityID - An opaque string representing the location of a compute node or a task that has run previously. You can pass the AffinityId of a compute node or task to indicate that this task needs to be placed close to the node or task.
- AffinityID *string `json:"affinityId,omitempty"`
-}
-
-// ApplicationListResult response to a ApplicationOperations.List request.
-type ApplicationListResult struct {
- autorest.Response `json:"-"`
- // Value - The list of applications available in the account.
- Value *[]ApplicationSummary `json:"value,omitempty"`
- // OdataNextLink - The URL to get the next set of results.
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// ApplicationListResultIterator provides access to a complete listing of ApplicationSummary values.
-type ApplicationListResultIterator struct {
- i int
- page ApplicationListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *ApplicationListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter ApplicationListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter ApplicationListResultIterator) Response() ApplicationListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter ApplicationListResultIterator) Value() ApplicationSummary {
- if !iter.page.NotDone() {
- return ApplicationSummary{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (alr ApplicationListResult) IsEmpty() bool {
- return alr.Value == nil || len(*alr.Value) == 0
-}
-
-// applicationListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (alr ApplicationListResult) applicationListResultPreparer() (*http.Request, error) {
- if alr.OdataNextLink == nil || len(to.String(alr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(alr.OdataNextLink)))
-}
-
-// ApplicationListResultPage contains a page of ApplicationSummary values.
-type ApplicationListResultPage struct {
- fn func(ApplicationListResult) (ApplicationListResult, error)
- alr ApplicationListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *ApplicationListResultPage) Next() error {
- next, err := page.fn(page.alr)
- if err != nil {
- return err
- }
- page.alr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page ApplicationListResultPage) NotDone() bool {
- return !page.alr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page ApplicationListResultPage) Response() ApplicationListResult {
- return page.alr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page ApplicationListResultPage) Values() []ApplicationSummary {
- if page.alr.IsEmpty() {
- return nil
- }
- return *page.alr.Value
-}
-
-// ApplicationPackageReference a reference to an application package to be installed on compute nodes in a pool.
-type ApplicationPackageReference struct {
- // ApplicationID - The id of the application to install.
- ApplicationID *string `json:"applicationId,omitempty"`
- // Version - The version of the application to install. If omitted, the default version is installed.
- Version *string `json:"version,omitempty"`
-}
-
-// ApplicationSummary contains information about an application in an Azure Batch account.
-type ApplicationSummary struct {
- autorest.Response `json:"-"`
- // ID - A string that uniquely identifies the application within the account.
- ID *string `json:"id,omitempty"`
- // DisplayName - The display name for the application.
- DisplayName *string `json:"displayName,omitempty"`
- Versions *[]string `json:"versions,omitempty"`
-}
-
-// AutoPoolSpecification specifies characteristics for a temporary 'auto pool'. The Batch service will create this
-// auto pool, run all the tasks for the job on it, and will delete the pool once the job has completed.
-type AutoPoolSpecification struct {
- // AutoPoolIDPrefix - A prefix to be added to the unique identifier when a pool is automatically created. The prefix can be up to 20 characters long.
- AutoPoolIDPrefix *string `json:"autoPoolIdPrefix,omitempty"`
- // PoolLifetimeOption - The minimum lifetime of created auto pools, and how multiple jobs on a schedule are assigned to pools. Possible values include: 'PoolLifetimeOptionJobschedule', 'PoolLifetimeOptionJob', 'PoolLifetimeOptionUnmapped'
- PoolLifetimeOption PoolLifetimeOption `json:"poolLifetimeOption,omitempty"`
- // KeepAlive - Whether to keep an auto pool alive after its lifetime expires.
- KeepAlive *bool `json:"keepAlive,omitempty"`
- // Pool - The pool specification for the auto pool.
- Pool *PoolSpecification `json:"pool,omitempty"`
-}
-
-// AutoScaleRun the results and errors from an execution of a pool autoscale formula.
-type AutoScaleRun struct {
- autorest.Response `json:"-"`
- // Timestamp - The time at which the autoscale formula was last evaluated.
- Timestamp *date.Time `json:"timestamp,omitempty"`
- // Results - The final values of all variables used in the evaluation of the autoscale formula. Each variable value is returned in the form $variable=value, and variables are separated by semicolons.
- Results *string `json:"results,omitempty"`
- // Error - Details of the error encountered evaluating the autoscale formula on the pool, if the evaluation was unsuccessful.
- Error *AutoScaleRunError `json:"error,omitempty"`
-}
-
-// AutoScaleRunError an error that occurred when executing or evaluating a pool autoscale formula.
-type AutoScaleRunError struct {
- // Code - An identifier for the autoscale error. Codes are invariant and are intended to be consumed programmatically.
- Code *string `json:"code,omitempty"`
- // Message - A message describing the autoscale error, intended to be suitable for display in a user interface.
- Message *string `json:"message,omitempty"`
- // Values - A list of additional error details related to the autoscale error.
- Values *[]NameValuePair `json:"values,omitempty"`
-}
-
-// Certificate a certificate that can be installed on compute nodes and can be used to authenticate operations on
-// the machine.
-type Certificate struct {
- autorest.Response `json:"-"`
- // Thumbprint - The X.509 thumbprint of the certificate. This is a sequence of up to 40 hex digits (it may include spaces but these are removed).
- Thumbprint *string `json:"thumbprint,omitempty"`
- // ThumbprintAlgorithm - The algorithm used to derive the thumbprint. This must be sha1.
- ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"`
- // URL - The URL of the certificate.
- URL *string `json:"url,omitempty"`
- // State - The current state of the certificate. Possible values include: 'Active', 'Deleting', 'Deletefailed'
- State CertificateState `json:"state,omitempty"`
- // StateTransitionTime - The time at which the certificate entered its current state.
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // PreviousState - The previous state of the certificate. This property is not set if the certificate is in its initial Active state. Possible values include: 'Active', 'Deleting', 'Deletefailed'
- PreviousState CertificateState `json:"previousState,omitempty"`
- // PreviousStateTransitionTime - The time at which the certificate entered its previous state. This property is not set if the certificate is in its initial Active state.
- PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"`
- // PublicData - The public part of the certificate as a base-64 encoded .cer file.
- PublicData *string `json:"publicData,omitempty"`
- // DeleteCertificateError - The error that occurred on the last attempt to delete this certificate. This property is set only if the certificate is in the deletefailed state.
- DeleteCertificateError *DeleteCertificateError `json:"deleteCertificateError,omitempty"`
-}
-
-// CertificateAddParameter a certificate that can be installed on compute nodes and can be used to authenticate
-// operations on the machine.
-type CertificateAddParameter struct {
- // Thumbprint - The X.509 thumbprint of the certificate. This is a sequence of up to 40 hex digits (it may include spaces but these are removed).
- Thumbprint *string `json:"thumbprint,omitempty"`
- // ThumbprintAlgorithm - The algorithm used to derive the thumbprint. This must be sha1.
- ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"`
- // Data - The base64-encoded contents of the certificate. The maximum size is 10KB.
- Data *string `json:"data,omitempty"`
- // CertificateFormat - The format of the certificate data. Possible values include: 'Pfx', 'Cer', 'Unmapped'
- CertificateFormat CertificateFormat `json:"certificateFormat,omitempty"`
- // Password - The password to access the certificate's private key.
- Password *string `json:"password,omitempty"`
-}
-
-// CertificateListResult response to a CertificateOperation.List request.
-type CertificateListResult struct {
- autorest.Response `json:"-"`
- // Value - The list of certificates.
- Value *[]Certificate `json:"value,omitempty"`
- // OdataNextLink - The URL to get the next set of results.
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CertificateListResultIterator provides access to a complete listing of Certificate values.
-type CertificateListResultIterator struct {
- i int
- page CertificateListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CertificateListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CertificateListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CertificateListResultIterator) Response() CertificateListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CertificateListResultIterator) Value() Certificate {
- if !iter.page.NotDone() {
- return Certificate{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (clr CertificateListResult) IsEmpty() bool {
- return clr.Value == nil || len(*clr.Value) == 0
-}
-
-// certificateListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (clr CertificateListResult) certificateListResultPreparer() (*http.Request, error) {
- if clr.OdataNextLink == nil || len(to.String(clr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(clr.OdataNextLink)))
-}
-
-// CertificateListResultPage contains a page of Certificate values.
-type CertificateListResultPage struct {
- fn func(CertificateListResult) (CertificateListResult, error)
- clr CertificateListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CertificateListResultPage) Next() error {
- next, err := page.fn(page.clr)
- if err != nil {
- return err
- }
- page.clr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CertificateListResultPage) NotDone() bool {
- return !page.clr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CertificateListResultPage) Response() CertificateListResult {
- return page.clr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CertificateListResultPage) Values() []Certificate {
- if page.clr.IsEmpty() {
- return nil
- }
- return *page.clr.Value
-}
-
-// CertificateReference a reference to a certificate to be installed on compute nodes in a pool.
-type CertificateReference struct {
- // Thumbprint - The thumbprint of the certificate.
- Thumbprint *string `json:"thumbprint,omitempty"`
- // ThumbprintAlgorithm - The algorithm with which the thumbprint is associated. This must be sha1.
- ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"`
- // StoreLocation - The location of the certificate store on the compute node into which to install the certificate. The default value is CurrentUser. Possible values include: 'CertificateStoreLocationCurrentuser', 'CertificateStoreLocationLocalmachine', 'CertificateStoreLocationUnmapped'
- StoreLocation CertificateStoreLocation `json:"storeLocation,omitempty"`
- // StoreName - The name of the certificate store on the compute node into which to install the certificate. The default value is My.
- StoreName *string `json:"storeName,omitempty"`
- // Visibility - Which user accounts on the compute node should have access to the private data of the certificate. This may be any subset of the values 'starttask', 'task' and 'remoteuser', separated by commas. The default is all accounts, corresponding to the string 'starttask,task,remoteuser'.
- Visibility *[]CertificateVisibility `json:"visibility,omitempty"`
-}
-
-// CloudJob an Azure Batch job.
-type CloudJob struct {
- autorest.Response `json:"-"`
- // ID - A string that uniquely identifies the job within the account. The id can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. It is common to use a GUID for the id.
- ID *string `json:"id,omitempty"`
- // DisplayName - The display name for the job.
- DisplayName *string `json:"displayName,omitempty"`
- // UsesTaskDependencies - The flag that determines if this job will use tasks with dependencies.
- UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"`
- // URL - The URL of the job.
- URL *string `json:"url,omitempty"`
- // ETag - The ETag of the job.
- ETag *string `json:"eTag,omitempty"`
- // LastModified - The last modified time of the job.
- LastModified *date.Time `json:"lastModified,omitempty"`
- // CreationTime - The creation time of the job.
- CreationTime *date.Time `json:"creationTime,omitempty"`
- // State - The current state of the job. Possible values include: 'JobStateActive', 'JobStateDisabling', 'JobStateDisabled', 'JobStateEnabling', 'JobStateTerminating', 'JobStateCompleted', 'JobStateDeleting'
- State JobState `json:"state,omitempty"`
- // StateTransitionTime - The time at which the job entered its current state.
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // PreviousState - The previous state of the job. This property is not set if the job is in its initial Active state. Possible values include: 'JobStateActive', 'JobStateDisabling', 'JobStateDisabled', 'JobStateEnabling', 'JobStateTerminating', 'JobStateCompleted', 'JobStateDeleting'
- PreviousState JobState `json:"previousState,omitempty"`
- // PreviousStateTransitionTime - The time at which the job entered its previous state. This property is not set if the job is in its initial Active state.
- PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"`
- // Priority - The priority of the job. Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0.
- Priority *int32 `json:"priority,omitempty"`
- // Constraints - The execution constraints for the job.
- Constraints *JobConstraints `json:"constraints,omitempty"`
- // JobManagerTask - Details of a Job Manager task to be launched when the job is started.
- JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"`
- // JobPreparationTask - The Job Preparation task.
- JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"`
- // JobReleaseTask - The Job Release task.
- JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"`
- // CommonEnvironmentSettings - The list of common environment variable settings. These environment variables are set for all tasks in the job (including the Job Manager, Job Preparation and Job Release tasks).
- CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"`
- // PoolInfo - The pool on which the Batch service runs the job's tasks.
- PoolInfo *PoolInformation `json:"poolInfo,omitempty"`
- // Metadata - A list of name-value pairs associated with the job as metadata.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
- // ExecutionInfo - The execution information for the job.
- ExecutionInfo *JobExecutionInformation `json:"executionInfo,omitempty"`
- // Stats - Resource usage statistics for the entire lifetime of the job.
- Stats *JobStatistics `json:"stats,omitempty"`
-}
-
-// CloudJobListPreparationAndReleaseTaskStatusResult response to a
-// CloudJobOperations.ListPreparationAndReleaseTaskStatus request.
-type CloudJobListPreparationAndReleaseTaskStatusResult struct {
- autorest.Response `json:"-"`
- // Value - A list of Job Preparation and Job Release task execution information.
- Value *[]JobPreparationAndReleaseTaskExecutionInformation `json:"value,omitempty"`
- // OdataNextLink - The URL to get the next set of results.
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CloudJobListPreparationAndReleaseTaskStatusResultIterator provides access to a complete listing of
-// JobPreparationAndReleaseTaskExecutionInformation values.
-type CloudJobListPreparationAndReleaseTaskStatusResultIterator struct {
- i int
- page CloudJobListPreparationAndReleaseTaskStatusResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CloudJobListPreparationAndReleaseTaskStatusResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CloudJobListPreparationAndReleaseTaskStatusResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CloudJobListPreparationAndReleaseTaskStatusResultIterator) Response() CloudJobListPreparationAndReleaseTaskStatusResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CloudJobListPreparationAndReleaseTaskStatusResultIterator) Value() JobPreparationAndReleaseTaskExecutionInformation {
- if !iter.page.NotDone() {
- return JobPreparationAndReleaseTaskExecutionInformation{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult) IsEmpty() bool {
- return cjlpartsr.Value == nil || len(*cjlpartsr.Value) == 0
-}
-
-// cloudJobListPreparationAndReleaseTaskStatusResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult) cloudJobListPreparationAndReleaseTaskStatusResultPreparer() (*http.Request, error) {
- if cjlpartsr.OdataNextLink == nil || len(to.String(cjlpartsr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(cjlpartsr.OdataNextLink)))
-}
-
-// CloudJobListPreparationAndReleaseTaskStatusResultPage contains a page of
-// JobPreparationAndReleaseTaskExecutionInformation values.
-type CloudJobListPreparationAndReleaseTaskStatusResultPage struct {
- fn func(CloudJobListPreparationAndReleaseTaskStatusResult) (CloudJobListPreparationAndReleaseTaskStatusResult, error)
- cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CloudJobListPreparationAndReleaseTaskStatusResultPage) Next() error {
- next, err := page.fn(page.cjlpartsr)
- if err != nil {
- return err
- }
- page.cjlpartsr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) NotDone() bool {
- return !page.cjlpartsr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) Response() CloudJobListPreparationAndReleaseTaskStatusResult {
- return page.cjlpartsr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) Values() []JobPreparationAndReleaseTaskExecutionInformation {
- if page.cjlpartsr.IsEmpty() {
- return nil
- }
- return *page.cjlpartsr.Value
-}
-
-// CloudJobListResult response to a CloudJobOperation.List or ListFromJobSchedule request.
-type CloudJobListResult struct {
- autorest.Response `json:"-"`
- // Value - The list of jobs.
- Value *[]CloudJob `json:"value,omitempty"`
- // OdataNextLink - The URL to get the next set of results.
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CloudJobListResultIterator provides access to a complete listing of CloudJob values.
-type CloudJobListResultIterator struct {
- i int
- page CloudJobListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CloudJobListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CloudJobListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CloudJobListResultIterator) Response() CloudJobListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CloudJobListResultIterator) Value() CloudJob {
- if !iter.page.NotDone() {
- return CloudJob{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (cjlr CloudJobListResult) IsEmpty() bool {
- return cjlr.Value == nil || len(*cjlr.Value) == 0
-}
-
-// cloudJobListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (cjlr CloudJobListResult) cloudJobListResultPreparer() (*http.Request, error) {
- if cjlr.OdataNextLink == nil || len(to.String(cjlr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(cjlr.OdataNextLink)))
-}
-
-// CloudJobListResultPage contains a page of CloudJob values.
-type CloudJobListResultPage struct {
- fn func(CloudJobListResult) (CloudJobListResult, error)
- cjlr CloudJobListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CloudJobListResultPage) Next() error {
- next, err := page.fn(page.cjlr)
- if err != nil {
- return err
- }
- page.cjlr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CloudJobListResultPage) NotDone() bool {
- return !page.cjlr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CloudJobListResultPage) Response() CloudJobListResult {
- return page.cjlr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CloudJobListResultPage) Values() []CloudJob {
- if page.cjlr.IsEmpty() {
- return nil
- }
- return *page.cjlr.Value
-}
-
-// CloudJobSchedule a job schedule that allows recurring jobs by specifying when to run jobs and a specification
-// used to create each job.
-type CloudJobSchedule struct {
- autorest.Response `json:"-"`
- // ID - A string that uniquely identifies the schedule within the account. A GUID is recommended.
- ID *string `json:"id,omitempty"`
- // DisplayName - The display name for the schedule.
- DisplayName *string `json:"displayName,omitempty"`
- // URL - The URL of the job schedule.
- URL *string `json:"url,omitempty"`
- // ETag - The ETag of the job schedule.
- ETag *string `json:"eTag,omitempty"`
- // LastModified - The last modified time of the job schedule.
- LastModified *date.Time `json:"lastModified,omitempty"`
- // CreationTime - The creation time of the job schedule.
- CreationTime *date.Time `json:"creationTime,omitempty"`
- // State - The current state of the job schedule. Possible values include: 'JobScheduleStateActive', 'JobScheduleStateCompleted', 'JobScheduleStateDisabled', 'JobScheduleStateTerminating', 'JobScheduleStateDeleting'
- State JobScheduleState `json:"state,omitempty"`
- // StateTransitionTime - The time at which the job schedule entered the current state.
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // PreviousState - The previous state of the job schedule. Possible values include: 'JobScheduleStateActive', 'JobScheduleStateCompleted', 'JobScheduleStateDisabled', 'JobScheduleStateTerminating', 'JobScheduleStateDeleting'
- PreviousState JobScheduleState `json:"previousState,omitempty"`
- // PreviousStateTransitionTime - The time at which the job schedule entered its previous state.
- PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"`
- // Schedule - The schedule according to which jobs will be created.
- Schedule *Schedule `json:"schedule,omitempty"`
- // JobSpecification - The details of the jobs to be created on this schedule.
- JobSpecification *JobSpecification `json:"jobSpecification,omitempty"`
- // ExecutionInfo - Information about jobs that have been and will be run under this schedule.
- ExecutionInfo *JobScheduleExecutionInformation `json:"executionInfo,omitempty"`
- // Metadata - A list of name-value pairs associated with the schedule as metadata.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
- // Stats - The lifetime resource usage statistics for the job schedule.
- Stats *JobScheduleStatistics `json:"stats,omitempty"`
-}
-
-// CloudJobScheduleListResult response to a CloudJobScheduleOperation.List request.
-type CloudJobScheduleListResult struct {
- autorest.Response `json:"-"`
- // Value - The list of job schedules.
- Value *[]CloudJobSchedule `json:"value,omitempty"`
- // OdataNextLink - The URL to get the next set of results.
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CloudJobScheduleListResultIterator provides access to a complete listing of CloudJobSchedule values.
-type CloudJobScheduleListResultIterator struct {
- i int
- page CloudJobScheduleListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CloudJobScheduleListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CloudJobScheduleListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CloudJobScheduleListResultIterator) Response() CloudJobScheduleListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CloudJobScheduleListResultIterator) Value() CloudJobSchedule {
- if !iter.page.NotDone() {
- return CloudJobSchedule{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (cjslr CloudJobScheduleListResult) IsEmpty() bool {
- return cjslr.Value == nil || len(*cjslr.Value) == 0
-}
-
-// cloudJobScheduleListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (cjslr CloudJobScheduleListResult) cloudJobScheduleListResultPreparer() (*http.Request, error) {
- if cjslr.OdataNextLink == nil || len(to.String(cjslr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(cjslr.OdataNextLink)))
-}
-
-// CloudJobScheduleListResultPage contains a page of CloudJobSchedule values.
-type CloudJobScheduleListResultPage struct {
- fn func(CloudJobScheduleListResult) (CloudJobScheduleListResult, error)
- cjslr CloudJobScheduleListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CloudJobScheduleListResultPage) Next() error {
- next, err := page.fn(page.cjslr)
- if err != nil {
- return err
- }
- page.cjslr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CloudJobScheduleListResultPage) NotDone() bool {
- return !page.cjslr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CloudJobScheduleListResultPage) Response() CloudJobScheduleListResult {
- return page.cjslr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CloudJobScheduleListResultPage) Values() []CloudJobSchedule {
- if page.cjslr.IsEmpty() {
- return nil
- }
- return *page.cjslr.Value
-}
-
-// CloudPool a pool in the Azure Batch service.
-type CloudPool struct {
- autorest.Response `json:"-"`
- // ID - A string that uniquely identifies the pool within the account. The id can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters.
- ID *string `json:"id,omitempty"`
- // DisplayName - The display name for the pool.
- DisplayName *string `json:"displayName,omitempty"`
- // URL - The URL of the pool.
- URL *string `json:"url,omitempty"`
- // ETag - The ETag of the pool.
- ETag *string `json:"eTag,omitempty"`
- // LastModified - The last modified time of the pool.
- LastModified *date.Time `json:"lastModified,omitempty"`
- // CreationTime - The creation time of the pool.
- CreationTime *date.Time `json:"creationTime,omitempty"`
- // State - The current state of the pool. Possible values include: 'PoolStateActive', 'PoolStateDeleting', 'PoolStateUpgrading'
- State PoolState `json:"state,omitempty"`
- // StateTransitionTime - The time at which the pool entered its current state.
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // AllocationState - Whether the pool is resizing. Possible values include: 'Steady', 'Resizing', 'Stopping'
- AllocationState AllocationState `json:"allocationState,omitempty"`
- // AllocationStateTransitionTime - The time at which the pool entered its current allocation state.
- AllocationStateTransitionTime *date.Time `json:"allocationStateTransitionTime,omitempty"`
- // VMSize - The size of virtual machines in the pool. All virtual machines in a pool are the same size.
- VMSize *string `json:"vmSize,omitempty"`
- // CloudServiceConfiguration - The cloud service configuration for the pool. This property and VirtualMachineConfiguration are mutually exclusive and one of the properties must be specified.
- CloudServiceConfiguration *CloudServiceConfiguration `json:"cloudServiceConfiguration,omitempty"`
- // VirtualMachineConfiguration - The virtual machine configuration for the pool. This property and CloudServiceConfiguration are mutually exclusive and one of the properties must be specified.
- VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"`
- // ResizeTimeout - The timeout for allocation of compute nodes to the pool. In a Get Pool operation, this is the timeout for the most recent resize operation. The default value is 10 minutes.
- ResizeTimeout *string `json:"resizeTimeout,omitempty"`
- // ResizeError - Details of any error encountered while performing the last resize on the pool. This property is set only if an error occurred during the last pool resize, and only when the pool AllocationState is Steady.
- ResizeError *ResizeError `json:"resizeError,omitempty"`
- // CurrentDedicated - The number of compute nodes currently in the pool.
- CurrentDedicated *int32 `json:"currentDedicated,omitempty"`
- // TargetDedicated - The desired number of compute nodes in the pool. This property must have the default value if EnableAutoScale is true. It is required if EnableAutoScale is false.
- TargetDedicated *int32 `json:"targetDedicated,omitempty"`
- // EnableAutoScale - Whether the pool size should automatically adjust over time. If true, the AutoScaleFormula property must be set. If false, the TargetDedicated property must be set.
- EnableAutoScale *bool `json:"enableAutoScale,omitempty"`
- // AutoScaleFormula - A formula for the desired number of compute nodes in the pool.
- AutoScaleFormula *string `json:"autoScaleFormula,omitempty"`
- // AutoScaleEvaluationInterval - A time interval for the desired AutoScale evaluation period in the pool.
- AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"`
- // AutoScaleRun - The results and errors from the last execution of the autoscale formula.
- AutoScaleRun *AutoScaleRun `json:"autoScaleRun,omitempty"`
- // EnableInterNodeCommunication - Whether the pool permits direct communication between nodes.
- EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"`
- // StartTask - A task specified to run on each compute node as it joins the pool.
- StartTask *StartTask `json:"startTask,omitempty"`
- // CertificateReferences - The list of certificates to be installed on each compute node in the pool.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- // ApplicationPackageReferences - The list of application packages to be installed on each compute node in the pool.
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // MaxTasksPerNode - The maximum number of tasks that can run concurrently on a single compute node in the pool.
- MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"`
- // TaskSchedulingPolicy - How the Batch service distributes tasks between compute nodes in the pool.
- TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"`
- // Metadata - A list of name-value pairs associated with the pool as metadata.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
- // Stats - Utilization and resource usage statistics for the entire lifetime of the pool.
- Stats *PoolStatistics `json:"stats,omitempty"`
-}
-
-// CloudPoolListResult response to a CloudPoolOperations.List request.
-type CloudPoolListResult struct {
- autorest.Response `json:"-"`
- // Value - The list of pools.
- Value *[]CloudPool `json:"value,omitempty"`
- // OdataNextLink - The URL to get the next set of results.
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CloudPoolListResultIterator provides access to a complete listing of CloudPool values.
-type CloudPoolListResultIterator struct {
- i int
- page CloudPoolListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CloudPoolListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CloudPoolListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CloudPoolListResultIterator) Response() CloudPoolListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CloudPoolListResultIterator) Value() CloudPool {
- if !iter.page.NotDone() {
- return CloudPool{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (cplr CloudPoolListResult) IsEmpty() bool {
- return cplr.Value == nil || len(*cplr.Value) == 0
-}
-
-// cloudPoolListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (cplr CloudPoolListResult) cloudPoolListResultPreparer() (*http.Request, error) {
- if cplr.OdataNextLink == nil || len(to.String(cplr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(cplr.OdataNextLink)))
-}
-
-// CloudPoolListResultPage contains a page of CloudPool values.
-type CloudPoolListResultPage struct {
- fn func(CloudPoolListResult) (CloudPoolListResult, error)
- cplr CloudPoolListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CloudPoolListResultPage) Next() error {
- next, err := page.fn(page.cplr)
- if err != nil {
- return err
- }
- page.cplr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CloudPoolListResultPage) NotDone() bool {
- return !page.cplr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CloudPoolListResultPage) Response() CloudPoolListResult {
- return page.cplr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CloudPoolListResultPage) Values() []CloudPool {
- if page.cplr.IsEmpty() {
- return nil
- }
- return *page.cplr.Value
-}
-
-// CloudServiceConfiguration the configuration for nodes in a pool based on the Azure Cloud Services platform.
-type CloudServiceConfiguration struct {
- // OsFamily - The Azure Guest OS family to be installed on the virtual machines in the pool.
- OsFamily *string `json:"osFamily,omitempty"`
- // TargetOSVersion - The Azure Guest OS version to be installed on the virtual machines in the pool. The default value is * which specifies the latest operating system version for the specified OS family.
- TargetOSVersion *string `json:"targetOSVersion,omitempty"`
- // CurrentOSVersion - The Azure Guest OS Version currently installed on the virtual machines in the pool. This may differ from TargetOSVersion if the pool state is Upgrading.
- CurrentOSVersion *string `json:"currentOSVersion,omitempty"`
-}
-
-// CloudTask an Azure Batch task.
-type CloudTask struct {
- autorest.Response `json:"-"`
- // ID - A string that uniquely identifies the task within the job. The id can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters.
- ID *string `json:"id,omitempty"`
- // DisplayName - A display name for the task.
- DisplayName *string `json:"displayName,omitempty"`
- // URL - The URL of the task.
- URL *string `json:"url,omitempty"`
- // ETag - The ETag of the task.
- ETag *string `json:"eTag,omitempty"`
- // LastModified - The last modified time of the task.
- LastModified *date.Time `json:"lastModified,omitempty"`
- // CreationTime - The creation time of the task.
- CreationTime *date.Time `json:"creationTime,omitempty"`
- // State - The current state of the task. Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted'
- State TaskState `json:"state,omitempty"`
- // StateTransitionTime - The time at which the task entered its current state.
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // PreviousState - The previous state of the task. This property is not set if the task is in its initial Active state. Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted'
- PreviousState TaskState `json:"previousState,omitempty"`
- // PreviousStateTransitionTime - The time at which the task entered its previous state. This property is not set if the task is in its initial Active state.
- PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"`
- // CommandLine - The command line of the task. For multi-instance tasks, the command line is executed on the primary subtask after all the subtasks have finished executing the coordianation command line.
- CommandLine *string `json:"commandLine,omitempty"`
- // ResourceFiles - A list of files that the Batch service will download to the compute node before running the command line. For multi-instance tasks, the resource files will only be downloaded to the compute node on which the primary subtask is executed.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- // EnvironmentSettings - A list of environment variable settings for the task.
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- // AffinityInfo - A locality hint that can be used by the Batch service to select a compute node on which to start the new task.
- AffinityInfo *AffinityInformation `json:"affinityInfo,omitempty"`
- // Constraints - The execution constraints that apply to this task.
- Constraints *TaskConstraints `json:"constraints,omitempty"`
- // RunElevated - Whether to run the task in elevated mode.
- RunElevated *bool `json:"runElevated,omitempty"`
- // ExecutionInfo - Information about the execution of the task.
- ExecutionInfo *TaskExecutionInformation `json:"executionInfo,omitempty"`
- // NodeInfo - Information about the compute node on which the task ran.
- NodeInfo *ComputeNodeInformation `json:"nodeInfo,omitempty"`
- // MultiInstanceSettings - Information about how to run the multi-instance task.
- MultiInstanceSettings *MultiInstanceSettings `json:"multiInstanceSettings,omitempty"`
- // Stats - Resource usage statistics for the task.
- Stats *TaskStatistics `json:"stats,omitempty"`
- // DependsOn - Any dependencies this task has.
- DependsOn *TaskDependencies `json:"dependsOn,omitempty"`
-}
-
-// CloudTaskListResult response to a CloudTaskOperations.List request.
-type CloudTaskListResult struct {
- autorest.Response `json:"-"`
- // Value - The list of tasks.
- Value *[]CloudTask `json:"value,omitempty"`
- // OdataNextLink - The URL to get the next set of results.
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CloudTaskListResultIterator provides access to a complete listing of CloudTask values.
-type CloudTaskListResultIterator struct {
- i int
- page CloudTaskListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CloudTaskListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CloudTaskListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CloudTaskListResultIterator) Response() CloudTaskListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CloudTaskListResultIterator) Value() CloudTask {
- if !iter.page.NotDone() {
- return CloudTask{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (ctlr CloudTaskListResult) IsEmpty() bool {
- return ctlr.Value == nil || len(*ctlr.Value) == 0
-}
-
-// cloudTaskListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (ctlr CloudTaskListResult) cloudTaskListResultPreparer() (*http.Request, error) {
- if ctlr.OdataNextLink == nil || len(to.String(ctlr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(ctlr.OdataNextLink)))
-}
-
-// CloudTaskListResultPage contains a page of CloudTask values.
-type CloudTaskListResultPage struct {
- fn func(CloudTaskListResult) (CloudTaskListResult, error)
- ctlr CloudTaskListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CloudTaskListResultPage) Next() error {
- next, err := page.fn(page.ctlr)
- if err != nil {
- return err
- }
- page.ctlr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CloudTaskListResultPage) NotDone() bool {
- return !page.ctlr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CloudTaskListResultPage) Response() CloudTaskListResult {
- return page.ctlr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CloudTaskListResultPage) Values() []CloudTask {
- if page.ctlr.IsEmpty() {
- return nil
- }
- return *page.ctlr.Value
-}
-
-// CloudTaskListSubtasksResult response to a CloudTaskOperations.ListSubtasks request.
-type CloudTaskListSubtasksResult struct {
- autorest.Response `json:"-"`
- // Value - The list of information of subtasks.
- Value *[]SubtaskInformation `json:"value,omitempty"`
-}
-
-// ComputeNode a compute node in the Batch service.
-type ComputeNode struct {
- autorest.Response `json:"-"`
- // ID - The id of the compute node.
- ID *string `json:"id,omitempty"`
- // URL - The URL of the compute node.
- URL *string `json:"url,omitempty"`
- // State - The current state of the compute node. Possible values include: 'Idle', 'Rebooting', 'Reimaging', 'Running', 'Unusable', 'Creating', 'Starting', 'Waitingforstarttask', 'Starttaskfailed', 'Unknown', 'Leavingpool', 'Offline'
- State ComputeNodeState `json:"state,omitempty"`
- // SchedulingState - Whether the compute node should be available for task scheduling. Possible values include: 'Enabled', 'Disabled'
- SchedulingState SchedulingState `json:"schedulingState,omitempty"`
- // StateTransitionTime - The time at which the compute node entered its current state.
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // LastBootTime - The time at which the compute node was started.
- LastBootTime *date.Time `json:"lastBootTime,omitempty"`
- // AllocationTime - The time at which this compute node was allocated to the pool.
- AllocationTime *date.Time `json:"allocationTime,omitempty"`
- // IPAddress - The IP address that other compute nodes can use to communicate with this compute node.
- IPAddress *string `json:"ipAddress,omitempty"`
- // AffinityID - An identifier which can be passed in the Add Task API to request that the task be scheduled close to this compute node.
- AffinityID *string `json:"affinityId,omitempty"`
- // VMSize - The size of the virtual machine hosting the compute node.
- VMSize *string `json:"vmSize,omitempty"`
- // TotalTasksRun - The total number of job tasks completed on the compute node. This includes Job Preparation, Job Release and Job Manager tasks, but not the pool start task.
- TotalTasksRun *int32 `json:"totalTasksRun,omitempty"`
- // RunningTasksCount - The total number of currently running job tasks on the compute node. This includes Job Preparation, Job Release, and Job Manager tasks, but not the pool start task.
- RunningTasksCount *int32 `json:"runningTasksCount,omitempty"`
- // TotalTasksSucceeded - The total number of job tasks which completed successfully (with exitCode 0) on the compute node. This includes Job Preparation, Job Release, and Job Manager tasks, but not the pool start task.
- TotalTasksSucceeded *int32 `json:"totalTasksSucceeded,omitempty"`
- // RecentTasks - The list of tasks that are currently running on the compute node.
- RecentTasks *[]TaskInformation `json:"recentTasks,omitempty"`
- // StartTask - The task specified to run on the compute node as it joins the pool.
- StartTask *StartTask `json:"startTask,omitempty"`
- // StartTaskInfo - Runtime information about the execution of the start task on the compute node.
- StartTaskInfo *StartTaskInformation `json:"startTaskInfo,omitempty"`
- // CertificateReferences - The list of certificates installed on the compute node.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- // Errors - The list of errors that are currently being encountered by the compute node.
- Errors *[]ComputeNodeError `json:"errors,omitempty"`
-}
-
-// ComputeNodeError an error encountered by a compute node.
-type ComputeNodeError struct {
- // Code - An identifier for the compute node error. Codes are invariant and are intended to be consumed programmatically.
- Code *string `json:"code,omitempty"`
- // Message - A message describing the compute node error, intended to be suitable for display in a user interface.
- Message *string `json:"message,omitempty"`
- // ErrorDetails - The list of additional error details related to the compute node error.
- ErrorDetails *[]NameValuePair `json:"errorDetails,omitempty"`
-}
-
-// ComputeNodeGetRemoteLoginSettingsResult response to a ComputeNodeOperation.GetRemoteLoginSettings request.
-type ComputeNodeGetRemoteLoginSettingsResult struct {
- autorest.Response `json:"-"`
- // RemoteLoginIPAddress - The IP address used for remote login to the compute node.
- RemoteLoginIPAddress *string `json:"remoteLoginIPAddress,omitempty"`
- // RemoteLoginPort - The port used for remote login to the compute node.
- RemoteLoginPort *int32 `json:"remoteLoginPort,omitempty"`
-}
-
-// ComputeNodeInformation information about the compute node on which a task ran.
-type ComputeNodeInformation struct {
- // AffinityID - An identifier for the compute node on which the task ran, which can be passed when adding a task to request that the task be scheduled close to this compute node.
- AffinityID *string `json:"affinityId,omitempty"`
- // NodeURL - The URL of the node on which the task ran.
- NodeURL *string `json:"nodeUrl,omitempty"`
- // PoolID - The id of the pool on which the task ran.
- PoolID *string `json:"poolId,omitempty"`
- // NodeID - The id of the node on which the task ran.
- NodeID *string `json:"nodeId,omitempty"`
- // TaskRootDirectory - The root directory of the task on the compute node.
- TaskRootDirectory *string `json:"taskRootDirectory,omitempty"`
- // TaskRootDirectoryURL - The URL to the root directory of the task on the compute node.
- TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"`
-}
-
-// ComputeNodeListResult response to a ComputeNodeOperation.List request.
-type ComputeNodeListResult struct {
- autorest.Response `json:"-"`
- // Value - The list of compute nodes.
- Value *[]ComputeNode `json:"value,omitempty"`
- // OdataNextLink - The URL to get the next set of results.
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// ComputeNodeListResultIterator provides access to a complete listing of ComputeNode values.
-type ComputeNodeListResultIterator struct {
- i int
- page ComputeNodeListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *ComputeNodeListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter ComputeNodeListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter ComputeNodeListResultIterator) Response() ComputeNodeListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter ComputeNodeListResultIterator) Value() ComputeNode {
- if !iter.page.NotDone() {
- return ComputeNode{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (cnlr ComputeNodeListResult) IsEmpty() bool {
- return cnlr.Value == nil || len(*cnlr.Value) == 0
-}
-
-// computeNodeListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (cnlr ComputeNodeListResult) computeNodeListResultPreparer() (*http.Request, error) {
- if cnlr.OdataNextLink == nil || len(to.String(cnlr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(cnlr.OdataNextLink)))
-}
-
-// ComputeNodeListResultPage contains a page of ComputeNode values.
-type ComputeNodeListResultPage struct {
- fn func(ComputeNodeListResult) (ComputeNodeListResult, error)
- cnlr ComputeNodeListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *ComputeNodeListResultPage) Next() error {
- next, err := page.fn(page.cnlr)
- if err != nil {
- return err
- }
- page.cnlr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page ComputeNodeListResultPage) NotDone() bool {
- return !page.cnlr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page ComputeNodeListResultPage) Response() ComputeNodeListResult {
- return page.cnlr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page ComputeNodeListResultPage) Values() []ComputeNode {
- if page.cnlr.IsEmpty() {
- return nil
- }
- return *page.cnlr.Value
-}
-
-// ComputeNodeUser an user account on a compute node.
-type ComputeNodeUser struct {
- // Name - The user name of the account.
- Name *string `json:"name,omitempty"`
- // IsAdmin - Whether the account should be an administrator on the compute node.
- IsAdmin *bool `json:"isAdmin,omitempty"`
- // ExpiryTime - The time at which the account should expire. If omitted, the default is 1 day from the current time.
- ExpiryTime *date.Time `json:"expiryTime,omitempty"`
- // Password - The password of the account.
- Password *string `json:"password,omitempty"`
- // SSHPublicKey - The SSH public key that can be used for remote login to the compute node.
- SSHPublicKey *string `json:"sshPublicKey,omitempty"`
-}
-
-// DeleteCertificateError an error encountered by the Batch service when deleting a certificate.
-type DeleteCertificateError struct {
- // Code - An identifier for the certificate deletion error. Codes are invariant and are intended to be consumed programmatically.
- Code *string `json:"code,omitempty"`
- // Message - A message describing the certificate deletion error, intended to be suitable for display in a user interface.
- Message *string `json:"message,omitempty"`
- // Values - A list of additional error details related to the certificate deletion error.
- Values *[]NameValuePair `json:"values,omitempty"`
-}
-
-// EnvironmentSetting an environment variable to be set on a task process.
-type EnvironmentSetting struct {
- // Name - The name of the environment variable.
- Name *string `json:"name,omitempty"`
- // Value - The value of the environment variable.
- Value *string `json:"value,omitempty"`
-}
-
-// Error an error response received from the Azure Batch service.
-type Error struct {
- // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically.
- Code *string `json:"code,omitempty"`
- // Message - A message describing the error, intended to be suitable for display in a user interface.
- Message *ErrorMessage `json:"message,omitempty"`
- // Values - A collection of key-value pairs containing additional details about the error.
- Values *[]ErrorDetail `json:"values,omitempty"`
-}
-
-// ErrorDetail an item of additional information included in an Azure Batch error response.
-type ErrorDetail struct {
- // Key - An identifier specifying the meaning of the Value property.
- Key *string `json:"key,omitempty"`
- // Value - The additional information included with the error response.
- Value *string `json:"value,omitempty"`
-}
-
-// ErrorMessage an error message received in an Azure Batch error response.
-type ErrorMessage struct {
- // Lang - The language code of the error message
- Lang *string `json:"lang,omitempty"`
- // Value - The text of the message.
- Value *string `json:"value,omitempty"`
-}
-
-// FileProperties the properties of a file on a compute node.
-type FileProperties struct {
- // CreationTime - The file creation time.
- CreationTime *date.Time `json:"creationTime,omitempty"`
- // LastModified - The time at which the file was last modified.
- LastModified *date.Time `json:"lastModified,omitempty"`
- // ContentLength - The length of the file.
- ContentLength *int64 `json:"contentLength,omitempty"`
- // ContentType - The content type of the file.
- ContentType *string `json:"contentType,omitempty"`
- // FileMode - The file mode attribute in octal format. This property will be returned only from a Linux compute node.
- FileMode *string `json:"fileMode,omitempty"`
-}
-
-// ImageReference a reference to an Azure Virtual Machines Marketplace image.
-type ImageReference struct {
- // Publisher - The publisher of the Azure Virtual Machines Marketplace image. For example, Canonical or MicrosoftWindowsServer.
- Publisher *string `json:"publisher,omitempty"`
- // Offer - The offer type of the Azure Virtual Machines Marketplace image. For example, UbuntuServer or WindowsServer.
- Offer *string `json:"offer,omitempty"`
- // Sku - The SKU of the Azure Virtual Machines Marketplace image. For example, 14.04.0-LTS or 2012-R2-Datacenter.
- Sku *string `json:"sku,omitempty"`
- // Version - The version of the Azure Virtual Machines Marketplace image. A value of 'latest' can be specified to select the latest version of an image. If omitted, the default is 'latest'.
- Version *string `json:"version,omitempty"`
-}
-
-// JobAddParameter an Azure Batch job to add.
-type JobAddParameter struct {
- // ID - A string that uniquely identifies the job within the account. The id can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. It is common to use a GUID for the id.
- ID *string `json:"id,omitempty"`
- // DisplayName - The display name for the job.
- DisplayName *string `json:"displayName,omitempty"`
- // Priority - The priority of the job. Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0.
- Priority *int32 `json:"priority,omitempty"`
- // Constraints - The execution constraints for the job.
- Constraints *JobConstraints `json:"constraints,omitempty"`
- // JobManagerTask - Details of a Job Manager task to be launched when the job is started.
- JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"`
- // JobPreparationTask - The Job Preparation task.
- JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"`
- // JobReleaseTask - The Job Release task.
- JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"`
- // CommonEnvironmentSettings - The list of common environment variable settings. These environment variables are set for all tasks in the job (including the Job Manager, Job Preparation and Job Release tasks).
- CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"`
- // PoolInfo - The pool on which the Batch service runs the job's tasks.
- PoolInfo *PoolInformation `json:"poolInfo,omitempty"`
- // Metadata - A list of name-value pairs associated with the job as metadata.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
- // UsesTaskDependencies - The flag that determines if this job will use tasks with dependencies.
- UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"`
-}
-
-// JobConstraints specifies the execution constraints for jobs created on a schedule.
-type JobConstraints struct {
- // MaxWallClockTime - The maximum elapsed time that the job may run, measured from the time the job starts. If the job does not complete within the time limit, the Batch service terminates it and any tasks that are still running.
- MaxWallClockTime *string `json:"maxWallClockTime,omitempty"`
- // MaxTaskRetryCount - The maximum number of times each task may be retried. The Batch service retries a task if its exit code is nonzero.
- MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"`
-}
-
-// JobDisableParameter parameters for a CloudJobOperations.Disable request.
-type JobDisableParameter struct {
- // DisableTasks - What to do with active tasks associated with the job. Possible values include: 'DisableJobOptionRequeue', 'DisableJobOptionTerminate', 'DisableJobOptionWait'
- DisableTasks DisableJobOption `json:"disableTasks,omitempty"`
-}
-
-// JobExecutionInformation contains information about the execution of a job in the Azure Batch service.
-type JobExecutionInformation struct {
- // StartTime - The start time of the job.
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - The completion time of the job. This property is set only if the job is in the completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
- // PoolID - The id of the pool to which this job is assigned.
- PoolID *string `json:"poolId,omitempty"`
- // SchedulingError - Details of any error encountered by the service in starting the job.
- SchedulingError *JobSchedulingError `json:"schedulingError,omitempty"`
- // TerminateReason - A string describing the reason the job ended.
- TerminateReason *string `json:"terminateReason,omitempty"`
-}
-
-// JobManagerTask specifies details of a Job Manager task.
-type JobManagerTask struct {
- // ID - A string that uniquely identifies the Job Manager task. A GUID is recommended.
- ID *string `json:"id,omitempty"`
- // DisplayName - The display name of the Job Manager task.
- DisplayName *string `json:"displayName,omitempty"`
- // CommandLine - The command line of the Job Manager task.
- CommandLine *string `json:"commandLine,omitempty"`
- // ResourceFiles - A list of files that the Batch service will download to the compute node before running the command line.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- // EnvironmentSettings - A list of environment variable settings for the Job Manager task.
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- // Constraints - Constraints that apply to the Job Manager task.
- Constraints *TaskConstraints `json:"constraints,omitempty"`
- // KillJobOnCompletion - Whether completion of the Job Manager task signifies completion of the entire job.
- KillJobOnCompletion *bool `json:"killJobOnCompletion,omitempty"`
- // RunElevated - Whether to run the Job Manager task in elevated mode. The default value is false.
- RunElevated *bool `json:"runElevated,omitempty"`
- // RunExclusive - Whether the Job Manager task requires exclusive use of the compute node where it runs. If true, no other tasks will run on the same compute node for as long as the Job Manager is running. If false, other tasks can run simultaneously with the Job Manager on a compute node. (The Job Manager task counts normally against the node's concurrent task limit, so this is only relevant if the node allows multiple concurrent tasks.)
- RunExclusive *bool `json:"runExclusive,omitempty"`
-}
-
-// JobPatchParameter parameters for a CloudJobOperations.Patch request.
-type JobPatchParameter struct {
- // Priority - The priority of the job. Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. If omitted, the priority of the job is left unchanged.
- Priority *int32 `json:"priority,omitempty"`
- // Constraints - The execution constraints for the job. If omitted, the existing execution constraints are left unchanged.
- Constraints *JobConstraints `json:"constraints,omitempty"`
- // PoolInfo - The pool on which the Batch service runs the job's tasks. If omitted, the job continues to run on its current pool.
- PoolInfo *PoolInformation `json:"poolInfo,omitempty"`
- // Metadata - A list of name-value pairs associated with the job as metadata. If omitted, the existing job metadata is left unchanged.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// JobPreparationAndReleaseTaskExecutionInformation the status of the Job Preparation and Job Release tasks on a
-// compute node.
-type JobPreparationAndReleaseTaskExecutionInformation struct {
- // PoolID - The id of the pool containing the compute node to which this entry refers.
- PoolID *string `json:"poolId,omitempty"`
- // NodeID - The id of the compute node to which this entry refers.
- NodeID *string `json:"nodeId,omitempty"`
- // NodeURL - The URL of the compute node to which this entry refers.
- NodeURL *string `json:"nodeUrl,omitempty"`
- // JobPreparationTaskExecutionInfo - Information about the execution status of the Job Preparation task on this compute node.
- JobPreparationTaskExecutionInfo *JobPreparationTaskExecutionInformation `json:"jobPreparationTaskExecutionInfo,omitempty"`
- // JobReleaseTaskExecutionInfo - Information about the execution status of the Job Release task on this compute node. This property is set only if the Job Release task has run on the node.
- JobReleaseTaskExecutionInfo *JobReleaseTaskExecutionInformation `json:"jobReleaseTaskExecutionInfo,omitempty"`
-}
-
-// JobPreparationTask a Job Preparation task to run before any tasks of the job on any given compute node.
-type JobPreparationTask struct {
- // ID - A string that uniquely identifies the job preparation task within the job. The id can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters.
- ID *string `json:"id,omitempty"`
- // CommandLine - The command line of the Job Preparation task.
- CommandLine *string `json:"commandLine,omitempty"`
- // ResourceFiles - A list of files that the Batch service will download to the compute node before running the command line.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- // EnvironmentSettings - A list of environment variable settings for the Job Preparation task.
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- // Constraints - Constraints that apply to the Job Preparation task.
- Constraints *TaskConstraints `json:"constraints,omitempty"`
- // WaitForSuccess - Whether the Batch service should wait for the Job Preparation task to complete successfully before scheduling any other tasks of the job on the compute node.
- WaitForSuccess *bool `json:"waitForSuccess,omitempty"`
- // RunElevated - Whether to run the Job Preparation task in elevated mode. The default value is false.
- RunElevated *bool `json:"runElevated,omitempty"`
- // RerunOnNodeRebootAfterSuccess - Whether the Batch service should rerun the Job Preparation task after a compute node reboots. Note that the Job Preparation task should still be written to be idempotent because it can be rerun if the compute node is rebooted while Job Preparation task is still running. The default value is true.
- RerunOnNodeRebootAfterSuccess *bool `json:"rerunOnNodeRebootAfterSuccess,omitempty"`
-}
-
-// JobPreparationTaskExecutionInformation contains information about the execution of a Job Preparation task on a
-// compute node.
-type JobPreparationTaskExecutionInformation struct {
- // StartTime - The time at which the task started running. Note that every time the task is restarted, this value is updated.
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - The time at which the Job Preparation task completed. This property is set only if the task is in the Completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
- // State - The current state of the Job Preparation task. Possible values include: 'JobPreparationTaskStateRunning', 'JobPreparationTaskStateCompleted'
- State JobPreparationTaskState `json:"state,omitempty"`
- // TaskRootDirectory - The root directory of the Job Preparation task on the compute node. You can use this path to retrieve files created by the task, such as log files.
- TaskRootDirectory *string `json:"taskRootDirectory,omitempty"`
- // TaskRootDirectoryURL - The URL to the root directory of the Job Preparation task on the compute node.
- TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"`
- // ExitCode - The exit code of the Job Preparation task. This property is set only if the task is in the Completed state.
- ExitCode *int32 `json:"exitCode,omitempty"`
- // SchedulingError - The error encountered by the Batch service when starting the task.
- SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"`
- // RetryCount - The number of times the task has been retried by the Batch service. Every time the task exits with a non-zero exit code, it is deemed a task failure. The Batch service will retry the task up to the limit specified by the constraints.
- RetryCount *int32 `json:"retryCount,omitempty"`
- // LastRetryTime - The most recent time at which a retry of the Job Preparation task started running. This property is set only if the task was retried (i.e. retryCount is nonzero).
- LastRetryTime *date.Time `json:"lastRetryTime,omitempty"`
-}
-
-// JobReleaseTask a Job Release task to run on job completion on any compute node where the job has run.
-type JobReleaseTask struct {
- // ID - A string that uniquely identifies the Job Release task within the job. The id can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters.
- ID *string `json:"id,omitempty"`
- // CommandLine - The command line of the Job Release task.
- CommandLine *string `json:"commandLine,omitempty"`
- // ResourceFiles - A list of files that the Batch service will download to the compute node before running the command line.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- // EnvironmentSettings - A list of environment variable settings for the Job Release task.
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- // MaxWallClockTime - The maximum elapsed time that the Job Release task may run on a given compute node, measured from the time the task starts. If the task does not complete within the time limit, the Batch service terminates it. The default value is 15 minutes.
- MaxWallClockTime *string `json:"maxWallClockTime,omitempty"`
- // RetentionTime - The minimum time to retain the working directory for the Job Release task on the compute node. After this time, the Batch service may delete the working directory and all its contents. The default is infinite.
- RetentionTime *string `json:"retentionTime,omitempty"`
- // RunElevated - Whether to run the Job Release task in elevated mode. The default value is false.
- RunElevated *bool `json:"runElevated,omitempty"`
-}
-
-// JobReleaseTaskExecutionInformation contains information about the execution of a Job Release task on a compute
-// node.
-type JobReleaseTaskExecutionInformation struct {
- // StartTime - The time at which the task started running. Note that every time the task is restarted, this value is updated.
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - The time at which the Job Release task completed. This property is set only if the task is in the Completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
- // State - The current state of the Job Release task. Possible values include: 'JobReleaseTaskStateRunning', 'JobReleaseTaskStateCompleted'
- State JobReleaseTaskState `json:"state,omitempty"`
- // TaskRootDirectory - The root directory of the Job Release task on the compute node. You can use this path to retrieve files created by the task, such as log files.
- TaskRootDirectory *string `json:"taskRootDirectory,omitempty"`
- // TaskRootDirectoryURL - The URL to the root directory of the Job Release task on the compute node.
- TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"`
- // ExitCode - The exit code of the Job Release task. This property is set only if the task is in the Completed state.
- ExitCode *int32 `json:"exitCode,omitempty"`
- // SchedulingError - The scheduling error encountered by the Batch service when starting the task.
- SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"`
-}
-
-// JobScheduleAddParameter a job schedule that allows recurring jobs by specifying when to run jobs and a
-// specification used to create each job.
-type JobScheduleAddParameter struct {
- // ID - A string that uniquely identifies the schedule within the account. A GUID is recommended.
- ID *string `json:"id,omitempty"`
- // DisplayName - The display name for the schedule.
- DisplayName *string `json:"displayName,omitempty"`
- // Schedule - The schedule according to which jobs will be created.
- Schedule *Schedule `json:"schedule,omitempty"`
- // JobSpecification - The details of the jobs to be created on this schedule.
- JobSpecification *JobSpecification `json:"jobSpecification,omitempty"`
- // Metadata - A list of name-value pairs associated with the schedule as metadata.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// JobScheduleExecutionInformation specifies how tasks should be run in a job associated with a job schedule.
-type JobScheduleExecutionInformation struct {
- // NextRunTime - The next time at which a job will be created under this schedule.
- NextRunTime *date.Time `json:"nextRunTime,omitempty"`
- // RecentJob - Information about the most recent job under the job schedule.
- RecentJob *RecentJob `json:"recentJob,omitempty"`
- // EndTime - The time at which the schedule ended. This property is set only if the job schedule is in the completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
-}
-
-// JobSchedulePatchParameter parameters for a CloudJobScheduleOperations.Patch request.
-type JobSchedulePatchParameter struct {
- // Schedule - The schedule according to which jobs will be created. If you do not specify this element, the existing schedule is not modified.
- Schedule *Schedule `json:"schedule,omitempty"`
- // JobSpecification - The details of the jobs to be created on this schedule.
- JobSpecification *JobSpecification `json:"jobSpecification,omitempty"`
- // Metadata - A list of name-value pairs associated with the job schedule as metadata.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// JobScheduleStatistics resource usage statistics for a job schedule.
-type JobScheduleStatistics struct {
- // URL - The URL of the statistics.
- URL *string `json:"url,omitempty"`
- // StartTime - The start time of the time range covered by the statistics.
- StartTime *date.Time `json:"startTime,omitempty"`
- // LastUpdateTime - The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime.
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- // UserCPUTime - The total user mode CPU time (summed across all cores and all compute nodes) consumed by all tasks in all jobs created under the schedule.
- UserCPUTime *string `json:"userCPUTime,omitempty"`
- // KernelCPUTime - The total kernel mode CPU time (summed across all cores and all compute nodes) consumed by all tasks in all jobs created under the schedule.
- KernelCPUTime *string `json:"kernelCPUTime,omitempty"`
- // WallClockTime - The total wall clock time of all the tasks in all the jobs created under the schedule.
- WallClockTime *string `json:"wallClockTime,omitempty"`
- // ReadIOps - The total number of disk read operations made by all tasks in all jobs created under the schedule.
- ReadIOps *int64 `json:"readIOps,omitempty"`
- // WriteIOps - The total number of disk write operations made by all tasks in all jobs created under the schedule.
- WriteIOps *int64 `json:"writeIOps,omitempty"`
- // ReadIOGiB - The total gibibytes read from disk by all tasks in all jobs created under the schedule.
- ReadIOGiB *float64 `json:"readIOGiB,omitempty"`
- // WriteIOGiB - The total gibibytes written to disk by all tasks in all jobs created under the schedule.
- WriteIOGiB *float64 `json:"writeIOGiB,omitempty"`
- // NumSucceededTasks - The total number of tasks successfully completed during the given time range in jobs created under the schedule. A task completes successfully if it returns exit code 0.
- NumSucceededTasks *int64 `json:"numSucceededTasks,omitempty"`
- // NumFailedTasks - The total number of tasks that failed during the given time range in jobs created under the schedule. A task fails if it exhausts its maximum retry count without returning exit code 0.
- NumFailedTasks *int64 `json:"numFailedTasks,omitempty"`
- // NumTaskRetries - The total number of retries during the given time range on all tasks in all jobs created under the schedule.
- NumTaskRetries *int64 `json:"numTaskRetries,omitempty"`
- // WaitTime - The total wait time of all tasks in all jobs created under the schedule. The wait time for a task is defined as the elapsed time between the creation of the task and the start of task execution. (If the task is retried due to failures, the wait time is the time to the most recent task execution.)
- WaitTime *string `json:"waitTime,omitempty"`
-}
-
-// JobScheduleUpdateParameter parameters for a CloudJobScheduleOperations.Update request.
-type JobScheduleUpdateParameter struct {
- // Schedule - The schedule according to which jobs will be created. If you do not specify this element, it is equivalent to passing the default schedule: that is, a single job scheduled to run immediately.
- Schedule *Schedule `json:"schedule,omitempty"`
- // JobSpecification - Details of the jobs to be created on this schedule.
- JobSpecification *JobSpecification `json:"jobSpecification,omitempty"`
- // Metadata - A list of name-value pairs associated with the job schedule as metadata. If you do not specify this element, it takes the default value of an empty list; in effect, any existing metadata is deleted.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// JobSchedulingError an error encountered by the Batch service when scheduling a job.
-type JobSchedulingError struct {
- // Category - The category of the job scheduling error. Possible values include: 'SchedulingErrorCategoryUsererror', 'SchedulingErrorCategoryServererror', 'SchedulingErrorCategoryUnmapped'
- Category SchedulingErrorCategory `json:"category,omitempty"`
- // Code - An identifier for the job scheduling error. Codes are invariant and are intended to be consumed programmatically.
- Code *string `json:"code,omitempty"`
- // Message - A message describing the job scheduling error, intended to be suitable for display in a user interface.
- Message *string `json:"message,omitempty"`
- // Details - A list of additional error details related to the scheduling error.
- Details *[]NameValuePair `json:"details,omitempty"`
-}
-
-// JobSpecification specifies details of the jobs to be created on a schedule.
-type JobSpecification struct {
- // Priority - The priority of jobs created under this schedule. Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0.
- Priority *int32 `json:"priority,omitempty"`
- // DisplayName - The display name for jobs created under this schedule. It need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- // UsesTaskDependencies - The flag that determines if this job will use tasks with dependencies.
- UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"`
- // Constraints - The execution constraints for jobs created under this schedule.
- Constraints *JobConstraints `json:"constraints,omitempty"`
- // JobManagerTask - The details of a Job Manager task to be launched when a job is started under this schedule.
- JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"`
- // JobPreparationTask - The Job Preparation task for jobs created under this schedule.
- JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"`
- // JobReleaseTask - The Job Release task for jobs created under this schedule.
- JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"`
- // CommonEnvironmentSettings - A list of common environment variable settings. These environment variables are set for all tasks in jobs created under this schedule (including the Job Manager, Job Preparation and Job Release tasks).
- CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"`
- // PoolInfo - The pool on which the Batch service runs the tasks of jobs created under this schedule.
- PoolInfo *PoolInformation `json:"poolInfo,omitempty"`
- // Metadata - A list of name-value pairs associated with each job created under this schedule as metadata.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// JobStatistics resource usage statistics for a job.
-type JobStatistics struct {
- autorest.Response `json:"-"`
- // URL - The URL of the statistics.
- URL *string `json:"url,omitempty"`
- // StartTime - The start time of the time range covered by the statistics.
- StartTime *date.Time `json:"startTime,omitempty"`
- // LastUpdateTime - The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime.
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- // UserCPUTime - The total user mode CPU time (summed across all cores and all compute nodes) consumed by all tasks in the job.
- UserCPUTime *string `json:"userCPUTime,omitempty"`
- // KernelCPUTime - The total kernel mode CPU time (summed across all cores and all compute nodes) consumed by all tasks in the job.
- KernelCPUTime *string `json:"kernelCPUTime,omitempty"`
- // WallClockTime - The total wall clock time of all tasks in the job.
- WallClockTime *string `json:"wallClockTime,omitempty"`
- // ReadIOps - The total number of disk read operations made by all tasks in the job.
- ReadIOps *int64 `json:"readIOps,omitempty"`
- // WriteIOps - The total number of disk write operations made by all tasks in the job.
- WriteIOps *int64 `json:"writeIOps,omitempty"`
- // ReadIOGiB - The total gibibytes read from disk by all tasks in the job.
- ReadIOGiB *float64 `json:"readIOGiB,omitempty"`
- // WriteIOGiB - The total gibibytes written to disk by all tasks in the job.
- WriteIOGiB *float64 `json:"writeIOGiB,omitempty"`
- // NumSucceededTasks - The total number of tasks successfully completed in the job during the given time range.
- NumSucceededTasks *int64 `json:"numSucceededTasks,omitempty"`
- // NumFailedTasks - The total number of tasks in the job that failed during the given time range.
- NumFailedTasks *int64 `json:"numFailedTasks,omitempty"`
- // NumTaskRetries - The total number of retries on all the tasks in the job during the given time range.
- NumTaskRetries *int64 `json:"numTaskRetries,omitempty"`
- // WaitTime - The total wait time of all tasks in the job. The wait time for a task is defined as the elapsed time between the creation of the task and the start of task execution. (If the task is retried due to failures, the wait time is the time to the most recent task execution.)
- WaitTime *string `json:"waitTime,omitempty"`
-}
-
-// JobTerminateParameter parameters for a CloudJobOperations.Terminate request.
-type JobTerminateParameter struct {
- // TerminateReason - The text you want to appear as the job's TerminateReason. The default is 'UserTerminate'.
- TerminateReason *string `json:"terminateReason,omitempty"`
-}
-
-// JobUpdateParameter parameters for a CloudJobOperations.Update request.
-type JobUpdateParameter struct {
- // Priority - The priority of the job. Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. If omitted, the priority of the job is left unchanged.
- Priority *int32 `json:"priority,omitempty"`
- // Constraints - The execution constraints for the job. If omitted, the existing execution constraints are left unchanged.
- Constraints *JobConstraints `json:"constraints,omitempty"`
- // PoolInfo - The pool on which the Batch service runs the job's tasks. If omitted, the job continues to run on its current pool.
- PoolInfo *PoolInformation `json:"poolInfo,omitempty"`
- // Metadata - A list of name-value pairs associated with the job as metadata. If omitted, the existing job metadata is left unchanged.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// MetadataItem a name-value pair associated with a Batch service resource. The Batch service does not assign any
-// meaning to this metadata; it is solely for the use of user code.
-type MetadataItem struct {
- // Name - The name of the metadata item.
- Name *string `json:"name,omitempty"`
- // Value - The value of the metadata item.
- Value *string `json:"value,omitempty"`
-}
-
-// MultiInstanceSettings settings which specify how to run a multi-instance task. Multi-instance tasks are commonly
-// used to support MPI tasks.
-type MultiInstanceSettings struct {
- // NumberOfInstances - The number of compute nodes required by the multi-instance task.
- NumberOfInstances *int32 `json:"numberOfInstances,omitempty"`
- // CoordinationCommandLine - The command to run on the compute node instances for coordinating among the subtasks.
- CoordinationCommandLine *string `json:"coordinationCommandLine,omitempty"`
- // CommonResourceFiles - A list of files that the Batch service will download before running the coordination command line. The difference between common resource files and task resource files is that common resource files are downloaded for all subtasks including the primary, whereas task resource files are downloaded only for the primary.
- CommonResourceFiles *[]ResourceFile `json:"commonResourceFiles,omitempty"`
-}
-
-// NameValuePair represents a name-value pair.
-type NameValuePair struct {
- // Name - The name in the name-value pair.
- Name *string `json:"name,omitempty"`
- // Value - The value in the name-value pair.
- Value *string `json:"value,omitempty"`
-}
-
-// NodeAgentSku a node agent SKU supported by the Batch service. The Batch node agent is a program that runs on
-// each node in the pool, and provides the command-and-control interface between the node and the Batch service.
-// There are different implementations of the node agent, known as SKUs, for different operating systems.
-type NodeAgentSku struct {
- // ID - The node agent SKU id.
- ID *string `json:"id,omitempty"`
- // VerifiedImageReferences - The list of images verified to be compatible with this node agent SKU. This collection is not exhaustive (the node agent may be compatible with other images).
- VerifiedImageReferences *[]ImageReference `json:"verifiedImageReferences,omitempty"`
- // OsType - The type of operating system compatible with the node agent SKU. Possible values include: 'OSTypeLinux', 'OSTypeWindows', 'OSTypeUnmapped'
- OsType OSType `json:"osType,omitempty"`
-}
-
-// NodeDisableSchedulingParameter parameters for a ComputeNodeOperations.DisableScheduling request.
-type NodeDisableSchedulingParameter struct {
- // NodeDisableSchedulingOption - What to do with currently running tasks when disable task scheduling on the compute node. The default value is requeue. Possible values include: 'DisableComputeNodeSchedulingOptionRequeue', 'DisableComputeNodeSchedulingOptionTerminate', 'DisableComputeNodeSchedulingOptionTaskcompletion'
- NodeDisableSchedulingOption DisableComputeNodeSchedulingOption `json:"nodeDisableSchedulingOption,omitempty"`
-}
-
-// NodeFile information about a file or directory on a compute node.
-type NodeFile struct {
- // Name - The file path.
- Name *string `json:"name,omitempty"`
- // URL - The URL of the file.
- URL *string `json:"url,omitempty"`
- // IsDirectory - Whether the object represents a directory.
- IsDirectory *bool `json:"isDirectory,omitempty"`
- // Properties - The file properties.
- Properties *FileProperties `json:"properties,omitempty"`
-}
-
-// NodeFileListResult response to a FileOperation.ListFromComputeNode or FileOperation.ListFromTask request.
-type NodeFileListResult struct {
- autorest.Response `json:"-"`
- // Value - The list of files.
- Value *[]NodeFile `json:"value,omitempty"`
- // OdataNextLink - The URL to get the next set of results.
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// NodeFileListResultIterator provides access to a complete listing of NodeFile values.
-type NodeFileListResultIterator struct {
- i int
- page NodeFileListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *NodeFileListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter NodeFileListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter NodeFileListResultIterator) Response() NodeFileListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter NodeFileListResultIterator) Value() NodeFile {
- if !iter.page.NotDone() {
- return NodeFile{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (nflr NodeFileListResult) IsEmpty() bool {
- return nflr.Value == nil || len(*nflr.Value) == 0
-}
-
-// nodeFileListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (nflr NodeFileListResult) nodeFileListResultPreparer() (*http.Request, error) {
- if nflr.OdataNextLink == nil || len(to.String(nflr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(nflr.OdataNextLink)))
-}
-
-// NodeFileListResultPage contains a page of NodeFile values.
-type NodeFileListResultPage struct {
- fn func(NodeFileListResult) (NodeFileListResult, error)
- nflr NodeFileListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *NodeFileListResultPage) Next() error {
- next, err := page.fn(page.nflr)
- if err != nil {
- return err
- }
- page.nflr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page NodeFileListResultPage) NotDone() bool {
- return !page.nflr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page NodeFileListResultPage) Response() NodeFileListResult {
- return page.nflr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page NodeFileListResultPage) Values() []NodeFile {
- if page.nflr.IsEmpty() {
- return nil
- }
- return *page.nflr.Value
-}
-
-// NodeRebootParameter parameters for a ComputeNodeOperations.Reboot request.
-type NodeRebootParameter struct {
- // NodeRebootOption - When to reboot the compute node and what to do with currently running tasks. The default value is requeue. Possible values include: 'ComputeNodeRebootOptionRequeue', 'ComputeNodeRebootOptionTerminate', 'ComputeNodeRebootOptionTaskcompletion', 'ComputeNodeRebootOptionRetaineddata'
- NodeRebootOption ComputeNodeRebootOption `json:"nodeRebootOption,omitempty"`
-}
-
-// NodeReimageParameter parameters for a ComputeNodeOperations.Reimage request.
-type NodeReimageParameter struct {
- // NodeReimageOption - When to reimage the compute node and what to do with currently running tasks. The default value is requeue. Possible values include: 'ComputeNodeReimageOptionRequeue', 'ComputeNodeReimageOptionTerminate', 'ComputeNodeReimageOptionTaskcompletion', 'ComputeNodeReimageOptionRetaineddata'
- NodeReimageOption ComputeNodeReimageOption `json:"nodeReimageOption,omitempty"`
-}
-
-// NodeRemoveParameter parameters for a ComputeNodeOperations.Remove request.
-type NodeRemoveParameter struct {
- // NodeList - A list containing the id of the compute nodes to be removed from the specified pool.
- NodeList *[]string `json:"nodeList,omitempty"`
- // ResizeTimeout - The timeout for removal of compute nodes to the pool. The default value is 10 minutes.
- ResizeTimeout *string `json:"resizeTimeout,omitempty"`
- // NodeDeallocationOption - When compute nodes may be removed from the pool. Possible values include: 'Requeue', 'Terminate', 'Taskcompletion', 'Retaineddata'
- NodeDeallocationOption ComputeNodeDeallocationOption `json:"nodeDeallocationOption,omitempty"`
-}
-
-// NodeUpdateUserParameter parameters for a ComputeNodeOperations.UpdateUser request.
-type NodeUpdateUserParameter struct {
- // Password - The password of the account.
- Password *string `json:"password,omitempty"`
- // ExpiryTime - The time at which the account should expire. If omitted, the default is 1 day from the current time.
- ExpiryTime *date.Time `json:"expiryTime,omitempty"`
- // SSHPublicKey - The SSH public key that can be used for remote login to the compute node.
- SSHPublicKey *string `json:"sshPublicKey,omitempty"`
-}
-
-// PoolAddParameter a pool in the Azure Batch service to add.
-type PoolAddParameter struct {
- // ID - A string that uniquely identifies the pool within the account. The id can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters.
- ID *string `json:"id,omitempty"`
- // DisplayName - The display name for the pool.
- DisplayName *string `json:"displayName,omitempty"`
- // VMSize - The size of virtual machines in the pool. All virtual machines in a pool are the same size.
- VMSize *string `json:"vmSize,omitempty"`
- // CloudServiceConfiguration - The cloud service configuration for the pool. This property and VirtualMachineConfiguration are mutually exclusive and one of the properties must be specified.
- CloudServiceConfiguration *CloudServiceConfiguration `json:"cloudServiceConfiguration,omitempty"`
- // VirtualMachineConfiguration - The virtual machine configuration for the pool. This property and CloudServiceConfiguration are mutually exclusive and one of the properties must be specified.
- VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"`
- // ResizeTimeout - The timeout for allocation of compute nodes to the pool. In a Get Pool operation, this is the timeout for the most recent resize operation. The default value is 10 minutes.
- ResizeTimeout *string `json:"resizeTimeout,omitempty"`
- // TargetDedicated - The desired number of compute nodes in the pool. This property must have the default value if EnableAutoScale is true. It is required if EnableAutoScale is false.
- TargetDedicated *int32 `json:"targetDedicated,omitempty"`
- // EnableAutoScale - Whether the pool size should automatically adjust over time. If true, the AutoScaleFormula property must be set. If false, the TargetDedicated property must be set.
- EnableAutoScale *bool `json:"enableAutoScale,omitempty"`
- // AutoScaleFormula - A formula for the desired number of compute nodes in the pool.
- AutoScaleFormula *string `json:"autoScaleFormula,omitempty"`
- // AutoScaleEvaluationInterval - A time interval for the desired autoscale evaluation period in the pool.
- AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"`
- // EnableInterNodeCommunication - Whether the pool permits direct communication between nodes.
- EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"`
- // StartTask - A task specified to run on each compute node as it joins the pool.
- StartTask *StartTask `json:"startTask,omitempty"`
- // CertificateReferences - The list of certificates to be installed on each compute node in the pool.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- // ApplicationPackageReferences - The list of application packages to be installed on each compute node in the pool.
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // MaxTasksPerNode - The maximum number of tasks that can run concurrently on a single compute node in the pool.
- MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"`
- // TaskSchedulingPolicy - How the Batch service distributes tasks between compute nodes in the pool.
- TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"`
- // Metadata - A list of name-value pairs associated with the pool as metadata.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// PoolEnableAutoScaleParameter parameters for a CloudPoolOperations.EnableAutoScale request.
-type PoolEnableAutoScaleParameter struct {
- // AutoScaleFormula - The formula for the desired number of compute nodes in the pool.
- AutoScaleFormula *string `json:"autoScaleFormula,omitempty"`
- // AutoScaleEvaluationInterval - A time interval for the desired autoscale evaluation period in the pool.
- AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"`
-}
-
-// PoolEvaluateAutoScaleParameter parameters for a CloudJobOperations.EvaluateAutoScale request.
-type PoolEvaluateAutoScaleParameter struct {
- // AutoScaleFormula - A formula for the desired number of compute nodes in the pool.
- AutoScaleFormula *string `json:"autoScaleFormula,omitempty"`
-}
-
-// PoolInformation specifies how a job should be assigned to a pool.
-type PoolInformation struct {
- // PoolID - The id of an existing pool. All the tasks of the job will run on the specified pool. You must specify either PoolId or AutoPoolSpecification, but not both.
- PoolID *string `json:"poolId,omitempty"`
- // AutoPoolSpecification - Characteristics for a temporary 'auto pool'. The Batch service will create this auto pool and run all of the tasks of the job on it, and will delete the pool once the job has completed. You must specify either PoolId or AutoPoolSpecification, but not both.
- AutoPoolSpecification *AutoPoolSpecification `json:"autoPoolSpecification,omitempty"`
-}
-
-// PoolListPoolUsageMetricsResult response to an AccountOperation.ListPoolUsageMetrics request.
-type PoolListPoolUsageMetricsResult struct {
- autorest.Response `json:"-"`
- // Value - The pool usage metrics data.
- Value *[]PoolUsageMetrics `json:"value,omitempty"`
- // OdataNextLink - The URL to get the next set of results.
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// PoolListPoolUsageMetricsResultIterator provides access to a complete listing of PoolUsageMetrics values.
-type PoolListPoolUsageMetricsResultIterator struct {
- i int
- page PoolListPoolUsageMetricsResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *PoolListPoolUsageMetricsResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter PoolListPoolUsageMetricsResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter PoolListPoolUsageMetricsResultIterator) Response() PoolListPoolUsageMetricsResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter PoolListPoolUsageMetricsResultIterator) Value() PoolUsageMetrics {
- if !iter.page.NotDone() {
- return PoolUsageMetrics{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (plpumr PoolListPoolUsageMetricsResult) IsEmpty() bool {
- return plpumr.Value == nil || len(*plpumr.Value) == 0
-}
-
-// poolListPoolUsageMetricsResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (plpumr PoolListPoolUsageMetricsResult) poolListPoolUsageMetricsResultPreparer() (*http.Request, error) {
- if plpumr.OdataNextLink == nil || len(to.String(plpumr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(plpumr.OdataNextLink)))
-}
-
-// PoolListPoolUsageMetricsResultPage contains a page of PoolUsageMetrics values.
-type PoolListPoolUsageMetricsResultPage struct {
- fn func(PoolListPoolUsageMetricsResult) (PoolListPoolUsageMetricsResult, error)
- plpumr PoolListPoolUsageMetricsResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *PoolListPoolUsageMetricsResultPage) Next() error {
- next, err := page.fn(page.plpumr)
- if err != nil {
- return err
- }
- page.plpumr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page PoolListPoolUsageMetricsResultPage) NotDone() bool {
- return !page.plpumr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page PoolListPoolUsageMetricsResultPage) Response() PoolListPoolUsageMetricsResult {
- return page.plpumr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page PoolListPoolUsageMetricsResultPage) Values() []PoolUsageMetrics {
- if page.plpumr.IsEmpty() {
- return nil
- }
- return *page.plpumr.Value
-}
-
-// PoolPatchParameter parameters for a CloudPoolOperations.Patch request.
-type PoolPatchParameter struct {
- // StartTask - A task to run on each compute node as it joins the pool. If omitted, any existing start task is left unchanged.
- StartTask *StartTask `json:"startTask,omitempty"`
- // CertificateReferences - A list of certificates to be installed on each compute node in the pool. If omitted, any existing certificate references are left unchanged.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- // ApplicationPackageReferences - A list of application packages to be installed on each compute node in the pool. If omitted, any existing application package references are left unchanged.
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // Metadata - A list of name-value pairs associated with the pool as metadata. If omitted, any existing metadata is left unchanged.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// PoolResizeParameter parameters for a CloudPoolOperations.Resize request.
-type PoolResizeParameter struct {
- // TargetDedicated - The desired number of compute nodes in the pool.
- TargetDedicated *int32 `json:"targetDedicated,omitempty"`
- // ResizeTimeout - The timeout for allocation of compute nodes to the pool or removal of compute nodes from the pool. The default value is 10 minutes.
- ResizeTimeout *string `json:"resizeTimeout,omitempty"`
- // NodeDeallocationOption - When nodes may be removed from the pool, if the pool size is decreasing. Possible values include: 'Requeue', 'Terminate', 'Taskcompletion', 'Retaineddata'
- NodeDeallocationOption ComputeNodeDeallocationOption `json:"nodeDeallocationOption,omitempty"`
-}
-
-// PoolSpecification specification for creating a new pool.
-type PoolSpecification struct {
- // DisplayName - The display name for the pool.
- DisplayName *string `json:"displayName,omitempty"`
- // VMSize - The size of the virtual machines in the pool. All virtual machines in a pool are the same size.
- VMSize *string `json:"vmSize,omitempty"`
- // CloudServiceConfiguration - The cloud service configuration for the pool. This property and VirtualMachineConfiguration are mutually exclusive and one of the properties must be specified.
- CloudServiceConfiguration *CloudServiceConfiguration `json:"cloudServiceConfiguration,omitempty"`
- // VirtualMachineConfiguration - The virtual machine configuration for the pool. This property and CloudServiceConfiguration are mutually exclusive and one of the properties must be specified.
- VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"`
- // MaxTasksPerNode - The maximum number of tasks that can run concurrently on a single compute node in the pool.
- MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"`
- // TaskSchedulingPolicy - How tasks are distributed among compute nodes in the pool.
- TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"`
- // ResizeTimeout - The timeout for allocation of compute nodes to the pool.
- ResizeTimeout *string `json:"resizeTimeout,omitempty"`
- // TargetDedicated - The desired number of compute nodes in the pool.
- TargetDedicated *int32 `json:"targetDedicated,omitempty"`
- // EnableAutoScale - Whether the pool size should automatically adjust over time.
- EnableAutoScale *bool `json:"enableAutoScale,omitempty"`
- // AutoScaleFormula - The formula for the desired number of compute nodes in the pool.
- AutoScaleFormula *string `json:"autoScaleFormula,omitempty"`
- // AutoScaleEvaluationInterval - A time interval for the desired AutoScale evaluation period in the pool.
- AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"`
- // EnableInterNodeCommunication - Whether the pool permits direct communication between nodes.
- EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"`
- // StartTask - A task to run on each compute node as it joins the pool. The task runs when the node is added to the pool or when the node is restarted.
- StartTask *StartTask `json:"startTask,omitempty"`
- // CertificateReferences - A list of certificates to be installed on each compute node in the pool.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- // ApplicationPackageReferences - The list of application packages to be installed on each compute node in the pool.
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // Metadata - A list of name-value pairs associated with the pool as metadata.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// PoolStatistics contains utilization and resource usage statistics for the lifetime of a pool.
-type PoolStatistics struct {
- autorest.Response `json:"-"`
- // URL - The URL for the statistics.
- URL *string `json:"url,omitempty"`
- // StartTime - The start time of the time range covered by the statistics.
- StartTime *date.Time `json:"startTime,omitempty"`
- // LastUpdateTime - The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime.
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- // UsageStats - Statistics related to pool usage, such as the amount of core-time used.
- UsageStats *UsageStatistics `json:"usageStats,omitempty"`
- // ResourceStats - Statistics related to resource consumption by compute nodes in the pool.
- ResourceStats *ResourceStatistics `json:"resourceStats,omitempty"`
-}
-
-// PoolUpdatePropertiesParameter parameters for a CloudPoolOperations.UpdateProperties request.
-type PoolUpdatePropertiesParameter struct {
- // StartTask - A task to run on each compute node as it joins the pool. If omitted, any existing start task is removed from the pool.
- StartTask *StartTask `json:"startTask,omitempty"`
- // CertificateReferences - A list of certificates to be installed on each compute node in the pool. If you specify an empty collection, any existing certificate references are removed from the pool.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- // ApplicationPackageReferences - A list of application packages to be installed on each compute node in the pool. If you specify an empty collection, any existing application packages references are removed from the pool.
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // Metadata - A list of name-value pairs associated with the pool as metadata. If you specify an empty collection, any existing metadata is removed from the pool.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// PoolUpgradeOSParameter parameters for a CloudPoolOperations.UpgradeOS request.
-type PoolUpgradeOSParameter struct {
- // TargetOSVersion - The Azure Guest OS version to be installed on the virtual machines in the pool.
- TargetOSVersion *string `json:"targetOSVersion,omitempty"`
-}
-
-// PoolUsageMetrics usage metrics for a pool across an aggregation interval.
-type PoolUsageMetrics struct {
- // PoolID - The id of the pool whose metrics are being aggregated.
- PoolID *string `json:"poolId,omitempty"`
- // StartTime - The start time of the aggregation interval.
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - The end time of the aggregation interval.
- EndTime *date.Time `json:"endTime,omitempty"`
- // VMSize - The size of virtual machines in the pool. All VMs in a pool are the same size.
- VMSize *string `json:"vmSize,omitempty"`
- // TotalCoreHours - The total core hours used in the pool during this aggregation interval.
- TotalCoreHours *float64 `json:"totalCoreHours,omitempty"`
- // DataIngressGiB - The cross data center network ingress in GiB to the pool during this interval.
- DataIngressGiB *float64 `json:"dataIngressGiB,omitempty"`
- // DataEgressGiB - The cross data center network egress in GiB from the pool during this interval.
- DataEgressGiB *float64 `json:"dataEgressGiB,omitempty"`
-}
-
-// ReadCloser ...
-type ReadCloser struct {
- autorest.Response `json:"-"`
- Value *io.ReadCloser `json:"value,omitempty"`
-}
-
-// RecentJob information about the most recent job to run under the job schedule.
-type RecentJob struct {
- // ID - The id of the job.
- ID *string `json:"id,omitempty"`
- // URL - The URL of the job.
- URL *string `json:"url,omitempty"`
-}
-
-// ResizeError an error that occurred when resizing a pool.
-type ResizeError struct {
- // Code - An identifier for the pool resize error. Codes are invariant and are intended to be consumed programmatically.
- Code *string `json:"code,omitempty"`
- // Message - A message describing the pool resize error, intended to be suitable for display in a user interface.
- Message *string `json:"message,omitempty"`
- // Values - A list of additional error details related to the pool resize error.
- Values *[]NameValuePair `json:"values,omitempty"`
-}
-
-// ResourceFile a file to be downloaded from Azure blob storage to a compute node.
-type ResourceFile struct {
- // BlobSource - The URL of the file within Azure Blob Storage. This URL should include a shared access signature if the blob is not publicly readable.
- BlobSource *string `json:"blobSource,omitempty"`
- // FilePath - The location to which to download the file, relative to the task's working directory.
- FilePath *string `json:"filePath,omitempty"`
- // FileMode - The file mode attribute in octal format. This property will be ignored if it is specified for a resourceFile which will be downloaded to a Windows compute node.
- FileMode *string `json:"fileMode,omitempty"`
-}
-
-// ResourceStatistics statistics related to resource consumption by compute nodes in a pool.
-type ResourceStatistics struct {
- // StartTime - The start time of the time range covered by the statistics.
- StartTime *date.Time `json:"startTime,omitempty"`
- // LastUpdateTime - The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime.
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- // AvgCPUPercentage - The average CPU usage across all nodes in the pool (percentage per node).
- AvgCPUPercentage *float64 `json:"avgCPUPercentage,omitempty"`
- // AvgMemoryGiB - The average memory usage in GiB across all nodes in the pool.
- AvgMemoryGiB *float64 `json:"avgMemoryGiB,omitempty"`
- // PeakMemoryGiB - The peak memory usage in GiB across all nodes in the pool.
- PeakMemoryGiB *float64 `json:"peakMemoryGiB,omitempty"`
- // AvgDiskGiB - The average used disk space in GiB across all nodes in the pool.
- AvgDiskGiB *float64 `json:"avgDiskGiB,omitempty"`
- // PeakDiskGiB - The peak used disk space in GiB across all nodes in the pool.
- PeakDiskGiB *float64 `json:"peakDiskGiB,omitempty"`
- // DiskReadIOps - The total number of disk read operations across all nodes in the pool.
- DiskReadIOps *int64 `json:"diskReadIOps,omitempty"`
- // DiskWriteIOps - The total number of disk write operations across all nodes in the pool.
- DiskWriteIOps *int64 `json:"diskWriteIOps,omitempty"`
- // DiskReadGiB - The total amount of data in GiB of disk reads across all nodes in the pool.
- DiskReadGiB *float64 `json:"diskReadGiB,omitempty"`
- // DiskWriteGiB - The total amount of data in GiB of disk writes across all nodes in the pool.
- DiskWriteGiB *float64 `json:"diskWriteGiB,omitempty"`
- // NetworkReadGiB - The total amount of data in GiB of network reads across all nodes in the pool.
- NetworkReadGiB *float64 `json:"networkReadGiB,omitempty"`
- // NetworkWriteGiB - The total amount of data in GiB of network writes across all nodes in the pool.
- NetworkWriteGiB *float64 `json:"networkWriteGiB,omitempty"`
-}
-
-// Schedule the schedule according to which jobs will be created
-type Schedule struct {
- // DoNotRunUntil - The earliest time at which any job may be created under this job schedule. If you do not specify a doNotRunUntil time, the schedule becomes ready to create jobs immediately.
- DoNotRunUntil *date.Time `json:"doNotRunUntil,omitempty"`
- // DoNotRunAfter - A time after which no job will be created under this job schedule. The schedule will move to the completed state as soon as this deadline is past and there is no active job under this job schedule.
- DoNotRunAfter *date.Time `json:"doNotRunAfter,omitempty"`
- // StartWindow - The time interval, starting from the time at which the schedule indicates a job should be created, within which a job must be created. If a job is not created within the startWindow interval, then the 'opportunity' is lost; no job will be created until the next recurrence of the schedule.
- StartWindow *string `json:"startWindow,omitempty"`
- // RecurrenceInterval - The time interval between the start times of two successive jobs under the job schedule. A job schedule can have at most one active job under it at any given time.
- RecurrenceInterval *string `json:"recurrenceInterval,omitempty"`
-}
-
-// StartTask a task which is run when a compute node joins a pool in the Azure Batch service, or when the compute
-// node is rebooted or reimaged.
-type StartTask struct {
- // CommandLine - The command line of the start task.
- CommandLine *string `json:"commandLine,omitempty"`
- // ResourceFiles - A list of files that the Batch service will download to the compute node before running the command line.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- // EnvironmentSettings - A list of environment variable settings for the start task.
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- // RunElevated - Whether to run the start task in elevated mode. The default value is false.
- RunElevated *bool `json:"runElevated,omitempty"`
- // MaxTaskRetryCount - The maximum number of times the task may be retried.
- MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"`
- // WaitForSuccess - Whether the Batch service should wait for the start task to complete successfully (that is, to exit with exit code 0) before scheduling any tasks on the compute node.
- WaitForSuccess *bool `json:"waitForSuccess,omitempty"`
-}
-
-// StartTaskInformation information about a start task running on a compute node.
-type StartTaskInformation struct {
- // State - The state of the start task on the compute node. Possible values include: 'StartTaskStateRunning', 'StartTaskStateCompleted'
- State StartTaskState `json:"state,omitempty"`
- // StartTime - The time at which the start task started running.
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - The time at which the start task stopped running.
- EndTime *date.Time `json:"endTime,omitempty"`
- // ExitCode - The exit code of the start task.
- ExitCode *int32 `json:"exitCode,omitempty"`
- // SchedulingError - Any error encountered scheduling the start task.
- SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"`
- // RetryCount - The number of times the task has been retried by the Batch service.
- RetryCount *int32 `json:"retryCount,omitempty"`
- // LastRetryTime - The most recent time at which a retry of the task started running.
- LastRetryTime *date.Time `json:"lastRetryTime,omitempty"`
-}
-
-// SubtaskInformation information about an Azure Batch subtask.
-type SubtaskInformation struct {
- // ID - The id of the subtask.
- ID *int32 `json:"id,omitempty"`
- // NodeInfo - Information about the compute node on which the subtask ran.
- NodeInfo *ComputeNodeInformation `json:"nodeInfo,omitempty"`
- // StartTime - The time at which the subtask started running. If the subtask has been restarted or retried, this is the most recent time at which the subtask started running.
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - The time at which the subtask completed. This property is set only if the subtask is in the Completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
- // ExitCode - The exit code of the subtask. This property is set only if the subtask is in the Completed state.
- ExitCode *int32 `json:"exitCode,omitempty"`
- // SchedulingError - Details of any error encountered scheduling the subtask.
- SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"`
- // State - The current state of the subtask. Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted'
- State TaskState `json:"state,omitempty"`
- // StateTransitionTime - The time at which the subtask entered its current state.
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // PreviousState - The previous state of the subtask. This property is not set if the subtask is in its initial Active state. Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted'
- PreviousState TaskState `json:"previousState,omitempty"`
- // PreviousStateTransitionTime - The time at which the subtask entered its previous state. This property is not set if the subtask is in its initial Active state.
- PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"`
-}
-
-// TaskAddCollectionParameter a collection of Azure Batch tasks to add.
-type TaskAddCollectionParameter struct {
- // Value - The collection of tasks to add.
- Value *[]TaskAddParameter `json:"value,omitempty"`
-}
-
-// TaskAddCollectionResult response to a TaskOperations.AddCollection request.
-type TaskAddCollectionResult struct {
- autorest.Response `json:"-"`
- // Value - The results of the add task collection operation.
- Value *[]TaskAddResult `json:"value,omitempty"`
-}
-
-// TaskAddParameter an Azure Batch task to add.
-type TaskAddParameter struct {
- // ID - A string that uniquely identifies the task within the job. The id can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters.
- ID *string `json:"id,omitempty"`
- // DisplayName - A display name for the task.
- DisplayName *string `json:"displayName,omitempty"`
- // CommandLine - The command line of the task. For multi-instance tasks, the command line is executed on the primary subtask after all the subtasks have finished executing the coordianation command line.
- CommandLine *string `json:"commandLine,omitempty"`
- // ResourceFiles - A list of files that the Batch service will download to the compute node before running the command line. For multi-instance tasks, the resource files will only be downloaded to the compute node on which the primary subtask is executed.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- // EnvironmentSettings - A list of environment variable settings for the task.
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- // AffinityInfo - A locality hint that can be used by the Batch service to select a compute node on which to start the new task.
- AffinityInfo *AffinityInformation `json:"affinityInfo,omitempty"`
- // Constraints - The execution constraints that apply to this task.
- Constraints *TaskConstraints `json:"constraints,omitempty"`
- // RunElevated - Whether to run the task in elevated mode.
- RunElevated *bool `json:"runElevated,omitempty"`
- // MultiInstanceSettings - Information about how to run the multi-instance task.
- MultiInstanceSettings *MultiInstanceSettings `json:"multiInstanceSettings,omitempty"`
- // DependsOn - Any other tasks that this task depends on.
- DependsOn *TaskDependencies `json:"dependsOn,omitempty"`
-}
-
-// TaskAddResult result for a single task added as part of an add task collection operation.
-type TaskAddResult struct {
- // Status - The status of the add task request. Possible values include: 'TaskAddStatusSuccess', 'TaskAddStatusClienterror', 'TaskAddStatusServererror', 'TaskAddStatusUnmapped'
- Status TaskAddStatus `json:"status,omitempty"`
- // TaskID - The id of the task for which this is the result.
- TaskID *string `json:"taskId,omitempty"`
- // ETag - The ETag of the task, if the task was successfully added.
- ETag *string `json:"eTag,omitempty"`
- // LastModified - The last modified time of the task.
- LastModified *date.Time `json:"lastModified,omitempty"`
- // Location - The URL of the task, if the task was successfully added.
- Location *string `json:"location,omitempty"`
- // Error - The error encountered while attempting to add the task.
- Error *Error `json:"error,omitempty"`
-}
-
-// TaskConstraints constraints to apply to the Job Manager task.
-type TaskConstraints struct {
- // MaxWallClockTime - The maximum elapsed time that the task may run, measured from the time the task starts. If the task does not complete within the time limit, the Batch service terminates it.
- MaxWallClockTime *string `json:"maxWallClockTime,omitempty"`
- // RetentionTime - The minimum time to retain the working directory for the task on the compute node where it ran, from the time it completes execution. After this time, the Batch service may delete the working directory and all its contents. The default is infinite.
- RetentionTime *string `json:"retentionTime,omitempty"`
- // MaxTaskRetryCount - The maximum number of times the task may be retried. The Batch service retries a task if its exit code is nonzero.
- MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"`
-}
-
-// TaskDependencies specifies any dependencies of a task. Any task that is explicitly specified or within a
-// dependency range must complete before the dependant task will be scheduled.
-type TaskDependencies struct {
- // TaskIds - The list of task ids that must complete before this task can be scheduled.
- TaskIds *[]string `json:"taskIds,omitempty"`
- // TaskIDRanges - The list of task ranges that must complete before this task can be scheduled.
- TaskIDRanges *[]TaskIDRange `json:"taskIdRanges,omitempty"`
-}
-
-// TaskExecutionInformation information about the execution of a task.
-type TaskExecutionInformation struct {
- // StartTime - The time at which the task started running. If the task has been restarted or retried, this is the most recent time at which the task started running.
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - The time at which the task completed. This property is set only if the task is in the Completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
- // ExitCode - The exit code of the task. This property is set only if the task is in completed state.
- ExitCode *int32 `json:"exitCode,omitempty"`
- // SchedulingError - Details of any error encountered scheduling the task.
- SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"`
- // RetryCount - The number of times the task has been retried by the Batch service.
- RetryCount *int32 `json:"retryCount,omitempty"`
- // LastRetryTime - The most recent time at which a retry of the task started running.
- LastRetryTime *date.Time `json:"lastRetryTime,omitempty"`
- // RequeueCount - The number of times the task has been requeued by the Batch service as the result of a user request.
- RequeueCount *int32 `json:"requeueCount,omitempty"`
- // LastRequeueTime - The most recent time at which the task has been requeued by the Batch service as the result of a user request.
- LastRequeueTime *date.Time `json:"lastRequeueTime,omitempty"`
-}
-
-// TaskIDRange a range of task ids that a task can depend on. All tasks with ids in the range must complete
-// successfully before the dependent task can be scheduled.
-type TaskIDRange struct {
- // Start - The first task id in the range.
- Start *int32 `json:"start,omitempty"`
- // End - The last task id in the range.
- End *int32 `json:"end,omitempty"`
-}
-
-// TaskInformation information about a task running on a compute node.
-type TaskInformation struct {
- // TaskURL - The URL of the task.
- TaskURL *string `json:"taskUrl,omitempty"`
- // JobID - The id of the job to which the task belongs.
- JobID *string `json:"jobId,omitempty"`
- // TaskID - The id of the task.
- TaskID *string `json:"taskId,omitempty"`
- // SubtaskID - The id of the subtask if the task is a multi-instance task.
- SubtaskID *int32 `json:"subtaskId,omitempty"`
- // TaskState - The current state of the task. Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted'
- TaskState TaskState `json:"taskState,omitempty"`
- // ExecutionInfo - Information about the execution of the task.
- ExecutionInfo *TaskExecutionInformation `json:"executionInfo,omitempty"`
-}
-
-// TaskSchedulingError information about an error when scheduling a task.
-type TaskSchedulingError struct {
- // Category - The category of the task scheduling error. Possible values include: 'SchedulingErrorCategoryUsererror', 'SchedulingErrorCategoryServererror', 'SchedulingErrorCategoryUnmapped'
- Category SchedulingErrorCategory `json:"category,omitempty"`
- // Code - An identifier for the task scheduling error. Codes are invariant and are intended to be consumed programmatically.
- Code *string `json:"code,omitempty"`
- // Message - A message describing the task scheduling error, intended to be suitable for display in a user interface.
- Message *string `json:"message,omitempty"`
- // Details - The list of additional error details related to the scheduling error.
- Details *[]NameValuePair `json:"details,omitempty"`
-}
-
-// TaskSchedulingPolicy specifies how tasks should be distributed across compute nodes.
-type TaskSchedulingPolicy struct {
- // NodeFillType - How tasks should be distributed across compute nodes. Possible values include: 'ComputeNodeFillTypeSpread', 'ComputeNodeFillTypePack', 'ComputeNodeFillTypeUnmapped'
- NodeFillType ComputeNodeFillType `json:"nodeFillType,omitempty"`
-}
-
-// TaskStatistics resource usage statistics for a task.
-type TaskStatistics struct {
- // URL - The URL of the statistics.
- URL *string `json:"url,omitempty"`
- // StartTime - The start time of the time range covered by the statistics.
- StartTime *date.Time `json:"startTime,omitempty"`
- // LastUpdateTime - The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime.
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- // UserCPUTime - The total user mode CPU time (summed across all cores and all compute nodes) consumed by the task.
- UserCPUTime *string `json:"userCPUTime,omitempty"`
- // KernelCPUTime - The total kernel mode CPU time (summed across all cores and all compute nodes) consumed by the task.
- KernelCPUTime *string `json:"kernelCPUTime,omitempty"`
- // WallClockTime - The total wall clock time of the task.
- WallClockTime *string `json:"wallClockTime,omitempty"`
- // ReadIOps - The total number of disk read operations made by the task.
- ReadIOps *int64 `json:"readIOps,omitempty"`
- // WriteIOps - The total number of disk write operations made by the task.
- WriteIOps *int64 `json:"writeIOps,omitempty"`
- // ReadIOGiB - The total gibibytes read from disk by the task.
- ReadIOGiB *float64 `json:"readIOGiB,omitempty"`
- // WriteIOGiB - The total gibibytes written to disk by the task.
- WriteIOGiB *float64 `json:"writeIOGiB,omitempty"`
- // WaitTime - The total wait time of the task. The wait time for a task is defined as the elapsed time between the creation of the task and the start of task execution. (If the task is retried due to failures, the wait time is the time to the most recent task execution.)
- WaitTime *string `json:"waitTime,omitempty"`
-}
-
-// TaskUpdateParameter parameters for a CloudTaskOperations.Update request.
-type TaskUpdateParameter struct {
- // Constraints - Constraints that apply to this task. If omitted, the task is given the default constraints.
- Constraints *TaskConstraints `json:"constraints,omitempty"`
-}
-
-// UsageStatistics statistics related to pool usage information.
-type UsageStatistics struct {
- // StartTime - The start time of the time range covered by the statistics.
- StartTime *date.Time `json:"startTime,omitempty"`
- // LastUpdateTime - The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime.
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- // DedicatedCoreTime - The aggregated wall-clock time of the dedicated compute node cores being part of the pool.
- DedicatedCoreTime *string `json:"dedicatedCoreTime,omitempty"`
-}
-
-// VirtualMachineConfiguration the configuration for compute nodes in a pool based on the Azure Virtual Machines
-// infrastructure.
-type VirtualMachineConfiguration struct {
- // ImageReference - A reference to the Azure Virtual Machines Marketplace image to use.
- ImageReference *ImageReference `json:"imageReference,omitempty"`
- // NodeAgentSKUID - The SKU of Batch Node Agent to be provisioned on the compute node. The Batch node agent is a program that runs on each node in the pool, and provides the command-and-control interface between the node and the Batch service. There are different implementations of the node agent, known as SKUs, for different operating systems.
- NodeAgentSKUID *string `json:"nodeAgentSKUId,omitempty"`
- // WindowsConfiguration - Windows operating system settings on the virtual machine. This property must not be specified if the ImageReference property specifies a Linux OS image.
- WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"`
-}
-
-// WindowsConfiguration windows operating system settings to apply to the virtual machine.
-type WindowsConfiguration struct {
- // EnableAutomaticUpdates - Whether automatic updates are enabled on the virtual machine. If omitted, the default value is true.
- EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"`
-}
diff --git a/services/batch/2016-02-01.3.0/batch/pool.go b/services/batch/2016-02-01.3.0/batch/pool.go
deleted file mode 100644
index 6d76f956dd84..000000000000
--- a/services/batch/2016-02-01.3.0/batch/pool.go
+++ /dev/null
@@ -1,1739 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "net/http"
-)
-
-// PoolClient is the a client for issuing REST requests to the Azure Batch service.
-type PoolClient struct {
- BaseClient
-}
-
-// NewPoolClient creates an instance of the PoolClient client.
-func NewPoolClient() PoolClient {
- return NewPoolClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewPoolClientWithBaseURI creates an instance of the PoolClient client.
-func NewPoolClientWithBaseURI(baseURI string) PoolClient {
- return PoolClient{NewWithBaseURI(baseURI)}
-}
-
-// Add adds a pool to the specified account.
-//
-// pool is the pool to be added. timeout is the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a
-// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id identifier in the response. ocpDate is the time the
-// request was issued. If not specified, this header will be automatically populated with the current system clock
-// time.
-func (client PoolClient) Add(ctx context.Context, pool PoolAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: pool,
- Constraints: []validation.Constraint{{Target: "pool.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "pool.VMSize", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "pool.CloudServiceConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "Add", err.Error())
- }
-
- req, err := client.AddPreparer(ctx, pool, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPreparer prepares the Add request.
-func (client PoolClient) AddPreparer(ctx context.Context, pool PoolAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/pools"),
- autorest.WithJSON(pool),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSender sends the Add request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) AddSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddResponder handles the response to the Add request. The method always
-// closes the http.Response Body.
-func (client PoolClient) AddResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Delete deletes a pool from the specified account.
-//
-// poolID is the id of the pool to delete. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id identifier in the response.
-// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with
-// the current system clock time. ifMatch is an ETag is specified. Specify this header to perform the operation
-// only if the resource's ETag is an exact match as specified. ifNoneMatch is an ETag is specified. Specify this
-// header to perform the operation only if the resource's ETag does not match the specified ETag. ifModifiedSince
-// is specify this header to perform the operation only if the resource has been modified since the specified
-// date/time. ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been
-// modified since the specified date/time.
-func (client PoolClient) Delete(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeletePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client PoolClient) DeletePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client PoolClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// DisableAutoScale disables automatic scaling for a pool.
-//
-// poolID is the id of the pool on which to disable automatic scaling. timeout is the maximum time that the server
-// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated
-// request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client PoolClient) DisableAutoScale(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DisableAutoScalePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DisableAutoScaleSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", resp, "Failure sending request")
- return
- }
-
- result, err = client.DisableAutoScaleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DisableAutoScalePreparer prepares the DisableAutoScale request.
-func (client PoolClient) DisableAutoScalePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/disableautoscale", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DisableAutoScaleSender sends the DisableAutoScale request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) DisableAutoScaleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DisableAutoScaleResponder handles the response to the DisableAutoScale request. The method always
-// closes the http.Response Body.
-func (client PoolClient) DisableAutoScaleResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// EnableAutoScale enables automatic scaling for a pool.
-//
-// poolID is the id of the pool on which to enable automatic scaling. poolEnableAutoScaleParameter is the
-// parameters for the request. timeout is the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a
-// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id identifier in the response. ocpDate is the time the
-// request was issued. If not specified, this header will be automatically populated with the current system clock
-// time. ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag
-// is an exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the
-// operation only if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header
-// to perform the operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince
-// is specify this header to perform the operation only if the resource has not been modified since the specified
-// date/time.
-func (client PoolClient) EnableAutoScale(ctx context.Context, poolID string, poolEnableAutoScaleParameter PoolEnableAutoScaleParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.EnableAutoScalePreparer(ctx, poolID, poolEnableAutoScaleParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.EnableAutoScaleSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", resp, "Failure sending request")
- return
- }
-
- result, err = client.EnableAutoScaleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", resp, "Failure responding to request")
- }
-
- return
-}
-
-// EnableAutoScalePreparer prepares the EnableAutoScale request.
-func (client PoolClient) EnableAutoScalePreparer(ctx context.Context, poolID string, poolEnableAutoScaleParameter PoolEnableAutoScaleParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/enableautoscale", pathParameters),
- autorest.WithJSON(poolEnableAutoScaleParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// EnableAutoScaleSender sends the EnableAutoScale request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) EnableAutoScaleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// EnableAutoScaleResponder handles the response to the EnableAutoScale request. The method always
-// closes the http.Response Body.
-func (client PoolClient) EnableAutoScaleResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// EvaluateAutoScale gets the result of evaluating an automatic scaling formula on the pool.
-//
-// poolID is the id of the pool on which to evaluate the automatic scaling formula. poolEvaluateAutoScaleParameter
-// is the parameters for the request. timeout is the maximum time that the server can spend processing the request,
-// in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of
-// a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id identifier in the response. ocpDate is the time the
-// request was issued. If not specified, this header will be automatically populated with the current system clock
-// time.
-func (client PoolClient) EvaluateAutoScale(ctx context.Context, poolID string, poolEvaluateAutoScaleParameter PoolEvaluateAutoScaleParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result AutoScaleRun, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: poolEvaluateAutoScaleParameter,
- Constraints: []validation.Constraint{{Target: "poolEvaluateAutoScaleParameter.AutoScaleFormula", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "EvaluateAutoScale", err.Error())
- }
-
- req, err := client.EvaluateAutoScalePreparer(ctx, poolID, poolEvaluateAutoScaleParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.EvaluateAutoScaleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", resp, "Failure sending request")
- return
- }
-
- result, err = client.EvaluateAutoScaleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", resp, "Failure responding to request")
- }
-
- return
-}
-
-// EvaluateAutoScalePreparer prepares the EvaluateAutoScale request.
-func (client PoolClient) EvaluateAutoScalePreparer(ctx context.Context, poolID string, poolEvaluateAutoScaleParameter PoolEvaluateAutoScaleParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/evaluateautoscale", pathParameters),
- autorest.WithJSON(poolEvaluateAutoScaleParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// EvaluateAutoScaleSender sends the EvaluateAutoScale request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) EvaluateAutoScaleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// EvaluateAutoScaleResponder handles the response to the EvaluateAutoScale request. The method always
-// closes the http.Response Body.
-func (client PoolClient) EvaluateAutoScaleResponder(resp *http.Response) (result AutoScaleRun, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Exists gets basic properties of a pool.
-//
-// poolID is the id of the pool to get. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id identifier in the response.
-// ocpDate is the time the request was issued. If not specified, this header will be automatically populated with
-// the current system clock time. ifMatch is an ETag is specified. Specify this header to perform the operation
-// only if the resource's ETag is an exact match as specified. ifNoneMatch is an ETag is specified. Specify this
-// header to perform the operation only if the resource's ETag does not match the specified ETag. ifModifiedSince
-// is specify this header to perform the operation only if the resource has been modified since the specified
-// date/time. ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been
-// modified since the specified date/time.
-func (client PoolClient) Exists(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.ExistsPreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ExistsSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", resp, "Failure sending request")
- return
- }
-
- result, err = client.ExistsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ExistsPreparer prepares the Exists request.
-func (client PoolClient) ExistsPreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsHead(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ExistsSender sends the Exists request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) ExistsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ExistsResponder handles the response to the Exists request. The method always
-// closes the http.Response Body.
-func (client PoolClient) ExistsResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get gets information about the specified pool.
-//
-// poolID is the id of the pool to get. selectParameter is an OData $select clause. expand is an OData $expand
-// clause. timeout is the maximum time that the server can spend processing the request, in seconds. The default is
-// 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration
-// such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server
-// should return the client-request-id identifier in the response. ocpDate is the time the request was issued. If
-// not specified, this header will be automatically populated with the current system clock time. ifMatch is an
-// ETag is specified. Specify this header to perform the operation only if the resource's ETag is an exact match as
-// specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the
-// resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the
-// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify
-// this header to perform the operation only if the resource has not been modified since the specified date/time.
-func (client PoolClient) Get(ctx context.Context, poolID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudPool, err error) {
- req, err := client.GetPreparer(ctx, poolID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client PoolClient) GetPreparer(ctx context.Context, poolID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client PoolClient) GetResponder(resp *http.Response) (result CloudPool, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetAllPoolsLifetimeStatistics gets lifetime summary statistics for all of the pools in the specified account.
-// Statistics are aggregated across all pools that have ever existed in the account, from account creation to the last
-// update time of the statistics.
-//
-// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30
-// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such
-// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should
-// return the client-request-id identifier in the response. ocpDate is the time the request was issued. If not
-// specified, this header will be automatically populated with the current system clock time.
-func (client PoolClient) GetAllPoolsLifetimeStatistics(ctx context.Context, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolStatistics, err error) {
- req, err := client.GetAllPoolsLifetimeStatisticsPreparer(ctx, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllPoolsLifetimeStatistics", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetAllPoolsLifetimeStatisticsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllPoolsLifetimeStatistics", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetAllPoolsLifetimeStatisticsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllPoolsLifetimeStatistics", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetAllPoolsLifetimeStatisticsPreparer prepares the GetAllPoolsLifetimeStatistics request.
-func (client PoolClient) GetAllPoolsLifetimeStatisticsPreparer(ctx context.Context, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/lifetimepoolstats"),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetAllPoolsLifetimeStatisticsSender sends the GetAllPoolsLifetimeStatistics request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) GetAllPoolsLifetimeStatisticsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetAllPoolsLifetimeStatisticsResponder handles the response to the GetAllPoolsLifetimeStatistics request. The method always
-// closes the http.Response Body.
-func (client PoolClient) GetAllPoolsLifetimeStatisticsResponder(resp *http.Response) (result PoolStatistics, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List lists all of the pools in the specified account.
-//
-// filter is an OData $filter clause. selectParameter is an OData $select clause. expand is an OData $expand
-// clause. maxResults is the maximum number of items to return in the response. timeout is the maximum time that
-// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client PoolClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudPoolListResultPage, err error) {
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.cplr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", resp, "Failure sending request")
- return
- }
-
- result.cplr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client PoolClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/pools"),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client PoolClient) ListResponder(resp *http.Response) (result CloudPoolListResult, 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 PoolClient) listNextResults(lastResults CloudPoolListResult) (result CloudPoolListResult, err error) {
- req, err := lastResults.cloudPoolListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.PoolClient", "listNextResults", 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.PoolClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client PoolClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudPoolListResultIterator, err error) {
- result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// ListPoolUsageMetrics lists the usage metrics, aggregated by pool across individual time intervals, for the specified
-// account.
-//
-// startTime is the earliest time from which to include metrics. This must be at least two and a half hours before
-// the current time. endTime is the latest time from which to include metrics. This must be at least two hours
-// before the current time. filter is an OData $filter clause. maxResults is the maximum number of items to return
-// in the response. timeout is the maximum time that the server can spend processing the request, in seconds. The
-// default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id identifier in the response. ocpDate is the time the request was
-// issued. If not specified, this header will be automatically populated with the current system clock time.
-func (client PoolClient) ListPoolUsageMetrics(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolListPoolUsageMetricsResultPage, err error) {
- result.fn = client.listPoolUsageMetricsNextResults
- req, err := client.ListPoolUsageMetricsPreparer(ctx, startTime, endTime, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListPoolUsageMetrics", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListPoolUsageMetricsSender(req)
- if err != nil {
- result.plpumr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListPoolUsageMetrics", resp, "Failure sending request")
- return
- }
-
- result.plpumr, err = client.ListPoolUsageMetricsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListPoolUsageMetrics", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPoolUsageMetricsPreparer prepares the ListPoolUsageMetrics request.
-func (client PoolClient) ListPoolUsageMetricsPreparer(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if startTime != nil {
- queryParameters["starttime"] = autorest.Encode("query", *startTime)
- }
- if endTime != nil {
- queryParameters["endtime"] = autorest.Encode("query", *endTime)
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/poolusagemetrics"),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListPoolUsageMetricsSender sends the ListPoolUsageMetrics request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) ListPoolUsageMetricsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListPoolUsageMetricsResponder handles the response to the ListPoolUsageMetrics request. The method always
-// closes the http.Response Body.
-func (client PoolClient) ListPoolUsageMetricsResponder(resp *http.Response) (result PoolListPoolUsageMetricsResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listPoolUsageMetricsNextResults retrieves the next set of results, if any.
-func (client PoolClient) listPoolUsageMetricsNextResults(lastResults PoolListPoolUsageMetricsResult) (result PoolListPoolUsageMetricsResult, err error) {
- req, err := lastResults.poolListPoolUsageMetricsResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.PoolClient", "listPoolUsageMetricsNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListPoolUsageMetricsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.PoolClient", "listPoolUsageMetricsNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListPoolUsageMetricsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "listPoolUsageMetricsNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListPoolUsageMetricsComplete enumerates all values, automatically crossing page boundaries as required.
-func (client PoolClient) ListPoolUsageMetricsComplete(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolListPoolUsageMetricsResultIterator, err error) {
- result.page, err = client.ListPoolUsageMetrics(ctx, startTime, endTime, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// Patch updates the properties of a pool.
-//
-// poolID is the id of the pool to update. poolPatchParameter is the parameters for the request. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified.
-// Specify this header to perform the operation only if the resource's ETag is an exact match as specified.
-// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag
-// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the
-// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform
-// the operation only if the resource has not been modified since the specified date/time.
-func (client PoolClient) Patch(ctx context.Context, poolID string, poolPatchParameter PoolPatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.PatchPreparer(ctx, poolID, poolPatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.PatchSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", resp, "Failure sending request")
- return
- }
-
- result, err = client.PatchResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", resp, "Failure responding to request")
- }
-
- return
-}
-
-// PatchPreparer prepares the Patch request.
-func (client PoolClient) PatchPreparer(ctx context.Context, poolID string, poolPatchParameter PoolPatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPatch(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}", pathParameters),
- autorest.WithJSON(poolPatchParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// PatchSender sends the Patch request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) PatchSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// PatchResponder handles the response to the Patch request. The method always
-// closes the http.Response Body.
-func (client PoolClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// RemoveNodes removes compute nodes from the specified pool.
-//
-// poolID is the id of the pool from which you want to remove nodes. nodeRemoveParameter is the parameters for the
-// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id identifier in the response. ocpDate is the time the request was
-// issued. If not specified, this header will be automatically populated with the current system clock time.
-// ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag is an
-// exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only
-// if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the
-// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify
-// this header to perform the operation only if the resource has not been modified since the specified date/time.
-func (client PoolClient) RemoveNodes(ctx context.Context, poolID string, nodeRemoveParameter NodeRemoveParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: nodeRemoveParameter,
- Constraints: []validation.Constraint{{Target: "nodeRemoveParameter.NodeList", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "RemoveNodes", err.Error())
- }
-
- req, err := client.RemoveNodesPreparer(ctx, poolID, nodeRemoveParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.RemoveNodesSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", resp, "Failure sending request")
- return
- }
-
- result, err = client.RemoveNodesResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", resp, "Failure responding to request")
- }
-
- return
-}
-
-// RemoveNodesPreparer prepares the RemoveNodes request.
-func (client PoolClient) RemoveNodesPreparer(ctx context.Context, poolID string, nodeRemoveParameter NodeRemoveParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/removenodes", pathParameters),
- autorest.WithJSON(nodeRemoveParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// RemoveNodesSender sends the RemoveNodes request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) RemoveNodesSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// RemoveNodesResponder handles the response to the RemoveNodes request. The method always
-// closes the http.Response Body.
-func (client PoolClient) RemoveNodesResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Resize changes the number of compute nodes that are assigned to a pool.
-//
-// poolID is the id of the pool to resize. poolResizeParameter is the parameters for the request. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified.
-// Specify this header to perform the operation only if the resource's ETag is an exact match as specified.
-// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag
-// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the
-// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform
-// the operation only if the resource has not been modified since the specified date/time.
-func (client PoolClient) Resize(ctx context.Context, poolID string, poolResizeParameter PoolResizeParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: poolResizeParameter,
- Constraints: []validation.Constraint{{Target: "poolResizeParameter.TargetDedicated", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "Resize", err.Error())
- }
-
- req, err := client.ResizePreparer(ctx, poolID, poolResizeParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ResizeSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", resp, "Failure sending request")
- return
- }
-
- result, err = client.ResizeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ResizePreparer prepares the Resize request.
-func (client PoolClient) ResizePreparer(ctx context.Context, poolID string, poolResizeParameter PoolResizeParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/resize", pathParameters),
- autorest.WithJSON(poolResizeParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ResizeSender sends the Resize request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) ResizeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ResizeResponder handles the response to the Resize request. The method always
-// closes the http.Response Body.
-func (client PoolClient) ResizeResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// StopResize stops an ongoing resize operation on the pool. This does not restore the pool to its previous state
-// before the resize operation: it only stops any further changes being made, and the pool maintains its current state.
-//
-// poolID is the id of the pool whose resizing you want to stop. timeout is the maximum time that the server can
-// spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated
-// request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified.
-// Specify this header to perform the operation only if the resource's ETag is an exact match as specified.
-// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag
-// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the
-// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform
-// the operation only if the resource has not been modified since the specified date/time.
-func (client PoolClient) StopResize(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.StopResizePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.StopResizeSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", resp, "Failure sending request")
- return
- }
-
- result, err = client.StopResizeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", resp, "Failure responding to request")
- }
-
- return
-}
-
-// StopResizePreparer prepares the StopResize request.
-func (client PoolClient) StopResizePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/stopresize", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// StopResizeSender sends the StopResize request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) StopResizeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// StopResizeResponder handles the response to the StopResize request. The method always
-// closes the http.Response Body.
-func (client PoolClient) StopResizeResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// UpdateProperties updates the properties of a pool.
-//
-// poolID is the id of the pool to update. poolUpdatePropertiesParameter is the parameters for the request. timeout
-// is the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client PoolClient) UpdateProperties(ctx context.Context, poolID string, poolUpdatePropertiesParameter PoolUpdatePropertiesParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: poolUpdatePropertiesParameter,
- Constraints: []validation.Constraint{{Target: "poolUpdatePropertiesParameter.CertificateReferences", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "poolUpdatePropertiesParameter.ApplicationPackageReferences", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "poolUpdatePropertiesParameter.Metadata", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "UpdateProperties", err.Error())
- }
-
- req, err := client.UpdatePropertiesPreparer(ctx, poolID, poolUpdatePropertiesParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdatePropertiesSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdatePropertiesResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePropertiesPreparer prepares the UpdateProperties request.
-func (client PoolClient) UpdatePropertiesPreparer(ctx context.Context, poolID string, poolUpdatePropertiesParameter PoolUpdatePropertiesParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/updateproperties", pathParameters),
- autorest.WithJSON(poolUpdatePropertiesParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdatePropertiesSender sends the UpdateProperties request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) UpdatePropertiesSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdatePropertiesResponder handles the response to the UpdateProperties request. The method always
-// closes the http.Response Body.
-func (client PoolClient) UpdatePropertiesResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// UpgradeOS upgrades the operating system of the specified pool.
-//
-// poolID is the id of the pool to upgrade. poolUpgradeOSParameter is the parameters for the request. timeout is
-// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified.
-// Specify this header to perform the operation only if the resource's ETag is an exact match as specified.
-// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag
-// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the
-// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform
-// the operation only if the resource has not been modified since the specified date/time.
-func (client PoolClient) UpgradeOS(ctx context.Context, poolID string, poolUpgradeOSParameter PoolUpgradeOSParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: poolUpgradeOSParameter,
- Constraints: []validation.Constraint{{Target: "poolUpgradeOSParameter.TargetOSVersion", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "UpgradeOS", err.Error())
- }
-
- req, err := client.UpgradeOSPreparer(ctx, poolID, poolUpgradeOSParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpgradeOSSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpgradeOSResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpgradeOSPreparer prepares the UpgradeOS request.
-func (client PoolClient) UpgradeOSPreparer(ctx context.Context, poolID string, poolUpgradeOSParameter PoolUpgradeOSParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/upgradeos", pathParameters),
- autorest.WithJSON(poolUpgradeOSParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpgradeOSSender sends the UpgradeOS request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) UpgradeOSSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpgradeOSResponder handles the response to the UpgradeOS request. The method always
-// closes the http.Response Body.
-func (client PoolClient) UpgradeOSResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff --git a/services/batch/2016-02-01.3.0/batch/task.go b/services/batch/2016-02-01.3.0/batch/task.go
deleted file mode 100644
index d658c82e2de6..000000000000
--- a/services/batch/2016-02-01.3.0/batch/task.go
+++ /dev/null
@@ -1,888 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "net/http"
-)
-
-// TaskClient is the a client for issuing REST requests to the Azure Batch service.
-type TaskClient struct {
- BaseClient
-}
-
-// NewTaskClient creates an instance of the TaskClient client.
-func NewTaskClient() TaskClient {
- return NewTaskClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewTaskClientWithBaseURI creates an instance of the TaskClient client.
-func NewTaskClientWithBaseURI(baseURI string) TaskClient {
- return TaskClient{NewWithBaseURI(baseURI)}
-}
-
-// Add adds a task to the specified job.
-//
-// jobID is the id of the job to which the task is to be added. task is the task to be added. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client TaskClient) Add(ctx context.Context, jobID string, task TaskAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: task,
- Constraints: []validation.Constraint{{Target: "task.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "task.CommandLine", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "task.MultiInstanceSettings", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "task.MultiInstanceSettings.NumberOfInstances", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil {
- return result, validation.NewError("batch.TaskClient", "Add", err.Error())
- }
-
- req, err := client.AddPreparer(ctx, jobID, task, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPreparer prepares the Add request.
-func (client TaskClient) AddPreparer(ctx context.Context, jobID string, task TaskAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks", pathParameters),
- autorest.WithJSON(task),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSender sends the Add request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) AddSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddResponder handles the response to the Add request. The method always
-// closes the http.Response Body.
-func (client TaskClient) AddResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// AddCollection adds a collection of tasks to the specified job.
-//
-// jobID is the id of the job to which the task collection is to be added. taskCollection is the tasks to be added.
-// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30
-// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such
-// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should
-// return the client-request-id identifier in the response. ocpDate is the time the request was issued. If not
-// specified, this header will be automatically populated with the current system clock time.
-func (client TaskClient) AddCollection(ctx context.Context, jobID string, taskCollection TaskAddCollectionParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result TaskAddCollectionResult, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: taskCollection,
- Constraints: []validation.Constraint{{Target: "taskCollection.Value", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.TaskClient", "AddCollection", err.Error())
- }
-
- req, err := client.AddCollectionPreparer(ctx, jobID, taskCollection, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "AddCollection", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddCollectionSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "AddCollection", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddCollectionResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "AddCollection", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddCollectionPreparer prepares the AddCollection request.
-func (client TaskClient) AddCollectionPreparer(ctx context.Context, jobID string, taskCollection TaskAddCollectionParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/addtaskcollection", pathParameters),
- autorest.WithJSON(taskCollection),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddCollectionSender sends the AddCollection request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) AddCollectionSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddCollectionResponder handles the response to the AddCollection request. The method always
-// closes the http.Response Body.
-func (client TaskClient) AddCollectionResponder(resp *http.Response) (result TaskAddCollectionResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Delete deletes a task from the specified job.
-//
-// jobID is the id of the job from which to delete the task. taskID is the id of the task to delete. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified.
-// Specify this header to perform the operation only if the resource's ETag is an exact match as specified.
-// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag
-// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the
-// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform
-// the operation only if the resource has not been modified since the specified date/time.
-func (client TaskClient) Delete(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeletePreparer(ctx, jobID, taskID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client TaskClient) DeletePreparer(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client TaskClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get gets information about the specified task.
-//
-// jobID is the id of the job that contains the task. taskID is the id of the task to get information about.
-// selectParameter is an OData $select clause. expand is an OData $expand clause. timeout is the maximum time that
-// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified.
-// Specify this header to perform the operation only if the resource's ETag is an exact match as specified.
-// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag
-// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the
-// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform
-// the operation only if the resource has not been modified since the specified date/time.
-func (client TaskClient) Get(ctx context.Context, jobID string, taskID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudTask, err error) {
- req, err := client.GetPreparer(ctx, jobID, taskID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client TaskClient) GetPreparer(ctx context.Context, jobID string, taskID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client TaskClient) GetResponder(resp *http.Response) (result CloudTask, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List lists all of the tasks that are associated with the specified job.
-//
-// jobID is the id of the job. filter is an OData $filter clause. selectParameter is an OData $select clause.
-// expand is an OData $expand clause. maxResults is the maximum number of items to return in the response. timeout
-// is the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client TaskClient) List(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListResultPage, err error) {
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, jobID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.ctlr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", resp, "Failure sending request")
- return
- }
-
- result.ctlr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client TaskClient) ListPreparer(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client TaskClient) ListResponder(resp *http.Response) (result CloudTaskListResult, 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 TaskClient) listNextResults(lastResults CloudTaskListResult) (result CloudTaskListResult, err error) {
- req, err := lastResults.cloudTaskListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.TaskClient", "listNextResults", 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.TaskClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client TaskClient) ListComplete(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListResultIterator, err error) {
- result.page, err = client.List(ctx, jobID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// ListSubtasks lists all of the subtasks that are associated with the specified multi-instance task.
-//
-// jobID is the id of the job. taskID is the id of the task. selectParameter is an OData $select clause. timeout is
-// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client TaskClient) ListSubtasks(ctx context.Context, jobID string, taskID string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListSubtasksResult, err error) {
- req, err := client.ListSubtasksPreparer(ctx, jobID, taskID, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSubtasksSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListSubtasksResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListSubtasksPreparer prepares the ListSubtasks request.
-func (client TaskClient) ListSubtasksPreparer(ctx context.Context, jobID string, taskID string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/subtasksinfo", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSubtasksSender sends the ListSubtasks request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) ListSubtasksSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListSubtasksResponder handles the response to the ListSubtasks request. The method always
-// closes the http.Response Body.
-func (client TaskClient) ListSubtasksResponder(resp *http.Response) (result CloudTaskListSubtasksResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Terminate terminates the specified task.
-//
-// jobID is the id of the job containing the task. taskID is the id of the task to terminate. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id identifier in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified.
-// Specify this header to perform the operation only if the resource's ETag is an exact match as specified.
-// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag
-// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the
-// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform
-// the operation only if the resource has not been modified since the specified date/time.
-func (client TaskClient) Terminate(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.TerminatePreparer(ctx, jobID, taskID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.TerminateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", resp, "Failure sending request")
- return
- }
-
- result, err = client.TerminateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", resp, "Failure responding to request")
- }
-
- return
-}
-
-// TerminatePreparer prepares the Terminate request.
-func (client TaskClient) TerminatePreparer(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/terminate", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// TerminateSender sends the Terminate request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) TerminateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// TerminateResponder handles the response to the Terminate request. The method always
-// closes the http.Response Body.
-func (client TaskClient) TerminateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Update updates the properties of the specified task.
-//
-// jobID is the id of the job containing the task. taskID is the id of the task to update. taskUpdateParameter is
-// the parameters for the request. timeout is the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a
-// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id identifier in the response. ocpDate is the time the
-// request was issued. If not specified, this header will be automatically populated with the current system clock
-// time. ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag
-// is an exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the
-// operation only if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header
-// to perform the operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince
-// is specify this header to perform the operation only if the resource has not been modified since the specified
-// date/time.
-func (client TaskClient) Update(ctx context.Context, jobID string, taskID string, taskUpdateParameter TaskUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.UpdatePreparer(ctx, jobID, taskID, taskUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePreparer prepares the Update request.
-func (client TaskClient) UpdatePreparer(ctx context.Context, jobID string, taskID string, taskUpdateParameter TaskUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2016-02-01.3.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters),
- autorest.WithJSON(taskUpdateParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSender sends the Update request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) UpdateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateResponder handles the response to the Update request. The method always
-// closes the http.Response Body.
-func (client TaskClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff --git a/services/batch/2016-07-01.3.1/batch/account.go b/services/batch/2016-07-01.3.1/batch/account.go
deleted file mode 100644
index 766be71589d4..000000000000
--- a/services/batch/2016-07-01.3.1/batch/account.go
+++ /dev/null
@@ -1,173 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "net/http"
-)
-
-// AccountClient is the a client for issuing REST requests to the Azure Batch service.
-type AccountClient struct {
- BaseClient
-}
-
-// NewAccountClient creates an instance of the AccountClient client.
-func NewAccountClient() AccountClient {
- return NewAccountClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewAccountClientWithBaseURI creates an instance of the AccountClient client.
-func NewAccountClientWithBaseURI(baseURI string) AccountClient {
- return AccountClient{NewWithBaseURI(baseURI)}
-}
-
-// ListNodeAgentSkus sends the list node agent skus request.
-//
-// filter is an OData $filter clause. maxResults is the maximum number of items to return in the response. A
-// maximum of 1000 results will be returned. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. If not specified, this header will be automatically populated with the current
-// system clock time.
-func (client AccountClient) ListNodeAgentSkus(ctx context.Context, filter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result AccountListNodeAgentSkusResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.AccountClient", "ListNodeAgentSkus", err.Error())
- }
-
- result.fn = client.listNodeAgentSkusNextResults
- req, err := client.ListNodeAgentSkusPreparer(ctx, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListNodeAgentSkus", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListNodeAgentSkusSender(req)
- if err != nil {
- result.alnasr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListNodeAgentSkus", resp, "Failure sending request")
- return
- }
-
- result.alnasr, err = client.ListNodeAgentSkusResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListNodeAgentSkus", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListNodeAgentSkusPreparer prepares the ListNodeAgentSkus request.
-func (client AccountClient) ListNodeAgentSkusPreparer(ctx context.Context, filter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/nodeagentskus"),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListNodeAgentSkusSender sends the ListNodeAgentSkus request. The method will close the
-// http.Response Body if it receives an error.
-func (client AccountClient) ListNodeAgentSkusSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListNodeAgentSkusResponder handles the response to the ListNodeAgentSkus request. The method always
-// closes the http.Response Body.
-func (client AccountClient) ListNodeAgentSkusResponder(resp *http.Response) (result AccountListNodeAgentSkusResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listNodeAgentSkusNextResults retrieves the next set of results, if any.
-func (client AccountClient) listNodeAgentSkusNextResults(lastResults AccountListNodeAgentSkusResult) (result AccountListNodeAgentSkusResult, err error) {
- req, err := lastResults.accountListNodeAgentSkusResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.AccountClient", "listNodeAgentSkusNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListNodeAgentSkusSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.AccountClient", "listNodeAgentSkusNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListNodeAgentSkusResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.AccountClient", "listNodeAgentSkusNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListNodeAgentSkusComplete enumerates all values, automatically crossing page boundaries as required.
-func (client AccountClient) ListNodeAgentSkusComplete(ctx context.Context, filter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result AccountListNodeAgentSkusResultIterator, err error) {
- result.page, err = client.ListNodeAgentSkus(ctx, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
diff --git a/services/batch/2016-07-01.3.1/batch/application.go b/services/batch/2016-07-01.3.1/batch/application.go
deleted file mode 100644
index 6a72e0733dc9..000000000000
--- a/services/batch/2016-07-01.3.1/batch/application.go
+++ /dev/null
@@ -1,260 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "net/http"
-)
-
-// ApplicationClient is the a client for issuing REST requests to the Azure Batch service.
-type ApplicationClient struct {
- BaseClient
-}
-
-// NewApplicationClient creates an instance of the ApplicationClient client.
-func NewApplicationClient() ApplicationClient {
- return NewApplicationClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewApplicationClientWithBaseURI creates an instance of the ApplicationClient client.
-func NewApplicationClientWithBaseURI(baseURI string) ApplicationClient {
- return ApplicationClient{NewWithBaseURI(baseURI)}
-}
-
-// Get sends the get request.
-//
-// applicationID is the ID of the application. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. If not specified, this header will be automatically populated with the current
-// system clock time.
-func (client ApplicationClient) Get(ctx context.Context, applicationID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationSummary, err error) {
- req, err := client.GetPreparer(ctx, applicationID, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client ApplicationClient) GetPreparer(ctx context.Context, applicationID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "applicationId": autorest.Encode("path", applicationID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/applications/{applicationId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client ApplicationClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client ApplicationClient) GetResponder(resp *http.Response) (result ApplicationSummary, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List this operation returns only applications and versions that are available for use on compute nodes; that is,
-// that can be used in an application package reference. For administrator information about applications and versions
-// that are not yet available to compute nodes, use the Azure portal or the Azure Resource Manager API.
-//
-// maxResults is the maximum number of items to return in the response. A maximum of 1000 applications can be
-// returned. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. If not
-// specified, this header will be automatically populated with the current system clock time.
-func (client ApplicationClient) List(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.ApplicationClient", "List", err.Error())
- }
-
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.alr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "List", resp, "Failure sending request")
- return
- }
-
- result.alr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client ApplicationClient) ListPreparer(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/applications"),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client ApplicationClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client ApplicationClient) ListResponder(resp *http.Response) (result ApplicationListResult, 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 ApplicationClient) listNextResults(lastResults ApplicationListResult) (result ApplicationListResult, err error) {
- req, err := lastResults.applicationListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.ApplicationClient", "listNextResults", 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.ApplicationClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client ApplicationClient) ListComplete(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationListResultIterator, err error) {
- result.page, err = client.List(ctx, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
diff --git a/services/batch/2016-07-01.3.1/batch/certificate.go b/services/batch/2016-07-01.3.1/batch/certificate.go
deleted file mode 100644
index 5498307391fd..000000000000
--- a/services/batch/2016-07-01.3.1/batch/certificate.go
+++ /dev/null
@@ -1,554 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "net/http"
-)
-
-// CertificateClient is the a client for issuing REST requests to the Azure Batch service.
-type CertificateClient struct {
- BaseClient
-}
-
-// NewCertificateClient creates an instance of the CertificateClient client.
-func NewCertificateClient() CertificateClient {
- return NewCertificateClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewCertificateClientWithBaseURI creates an instance of the CertificateClient client.
-func NewCertificateClientWithBaseURI(baseURI string) CertificateClient {
- return CertificateClient{NewWithBaseURI(baseURI)}
-}
-
-// Add sends the add request.
-//
-// certificate is the certificate to be added. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. If not specified, this header will be automatically populated with the current
-// system clock time.
-func (client CertificateClient) Add(ctx context.Context, certificate CertificateAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: certificate,
- Constraints: []validation.Constraint{{Target: "certificate.Thumbprint", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "certificate.ThumbprintAlgorithm", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "certificate.Data", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.CertificateClient", "Add", err.Error())
- }
-
- req, err := client.AddPreparer(ctx, certificate, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPreparer prepares the Add request.
-func (client CertificateClient) AddPreparer(ctx context.Context, certificate CertificateAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/certificates"),
- autorest.WithJSON(certificate),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSender sends the Add request. The method will close the
-// http.Response Body if it receives an error.
-func (client CertificateClient) AddSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddResponder handles the response to the Add request. The method always
-// closes the http.Response Body.
-func (client CertificateClient) AddResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// CancelDeletion if you try to delete a certificate that is being used by a pool or compute node, the status of the
-// certificate changes to deletefailed. If you decide that you want to continue using the certificate, you can use this
-// operation to set the status of the certificate back to active. If you intend to delete the certificate, you do not
-// need to run this operation after the deletion failed. You must make sure that the certificate is not being used by
-// any resources, and then you can try again to delete the certificate.
-//
-// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is
-// the thumbprint of the certificate being deleted. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time.
-func (client CertificateClient) CancelDeletion(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.CancelDeletionPreparer(ctx, thumbprintAlgorithm, thumbprint, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.CancelDeletionSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", resp, "Failure sending request")
- return
- }
-
- result, err = client.CancelDeletionResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", resp, "Failure responding to request")
- }
-
- return
-}
-
-// CancelDeletionPreparer prepares the CancelDeletion request.
-func (client CertificateClient) CancelDeletionPreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "thumbprint": autorest.Encode("path", thumbprint),
- "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})/canceldelete", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CancelDeletionSender sends the CancelDeletion request. The method will close the
-// http.Response Body if it receives an error.
-func (client CertificateClient) CancelDeletionSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// CancelDeletionResponder handles the response to the CancelDeletion request. The method always
-// closes the http.Response Body.
-func (client CertificateClient) CancelDeletionResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Delete you cannot delete a certificate if a resource (pool or compute node) is using it. Before you can delete a
-// certificate, you must therefore make sure that the certificate is not associated with any existing pools, the
-// certificate is not installed on any compute nodes (even if you remove a certificate from a pool, it is not removed
-// from existing compute nodes in that pool until they restart), and no running tasks depend on the certificate. If you
-// try to delete a certificate that is in use, the deletion fails. The certificate status changes to deletefailed. You
-// can use Cancel Delete Certificate to set the status back to active if you decide that you want to continue using the
-// certificate.
-//
-// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is
-// the thumbprint of the certificate to be deleted. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time.
-func (client CertificateClient) Delete(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeletePreparer(ctx, thumbprintAlgorithm, thumbprint, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client CertificateClient) DeletePreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "thumbprint": autorest.Encode("path", thumbprint),
- "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client CertificateClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client CertificateClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get gets information about the specified certificate.
-//
-// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is
-// the thumbprint of the certificate to get. selectParameter is an OData $select clause. timeout is the maximum
-// time that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is
-// the caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time.
-func (client CertificateClient) Get(ctx context.Context, thumbprintAlgorithm string, thumbprint string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result Certificate, err error) {
- req, err := client.GetPreparer(ctx, thumbprintAlgorithm, thumbprint, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client CertificateClient) GetPreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "thumbprint": autorest.Encode("path", thumbprint),
- "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client CertificateClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client CertificateClient) GetResponder(resp *http.Response) (result Certificate, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List sends the list request.
-//
-// filter is an OData $filter clause. selectParameter is an OData $select clause. maxResults is the maximum number
-// of items to return in the response. A maximum of 1000 certificates can be returned. timeout is the maximum time
-// that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time.
-func (client CertificateClient) List(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CertificateListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.CertificateClient", "List", err.Error())
- }
-
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.clr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "List", resp, "Failure sending request")
- return
- }
-
- result.clr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client CertificateClient) ListPreparer(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/certificates"),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client CertificateClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client CertificateClient) ListResponder(resp *http.Response) (result CertificateListResult, 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 CertificateClient) listNextResults(lastResults CertificateListResult) (result CertificateListResult, err error) {
- req, err := lastResults.certificateListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.CertificateClient", "listNextResults", 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.CertificateClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client CertificateClient) ListComplete(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CertificateListResultIterator, err error) {
- result.page, err = client.List(ctx, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
diff --git a/services/batch/2016-07-01.3.1/batch/client.go b/services/batch/2016-07-01.3.1/batch/client.go
deleted file mode 100644
index 052769b94138..000000000000
--- a/services/batch/2016-07-01.3.1/batch/client.go
+++ /dev/null
@@ -1,49 +0,0 @@
-// Package batch implements the Azure ARM Batch service API version 2016-07-01.3.1.
-//
-// A client for issuing REST requests to the Azure Batch service.
-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"
-)
-
-const (
- // DefaultBaseURI is the default URI used for the service Batch
- DefaultBaseURI = "https://batch.core.windows.net"
-)
-
-// BaseClient is the base client for Batch.
-type BaseClient struct {
- autorest.Client
- BaseURI string
-}
-
-// New creates an instance of the BaseClient client.
-func New() BaseClient {
- return NewWithBaseURI(DefaultBaseURI)
-}
-
-// NewWithBaseURI creates an instance of the BaseClient client.
-func NewWithBaseURI(baseURI string) BaseClient {
- return BaseClient{
- Client: autorest.NewClientWithUserAgent(UserAgent()),
- BaseURI: baseURI,
- }
-}
diff --git a/services/batch/2016-07-01.3.1/batch/computenode.go b/services/batch/2016-07-01.3.1/batch/computenode.go
deleted file mode 100644
index 337fba456d4a..000000000000
--- a/services/batch/2016-07-01.3.1/batch/computenode.go
+++ /dev/null
@@ -1,1117 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "net/http"
-)
-
-// ComputeNodeClient is the a client for issuing REST requests to the Azure Batch service.
-type ComputeNodeClient struct {
- BaseClient
-}
-
-// NewComputeNodeClient creates an instance of the ComputeNodeClient client.
-func NewComputeNodeClient() ComputeNodeClient {
- return NewComputeNodeClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewComputeNodeClientWithBaseURI creates an instance of the ComputeNodeClient client.
-func NewComputeNodeClientWithBaseURI(baseURI string) ComputeNodeClient {
- return ComputeNodeClient{NewWithBaseURI(baseURI)}
-}
-
-// AddUser you can add a user account to a node only when it is in the idle or running state.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the machine on which you want
-// to create a user account. userParameter is the user account to be created. timeout is the maximum time that the
-// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time.
-func (client ComputeNodeClient) AddUser(ctx context.Context, poolID string, nodeID string, userParameter ComputeNodeUser, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: userParameter,
- Constraints: []validation.Constraint{{Target: "userParameter.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.ComputeNodeClient", "AddUser", err.Error())
- }
-
- req, err := client.AddUserPreparer(ctx, poolID, nodeID, userParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddUserSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddUserResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddUserPreparer prepares the AddUser request.
-func (client ComputeNodeClient) AddUserPreparer(ctx context.Context, poolID string, nodeID string, userParameter ComputeNodeUser, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users", pathParameters),
- autorest.WithJSON(userParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddUserSender sends the AddUser request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) AddUserSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddUserResponder handles the response to the AddUser request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) AddUserResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// DeleteUser you can delete a user account to a node only when it is in the idle or running state.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the machine on which you want
-// to delete a user account. userName is the name of the user account to delete. timeout is the maximum time that
-// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time.
-func (client ComputeNodeClient) DeleteUser(ctx context.Context, poolID string, nodeID string, userName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeleteUserPreparer(ctx, poolID, nodeID, userName, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteUserSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteUserResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteUserPreparer prepares the DeleteUser request.
-func (client ComputeNodeClient) DeleteUserPreparer(ctx context.Context, poolID string, nodeID string, userName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- "userName": autorest.Encode("path", userName),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users/{userName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteUserSender sends the DeleteUser request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) DeleteUserSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteUserResponder handles the response to the DeleteUser request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) DeleteUserResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// DisableScheduling sends the disable scheduling request.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node on which you
-// want to disable task scheduling. nodeDisableSchedulingParameter is the parameters for the request. timeout is
-// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time.
-func (client ComputeNodeClient) DisableScheduling(ctx context.Context, poolID string, nodeID string, nodeDisableSchedulingParameter *NodeDisableSchedulingParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DisableSchedulingPreparer(ctx, poolID, nodeID, nodeDisableSchedulingParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DisableSchedulingSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", resp, "Failure sending request")
- return
- }
-
- result, err = client.DisableSchedulingResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DisableSchedulingPreparer prepares the DisableScheduling request.
-func (client ComputeNodeClient) DisableSchedulingPreparer(ctx context.Context, poolID string, nodeID string, nodeDisableSchedulingParameter *NodeDisableSchedulingParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/disablescheduling", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if nodeDisableSchedulingParameter != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(nodeDisableSchedulingParameter))
- }
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DisableSchedulingSender sends the DisableScheduling request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) DisableSchedulingSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DisableSchedulingResponder handles the response to the DisableScheduling request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) DisableSchedulingResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// EnableScheduling sends the enable scheduling request.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node on which you
-// want to enable task scheduling. timeout is the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a
-// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. If not specified, this header will be automatically populated with the current system clock time.
-func (client ComputeNodeClient) EnableScheduling(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.EnableSchedulingPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.EnableSchedulingSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", resp, "Failure sending request")
- return
- }
-
- result, err = client.EnableSchedulingResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", resp, "Failure responding to request")
- }
-
- return
-}
-
-// EnableSchedulingPreparer prepares the EnableScheduling request.
-func (client ComputeNodeClient) EnableSchedulingPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/enablescheduling", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// EnableSchedulingSender sends the EnableScheduling request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) EnableSchedulingSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// EnableSchedulingResponder handles the response to the EnableScheduling request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) EnableSchedulingResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get sends the get request.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that you want
-// to get information about. selectParameter is an OData $select clause. timeout is the maximum time that the
-// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time.
-func (client ComputeNodeClient) Get(ctx context.Context, poolID string, nodeID string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNode, err error) {
- req, err := client.GetPreparer(ctx, poolID, nodeID, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client ComputeNodeClient) GetPreparer(ctx context.Context, poolID string, nodeID string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) GetResponder(resp *http.Response) (result ComputeNode, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetRemoteDesktop before you can access a node by using the RDP file, you must create a user account on the node.
-// This API can only be invoked on pools created with the cloud service configuration property.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node for which you
-// want to get the Remote Desktop Protocol file. timeout is the maximum time that the server can spend processing
-// the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in
-// the form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. If not specified, this header will be automatically populated with the current
-// system clock time.
-func (client ComputeNodeClient) GetRemoteDesktop(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ReadCloser, err error) {
- req, err := client.GetRemoteDesktopPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetRemoteDesktopSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetRemoteDesktopResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetRemoteDesktopPreparer prepares the GetRemoteDesktop request.
-func (client ComputeNodeClient) GetRemoteDesktopPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/rdp", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetRemoteDesktopSender sends the GetRemoteDesktop request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) GetRemoteDesktopSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetRemoteDesktopResponder handles the response to the GetRemoteDesktop request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) GetRemoteDesktopResponder(resp *http.Response) (result ReadCloser, err error) {
- result.Value = &resp.Body
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK))
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetRemoteLoginSettings before you can remotely login to a node using the remote login settings, you must create a
-// user account on the node. This API can be invoked only on pools created with the virtual machine configuration
-// property.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node for which to
-// obtain the remote login settings. timeout is the maximum time that the server can spend processing the request,
-// in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of
-// a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. If not specified, this header will be automatically populated with the current system clock time.
-func (client ComputeNodeClient) GetRemoteLoginSettings(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeGetRemoteLoginSettingsResult, err error) {
- req, err := client.GetRemoteLoginSettingsPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteLoginSettings", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetRemoteLoginSettingsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteLoginSettings", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetRemoteLoginSettingsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteLoginSettings", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetRemoteLoginSettingsPreparer prepares the GetRemoteLoginSettings request.
-func (client ComputeNodeClient) GetRemoteLoginSettingsPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/remoteloginsettings", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetRemoteLoginSettingsSender sends the GetRemoteLoginSettings request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) GetRemoteLoginSettingsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetRemoteLoginSettingsResponder handles the response to the GetRemoteLoginSettings request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) GetRemoteLoginSettingsResponder(resp *http.Response) (result ComputeNodeGetRemoteLoginSettingsResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List sends the list request.
-//
-// poolID is the ID of the pool from which you want to list nodes. filter is an OData $filter clause..
-// selectParameter is an OData $select clause. maxResults is the maximum number of items to return in the response.
-// A maximum of 1000 nodes can be returned. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. If not specified, this header will be automatically populated with the current
-// system clock time.
-func (client ComputeNodeClient) List(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.ComputeNodeClient", "List", err.Error())
- }
-
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, poolID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.cnlr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", resp, "Failure sending request")
- return
- }
-
- result.cnlr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client ComputeNodeClient) ListPreparer(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) ListResponder(resp *http.Response) (result ComputeNodeListResult, 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 ComputeNodeClient) listNextResults(lastResults ComputeNodeListResult) (result ComputeNodeListResult, err error) {
- req, err := lastResults.computeNodeListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "listNextResults", 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.ComputeNodeClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client ComputeNodeClient) ListComplete(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeListResultIterator, err error) {
- result.page, err = client.List(ctx, poolID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// Reboot you can restart a node only if it is in an idle or running state.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that you want
-// to restart. nodeRebootParameter is the parameters for the request. timeout is the maximum time that the server
-// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated
-// request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time.
-func (client ComputeNodeClient) Reboot(ctx context.Context, poolID string, nodeID string, nodeRebootParameter *NodeRebootParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.RebootPreparer(ctx, poolID, nodeID, nodeRebootParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.RebootSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", resp, "Failure sending request")
- return
- }
-
- result, err = client.RebootResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", resp, "Failure responding to request")
- }
-
- return
-}
-
-// RebootPreparer prepares the Reboot request.
-func (client ComputeNodeClient) RebootPreparer(ctx context.Context, poolID string, nodeID string, nodeRebootParameter *NodeRebootParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/reboot", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if nodeRebootParameter != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(nodeRebootParameter))
- }
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// RebootSender sends the Reboot request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) RebootSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// RebootResponder handles the response to the Reboot request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) RebootResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Reimage you can reinstall the operating system on a node only if it is in an idle or running state. This API can be
-// invoked only on pools created with the cloud service configuration property.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that you want
-// to restart. nodeReimageParameter is the parameters for the request. timeout is the maximum time that the server
-// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated
-// request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time.
-func (client ComputeNodeClient) Reimage(ctx context.Context, poolID string, nodeID string, nodeReimageParameter *NodeReimageParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.ReimagePreparer(ctx, poolID, nodeID, nodeReimageParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ReimageSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", resp, "Failure sending request")
- return
- }
-
- result, err = client.ReimageResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ReimagePreparer prepares the Reimage request.
-func (client ComputeNodeClient) ReimagePreparer(ctx context.Context, poolID string, nodeID string, nodeReimageParameter *NodeReimageParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/reimage", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if nodeReimageParameter != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(nodeReimageParameter))
- }
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ReimageSender sends the Reimage request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) ReimageSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ReimageResponder handles the response to the Reimage request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// UpdateUser this operation replaces of all the updateable properties of the account. For example, if the expiryTime
-// element is not specified, the current value is replaced with the default value, not left unmodified. You can update
-// a user account on a node only when it is in the idle or running state.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the machine on which you want
-// to update a user account. userName is the name of the user account to update. nodeUpdateUserParameter is the
-// parameters for the request. timeout is the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a
-// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. If not specified, this header will be automatically populated with the current system clock time.
-func (client ComputeNodeClient) UpdateUser(ctx context.Context, poolID string, nodeID string, userName string, nodeUpdateUserParameter NodeUpdateUserParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.UpdateUserPreparer(ctx, poolID, nodeID, userName, nodeUpdateUserParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateUserSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateUserResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdateUserPreparer prepares the UpdateUser request.
-func (client ComputeNodeClient) UpdateUserPreparer(ctx context.Context, poolID string, nodeID string, userName string, nodeUpdateUserParameter NodeUpdateUserParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- "userName": autorest.Encode("path", userName),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users/{userName}", pathParameters),
- autorest.WithJSON(nodeUpdateUserParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateUserSender sends the UpdateUser request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) UpdateUserSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateUserResponder handles the response to the UpdateUser request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) UpdateUserResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff --git a/services/batch/2016-07-01.3.1/batch/file.go b/services/batch/2016-07-01.3.1/batch/file.go
deleted file mode 100644
index c4e3094c8ca8..000000000000
--- a/services/batch/2016-07-01.3.1/batch/file.go
+++ /dev/null
@@ -1,935 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "net/http"
-)
-
-// FileClient is the a client for issuing REST requests to the Azure Batch service.
-type FileClient struct {
- BaseClient
-}
-
-// NewFileClient creates an instance of the FileClient client.
-func NewFileClient() FileClient {
- return NewFileClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewFileClientWithBaseURI creates an instance of the FileClient client.
-func NewFileClientWithBaseURI(baseURI string) FileClient {
- return FileClient{NewWithBaseURI(baseURI)}
-}
-
-// DeleteFromComputeNode sends the delete from compute node request.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node from which you
-// want to delete the file. fileName is the path to the file that you want to delete. recursive is whether to
-// delete children of a directory. If the fileName parameter represents a directory instead of a file, you can set
-// recursive to true to delete the directory and all of the files and subdirectories in it. If recursive is false
-// then the directory must be empty or deletion will fail. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time.
-func (client FileClient) DeleteFromComputeNode(ctx context.Context, poolID string, nodeID string, fileName string, recursive *bool, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeleteFromComputeNodePreparer(ctx, poolID, nodeID, fileName, recursive, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteFromComputeNodeSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteFromComputeNodeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteFromComputeNodePreparer prepares the DeleteFromComputeNode request.
-func (client FileClient) DeleteFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, fileName string, recursive *bool, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "fileName": autorest.Encode("path", fileName),
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if recursive != nil {
- queryParameters["recursive"] = autorest.Encode("query", *recursive)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{fileName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteFromComputeNodeSender sends the DeleteFromComputeNode request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) DeleteFromComputeNodeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteFromComputeNodeResponder handles the response to the DeleteFromComputeNode request. The method always
-// closes the http.Response Body.
-func (client FileClient) DeleteFromComputeNodeResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// DeleteFromTask sends the delete from task request.
-//
-// jobID is the ID of the job that contains the task. taskID is the ID of the task whose file you want to delete.
-// fileName is the path to the task file that you want to delete. recursive is whether to delete children of a
-// directory. If the fileName parameter represents a directory instead of a file, you can set recursive to true to
-// delete the directory and all of the files and subdirectories in it. If recursive is false then the directory
-// must be empty or deletion will fail. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. If not specified, this header will be automatically populated with the current
-// system clock time.
-func (client FileClient) DeleteFromTask(ctx context.Context, jobID string, taskID string, fileName string, recursive *bool, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeleteFromTaskPreparer(ctx, jobID, taskID, fileName, recursive, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteFromTaskSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteFromTaskResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteFromTaskPreparer prepares the DeleteFromTask request.
-func (client FileClient) DeleteFromTaskPreparer(ctx context.Context, jobID string, taskID string, fileName string, recursive *bool, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "fileName": autorest.Encode("path", fileName),
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if recursive != nil {
- queryParameters["recursive"] = autorest.Encode("query", *recursive)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{fileName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteFromTaskSender sends the DeleteFromTask request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) DeleteFromTaskSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteFromTaskResponder handles the response to the DeleteFromTask request. The method always
-// closes the http.Response Body.
-func (client FileClient) DeleteFromTaskResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// GetFromComputeNode returns the content of the specified task file.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that contains
-// the file. fileName is the path to the task file that you want to get the content of. timeout is the maximum time
-// that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time. ocpRange is the byte range to be retrieved.
-// The default is to retrieve the entire file. The format is bytes=startRange-endRange. ifModifiedSince is specify
-// this header to perform the operation only if the resource has been modified since the specified date/time.
-// ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been modified
-// since the specified date/time.
-func (client FileClient) GetFromComputeNode(ctx context.Context, poolID string, nodeID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result ReadCloser, err error) {
- req, err := client.GetFromComputeNodePreparer(ctx, poolID, nodeID, fileName, timeout, clientRequestID, returnClientRequestID, ocpDate, ocpRange, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetFromComputeNodeSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetFromComputeNodeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetFromComputeNodePreparer prepares the GetFromComputeNode request.
-func (client FileClient) GetFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "fileName": autorest.Encode("path", fileName),
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{fileName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ocpRange) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-range", autorest.String(ocpRange)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetFromComputeNodeSender sends the GetFromComputeNode request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) GetFromComputeNodeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetFromComputeNodeResponder handles the response to the GetFromComputeNode request. The method always
-// closes the http.Response Body.
-func (client FileClient) GetFromComputeNodeResponder(resp *http.Response) (result ReadCloser, err error) {
- result.Value = &resp.Body
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK))
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetFromTask returns the content of the specified task file.
-//
-// jobID is the ID of the job that contains the task. taskID is the ID of the task whose file you want to retrieve.
-// fileName is the path to the task file that you want to get the content of. timeout is the maximum time that the
-// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time. ocpRange is the byte range to be retrieved.
-// The default is to retrieve the entire file. The format is bytes=startRange-endRange. ifModifiedSince is specify
-// this header to perform the operation only if the resource has been modified since the specified date/time.
-// ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been modified
-// since the specified date/time.
-func (client FileClient) GetFromTask(ctx context.Context, jobID string, taskID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result ReadCloser, err error) {
- req, err := client.GetFromTaskPreparer(ctx, jobID, taskID, fileName, timeout, clientRequestID, returnClientRequestID, ocpDate, ocpRange, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetFromTaskSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetFromTaskResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetFromTaskPreparer prepares the GetFromTask request.
-func (client FileClient) GetFromTaskPreparer(ctx context.Context, jobID string, taskID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "fileName": autorest.Encode("path", fileName),
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{fileName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ocpRange) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-range", autorest.String(ocpRange)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetFromTaskSender sends the GetFromTask request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) GetFromTaskSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetFromTaskResponder handles the response to the GetFromTask request. The method always
-// closes the http.Response Body.
-func (client FileClient) GetFromTaskResponder(resp *http.Response) (result ReadCloser, err error) {
- result.Value = &resp.Body
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK))
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetNodeFilePropertiesFromComputeNode gets the properties of the specified compute node file.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that contains
-// the file. fileName is the path to the compute node file that you want to get the properties of. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time. ifModifiedSince is specify this header to
-// perform the operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is
-// specify this header to perform the operation only if the resource has not been modified since the specified
-// date/time.
-func (client FileClient) GetNodeFilePropertiesFromComputeNode(ctx context.Context, poolID string, nodeID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.GetNodeFilePropertiesFromComputeNodePreparer(ctx, poolID, nodeID, fileName, timeout, clientRequestID, returnClientRequestID, ocpDate, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromComputeNode", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetNodeFilePropertiesFromComputeNodeSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromComputeNode", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetNodeFilePropertiesFromComputeNodeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromComputeNode", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetNodeFilePropertiesFromComputeNodePreparer prepares the GetNodeFilePropertiesFromComputeNode request.
-func (client FileClient) GetNodeFilePropertiesFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "fileName": autorest.Encode("path", fileName),
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsHead(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{fileName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetNodeFilePropertiesFromComputeNodeSender sends the GetNodeFilePropertiesFromComputeNode request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) GetNodeFilePropertiesFromComputeNodeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetNodeFilePropertiesFromComputeNodeResponder handles the response to the GetNodeFilePropertiesFromComputeNode request. The method always
-// closes the http.Response Body.
-func (client FileClient) GetNodeFilePropertiesFromComputeNodeResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// GetNodeFilePropertiesFromTask gets the properties of the specified task file.
-//
-// jobID is the ID of the job that contains the task. taskID is the ID of the task whose file you want to get the
-// properties of. fileName is the path to the task file that you want to get the properties of. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time. ifModifiedSince is specify this header to
-// perform the operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is
-// specify this header to perform the operation only if the resource has not been modified since the specified
-// date/time.
-func (client FileClient) GetNodeFilePropertiesFromTask(ctx context.Context, jobID string, taskID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.GetNodeFilePropertiesFromTaskPreparer(ctx, jobID, taskID, fileName, timeout, clientRequestID, returnClientRequestID, ocpDate, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromTask", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetNodeFilePropertiesFromTaskSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromTask", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetNodeFilePropertiesFromTaskResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetNodeFilePropertiesFromTask", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetNodeFilePropertiesFromTaskPreparer prepares the GetNodeFilePropertiesFromTask request.
-func (client FileClient) GetNodeFilePropertiesFromTaskPreparer(ctx context.Context, jobID string, taskID string, fileName string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "fileName": autorest.Encode("path", fileName),
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsHead(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{fileName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetNodeFilePropertiesFromTaskSender sends the GetNodeFilePropertiesFromTask request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) GetNodeFilePropertiesFromTaskSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetNodeFilePropertiesFromTaskResponder handles the response to the GetNodeFilePropertiesFromTask request. The method always
-// closes the http.Response Body.
-func (client FileClient) GetNodeFilePropertiesFromTaskResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// ListFromComputeNode sends the list from compute node request.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node whose files
-// you want to list. filter is an OData $filter clause. recursive is whether to list children of a directory.
-// maxResults is the maximum number of items to return in the response. A maximum of 1000 files can be returned.
-// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30
-// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such
-// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should
-// return the client-request-id in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client FileClient) ListFromComputeNode(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.FileClient", "ListFromComputeNode", err.Error())
- }
-
- result.fn = client.listFromComputeNodeNextResults
- req, err := client.ListFromComputeNodePreparer(ctx, poolID, nodeID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListFromComputeNodeSender(req)
- if err != nil {
- result.nflr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", resp, "Failure sending request")
- return
- }
-
- result.nflr, err = client.ListFromComputeNodeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListFromComputeNodePreparer prepares the ListFromComputeNode request.
-func (client FileClient) ListFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if recursive != nil {
- queryParameters["recursive"] = autorest.Encode("query", *recursive)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListFromComputeNodeSender sends the ListFromComputeNode request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) ListFromComputeNodeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListFromComputeNodeResponder handles the response to the ListFromComputeNode request. The method always
-// closes the http.Response Body.
-func (client FileClient) ListFromComputeNodeResponder(resp *http.Response) (result NodeFileListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listFromComputeNodeNextResults retrieves the next set of results, if any.
-func (client FileClient) listFromComputeNodeNextResults(lastResults NodeFileListResult) (result NodeFileListResult, err error) {
- req, err := lastResults.nodeFileListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListFromComputeNodeSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListFromComputeNodeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListFromComputeNodeComplete enumerates all values, automatically crossing page boundaries as required.
-func (client FileClient) ListFromComputeNodeComplete(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultIterator, err error) {
- result.page, err = client.ListFromComputeNode(ctx, poolID, nodeID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// ListFromTask sends the list from task request.
-//
-// jobID is the ID of the job that contains the task. taskID is the ID of the task whose files you want to list.
-// filter is an OData $filter clause. recursive is whether to list children of a directory. This parameter can be
-// used in combination with the filter parameter to list specific type of files. maxResults is the maximum number
-// of items to return in the response. A maximum of 1000 files can be returned. timeout is the maximum time that
-// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time.
-func (client FileClient) ListFromTask(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.FileClient", "ListFromTask", err.Error())
- }
-
- result.fn = client.listFromTaskNextResults
- req, err := client.ListFromTaskPreparer(ctx, jobID, taskID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListFromTaskSender(req)
- if err != nil {
- result.nflr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", resp, "Failure sending request")
- return
- }
-
- result.nflr, err = client.ListFromTaskResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListFromTaskPreparer prepares the ListFromTask request.
-func (client FileClient) ListFromTaskPreparer(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if recursive != nil {
- queryParameters["recursive"] = autorest.Encode("query", *recursive)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListFromTaskSender sends the ListFromTask request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) ListFromTaskSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListFromTaskResponder handles the response to the ListFromTask request. The method always
-// closes the http.Response Body.
-func (client FileClient) ListFromTaskResponder(resp *http.Response) (result NodeFileListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listFromTaskNextResults retrieves the next set of results, if any.
-func (client FileClient) listFromTaskNextResults(lastResults NodeFileListResult) (result NodeFileListResult, err error) {
- req, err := lastResults.nodeFileListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListFromTaskSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListFromTaskResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListFromTaskComplete enumerates all values, automatically crossing page boundaries as required.
-func (client FileClient) ListFromTaskComplete(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultIterator, err error) {
- result.page, err = client.ListFromTask(ctx, jobID, taskID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
diff --git a/services/batch/2016-07-01.3.1/batch/job.go b/services/batch/2016-07-01.3.1/batch/job.go
deleted file mode 100644
index 2a1f5f5c3631..000000000000
--- a/services/batch/2016-07-01.3.1/batch/job.go
+++ /dev/null
@@ -1,1489 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "net/http"
-)
-
-// JobClient is the a client for issuing REST requests to the Azure Batch service.
-type JobClient struct {
- BaseClient
-}
-
-// NewJobClient creates an instance of the JobClient client.
-func NewJobClient() JobClient {
- return NewJobClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewJobClientWithBaseURI creates an instance of the JobClient client.
-func NewJobClientWithBaseURI(baseURI string) JobClient {
- return JobClient{NewWithBaseURI(baseURI)}
-}
-
-// Add the Batch service supports two ways to control the work done as part of a job. In the first approach, the user
-// specifies a Job Manager task. The Batch service launches this task when it is ready to start the job. The Job
-// Manager task controls all other tasks that run under this job, by using the Task APIs. In the second approach, the
-// user directly controls the execution of tasks under an active job, by using the Task APIs. Also note: when naming
-// jobs, avoid including sensitive information such as user names or secret project names. This information may appear
-// in telemetry logs accessible to Microsoft Support engineers.
-//
-// job is the job to be added. timeout is the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a
-// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. If not specified, this header will be automatically populated with the current system clock time.
-func (client JobClient) Add(ctx context.Context, job JobAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: job,
- Constraints: []validation.Constraint{{Target: "job.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.JobManagerTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.JobManagerTask.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.JobManagerTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "job.JobPreparationTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.JobPreparationTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "job.JobReleaseTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.JobReleaseTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "job.PoolInfo", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.VMSize", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.StartTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}},
- }},
- }},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobClient", "Add", err.Error())
- }
-
- req, err := client.AddPreparer(ctx, job, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPreparer prepares the Add request.
-func (client JobClient) AddPreparer(ctx context.Context, job JobAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/jobs"),
- autorest.WithJSON(job),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSender sends the Add request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) AddSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddResponder handles the response to the Add request. The method always
-// closes the http.Response Body.
-func (client JobClient) AddResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Delete deleting a job also deletes all tasks that are part of that job, and all job statistics. This also overrides
-// the retention period for task data; that is, if the job contains tasks which are still retained on compute nodes,
-// the Batch services deletes those tasks' working directories and all their contents.
-//
-// jobID is the ID of the job to delete. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. If not specified, this header will be automatically populated with the current
-// system clock time. ifMatch is an ETag is specified. Specify this header to perform the operation only if the
-// resource's ETag is an exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to
-// perform the operation only if the resource's ETag does not match the specified ETag. ifModifiedSince is specify
-// this header to perform the operation only if the resource has been modified since the specified date/time.
-// ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been modified
-// since the specified date/time.
-func (client JobClient) Delete(ctx context.Context, jobID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeletePreparer(ctx, jobID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client JobClient) DeletePreparer(ctx context.Context, jobID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client JobClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Disable the Batch Service immediately moves the job to the disabling state. Batch then uses the disableTasks
-// parameter to determine what to do with the currently running tasks of the job. The job remains in the disabling
-// state until the disable operation is completed and all tasks have been dealt with according to the disableTasks
-// option; the job then moves to the disabled state. No new tasks are started under the job until it moves back to
-// active state. If you try to disable a job that is in any state other than active, disabling, or disabled, the
-// request fails with status code 409.
-//
-// jobID is the ID of the job to disable. jobDisableParameter is the parameters for the request. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time. ifMatch is an ETag is specified. Specify
-// this header to perform the operation only if the resource's ETag is an exact match as specified. ifNoneMatch is
-// an ETag is specified. Specify this header to perform the operation only if the resource's ETag does not match
-// the specified ETag. ifModifiedSince is specify this header to perform the operation only if the resource has
-// been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform the operation
-// only if the resource has not been modified since the specified date/time.
-func (client JobClient) Disable(ctx context.Context, jobID string, jobDisableParameter JobDisableParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DisablePreparer(ctx, jobID, jobDisableParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DisableSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", resp, "Failure sending request")
- return
- }
-
- result, err = client.DisableResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DisablePreparer prepares the Disable request.
-func (client JobClient) DisablePreparer(ctx context.Context, jobID string, jobDisableParameter JobDisableParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/disable", pathParameters),
- autorest.WithJSON(jobDisableParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DisableSender sends the Disable request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) DisableSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DisableResponder handles the response to the Disable request. The method always
-// closes the http.Response Body.
-func (client JobClient) DisableResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Enable when you call this API, the Batch service sets a disabled job to the enabling state. After the this operation
-// is completed, the job moves to the active state, and scheduling of new tasks under the job resumes. The Batch
-// service does not allow a task to remain in the active state for more than 7 days. Therefore, if you enable a job
-// containing active tasks which were added more than 7 days ago, those tasks will not run.
-//
-// jobID is the ID of the job to enable. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. If not specified, this header will be automatically populated with the current
-// system clock time. ifMatch is an ETag is specified. Specify this header to perform the operation only if the
-// resource's ETag is an exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to
-// perform the operation only if the resource's ETag does not match the specified ETag. ifModifiedSince is specify
-// this header to perform the operation only if the resource has been modified since the specified date/time.
-// ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been modified
-// since the specified date/time.
-func (client JobClient) Enable(ctx context.Context, jobID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.EnablePreparer(ctx, jobID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.EnableSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", resp, "Failure sending request")
- return
- }
-
- result, err = client.EnableResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", resp, "Failure responding to request")
- }
-
- return
-}
-
-// EnablePreparer prepares the Enable request.
-func (client JobClient) EnablePreparer(ctx context.Context, jobID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/enable", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// EnableSender sends the Enable request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) EnableSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// EnableResponder handles the response to the Enable request. The method always
-// closes the http.Response Body.
-func (client JobClient) EnableResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get sends the get request.
-//
-// jobID is the ID of the job. selectParameter is an OData $select clause. expand is an OData $expand clause.
-// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30
-// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such
-// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should
-// return the client-request-id in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time. ifMatch is an ETag is specified.
-// Specify this header to perform the operation only if the resource's ETag is an exact match as specified.
-// ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag
-// does not match the specified ETag. ifModifiedSince is specify this header to perform the operation only if the
-// resource has been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform
-// the operation only if the resource has not been modified since the specified date/time.
-func (client JobClient) Get(ctx context.Context, jobID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudJob, err error) {
- req, err := client.GetPreparer(ctx, jobID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client JobClient) GetPreparer(ctx context.Context, jobID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client JobClient) GetResponder(resp *http.Response) (result CloudJob, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetAllJobsLifetimeStatistics statistics are aggregated across all jobs that have ever existed in the account, from
-// account creation to the last update time of the statistics.
-//
-// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30
-// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such
-// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should
-// return the client-request-id in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client JobClient) GetAllJobsLifetimeStatistics(ctx context.Context, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result JobStatistics, err error) {
- req, err := client.GetAllJobsLifetimeStatisticsPreparer(ctx, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllJobsLifetimeStatistics", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetAllJobsLifetimeStatisticsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllJobsLifetimeStatistics", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetAllJobsLifetimeStatisticsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllJobsLifetimeStatistics", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetAllJobsLifetimeStatisticsPreparer prepares the GetAllJobsLifetimeStatistics request.
-func (client JobClient) GetAllJobsLifetimeStatisticsPreparer(ctx context.Context, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/lifetimejobstats"),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetAllJobsLifetimeStatisticsSender sends the GetAllJobsLifetimeStatistics request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) GetAllJobsLifetimeStatisticsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetAllJobsLifetimeStatisticsResponder handles the response to the GetAllJobsLifetimeStatistics request. The method always
-// closes the http.Response Body.
-func (client JobClient) GetAllJobsLifetimeStatisticsResponder(resp *http.Response) (result JobStatistics, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List sends the list request.
-//
-// filter is an OData $filter clause. selectParameter is an OData $select clause. expand is an OData $expand
-// clause. maxResults is the maximum number of items to return in the response. A maximum of 1000 jobs can be
-// returned. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. If not
-// specified, this header will be automatically populated with the current system clock time.
-func (client JobClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobClient", "List", err.Error())
- }
-
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.cjlr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobClient", "List", resp, "Failure sending request")
- return
- }
-
- result.cjlr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client JobClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/jobs"),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client JobClient) ListResponder(resp *http.Response) (result CloudJobListResult, 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 JobClient) listNextResults(lastResults CloudJobListResult) (result CloudJobListResult, err error) {
- req, err := lastResults.cloudJobListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.JobClient", "listNextResults", 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.JobClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client JobClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultIterator, err error) {
- result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// ListFromJobSchedule sends the list from job schedule request.
-//
-// jobScheduleID is the ID of the job schedule from which you want to get a list of jobs. filter is an OData
-// $filter clause. selectParameter is an OData $select clause. expand is an OData $expand clause. maxResults is the
-// maximum number of items to return in the response. A maximum of 1000 jobs can be returned. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time.
-func (client JobClient) ListFromJobSchedule(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobClient", "ListFromJobSchedule", err.Error())
- }
-
- result.fn = client.listFromJobScheduleNextResults
- req, err := client.ListFromJobSchedulePreparer(ctx, jobScheduleID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListFromJobScheduleSender(req)
- if err != nil {
- result.cjlr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", resp, "Failure sending request")
- return
- }
-
- result.cjlr, err = client.ListFromJobScheduleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListFromJobSchedulePreparer prepares the ListFromJobSchedule request.
-func (client JobClient) ListFromJobSchedulePreparer(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}/jobs", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListFromJobScheduleSender sends the ListFromJobSchedule request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) ListFromJobScheduleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListFromJobScheduleResponder handles the response to the ListFromJobSchedule request. The method always
-// closes the http.Response Body.
-func (client JobClient) ListFromJobScheduleResponder(resp *http.Response) (result CloudJobListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listFromJobScheduleNextResults retrieves the next set of results, if any.
-func (client JobClient) listFromJobScheduleNextResults(lastResults CloudJobListResult) (result CloudJobListResult, err error) {
- req, err := lastResults.cloudJobListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListFromJobScheduleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListFromJobScheduleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListFromJobScheduleComplete enumerates all values, automatically crossing page boundaries as required.
-func (client JobClient) ListFromJobScheduleComplete(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultIterator, err error) {
- result.page, err = client.ListFromJobSchedule(ctx, jobScheduleID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// ListPreparationAndReleaseTaskStatus this API returns the Job Preparation and Job Release task status on all compute
-// nodes that have run the Job Preparation or Job Release task. This includes nodes which have since been removed from
-// the pool.
-//
-// jobID is the ID of the job. filter is an OData $filter clause. selectParameter is an OData $select clause.
-// maxResults is the maximum number of items to return in the response. A maximum of 1000 tasks can be returned.
-// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30
-// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such
-// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should
-// return the client-request-id in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client JobClient) ListPreparationAndReleaseTaskStatus(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListPreparationAndReleaseTaskStatusResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobClient", "ListPreparationAndReleaseTaskStatus", err.Error())
- }
-
- result.fn = client.listPreparationAndReleaseTaskStatusNextResults
- req, err := client.ListPreparationAndReleaseTaskStatusPreparer(ctx, jobID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListPreparationAndReleaseTaskStatusSender(req)
- if err != nil {
- result.cjlpartsr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", resp, "Failure sending request")
- return
- }
-
- result.cjlpartsr, err = client.ListPreparationAndReleaseTaskStatusResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparationAndReleaseTaskStatusPreparer prepares the ListPreparationAndReleaseTaskStatus request.
-func (client JobClient) ListPreparationAndReleaseTaskStatusPreparer(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/jobpreparationandreleasetaskstatus", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListPreparationAndReleaseTaskStatusSender sends the ListPreparationAndReleaseTaskStatus request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) ListPreparationAndReleaseTaskStatusSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListPreparationAndReleaseTaskStatusResponder handles the response to the ListPreparationAndReleaseTaskStatus request. The method always
-// closes the http.Response Body.
-func (client JobClient) ListPreparationAndReleaseTaskStatusResponder(resp *http.Response) (result CloudJobListPreparationAndReleaseTaskStatusResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listPreparationAndReleaseTaskStatusNextResults retrieves the next set of results, if any.
-func (client JobClient) listPreparationAndReleaseTaskStatusNextResults(lastResults CloudJobListPreparationAndReleaseTaskStatusResult) (result CloudJobListPreparationAndReleaseTaskStatusResult, err error) {
- req, err := lastResults.cloudJobListPreparationAndReleaseTaskStatusResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListPreparationAndReleaseTaskStatusSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListPreparationAndReleaseTaskStatusResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListPreparationAndReleaseTaskStatusComplete enumerates all values, automatically crossing page boundaries as required.
-func (client JobClient) ListPreparationAndReleaseTaskStatusComplete(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListPreparationAndReleaseTaskStatusResultIterator, err error) {
- result.page, err = client.ListPreparationAndReleaseTaskStatus(ctx, jobID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// Patch this replaces only the job properties specified in the request. For example, if the job has constraints, and a
-// request does not specify the constraints element, then the job keeps the existing constraints.
-//
-// jobID is the ID of the job whose properties you want to update. jobPatchParameter is the parameters for the
-// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. If not
-// specified, this header will be automatically populated with the current system clock time. ifMatch is an ETag is
-// specified. Specify this header to perform the operation only if the resource's ETag is an exact match as
-// specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the
-// resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the
-// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify
-// this header to perform the operation only if the resource has not been modified since the specified date/time.
-func (client JobClient) Patch(ctx context.Context, jobID string, jobPatchParameter JobPatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.PatchPreparer(ctx, jobID, jobPatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.PatchSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", resp, "Failure sending request")
- return
- }
-
- result, err = client.PatchResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", resp, "Failure responding to request")
- }
-
- return
-}
-
-// PatchPreparer prepares the Patch request.
-func (client JobClient) PatchPreparer(ctx context.Context, jobID string, jobPatchParameter JobPatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPatch(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}", pathParameters),
- autorest.WithJSON(jobPatchParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// PatchSender sends the Patch request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) PatchSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// PatchResponder handles the response to the Patch request. The method always
-// closes the http.Response Body.
-func (client JobClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Terminate when a Terminate Job request is received, the Batch service sets the job to the terminating state. The
-// Batch service then terminates any active or running tasks associated with the job, and runs any required Job Release
-// tasks. The job then moves into the completed state.
-//
-// jobID is the ID of the job to terminate. jobTerminateParameter is the parameters for the request. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time. ifMatch is an ETag is specified. Specify
-// this header to perform the operation only if the resource's ETag is an exact match as specified. ifNoneMatch is
-// an ETag is specified. Specify this header to perform the operation only if the resource's ETag does not match
-// the specified ETag. ifModifiedSince is specify this header to perform the operation only if the resource has
-// been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform the operation
-// only if the resource has not been modified since the specified date/time.
-func (client JobClient) Terminate(ctx context.Context, jobID string, jobTerminateParameter *JobTerminateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.TerminatePreparer(ctx, jobID, jobTerminateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.TerminateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", resp, "Failure sending request")
- return
- }
-
- result, err = client.TerminateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", resp, "Failure responding to request")
- }
-
- return
-}
-
-// TerminatePreparer prepares the Terminate request.
-func (client JobClient) TerminatePreparer(ctx context.Context, jobID string, jobTerminateParameter *JobTerminateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/terminate", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if jobTerminateParameter != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(jobTerminateParameter))
- }
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// TerminateSender sends the Terminate request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) TerminateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// TerminateResponder handles the response to the Terminate request. The method always
-// closes the http.Response Body.
-func (client JobClient) TerminateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Update this fully replaces all the updateable properties of the job. For example, if the job has constraints
-// associated with it and if constraints is not specified with this request, then the Batch service will remove the
-// existing constraints.
-//
-// jobID is the ID of the job whose properties you want to update. jobUpdateParameter is the parameters for the
-// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. If not
-// specified, this header will be automatically populated with the current system clock time. ifMatch is an ETag is
-// specified. Specify this header to perform the operation only if the resource's ETag is an exact match as
-// specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the
-// resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the
-// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify
-// this header to perform the operation only if the resource has not been modified since the specified date/time.
-func (client JobClient) Update(ctx context.Context, jobID string, jobUpdateParameter JobUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: jobUpdateParameter,
- Constraints: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VMSize", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.StartTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}},
- }},
- }},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobClient", "Update", err.Error())
- }
-
- req, err := client.UpdatePreparer(ctx, jobID, jobUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePreparer prepares the Update request.
-func (client JobClient) UpdatePreparer(ctx context.Context, jobID string, jobUpdateParameter JobUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}", pathParameters),
- autorest.WithJSON(jobUpdateParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSender sends the Update request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) UpdateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateResponder handles the response to the Update request. The method always
-// closes the http.Response Body.
-func (client JobClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff --git a/services/batch/2016-07-01.3.1/batch/jobschedule.go b/services/batch/2016-07-01.3.1/batch/jobschedule.go
deleted file mode 100644
index 11f64efc865e..000000000000
--- a/services/batch/2016-07-01.3.1/batch/jobschedule.go
+++ /dev/null
@@ -1,1228 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "net/http"
-)
-
-// JobScheduleClient is the a client for issuing REST requests to the Azure Batch service.
-type JobScheduleClient struct {
- BaseClient
-}
-
-// NewJobScheduleClient creates an instance of the JobScheduleClient client.
-func NewJobScheduleClient() JobScheduleClient {
- return NewJobScheduleClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewJobScheduleClientWithBaseURI creates an instance of the JobScheduleClient client.
-func NewJobScheduleClientWithBaseURI(baseURI string) JobScheduleClient {
- return JobScheduleClient{NewWithBaseURI(baseURI)}
-}
-
-// Add sends the add request.
-//
-// cloudJobSchedule is the job schedule to be added. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time.
-func (client JobScheduleClient) Add(ctx context.Context, cloudJobSchedule JobScheduleAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: cloudJobSchedule,
- Constraints: []validation.Constraint{{Target: "cloudJobSchedule.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.Schedule", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobManagerTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobManagerTask.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification.JobManagerTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "cloudJobSchedule.JobSpecification.JobPreparationTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobPreparationTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "cloudJobSchedule.JobSpecification.JobReleaseTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobReleaseTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VMSize", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}},
- }},
- }},
- }},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobScheduleClient", "Add", err.Error())
- }
-
- req, err := client.AddPreparer(ctx, cloudJobSchedule, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPreparer prepares the Add request.
-func (client JobScheduleClient) AddPreparer(ctx context.Context, cloudJobSchedule JobScheduleAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/jobschedules"),
- autorest.WithJSON(cloudJobSchedule),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSender sends the Add request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) AddSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddResponder handles the response to the Add request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) AddResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Delete when you delete a job schedule, this also deletes all jobs and tasks under that schedule. When tasks are
-// deleted, all the files in their working directories on the compute nodes are also deleted (the retention period is
-// ignored). The job schedule statistics are no longer accessible once the job schedule is deleted, though they are
-// still counted towards account lifetime statistics.
-//
-// jobScheduleID is the ID of the job schedule to delete. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time. ifMatch is an ETag is specified. Specify
-// this header to perform the operation only if the resource's ETag is an exact match as specified. ifNoneMatch is
-// an ETag is specified. Specify this header to perform the operation only if the resource's ETag does not match
-// the specified ETag. ifModifiedSince is specify this header to perform the operation only if the resource has
-// been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform the operation
-// only if the resource has not been modified since the specified date/time.
-func (client JobScheduleClient) Delete(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeletePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client JobScheduleClient) DeletePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Disable no new jobs will be created until the job schedule is enabled again.
-//
-// jobScheduleID is the ID of the job schedule to disable. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time. ifMatch is an ETag is specified. Specify
-// this header to perform the operation only if the resource's ETag is an exact match as specified. ifNoneMatch is
-// an ETag is specified. Specify this header to perform the operation only if the resource's ETag does not match
-// the specified ETag. ifModifiedSince is specify this header to perform the operation only if the resource has
-// been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform the operation
-// only if the resource has not been modified since the specified date/time.
-func (client JobScheduleClient) Disable(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DisablePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DisableSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", resp, "Failure sending request")
- return
- }
-
- result, err = client.DisableResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DisablePreparer prepares the Disable request.
-func (client JobScheduleClient) DisablePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}/disable", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DisableSender sends the Disable request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) DisableSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DisableResponder handles the response to the Disable request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) DisableResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Enable sends the enable request.
-//
-// jobScheduleID is the ID of the job schedule to enable. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time. ifMatch is an ETag is specified. Specify
-// this header to perform the operation only if the resource's ETag is an exact match as specified. ifNoneMatch is
-// an ETag is specified. Specify this header to perform the operation only if the resource's ETag does not match
-// the specified ETag. ifModifiedSince is specify this header to perform the operation only if the resource has
-// been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform the operation
-// only if the resource has not been modified since the specified date/time.
-func (client JobScheduleClient) Enable(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.EnablePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.EnableSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", resp, "Failure sending request")
- return
- }
-
- result, err = client.EnableResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", resp, "Failure responding to request")
- }
-
- return
-}
-
-// EnablePreparer prepares the Enable request.
-func (client JobScheduleClient) EnablePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}/enable", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// EnableSender sends the Enable request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) EnableSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// EnableResponder handles the response to the Enable request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) EnableResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Exists sends the exists request.
-//
-// jobScheduleID is the ID of the job schedule which you want to check. timeout is the maximum time that the server
-// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated
-// request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time. ifMatch is an ETag is specified. Specify
-// this header to perform the operation only if the resource's ETag is an exact match as specified. ifNoneMatch is
-// an ETag is specified. Specify this header to perform the operation only if the resource's ETag does not match
-// the specified ETag. ifModifiedSince is specify this header to perform the operation only if the resource has
-// been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform the operation
-// only if the resource has not been modified since the specified date/time.
-func (client JobScheduleClient) Exists(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.ExistsPreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ExistsSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", resp, "Failure sending request")
- return
- }
-
- result, err = client.ExistsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ExistsPreparer prepares the Exists request.
-func (client JobScheduleClient) ExistsPreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsHead(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ExistsSender sends the Exists request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) ExistsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ExistsResponder handles the response to the Exists request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) ExistsResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get gets information about the specified job schedule.
-//
-// jobScheduleID is the ID of the job schedule to get. selectParameter is an OData $select clause. expand is an
-// OData $expand clause. timeout is the maximum time that the server can spend processing the request, in seconds.
-// The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with
-// no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether
-// the server should return the client-request-id in the response. ocpDate is the time the request was issued. If
-// not specified, this header will be automatically populated with the current system clock time. ifMatch is an
-// ETag is specified. Specify this header to perform the operation only if the resource's ETag is an exact match as
-// specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the
-// resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the
-// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify
-// this header to perform the operation only if the resource has not been modified since the specified date/time.
-func (client JobScheduleClient) Get(ctx context.Context, jobScheduleID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudJobSchedule, err error) {
- req, err := client.GetPreparer(ctx, jobScheduleID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client JobScheduleClient) GetPreparer(ctx context.Context, jobScheduleID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) GetResponder(resp *http.Response) (result CloudJobSchedule, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List sends the list request.
-//
-// filter is an OData $filter clause. selectParameter is an OData $select clause. expand is an OData $expand
-// clause. maxResults is the maximum number of items to return in the response. A maximum of 1000 job schedules can
-// be returned. timeout is the maximum time that the server can spend processing the request, in seconds. The
-// default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. If not
-// specified, this header will be automatically populated with the current system clock time.
-func (client JobScheduleClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobScheduleListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobScheduleClient", "List", err.Error())
- }
-
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.cjslr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", resp, "Failure sending request")
- return
- }
-
- result.cjslr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client JobScheduleClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/jobschedules"),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) ListResponder(resp *http.Response) (result CloudJobScheduleListResult, 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 JobScheduleClient) listNextResults(lastResults CloudJobScheduleListResult) (result CloudJobScheduleListResult, err error) {
- req, err := lastResults.cloudJobScheduleListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.JobScheduleClient", "listNextResults", 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.JobScheduleClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client JobScheduleClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobScheduleListResultIterator, err error) {
- result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// Patch this replaces only the job schedule properties specified in the request. For example, if the schedule property
-// is not specified with this request, then the Batch service will keep the existing schedule. Changes to a job
-// schedule only impact jobs created by the schedule after the update has taken place; currently running jobs are
-// unaffected.
-//
-// jobScheduleID is the ID of the job schedule to update. jobSchedulePatchParameter is the parameters for the
-// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. If not
-// specified, this header will be automatically populated with the current system clock time. ifMatch is an ETag is
-// specified. Specify this header to perform the operation only if the resource's ETag is an exact match as
-// specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the
-// resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the
-// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify
-// this header to perform the operation only if the resource has not been modified since the specified date/time.
-func (client JobScheduleClient) Patch(ctx context.Context, jobScheduleID string, jobSchedulePatchParameter JobSchedulePatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.PatchPreparer(ctx, jobScheduleID, jobSchedulePatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.PatchSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", resp, "Failure sending request")
- return
- }
-
- result, err = client.PatchResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", resp, "Failure responding to request")
- }
-
- return
-}
-
-// PatchPreparer prepares the Patch request.
-func (client JobScheduleClient) PatchPreparer(ctx context.Context, jobScheduleID string, jobSchedulePatchParameter JobSchedulePatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPatch(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters),
- autorest.WithJSON(jobSchedulePatchParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// PatchSender sends the Patch request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) PatchSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// PatchResponder handles the response to the Patch request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Terminate sends the terminate request.
-//
-// jobScheduleID is the ID of the job schedule to terminates. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time. ifMatch is an ETag is specified. Specify
-// this header to perform the operation only if the resource's ETag is an exact match as specified. ifNoneMatch is
-// an ETag is specified. Specify this header to perform the operation only if the resource's ETag does not match
-// the specified ETag. ifModifiedSince is specify this header to perform the operation only if the resource has
-// been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform the operation
-// only if the resource has not been modified since the specified date/time.
-func (client JobScheduleClient) Terminate(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.TerminatePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.TerminateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", resp, "Failure sending request")
- return
- }
-
- result, err = client.TerminateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", resp, "Failure responding to request")
- }
-
- return
-}
-
-// TerminatePreparer prepares the Terminate request.
-func (client JobScheduleClient) TerminatePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}/terminate", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// TerminateSender sends the Terminate request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) TerminateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// TerminateResponder handles the response to the Terminate request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) TerminateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Update this fully replaces all the updateable properties of the job schedule. For example, if the schedule property
-// is not specified with this request, then the Batch service will remove the existing schedule. Changes to a job
-// schedule only impact jobs created by the schedule after the update has taken place; currently running jobs are
-// unaffected.
-//
-// jobScheduleID is the ID of the job schedule to update. jobScheduleUpdateParameter is the parameters for the
-// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. If not
-// specified, this header will be automatically populated with the current system clock time. ifMatch is an ETag is
-// specified. Specify this header to perform the operation only if the resource's ETag is an exact match as
-// specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the
-// resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the
-// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify
-// this header to perform the operation only if the resource has not been modified since the specified date/time.
-func (client JobScheduleClient) Update(ctx context.Context, jobScheduleID string, jobScheduleUpdateParameter JobScheduleUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: jobScheduleUpdateParameter,
- Constraints: []validation.Constraint{{Target: "jobScheduleUpdateParameter.Schedule", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "jobScheduleUpdateParameter.JobSpecification.JobPreparationTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobPreparationTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "jobScheduleUpdateParameter.JobSpecification.JobReleaseTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobReleaseTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VMSize", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}},
- }},
- }},
- }},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobScheduleClient", "Update", err.Error())
- }
-
- req, err := client.UpdatePreparer(ctx, jobScheduleID, jobScheduleUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePreparer prepares the Update request.
-func (client JobScheduleClient) UpdatePreparer(ctx context.Context, jobScheduleID string, jobScheduleUpdateParameter JobScheduleUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters),
- autorest.WithJSON(jobScheduleUpdateParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSender sends the Update request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) UpdateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateResponder handles the response to the Update request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff --git a/services/batch/2016-07-01.3.1/batch/models.go b/services/batch/2016-07-01.3.1/batch/models.go
deleted file mode 100644
index c7ca9252c86f..000000000000
--- a/services/batch/2016-07-01.3.1/batch/models.go
+++ /dev/null
@@ -1,2839 +0,0 @@
-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/date"
- "github.com/Azure/go-autorest/autorest/to"
- "io"
- "net/http"
-)
-
-// AllocationState enumerates the values for allocation state.
-type AllocationState string
-
-const (
- // Resizing ...
- Resizing AllocationState = "resizing"
- // Steady ...
- Steady AllocationState = "steady"
- // Stopping ...
- Stopping AllocationState = "stopping"
-)
-
-// PossibleAllocationStateValues returns an array of possible values for the AllocationState const type.
-func PossibleAllocationStateValues() []AllocationState {
- return []AllocationState{Resizing, Steady, Stopping}
-}
-
-// CertificateFormat enumerates the values for certificate format.
-type CertificateFormat string
-
-const (
- // Cer ...
- Cer CertificateFormat = "cer"
- // Pfx ...
- Pfx CertificateFormat = "pfx"
- // Unmapped ...
- Unmapped CertificateFormat = "unmapped"
-)
-
-// PossibleCertificateFormatValues returns an array of possible values for the CertificateFormat const type.
-func PossibleCertificateFormatValues() []CertificateFormat {
- return []CertificateFormat{Cer, Pfx, Unmapped}
-}
-
-// CertificateState enumerates the values for certificate state.
-type CertificateState string
-
-const (
- // Active ...
- Active CertificateState = "active"
- // Deletefailed ...
- Deletefailed CertificateState = "deletefailed"
- // Deleting ...
- Deleting CertificateState = "deleting"
-)
-
-// PossibleCertificateStateValues returns an array of possible values for the CertificateState const type.
-func PossibleCertificateStateValues() []CertificateState {
- return []CertificateState{Active, Deletefailed, Deleting}
-}
-
-// CertificateStoreLocation enumerates the values for certificate store location.
-type CertificateStoreLocation string
-
-const (
- // CertificateStoreLocationCurrentuser ...
- CertificateStoreLocationCurrentuser CertificateStoreLocation = "currentuser"
- // CertificateStoreLocationLocalmachine ...
- CertificateStoreLocationLocalmachine CertificateStoreLocation = "localmachine"
- // CertificateStoreLocationUnmapped ...
- CertificateStoreLocationUnmapped CertificateStoreLocation = "unmapped"
-)
-
-// PossibleCertificateStoreLocationValues returns an array of possible values for the CertificateStoreLocation const type.
-func PossibleCertificateStoreLocationValues() []CertificateStoreLocation {
- return []CertificateStoreLocation{CertificateStoreLocationCurrentuser, CertificateStoreLocationLocalmachine, CertificateStoreLocationUnmapped}
-}
-
-// CertificateVisibility enumerates the values for certificate visibility.
-type CertificateVisibility string
-
-const (
- // CertificateVisibilityRemoteuser ...
- CertificateVisibilityRemoteuser CertificateVisibility = "remoteuser"
- // CertificateVisibilityStarttask ...
- CertificateVisibilityStarttask CertificateVisibility = "starttask"
- // CertificateVisibilityTask ...
- CertificateVisibilityTask CertificateVisibility = "task"
- // CertificateVisibilityUnmapped ...
- CertificateVisibilityUnmapped CertificateVisibility = "unmapped"
-)
-
-// PossibleCertificateVisibilityValues returns an array of possible values for the CertificateVisibility const type.
-func PossibleCertificateVisibilityValues() []CertificateVisibility {
- return []CertificateVisibility{CertificateVisibilityRemoteuser, CertificateVisibilityStarttask, CertificateVisibilityTask, CertificateVisibilityUnmapped}
-}
-
-// ComputeNodeDeallocationOption enumerates the values for compute node deallocation option.
-type ComputeNodeDeallocationOption string
-
-const (
- // Requeue ...
- Requeue ComputeNodeDeallocationOption = "requeue"
- // Retaineddata ...
- Retaineddata ComputeNodeDeallocationOption = "retaineddata"
- // Taskcompletion ...
- Taskcompletion ComputeNodeDeallocationOption = "taskcompletion"
- // Terminate ...
- Terminate ComputeNodeDeallocationOption = "terminate"
-)
-
-// PossibleComputeNodeDeallocationOptionValues returns an array of possible values for the ComputeNodeDeallocationOption const type.
-func PossibleComputeNodeDeallocationOptionValues() []ComputeNodeDeallocationOption {
- return []ComputeNodeDeallocationOption{Requeue, Retaineddata, Taskcompletion, Terminate}
-}
-
-// ComputeNodeFillType enumerates the values for compute node fill type.
-type ComputeNodeFillType string
-
-const (
- // ComputeNodeFillTypePack ...
- ComputeNodeFillTypePack ComputeNodeFillType = "pack"
- // ComputeNodeFillTypeSpread ...
- ComputeNodeFillTypeSpread ComputeNodeFillType = "spread"
- // ComputeNodeFillTypeUnmapped ...
- ComputeNodeFillTypeUnmapped ComputeNodeFillType = "unmapped"
-)
-
-// PossibleComputeNodeFillTypeValues returns an array of possible values for the ComputeNodeFillType const type.
-func PossibleComputeNodeFillTypeValues() []ComputeNodeFillType {
- return []ComputeNodeFillType{ComputeNodeFillTypePack, ComputeNodeFillTypeSpread, ComputeNodeFillTypeUnmapped}
-}
-
-// ComputeNodeRebootOption enumerates the values for compute node reboot option.
-type ComputeNodeRebootOption string
-
-const (
- // ComputeNodeRebootOptionRequeue ...
- ComputeNodeRebootOptionRequeue ComputeNodeRebootOption = "requeue"
- // ComputeNodeRebootOptionRetaineddata ...
- ComputeNodeRebootOptionRetaineddata ComputeNodeRebootOption = "retaineddata"
- // ComputeNodeRebootOptionTaskcompletion ...
- ComputeNodeRebootOptionTaskcompletion ComputeNodeRebootOption = "taskcompletion"
- // ComputeNodeRebootOptionTerminate ...
- ComputeNodeRebootOptionTerminate ComputeNodeRebootOption = "terminate"
-)
-
-// PossibleComputeNodeRebootOptionValues returns an array of possible values for the ComputeNodeRebootOption const type.
-func PossibleComputeNodeRebootOptionValues() []ComputeNodeRebootOption {
- return []ComputeNodeRebootOption{ComputeNodeRebootOptionRequeue, ComputeNodeRebootOptionRetaineddata, ComputeNodeRebootOptionTaskcompletion, ComputeNodeRebootOptionTerminate}
-}
-
-// ComputeNodeReimageOption enumerates the values for compute node reimage option.
-type ComputeNodeReimageOption string
-
-const (
- // ComputeNodeReimageOptionRequeue ...
- ComputeNodeReimageOptionRequeue ComputeNodeReimageOption = "requeue"
- // ComputeNodeReimageOptionRetaineddata ...
- ComputeNodeReimageOptionRetaineddata ComputeNodeReimageOption = "retaineddata"
- // ComputeNodeReimageOptionTaskcompletion ...
- ComputeNodeReimageOptionTaskcompletion ComputeNodeReimageOption = "taskcompletion"
- // ComputeNodeReimageOptionTerminate ...
- ComputeNodeReimageOptionTerminate ComputeNodeReimageOption = "terminate"
-)
-
-// PossibleComputeNodeReimageOptionValues returns an array of possible values for the ComputeNodeReimageOption const type.
-func PossibleComputeNodeReimageOptionValues() []ComputeNodeReimageOption {
- return []ComputeNodeReimageOption{ComputeNodeReimageOptionRequeue, ComputeNodeReimageOptionRetaineddata, ComputeNodeReimageOptionTaskcompletion, ComputeNodeReimageOptionTerminate}
-}
-
-// ComputeNodeState enumerates the values for compute node state.
-type ComputeNodeState string
-
-const (
- // Creating ...
- Creating ComputeNodeState = "creating"
- // Idle ...
- Idle ComputeNodeState = "idle"
- // Leavingpool ...
- Leavingpool ComputeNodeState = "leavingpool"
- // Offline ...
- Offline ComputeNodeState = "offline"
- // Rebooting ...
- Rebooting ComputeNodeState = "rebooting"
- // Reimaging ...
- Reimaging ComputeNodeState = "reimaging"
- // Running ...
- Running ComputeNodeState = "running"
- // Starting ...
- Starting ComputeNodeState = "starting"
- // Starttaskfailed ...
- Starttaskfailed ComputeNodeState = "starttaskfailed"
- // Unknown ...
- Unknown ComputeNodeState = "unknown"
- // Unusable ...
- Unusable ComputeNodeState = "unusable"
- // Waitingforstarttask ...
- Waitingforstarttask ComputeNodeState = "waitingforstarttask"
-)
-
-// PossibleComputeNodeStateValues returns an array of possible values for the ComputeNodeState const type.
-func PossibleComputeNodeStateValues() []ComputeNodeState {
- return []ComputeNodeState{Creating, Idle, Leavingpool, Offline, Rebooting, Reimaging, Running, Starting, Starttaskfailed, Unknown, Unusable, Waitingforstarttask}
-}
-
-// DisableComputeNodeSchedulingOption enumerates the values for disable compute node scheduling option.
-type DisableComputeNodeSchedulingOption string
-
-const (
- // DisableComputeNodeSchedulingOptionRequeue ...
- DisableComputeNodeSchedulingOptionRequeue DisableComputeNodeSchedulingOption = "requeue"
- // DisableComputeNodeSchedulingOptionTaskcompletion ...
- DisableComputeNodeSchedulingOptionTaskcompletion DisableComputeNodeSchedulingOption = "taskcompletion"
- // DisableComputeNodeSchedulingOptionTerminate ...
- DisableComputeNodeSchedulingOptionTerminate DisableComputeNodeSchedulingOption = "terminate"
-)
-
-// PossibleDisableComputeNodeSchedulingOptionValues returns an array of possible values for the DisableComputeNodeSchedulingOption const type.
-func PossibleDisableComputeNodeSchedulingOptionValues() []DisableComputeNodeSchedulingOption {
- return []DisableComputeNodeSchedulingOption{DisableComputeNodeSchedulingOptionRequeue, DisableComputeNodeSchedulingOptionTaskcompletion, DisableComputeNodeSchedulingOptionTerminate}
-}
-
-// DisableJobOption enumerates the values for disable job option.
-type DisableJobOption string
-
-const (
- // DisableJobOptionRequeue ...
- DisableJobOptionRequeue DisableJobOption = "requeue"
- // DisableJobOptionTerminate ...
- DisableJobOptionTerminate DisableJobOption = "terminate"
- // DisableJobOptionWait ...
- DisableJobOptionWait DisableJobOption = "wait"
-)
-
-// PossibleDisableJobOptionValues returns an array of possible values for the DisableJobOption const type.
-func PossibleDisableJobOptionValues() []DisableJobOption {
- return []DisableJobOption{DisableJobOptionRequeue, DisableJobOptionTerminate, DisableJobOptionWait}
-}
-
-// JobAction enumerates the values for job action.
-type JobAction string
-
-const (
- // JobActionDisable ...
- JobActionDisable JobAction = "disable"
- // JobActionNone ...
- JobActionNone JobAction = "none"
- // JobActionTerminate ...
- JobActionTerminate JobAction = "terminate"
-)
-
-// PossibleJobActionValues returns an array of possible values for the JobAction const type.
-func PossibleJobActionValues() []JobAction {
- return []JobAction{JobActionDisable, JobActionNone, JobActionTerminate}
-}
-
-// JobPreparationTaskState enumerates the values for job preparation task state.
-type JobPreparationTaskState string
-
-const (
- // JobPreparationTaskStateCompleted ...
- JobPreparationTaskStateCompleted JobPreparationTaskState = "completed"
- // JobPreparationTaskStateRunning ...
- JobPreparationTaskStateRunning JobPreparationTaskState = "running"
-)
-
-// PossibleJobPreparationTaskStateValues returns an array of possible values for the JobPreparationTaskState const type.
-func PossibleJobPreparationTaskStateValues() []JobPreparationTaskState {
- return []JobPreparationTaskState{JobPreparationTaskStateCompleted, JobPreparationTaskStateRunning}
-}
-
-// JobReleaseTaskState enumerates the values for job release task state.
-type JobReleaseTaskState string
-
-const (
- // JobReleaseTaskStateCompleted ...
- JobReleaseTaskStateCompleted JobReleaseTaskState = "completed"
- // JobReleaseTaskStateRunning ...
- JobReleaseTaskStateRunning JobReleaseTaskState = "running"
-)
-
-// PossibleJobReleaseTaskStateValues returns an array of possible values for the JobReleaseTaskState const type.
-func PossibleJobReleaseTaskStateValues() []JobReleaseTaskState {
- return []JobReleaseTaskState{JobReleaseTaskStateCompleted, JobReleaseTaskStateRunning}
-}
-
-// JobScheduleState enumerates the values for job schedule state.
-type JobScheduleState string
-
-const (
- // JobScheduleStateActive ...
- JobScheduleStateActive JobScheduleState = "active"
- // JobScheduleStateCompleted ...
- JobScheduleStateCompleted JobScheduleState = "completed"
- // JobScheduleStateDeleting ...
- JobScheduleStateDeleting JobScheduleState = "deleting"
- // JobScheduleStateDisabled ...
- JobScheduleStateDisabled JobScheduleState = "disabled"
- // JobScheduleStateTerminating ...
- JobScheduleStateTerminating JobScheduleState = "terminating"
-)
-
-// PossibleJobScheduleStateValues returns an array of possible values for the JobScheduleState const type.
-func PossibleJobScheduleStateValues() []JobScheduleState {
- return []JobScheduleState{JobScheduleStateActive, JobScheduleStateCompleted, JobScheduleStateDeleting, JobScheduleStateDisabled, JobScheduleStateTerminating}
-}
-
-// JobState enumerates the values for job state.
-type JobState string
-
-const (
- // JobStateActive ...
- JobStateActive JobState = "active"
- // JobStateCompleted ...
- JobStateCompleted JobState = "completed"
- // JobStateDeleting ...
- JobStateDeleting JobState = "deleting"
- // JobStateDisabled ...
- JobStateDisabled JobState = "disabled"
- // JobStateDisabling ...
- JobStateDisabling JobState = "disabling"
- // JobStateEnabling ...
- JobStateEnabling JobState = "enabling"
- // JobStateTerminating ...
- JobStateTerminating JobState = "terminating"
-)
-
-// PossibleJobStateValues returns an array of possible values for the JobState const type.
-func PossibleJobStateValues() []JobState {
- return []JobState{JobStateActive, JobStateCompleted, JobStateDeleting, JobStateDisabled, JobStateDisabling, JobStateEnabling, JobStateTerminating}
-}
-
-// OnAllTasksComplete enumerates the values for on all tasks complete.
-type OnAllTasksComplete string
-
-const (
- // NoAction ...
- NoAction OnAllTasksComplete = "noAction"
- // TerminateJob ...
- TerminateJob OnAllTasksComplete = "terminateJob"
-)
-
-// PossibleOnAllTasksCompleteValues returns an array of possible values for the OnAllTasksComplete const type.
-func PossibleOnAllTasksCompleteValues() []OnAllTasksComplete {
- return []OnAllTasksComplete{NoAction, TerminateJob}
-}
-
-// OnTaskFailure enumerates the values for on task failure.
-type OnTaskFailure string
-
-const (
- // OnTaskFailureNoAction ...
- OnTaskFailureNoAction OnTaskFailure = "noAction"
- // OnTaskFailurePerformExitOptionsJobAction ...
- OnTaskFailurePerformExitOptionsJobAction OnTaskFailure = "performExitOptionsJobAction"
-)
-
-// PossibleOnTaskFailureValues returns an array of possible values for the OnTaskFailure const type.
-func PossibleOnTaskFailureValues() []OnTaskFailure {
- return []OnTaskFailure{OnTaskFailureNoAction, OnTaskFailurePerformExitOptionsJobAction}
-}
-
-// OSType enumerates the values for os type.
-type OSType string
-
-const (
- // OSTypeLinux ...
- OSTypeLinux OSType = "linux"
- // OSTypeUnmapped ...
- OSTypeUnmapped OSType = "unmapped"
- // OSTypeWindows ...
- OSTypeWindows OSType = "windows"
-)
-
-// PossibleOSTypeValues returns an array of possible values for the OSType const type.
-func PossibleOSTypeValues() []OSType {
- return []OSType{OSTypeLinux, OSTypeUnmapped, OSTypeWindows}
-}
-
-// PoolLifetimeOption enumerates the values for pool lifetime option.
-type PoolLifetimeOption string
-
-const (
- // PoolLifetimeOptionJob ...
- PoolLifetimeOptionJob PoolLifetimeOption = "job"
- // PoolLifetimeOptionJobschedule ...
- PoolLifetimeOptionJobschedule PoolLifetimeOption = "jobschedule"
- // PoolLifetimeOptionUnmapped ...
- PoolLifetimeOptionUnmapped PoolLifetimeOption = "unmapped"
-)
-
-// PossiblePoolLifetimeOptionValues returns an array of possible values for the PoolLifetimeOption const type.
-func PossiblePoolLifetimeOptionValues() []PoolLifetimeOption {
- return []PoolLifetimeOption{PoolLifetimeOptionJob, PoolLifetimeOptionJobschedule, PoolLifetimeOptionUnmapped}
-}
-
-// PoolState enumerates the values for pool state.
-type PoolState string
-
-const (
- // PoolStateActive ...
- PoolStateActive PoolState = "active"
- // PoolStateDeleting ...
- PoolStateDeleting PoolState = "deleting"
- // PoolStateUpgrading ...
- PoolStateUpgrading PoolState = "upgrading"
-)
-
-// PossiblePoolStateValues returns an array of possible values for the PoolState const type.
-func PossiblePoolStateValues() []PoolState {
- return []PoolState{PoolStateActive, PoolStateDeleting, PoolStateUpgrading}
-}
-
-// SchedulingErrorCategory enumerates the values for scheduling error category.
-type SchedulingErrorCategory string
-
-const (
- // SchedulingErrorCategoryServererror ...
- SchedulingErrorCategoryServererror SchedulingErrorCategory = "servererror"
- // SchedulingErrorCategoryUnmapped ...
- SchedulingErrorCategoryUnmapped SchedulingErrorCategory = "unmapped"
- // SchedulingErrorCategoryUsererror ...
- SchedulingErrorCategoryUsererror SchedulingErrorCategory = "usererror"
-)
-
-// PossibleSchedulingErrorCategoryValues returns an array of possible values for the SchedulingErrorCategory const type.
-func PossibleSchedulingErrorCategoryValues() []SchedulingErrorCategory {
- return []SchedulingErrorCategory{SchedulingErrorCategoryServererror, SchedulingErrorCategoryUnmapped, SchedulingErrorCategoryUsererror}
-}
-
-// SchedulingState enumerates the values for scheduling state.
-type SchedulingState string
-
-const (
- // Disabled ...
- Disabled SchedulingState = "disabled"
- // Enabled ...
- Enabled SchedulingState = "enabled"
-)
-
-// PossibleSchedulingStateValues returns an array of possible values for the SchedulingState const type.
-func PossibleSchedulingStateValues() []SchedulingState {
- return []SchedulingState{Disabled, Enabled}
-}
-
-// StartTaskState enumerates the values for start task state.
-type StartTaskState string
-
-const (
- // StartTaskStateCompleted ...
- StartTaskStateCompleted StartTaskState = "completed"
- // StartTaskStateRunning ...
- StartTaskStateRunning StartTaskState = "running"
-)
-
-// PossibleStartTaskStateValues returns an array of possible values for the StartTaskState const type.
-func PossibleStartTaskStateValues() []StartTaskState {
- return []StartTaskState{StartTaskStateCompleted, StartTaskStateRunning}
-}
-
-// TaskAddStatus enumerates the values for task add status.
-type TaskAddStatus string
-
-const (
- // TaskAddStatusClienterror ...
- TaskAddStatusClienterror TaskAddStatus = "clienterror"
- // TaskAddStatusServererror ...
- TaskAddStatusServererror TaskAddStatus = "servererror"
- // TaskAddStatusSuccess ...
- TaskAddStatusSuccess TaskAddStatus = "success"
- // TaskAddStatusUnmapped ...
- TaskAddStatusUnmapped TaskAddStatus = "unmapped"
-)
-
-// PossibleTaskAddStatusValues returns an array of possible values for the TaskAddStatus const type.
-func PossibleTaskAddStatusValues() []TaskAddStatus {
- return []TaskAddStatus{TaskAddStatusClienterror, TaskAddStatusServererror, TaskAddStatusSuccess, TaskAddStatusUnmapped}
-}
-
-// TaskState enumerates the values for task state.
-type TaskState string
-
-const (
- // TaskStateActive ...
- TaskStateActive TaskState = "active"
- // TaskStateCompleted ...
- TaskStateCompleted TaskState = "completed"
- // TaskStatePreparing ...
- TaskStatePreparing TaskState = "preparing"
- // TaskStateRunning ...
- TaskStateRunning TaskState = "running"
-)
-
-// PossibleTaskStateValues returns an array of possible values for the TaskState const type.
-func PossibleTaskStateValues() []TaskState {
- return []TaskState{TaskStateActive, TaskStateCompleted, TaskStatePreparing, TaskStateRunning}
-}
-
-// AccountListNodeAgentSkusResult ...
-type AccountListNodeAgentSkusResult struct {
- autorest.Response `json:"-"`
- Value *[]NodeAgentSku `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// AccountListNodeAgentSkusResultIterator provides access to a complete listing of NodeAgentSku values.
-type AccountListNodeAgentSkusResultIterator struct {
- i int
- page AccountListNodeAgentSkusResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *AccountListNodeAgentSkusResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter AccountListNodeAgentSkusResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter AccountListNodeAgentSkusResultIterator) Response() AccountListNodeAgentSkusResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter AccountListNodeAgentSkusResultIterator) Value() NodeAgentSku {
- if !iter.page.NotDone() {
- return NodeAgentSku{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (alnasr AccountListNodeAgentSkusResult) IsEmpty() bool {
- return alnasr.Value == nil || len(*alnasr.Value) == 0
-}
-
-// accountListNodeAgentSkusResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (alnasr AccountListNodeAgentSkusResult) accountListNodeAgentSkusResultPreparer() (*http.Request, error) {
- if alnasr.OdataNextLink == nil || len(to.String(alnasr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(alnasr.OdataNextLink)))
-}
-
-// AccountListNodeAgentSkusResultPage contains a page of NodeAgentSku values.
-type AccountListNodeAgentSkusResultPage struct {
- fn func(AccountListNodeAgentSkusResult) (AccountListNodeAgentSkusResult, error)
- alnasr AccountListNodeAgentSkusResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *AccountListNodeAgentSkusResultPage) Next() error {
- next, err := page.fn(page.alnasr)
- if err != nil {
- return err
- }
- page.alnasr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page AccountListNodeAgentSkusResultPage) NotDone() bool {
- return !page.alnasr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page AccountListNodeAgentSkusResultPage) Response() AccountListNodeAgentSkusResult {
- return page.alnasr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page AccountListNodeAgentSkusResultPage) Values() []NodeAgentSku {
- if page.alnasr.IsEmpty() {
- return nil
- }
- return *page.alnasr.Value
-}
-
-// AffinityInformation ...
-type AffinityInformation struct {
- // AffinityID - You can pass the affinityId of a compute node or task to indicate that this task needs to be placed close to the node or task.
- AffinityID *string `json:"affinityId,omitempty"`
-}
-
-// ApplicationListResult ...
-type ApplicationListResult struct {
- autorest.Response `json:"-"`
- Value *[]ApplicationSummary `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// ApplicationListResultIterator provides access to a complete listing of ApplicationSummary values.
-type ApplicationListResultIterator struct {
- i int
- page ApplicationListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *ApplicationListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter ApplicationListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter ApplicationListResultIterator) Response() ApplicationListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter ApplicationListResultIterator) Value() ApplicationSummary {
- if !iter.page.NotDone() {
- return ApplicationSummary{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (alr ApplicationListResult) IsEmpty() bool {
- return alr.Value == nil || len(*alr.Value) == 0
-}
-
-// applicationListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (alr ApplicationListResult) applicationListResultPreparer() (*http.Request, error) {
- if alr.OdataNextLink == nil || len(to.String(alr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(alr.OdataNextLink)))
-}
-
-// ApplicationListResultPage contains a page of ApplicationSummary values.
-type ApplicationListResultPage struct {
- fn func(ApplicationListResult) (ApplicationListResult, error)
- alr ApplicationListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *ApplicationListResultPage) Next() error {
- next, err := page.fn(page.alr)
- if err != nil {
- return err
- }
- page.alr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page ApplicationListResultPage) NotDone() bool {
- return !page.alr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page ApplicationListResultPage) Response() ApplicationListResult {
- return page.alr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page ApplicationListResultPage) Values() []ApplicationSummary {
- if page.alr.IsEmpty() {
- return nil
- }
- return *page.alr.Value
-}
-
-// ApplicationPackageReference ...
-type ApplicationPackageReference struct {
- ApplicationID *string `json:"applicationId,omitempty"`
- // Version - If this is omitted, and no default version is specified for this application, the request fails with the error code InvalidApplicationPackageReferences. If you are calling the REST API directly, the HTTP status code is 409.
- Version *string `json:"version,omitempty"`
-}
-
-// ApplicationSummary ...
-type ApplicationSummary struct {
- autorest.Response `json:"-"`
- ID *string `json:"id,omitempty"`
- DisplayName *string `json:"displayName,omitempty"`
- Versions *[]string `json:"versions,omitempty"`
-}
-
-// AutoPoolSpecification ...
-type AutoPoolSpecification struct {
- // AutoPoolIDPrefix - The Batch service assigns each auto pool a unique identifier on creation. To distinguish between pools created for different purposes, you can specify this element to add a prefix to the id that is assigned. The prefix can be up to 20 characters long.
- AutoPoolIDPrefix *string `json:"autoPoolIdPrefix,omitempty"`
- // PoolLifetimeOption - When the pool lifetime scope is jobschedule level, the Batch service keeps track of the last autopool created for the jobschedule, and deletes that pool when the jobschedule completes. Batch will also delete this pool if the user updates the auto pool specification in a way that changes this lifetime. Possible values include: 'PoolLifetimeOptionJobschedule', 'PoolLifetimeOptionJob', 'PoolLifetimeOptionUnmapped'
- PoolLifetimeOption PoolLifetimeOption `json:"poolLifetimeOption,omitempty"`
- // KeepAlive - If false, the Batch service deletes the pool once its lifetime (as determined by the poolLifetimeOption setting) expires; that is, when the job or job schedule completes. If true, the Batch service does not delete the pool automatically. It is up to the user to delete auto pools created with this option.
- KeepAlive *bool `json:"keepAlive,omitempty"`
- Pool *PoolSpecification `json:"pool,omitempty"`
-}
-
-// AutoScaleRun ...
-type AutoScaleRun struct {
- autorest.Response `json:"-"`
- Timestamp *date.Time `json:"timestamp,omitempty"`
- // Results - Each variable value is returned in the form $variable=value, and variables are separated by semicolons.
- Results *string `json:"results,omitempty"`
- Error *AutoScaleRunError `json:"error,omitempty"`
-}
-
-// AutoScaleRunError ...
-type AutoScaleRunError struct {
- Code *string `json:"code,omitempty"`
- Message *string `json:"message,omitempty"`
- Values *[]NameValuePair `json:"values,omitempty"`
-}
-
-// Certificate a certificate that can be installed on compute nodes and can be used to authenticate operations on
-// the machine.
-type Certificate struct {
- autorest.Response `json:"-"`
- Thumbprint *string `json:"thumbprint,omitempty"`
- ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"`
- URL *string `json:"url,omitempty"`
- // State - Possible values include: 'Active', 'Deleting', 'Deletefailed'
- State CertificateState `json:"state,omitempty"`
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // PreviousState - This property is not set if the certificate is in its initial Active state. Possible values include: 'Active', 'Deleting', 'Deletefailed'
- PreviousState CertificateState `json:"previousState,omitempty"`
- // PreviousStateTransitionTime - This property is not set if the certificate is in its initial Active state.
- PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"`
- PublicData *string `json:"publicData,omitempty"`
- // DeleteCertificateError - This property is set only if the certificate is in the DeleteFailed state.
- DeleteCertificateError *DeleteCertificateError `json:"deleteCertificateError,omitempty"`
-}
-
-// CertificateAddParameter ...
-type CertificateAddParameter struct {
- Thumbprint *string `json:"thumbprint,omitempty"`
- ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"`
- Data *string `json:"data,omitempty"`
- // CertificateFormat - Possible values include: 'Pfx', 'Cer', 'Unmapped'
- CertificateFormat CertificateFormat `json:"certificateFormat,omitempty"`
- // Password - This is required if the certificate format is pfx. It should be omitted if the certificate format is cer.
- Password *string `json:"password,omitempty"`
-}
-
-// CertificateListResult ...
-type CertificateListResult struct {
- autorest.Response `json:"-"`
- Value *[]Certificate `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CertificateListResultIterator provides access to a complete listing of Certificate values.
-type CertificateListResultIterator struct {
- i int
- page CertificateListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CertificateListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CertificateListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CertificateListResultIterator) Response() CertificateListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CertificateListResultIterator) Value() Certificate {
- if !iter.page.NotDone() {
- return Certificate{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (clr CertificateListResult) IsEmpty() bool {
- return clr.Value == nil || len(*clr.Value) == 0
-}
-
-// certificateListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (clr CertificateListResult) certificateListResultPreparer() (*http.Request, error) {
- if clr.OdataNextLink == nil || len(to.String(clr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(clr.OdataNextLink)))
-}
-
-// CertificateListResultPage contains a page of Certificate values.
-type CertificateListResultPage struct {
- fn func(CertificateListResult) (CertificateListResult, error)
- clr CertificateListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CertificateListResultPage) Next() error {
- next, err := page.fn(page.clr)
- if err != nil {
- return err
- }
- page.clr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CertificateListResultPage) NotDone() bool {
- return !page.clr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CertificateListResultPage) Response() CertificateListResult {
- return page.clr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CertificateListResultPage) Values() []Certificate {
- if page.clr.IsEmpty() {
- return nil
- }
- return *page.clr.Value
-}
-
-// CertificateReference ...
-type CertificateReference struct {
- Thumbprint *string `json:"thumbprint,omitempty"`
- ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"`
- // StoreLocation - The default value is CurrentUser. This property is applicable only for pools configured with Windows nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows image reference). For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of remoteuser, a certs directory is created in the user's home directory (e.g., /home//certs) where certificates are placed. Possible values include: 'CertificateStoreLocationCurrentuser', 'CertificateStoreLocationLocalmachine', 'CertificateStoreLocationUnmapped'
- StoreLocation CertificateStoreLocation `json:"storeLocation,omitempty"`
- // StoreName - The default value is My. This property is applicable only for pools configured with Windows nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows image reference).
- StoreName *string `json:"storeName,omitempty"`
- // Visibility - The default is all accounts.
- Visibility *[]CertificateVisibility `json:"visibility,omitempty"`
-}
-
-// CloudJob ...
-type CloudJob struct {
- autorest.Response `json:"-"`
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. It is common to use a GUID for the id.
- ID *string `json:"id,omitempty"`
- DisplayName *string `json:"displayName,omitempty"`
- UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"`
- URL *string `json:"url,omitempty"`
- // ETag - This is an opaque string. You can use it to detect whether the job has changed between requests. In particular, you can be pass the ETag when updating a job to specify that your changes should take effect only if nobody else has modified the job in the meantime.
- ETag *string `json:"eTag,omitempty"`
- // LastModified - This is the last time at which the job level data, such as the job state or priority, changed. It does not factor in task-level changes such as adding new tasks or tasks changing state.
- LastModified *date.Time `json:"lastModified,omitempty"`
- CreationTime *date.Time `json:"creationTime,omitempty"`
- // State - Possible values include: 'JobStateActive', 'JobStateDisabling', 'JobStateDisabled', 'JobStateEnabling', 'JobStateTerminating', 'JobStateCompleted', 'JobStateDeleting'
- State JobState `json:"state,omitempty"`
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // PreviousState - This property is not set if the job is in its initial Active state. Possible values include: 'JobStateActive', 'JobStateDisabling', 'JobStateDisabled', 'JobStateEnabling', 'JobStateTerminating', 'JobStateCompleted', 'JobStateDeleting'
- PreviousState JobState `json:"previousState,omitempty"`
- // PreviousStateTransitionTime - This property is not set if the job is in its initial Active state.
- PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"`
- // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0.
- Priority *int32 `json:"priority,omitempty"`
- Constraints *JobConstraints `json:"constraints,omitempty"`
- JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"`
- // JobPreparationTask - The Job Preparation task is a special task run on each node before any other task of the job.
- JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"`
- // JobReleaseTask - The Job Release task is a special task run at the end of the job on each node that has run any other task of the job.
- JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"`
- CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"`
- PoolInfo *PoolInformation `json:"poolInfo,omitempty"`
- // OnAllTasksComplete - Permitted values are: noaction – do nothing. The job remains active unless terminated or disabled by some other means. terminatejob – terminate the job. The job's terminateReason is set to 'AllTasksComplete'. The default is noaction. Possible values include: 'NoAction', 'TerminateJob'
- OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"`
- // OnTaskFailure - Permitted values are: noaction – do nothing. performexitoptionsjobaction – take the action associated with the task exit condition in the task's exitConditions collection. (This may still result in no action being taken, if that is what the task specifies.) The default is noaction. Possible values include: 'OnTaskFailureNoAction', 'OnTaskFailurePerformExitOptionsJobAction'
- OnTaskFailure OnTaskFailure `json:"onTaskFailure,omitempty"`
- // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
- ExecutionInfo *JobExecutionInformation `json:"executionInfo,omitempty"`
- Stats *JobStatistics `json:"stats,omitempty"`
-}
-
-// CloudJobListPreparationAndReleaseTaskStatusResult ...
-type CloudJobListPreparationAndReleaseTaskStatusResult struct {
- autorest.Response `json:"-"`
- Value *[]JobPreparationAndReleaseTaskExecutionInformation `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CloudJobListPreparationAndReleaseTaskStatusResultIterator provides access to a complete listing of
-// JobPreparationAndReleaseTaskExecutionInformation values.
-type CloudJobListPreparationAndReleaseTaskStatusResultIterator struct {
- i int
- page CloudJobListPreparationAndReleaseTaskStatusResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CloudJobListPreparationAndReleaseTaskStatusResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CloudJobListPreparationAndReleaseTaskStatusResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CloudJobListPreparationAndReleaseTaskStatusResultIterator) Response() CloudJobListPreparationAndReleaseTaskStatusResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CloudJobListPreparationAndReleaseTaskStatusResultIterator) Value() JobPreparationAndReleaseTaskExecutionInformation {
- if !iter.page.NotDone() {
- return JobPreparationAndReleaseTaskExecutionInformation{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult) IsEmpty() bool {
- return cjlpartsr.Value == nil || len(*cjlpartsr.Value) == 0
-}
-
-// cloudJobListPreparationAndReleaseTaskStatusResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult) cloudJobListPreparationAndReleaseTaskStatusResultPreparer() (*http.Request, error) {
- if cjlpartsr.OdataNextLink == nil || len(to.String(cjlpartsr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(cjlpartsr.OdataNextLink)))
-}
-
-// CloudJobListPreparationAndReleaseTaskStatusResultPage contains a page of
-// JobPreparationAndReleaseTaskExecutionInformation values.
-type CloudJobListPreparationAndReleaseTaskStatusResultPage struct {
- fn func(CloudJobListPreparationAndReleaseTaskStatusResult) (CloudJobListPreparationAndReleaseTaskStatusResult, error)
- cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CloudJobListPreparationAndReleaseTaskStatusResultPage) Next() error {
- next, err := page.fn(page.cjlpartsr)
- if err != nil {
- return err
- }
- page.cjlpartsr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) NotDone() bool {
- return !page.cjlpartsr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) Response() CloudJobListPreparationAndReleaseTaskStatusResult {
- return page.cjlpartsr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) Values() []JobPreparationAndReleaseTaskExecutionInformation {
- if page.cjlpartsr.IsEmpty() {
- return nil
- }
- return *page.cjlpartsr.Value
-}
-
-// CloudJobListResult ...
-type CloudJobListResult struct {
- autorest.Response `json:"-"`
- Value *[]CloudJob `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CloudJobListResultIterator provides access to a complete listing of CloudJob values.
-type CloudJobListResultIterator struct {
- i int
- page CloudJobListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CloudJobListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CloudJobListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CloudJobListResultIterator) Response() CloudJobListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CloudJobListResultIterator) Value() CloudJob {
- if !iter.page.NotDone() {
- return CloudJob{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (cjlr CloudJobListResult) IsEmpty() bool {
- return cjlr.Value == nil || len(*cjlr.Value) == 0
-}
-
-// cloudJobListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (cjlr CloudJobListResult) cloudJobListResultPreparer() (*http.Request, error) {
- if cjlr.OdataNextLink == nil || len(to.String(cjlr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(cjlr.OdataNextLink)))
-}
-
-// CloudJobListResultPage contains a page of CloudJob values.
-type CloudJobListResultPage struct {
- fn func(CloudJobListResult) (CloudJobListResult, error)
- cjlr CloudJobListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CloudJobListResultPage) Next() error {
- next, err := page.fn(page.cjlr)
- if err != nil {
- return err
- }
- page.cjlr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CloudJobListResultPage) NotDone() bool {
- return !page.cjlr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CloudJobListResultPage) Response() CloudJobListResult {
- return page.cjlr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CloudJobListResultPage) Values() []CloudJob {
- if page.cjlr.IsEmpty() {
- return nil
- }
- return *page.cjlr.Value
-}
-
-// CloudJobSchedule ...
-type CloudJobSchedule struct {
- autorest.Response `json:"-"`
- // ID - It is common to use a GUID for the id.
- ID *string `json:"id,omitempty"`
- DisplayName *string `json:"displayName,omitempty"`
- URL *string `json:"url,omitempty"`
- // ETag - This is an opaque string. You can use it to detect whether the job schedule has changed between requests. In particular, you can be pass the ETag with an Update Job Schedule request to specify that your changes should take effect only if nobody else has modified the schedule in the meantime.
- ETag *string `json:"eTag,omitempty"`
- // LastModified - This is the last time at which the schedule level data, such as the job specification or recurrence information, changed. It does not factor in job-level changes such as new jobs being created or jobs changing state.
- LastModified *date.Time `json:"lastModified,omitempty"`
- CreationTime *date.Time `json:"creationTime,omitempty"`
- // State - Possible values include: 'JobScheduleStateActive', 'JobScheduleStateCompleted', 'JobScheduleStateDisabled', 'JobScheduleStateTerminating', 'JobScheduleStateDeleting'
- State JobScheduleState `json:"state,omitempty"`
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // PreviousState - This property is not present if the job schedule is in its initial active state. Possible values include: 'JobScheduleStateActive', 'JobScheduleStateCompleted', 'JobScheduleStateDisabled', 'JobScheduleStateTerminating', 'JobScheduleStateDeleting'
- PreviousState JobScheduleState `json:"previousState,omitempty"`
- // PreviousStateTransitionTime - This property is not present if the job schedule is in its initial active state.
- PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"`
- Schedule *Schedule `json:"schedule,omitempty"`
- JobSpecification *JobSpecification `json:"jobSpecification,omitempty"`
- ExecutionInfo *JobScheduleExecutionInformation `json:"executionInfo,omitempty"`
- // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
- Stats *JobScheduleStatistics `json:"stats,omitempty"`
-}
-
-// CloudJobScheduleListResult ...
-type CloudJobScheduleListResult struct {
- autorest.Response `json:"-"`
- Value *[]CloudJobSchedule `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CloudJobScheduleListResultIterator provides access to a complete listing of CloudJobSchedule values.
-type CloudJobScheduleListResultIterator struct {
- i int
- page CloudJobScheduleListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CloudJobScheduleListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CloudJobScheduleListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CloudJobScheduleListResultIterator) Response() CloudJobScheduleListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CloudJobScheduleListResultIterator) Value() CloudJobSchedule {
- if !iter.page.NotDone() {
- return CloudJobSchedule{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (cjslr CloudJobScheduleListResult) IsEmpty() bool {
- return cjslr.Value == nil || len(*cjslr.Value) == 0
-}
-
-// cloudJobScheduleListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (cjslr CloudJobScheduleListResult) cloudJobScheduleListResultPreparer() (*http.Request, error) {
- if cjslr.OdataNextLink == nil || len(to.String(cjslr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(cjslr.OdataNextLink)))
-}
-
-// CloudJobScheduleListResultPage contains a page of CloudJobSchedule values.
-type CloudJobScheduleListResultPage struct {
- fn func(CloudJobScheduleListResult) (CloudJobScheduleListResult, error)
- cjslr CloudJobScheduleListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CloudJobScheduleListResultPage) Next() error {
- next, err := page.fn(page.cjslr)
- if err != nil {
- return err
- }
- page.cjslr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CloudJobScheduleListResultPage) NotDone() bool {
- return !page.cjslr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CloudJobScheduleListResultPage) Response() CloudJobScheduleListResult {
- return page.cjslr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CloudJobScheduleListResultPage) Values() []CloudJobSchedule {
- if page.cjslr.IsEmpty() {
- return nil
- }
- return *page.cjslr.Value
-}
-
-// CloudPool ...
-type CloudPool struct {
- autorest.Response `json:"-"`
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. It is common to use a GUID for the id.
- ID *string `json:"id,omitempty"`
- // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- URL *string `json:"url,omitempty"`
- // ETag - This is an opaque string. You can use it to detect whether the pool has changed between requests. In particular, you can be pass the ETag when updating a pool to specify that your changes should take effect only if nobody else has modified the pool in the meantime.
- ETag *string `json:"eTag,omitempty"`
- // LastModified - This is the last time at which the pool level data, such as the targetDedicated or enableAutoscale settings, changed. It does not factor in node-level changes such as a compute node changing state.
- LastModified *date.Time `json:"lastModified,omitempty"`
- CreationTime *date.Time `json:"creationTime,omitempty"`
- // State - Possible values are: active – The pool is available to run tasks subject to the availability of compute nodes. deleting – The user has requested that the pool be deleted, but the delete operation has not yet completed. upgrading – The user has requested that the operating system of the pool's nodes be upgraded, but the upgrade operation has not yet completed (that is, some nodes in the pool have not yet been upgraded). While upgrading, the pool may be able to run tasks (with reduced capacity) but this is not guaranteed. Possible values include: 'PoolStateActive', 'PoolStateDeleting', 'PoolStateUpgrading'
- State PoolState `json:"state,omitempty"`
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // AllocationState - Possible values are: steady – The pool is not resizing. There are no changes to the number of nodes in the pool in progress. A pool enters this state when it is created and when no operations are being performed on the pool to change the number of dedicated nodes. resizing - The pool is resizing; that is, compute nodes are being added to or removed from the pool. stopping - The pool was resizing, but the user has requested that the resize be stopped, but the stop request has not yet been completed. Possible values include: 'Steady', 'Resizing', 'Stopping'
- AllocationState AllocationState `json:"allocationState,omitempty"`
- AllocationStateTransitionTime *date.Time `json:"allocationStateTransitionTime,omitempty"`
- // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series).
- VMSize *string `json:"vmSize,omitempty"`
- // CloudServiceConfiguration - This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified.
- CloudServiceConfiguration *CloudServiceConfiguration `json:"cloudServiceConfiguration,omitempty"`
- // VirtualMachineConfiguration - This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified.
- VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"`
- // ResizeTimeout - This is the timeout for the most recent resize operation. (The initial sizing when the pool is created counts as a resize.) The default value is 15 minutes.
- ResizeTimeout *string `json:"resizeTimeout,omitempty"`
- // ResizeError - This property is set only if an error occurred during the last pool resize, and only when the pool allocationState is Steady.
- ResizeError *ResizeError `json:"resizeError,omitempty"`
- CurrentDedicated *int32 `json:"currentDedicated,omitempty"`
- // TargetDedicated - This property is not set if enableAutoScale is true. It is required if enableAutoScale is false.
- TargetDedicated *int32 `json:"targetDedicated,omitempty"`
- // EnableAutoScale - If true, the autoScaleFormula property must be set. If false, the targetDedicated property must be set.
- EnableAutoScale *bool `json:"enableAutoScale,omitempty"`
- // AutoScaleFormula - This property is set only if the pool automatically scales, i.e. enableAutoScale is true.
- AutoScaleFormula *string `json:"autoScaleFormula,omitempty"`
- // AutoScaleEvaluationInterval - This property is set only if the pool automatically scales, i.e. enableAutoScale is true.
- AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"`
- // AutoScaleRun - This property is set only if the pool automatically scales, i.e. enableAutoScale is true.
- AutoScaleRun *AutoScaleRun `json:"autoScaleRun,omitempty"`
- // EnableInterNodeCommunication - This imposes restrictions on which nodes can be assigned to the pool. Specifying this value can reduce the chance of the requested number of nodes to be allocated in the pool.
- EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"`
- NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"`
- StartTask *StartTask `json:"startTask,omitempty"`
- // CertificateReferences - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of remoteuser, a certs directory is created in the user's home directory (e.g., /home//certs) where certificates are placed.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"`
- TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"`
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
- Stats *PoolStatistics `json:"stats,omitempty"`
-}
-
-// CloudPoolListResult ...
-type CloudPoolListResult struct {
- autorest.Response `json:"-"`
- Value *[]CloudPool `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CloudPoolListResultIterator provides access to a complete listing of CloudPool values.
-type CloudPoolListResultIterator struct {
- i int
- page CloudPoolListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CloudPoolListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CloudPoolListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CloudPoolListResultIterator) Response() CloudPoolListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CloudPoolListResultIterator) Value() CloudPool {
- if !iter.page.NotDone() {
- return CloudPool{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (cplr CloudPoolListResult) IsEmpty() bool {
- return cplr.Value == nil || len(*cplr.Value) == 0
-}
-
-// cloudPoolListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (cplr CloudPoolListResult) cloudPoolListResultPreparer() (*http.Request, error) {
- if cplr.OdataNextLink == nil || len(to.String(cplr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(cplr.OdataNextLink)))
-}
-
-// CloudPoolListResultPage contains a page of CloudPool values.
-type CloudPoolListResultPage struct {
- fn func(CloudPoolListResult) (CloudPoolListResult, error)
- cplr CloudPoolListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CloudPoolListResultPage) Next() error {
- next, err := page.fn(page.cplr)
- if err != nil {
- return err
- }
- page.cplr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CloudPoolListResultPage) NotDone() bool {
- return !page.cplr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CloudPoolListResultPage) Response() CloudPoolListResult {
- return page.cplr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CloudPoolListResultPage) Values() []CloudPool {
- if page.cplr.IsEmpty() {
- return nil
- }
- return *page.cplr.Value
-}
-
-// CloudServiceConfiguration ...
-type CloudServiceConfiguration struct {
- // OsFamily - Possible values are: 2 – OS Family 2, equivalent to Windows Server 2008 R2 SP1. 3 – OS Family 3, equivalent to Windows Server 2012. 4 – OS Family 4, equivalent to Windows Server 2012 R2. For more information, see Azure Guest OS Releases (https://azure.microsoft.com/documentation/articles/cloud-services-guestos-update-matrix/#releases).
- OsFamily *string `json:"osFamily,omitempty"`
- // TargetOSVersion - The default value is * which specifies the latest operating system version for the specified OS family.
- TargetOSVersion *string `json:"targetOSVersion,omitempty"`
- // CurrentOSVersion - This may differ from targetOSVersion if the pool state is Upgrading. In this case some virtual machines may be on the targetOSVersion and some may be on the currentOSVersion during the upgrade process. Once all virtual machines have upgraded, currentOSVersion is updated to be the same as targetOSVersion.
- CurrentOSVersion *string `json:"currentOSVersion,omitempty"`
-}
-
-// CloudTask ...
-type CloudTask struct {
- autorest.Response `json:"-"`
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters.
- ID *string `json:"id,omitempty"`
- // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- URL *string `json:"url,omitempty"`
- // ETag - This is an opaque string. You can use it to detect whether the task has changed between requests. In particular, you can be pass the ETag when updating a task to specify that your changes should take effect only if nobody else has modified the task in the meantime.
- ETag *string `json:"eTag,omitempty"`
- LastModified *date.Time `json:"lastModified,omitempty"`
- CreationTime *date.Time `json:"creationTime,omitempty"`
- // ExitConditions - How the Batch service should respond when the task completes.
- ExitConditions *ExitConditions `json:"exitConditions,omitempty"`
- // State - Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted'
- State TaskState `json:"state,omitempty"`
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // PreviousState - This property is not set if the task is in its initial Active state. Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted'
- PreviousState TaskState `json:"previousState,omitempty"`
- // PreviousStateTransitionTime - This property is not set if the task is in its initial Active state.
- PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"`
- // CommandLine - For multi-instance tasks, the command line is executed as the primary task, after the primary task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux.
- CommandLine *string `json:"commandLine,omitempty"`
- // ResourceFiles - For multi-instance tasks, the resource files will only be downloaded to the compute node on which the primary task is executed.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- AffinityInfo *AffinityInformation `json:"affinityInfo,omitempty"`
- Constraints *TaskConstraints `json:"constraints,omitempty"`
- RunElevated *bool `json:"runElevated,omitempty"`
- ExecutionInfo *TaskExecutionInformation `json:"executionInfo,omitempty"`
- NodeInfo *ComputeNodeInformation `json:"nodeInfo,omitempty"`
- MultiInstanceSettings *MultiInstanceSettings `json:"multiInstanceSettings,omitempty"`
- Stats *TaskStatistics `json:"stats,omitempty"`
- // DependsOn - The task will not be scheduled until all depended-on tasks have completed successfully. (If any depended-on tasks fail and exhaust their retry counts, the task will never be scheduled.)
- DependsOn *TaskDependencies `json:"dependsOn,omitempty"`
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
-}
-
-// CloudTaskListResult ...
-type CloudTaskListResult struct {
- autorest.Response `json:"-"`
- Value *[]CloudTask `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CloudTaskListResultIterator provides access to a complete listing of CloudTask values.
-type CloudTaskListResultIterator struct {
- i int
- page CloudTaskListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CloudTaskListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CloudTaskListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CloudTaskListResultIterator) Response() CloudTaskListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CloudTaskListResultIterator) Value() CloudTask {
- if !iter.page.NotDone() {
- return CloudTask{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (ctlr CloudTaskListResult) IsEmpty() bool {
- return ctlr.Value == nil || len(*ctlr.Value) == 0
-}
-
-// cloudTaskListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (ctlr CloudTaskListResult) cloudTaskListResultPreparer() (*http.Request, error) {
- if ctlr.OdataNextLink == nil || len(to.String(ctlr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(ctlr.OdataNextLink)))
-}
-
-// CloudTaskListResultPage contains a page of CloudTask values.
-type CloudTaskListResultPage struct {
- fn func(CloudTaskListResult) (CloudTaskListResult, error)
- ctlr CloudTaskListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CloudTaskListResultPage) Next() error {
- next, err := page.fn(page.ctlr)
- if err != nil {
- return err
- }
- page.ctlr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CloudTaskListResultPage) NotDone() bool {
- return !page.ctlr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CloudTaskListResultPage) Response() CloudTaskListResult {
- return page.ctlr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CloudTaskListResultPage) Values() []CloudTask {
- if page.ctlr.IsEmpty() {
- return nil
- }
- return *page.ctlr.Value
-}
-
-// CloudTaskListSubtasksResult ...
-type CloudTaskListSubtasksResult struct {
- autorest.Response `json:"-"`
- Value *[]SubtaskInformation `json:"value,omitempty"`
-}
-
-// ComputeNode ...
-type ComputeNode struct {
- autorest.Response `json:"-"`
- // ID - Every node that is added to a pool is assigned a unique ID. Whenever a node is removed from a pool, all of its local files are deleted, and the ID is reclaimed and could be reused for new nodes.
- ID *string `json:"id,omitempty"`
- URL *string `json:"url,omitempty"`
- // State - Possible values include: 'Idle', 'Rebooting', 'Reimaging', 'Running', 'Unusable', 'Creating', 'Starting', 'Waitingforstarttask', 'Starttaskfailed', 'Unknown', 'Leavingpool', 'Offline'
- State ComputeNodeState `json:"state,omitempty"`
- // SchedulingState - Possible values are: enabled – Tasks can be scheduled on the node. disabled – No new tasks will be scheduled on the node. Tasks already running on the node may still run to completion. All nodes start with scheduling enabled. Possible values include: 'Enabled', 'Disabled'
- SchedulingState SchedulingState `json:"schedulingState,omitempty"`
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // LastBootTime - This property may not be present if the node state is unusable.
- LastBootTime *date.Time `json:"lastBootTime,omitempty"`
- AllocationTime *date.Time `json:"allocationTime,omitempty"`
- // IPAddress - Every node that is added to a pool is assigned a unique IP address. Whenever a node is removed from a pool, all of its local files are deleted, and the IP address is reclaimed and could be reused for new nodes.
- IPAddress *string `json:"ipAddress,omitempty"`
- AffinityID *string `json:"affinityId,omitempty"`
- // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series).
- VMSize *string `json:"vmSize,omitempty"`
- TotalTasksRun *int32 `json:"totalTasksRun,omitempty"`
- RunningTasksCount *int32 `json:"runningTasksCount,omitempty"`
- TotalTasksSucceeded *int32 `json:"totalTasksSucceeded,omitempty"`
- RecentTasks *[]TaskInformation `json:"recentTasks,omitempty"`
- StartTask *StartTask `json:"startTask,omitempty"`
- StartTaskInfo *StartTaskInformation `json:"startTaskInfo,omitempty"`
- // CertificateReferences - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of remoteuser, a certs directory is created in the user's home directory (e.g., /home//certs) where certificates are placed.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- Errors *[]ComputeNodeError `json:"errors,omitempty"`
-}
-
-// ComputeNodeError ...
-type ComputeNodeError struct {
- Code *string `json:"code,omitempty"`
- Message *string `json:"message,omitempty"`
- ErrorDetails *[]NameValuePair `json:"errorDetails,omitempty"`
-}
-
-// ComputeNodeGetRemoteLoginSettingsResult ...
-type ComputeNodeGetRemoteLoginSettingsResult struct {
- autorest.Response `json:"-"`
- RemoteLoginIPAddress *string `json:"remoteLoginIPAddress,omitempty"`
- RemoteLoginPort *int32 `json:"remoteLoginPort,omitempty"`
-}
-
-// ComputeNodeInformation ...
-type ComputeNodeInformation struct {
- AffinityID *string `json:"affinityId,omitempty"`
- NodeURL *string `json:"nodeUrl,omitempty"`
- PoolID *string `json:"poolId,omitempty"`
- NodeID *string `json:"nodeId,omitempty"`
- TaskRootDirectory *string `json:"taskRootDirectory,omitempty"`
- TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"`
-}
-
-// ComputeNodeListResult ...
-type ComputeNodeListResult struct {
- autorest.Response `json:"-"`
- Value *[]ComputeNode `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// ComputeNodeListResultIterator provides access to a complete listing of ComputeNode values.
-type ComputeNodeListResultIterator struct {
- i int
- page ComputeNodeListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *ComputeNodeListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter ComputeNodeListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter ComputeNodeListResultIterator) Response() ComputeNodeListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter ComputeNodeListResultIterator) Value() ComputeNode {
- if !iter.page.NotDone() {
- return ComputeNode{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (cnlr ComputeNodeListResult) IsEmpty() bool {
- return cnlr.Value == nil || len(*cnlr.Value) == 0
-}
-
-// computeNodeListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (cnlr ComputeNodeListResult) computeNodeListResultPreparer() (*http.Request, error) {
- if cnlr.OdataNextLink == nil || len(to.String(cnlr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(cnlr.OdataNextLink)))
-}
-
-// ComputeNodeListResultPage contains a page of ComputeNode values.
-type ComputeNodeListResultPage struct {
- fn func(ComputeNodeListResult) (ComputeNodeListResult, error)
- cnlr ComputeNodeListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *ComputeNodeListResultPage) Next() error {
- next, err := page.fn(page.cnlr)
- if err != nil {
- return err
- }
- page.cnlr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page ComputeNodeListResultPage) NotDone() bool {
- return !page.cnlr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page ComputeNodeListResultPage) Response() ComputeNodeListResult {
- return page.cnlr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page ComputeNodeListResultPage) Values() []ComputeNode {
- if page.cnlr.IsEmpty() {
- return nil
- }
- return *page.cnlr.Value
-}
-
-// ComputeNodeUser ...
-type ComputeNodeUser struct {
- Name *string `json:"name,omitempty"`
- // IsAdmin - The default value is false.
- IsAdmin *bool `json:"isAdmin,omitempty"`
- // ExpiryTime - If omitted, the default is 1 day from the current time. For Linux compute nodes, the expiryTime has a precision up to a day.
- ExpiryTime *date.Time `json:"expiryTime,omitempty"`
- // Password - The password is required for Windows nodes (those created with 'cloudServiceConfiguration', or created with 'virtualMachineConfiguration' using a Windows image reference). For Linux compute nodes, the password can optionally be specified along with the sshPublicKey property.
- Password *string `json:"password,omitempty"`
- // SSHPublicKey - The public key should be compatible with OpenSSH encoding and should be base 64 encoded. This property can be specified only for Linux nodes. If this is specified for a Windows node, then the Batch service rejects the request; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- SSHPublicKey *string `json:"sshPublicKey,omitempty"`
-}
-
-// DeleteCertificateError ...
-type DeleteCertificateError struct {
- Code *string `json:"code,omitempty"`
- Message *string `json:"message,omitempty"`
- // Values - This list includes details such as the active pools and nodes referencing this certificate. However, if a large number of resources reference the certificate, the list contains only about the first hundred.
- Values *[]NameValuePair `json:"values,omitempty"`
-}
-
-// EnvironmentSetting ...
-type EnvironmentSetting struct {
- Name *string `json:"name,omitempty"`
- Value *string `json:"value,omitempty"`
-}
-
-// Error ...
-type Error struct {
- Code *string `json:"code,omitempty"`
- Message *ErrorMessage `json:"message,omitempty"`
- Values *[]ErrorDetail `json:"values,omitempty"`
-}
-
-// ErrorDetail ...
-type ErrorDetail struct {
- Key *string `json:"key,omitempty"`
- Value *string `json:"value,omitempty"`
-}
-
-// ErrorMessage ...
-type ErrorMessage struct {
- Lang *string `json:"lang,omitempty"`
- Value *string `json:"value,omitempty"`
-}
-
-// ExitCodeMapping ...
-type ExitCodeMapping struct {
- Code *int32 `json:"code,omitempty"`
- ExitOptions *ExitOptions `json:"exitOptions,omitempty"`
-}
-
-// ExitCodeRangeMapping ...
-type ExitCodeRangeMapping struct {
- Start *int32 `json:"start,omitempty"`
- End *int32 `json:"end,omitempty"`
- ExitOptions *ExitOptions `json:"exitOptions,omitempty"`
-}
-
-// ExitConditions ...
-type ExitConditions struct {
- ExitCodes *[]ExitCodeMapping `json:"exitCodes,omitempty"`
- ExitCodeRanges *[]ExitCodeRangeMapping `json:"exitCodeRanges,omitempty"`
- SchedulingError *ExitOptions `json:"schedulingError,omitempty"`
- // Default - Note that the default condition does not include exit code 0. If you want non-default behaviour on exit code 0, you must list it explicitly using the exitCodes or exitCodeRanges collection.
- Default *ExitOptions `json:"default,omitempty"`
-}
-
-// ExitOptions ...
-type ExitOptions struct {
- // JobAction - The default is none for exit code 0 and terminate for all other exit conditions. It is an error to specify this if the job's onTaskFailed is noaction. The add task request fails with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). Possible values include: 'JobActionNone', 'JobActionDisable', 'JobActionTerminate'
- JobAction JobAction `json:"jobAction,omitempty"`
-}
-
-// FileProperties ...
-type FileProperties struct {
- // CreationTime - The creation time is not returned for files on Linux compute nodes.
- CreationTime *date.Time `json:"creationTime,omitempty"`
- LastModified *date.Time `json:"lastModified,omitempty"`
- ContentLength *int64 `json:"contentLength,omitempty"`
- ContentType *string `json:"contentType,omitempty"`
- // FileMode - The file mode is returned only for files on Linux compute nodes.
- FileMode *string `json:"fileMode,omitempty"`
-}
-
-// ImageReference ...
-type ImageReference struct {
- // Publisher - For example, Canonical or MicrosoftWindowsServer.
- Publisher *string `json:"publisher,omitempty"`
- // Offer - For example, UbuntuServer or WindowsServer.
- Offer *string `json:"offer,omitempty"`
- // Sku - For example, 14.04.0-LTS or 2012-R2-Datacenter.
- Sku *string `json:"sku,omitempty"`
- // Version - A value of 'latest' can be specified to select the latest version of an image. If omitted, the default is 'latest'.
- Version *string `json:"version,omitempty"`
-}
-
-// JobAddParameter ...
-type JobAddParameter struct {
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. It is common to use a GUID for the id.
- ID *string `json:"id,omitempty"`
- // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0.
- Priority *int32 `json:"priority,omitempty"`
- // Constraints - The execution constraints for the job.
- Constraints *JobConstraints `json:"constraints,omitempty"`
- // JobManagerTask - If the job does not specify a Job Manager task, the user must explicitly add tasks to the job. If the job does specify a Job Manager task, the Batch service creates the Job Manager task when the job is created, and will try to schedule the Job Manager task before scheduling other tasks in the job. The Job Manager task's typical purpose is to control and/or monitor job execution, for example by deciding what additional tasks to run, determining when the work is complete, etc. (However, a Job Manager task is not restricted to these activities – it is a fully-fledged task in the system and perform whatever actions are required for the job.) For example, a Job Manager task might download a file specified as a parameter, analyze the contents of that file and submit additional tasks based on those contents.
- JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"`
- // JobPreparationTask - If a job has a Job Preparation task, the Batch service will run the Job Preparation task on a compute node before starting any tasks of that job on that compute node.
- JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"`
- // JobReleaseTask - A Job Release task cannot be specified without also specifying a Job Preparation task for the job. The Batch service runs the Job Release task on the compute nodes that have run the Job Preparation task. The primary purpose of the Job Release task is to undo changes to compute nodes made by the Job Preparation task. Example activities include deleting local files, or shutting down services that were started as part of job preparation.
- JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"`
- CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"`
- PoolInfo *PoolInformation `json:"poolInfo,omitempty"`
- // OnAllTasksComplete - Note that if a job contains no tasks, then all tasks are considered complete. This option is therefore most commonly used with a job manager task; if you want to use automatic job termination without a job manager, you should initially set onAllTasksComplete to noaction and update the job properties to set onAllTasksComplete to terminatejob once you have finished adding tasks. Permitted values are: noaction – do nothing. The job remains active unless terminated or disabled by some other means. terminatejob – terminate the job. The job’s terminateReason is set to 'AllTasksComplete'. The default is noaction. Possible values include: 'NoAction', 'TerminateJob'
- OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"`
- // OnTaskFailure - Permitted values are: noaction – do nothing. performexitoptionsjobaction – take the action associated with the task exit condition in the task's exitConditions collection. (This may still result in no action being taken, if that is what the task specifies.) The default is noaction. Possible values include: 'OnTaskFailureNoAction', 'OnTaskFailurePerformExitOptionsJobAction'
- OnTaskFailure OnTaskFailure `json:"onTaskFailure,omitempty"`
- // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
- UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"`
-}
-
-// JobConstraints ...
-type JobConstraints struct {
- // MaxWallClockTime - If the job does not complete within the time limit, the Batch service terminates it and any tasks that are still running. In this case, the termination reason will be MaxWallClockTimeExpiry. If this property is not specified, there is no time limit on how long the job may run.
- MaxWallClockTime *string `json:"maxWallClockTime,omitempty"`
- // MaxTaskRetryCount - Note that this value specifically controls the number of retries. The Batch service will try each task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries a task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry tasks. If the maximum retry count is -1, the Batch service retries tasks without limit. The default value is 0 (no retries).
- MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"`
-}
-
-// JobDisableParameter ...
-type JobDisableParameter struct {
- // DisableTasks - Possible values are: requeue – Terminate running tasks and requeue them. The tasks will run again when the job is enabled. terminate – Terminate running tasks. The tasks will not run again. wait – Allow currently running tasks to complete. Possible values include: 'DisableJobOptionRequeue', 'DisableJobOptionTerminate', 'DisableJobOptionWait'
- DisableTasks DisableJobOption `json:"disableTasks,omitempty"`
-}
-
-// JobExecutionInformation ...
-type JobExecutionInformation struct {
- // StartTime - This is the time at which the job was created.
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - This property is set only if the job is in the completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
- // PoolID - This element contains the actual pool where the job is assigned. When you get job details from the service, they also contain a poolInfo element, which contains the pool configuration data from when the job was added or updated. That poolInfo element may also contain a poolId element. If it does, the two IDs are the same. If it does not, it means the job ran on an auto pool, and this property contains the id of that auto pool.
- PoolID *string `json:"poolId,omitempty"`
- // SchedulingError - This property is not set if there was no error starting the job.
- SchedulingError *JobSchedulingError `json:"schedulingError,omitempty"`
- // TerminateReason - This property is set only if the job is in the completed state. If the Batch service terminates the job, it sets the reason as follows: JMComplete – the Job Manager task completed, and killJobOnCompletion was set to true. MaxWallClockTimeExpiry – the job reached its maxWallClockTime constraint. TerminateJobSchedule – the job ran as part of a schedule, and the schedule terminated. AllTasksComplete – the job's onAllTasksComplete attribute is set to terminatejob, and all tasks in the job are complete. TaskFailed – the job's onTaskFailure attribute is set to performexitoptionsjobaction, and a task in the job failed with an exit condition that specified a jobAction of terminatejob. Any other string is a user-defined reason specified in a call to the 'Terminate a job' operation.
- TerminateReason *string `json:"terminateReason,omitempty"`
-}
-
-// JobManagerTask ...
-type JobManagerTask struct {
- // ID - The id can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters.
- ID *string `json:"id,omitempty"`
- // DisplayName - It need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux.
- CommandLine *string `json:"commandLine,omitempty"`
- // ResourceFiles - Files listed under this element are located in the task's working directory.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- Constraints *TaskConstraints `json:"constraints,omitempty"`
- // KillJobOnCompletion - If true, when the Job Manager task completes, the Batch service marks the job as complete. If any tasks are still running at this time (other than Job Release), those tasks are terminated. If false, the completion of the Job Manager task does not affect the job status. In this case, you should either use the onAllTasksComplete attribute to terminate the job, or have a client or user terminate the job explicitly. An example of this is if the Job Manager creates a set of tasks but then takes no further role in their execution. The default value is true. If you are using the onAllTasksComplete and onTaskFailure attributes to control job lifetime, and using the job manager task only to create the tasks for the job (not to monitor progress), then it is important to set killJobOnCompletion to false.
- KillJobOnCompletion *bool `json:"killJobOnCompletion,omitempty"`
- RunElevated *bool `json:"runElevated,omitempty"`
- // RunExclusive - If true, no other tasks will run on the same compute node for as long as the Job Manager is running. If false, other tasks can run simultaneously with the Job Manager on a compute node. The Job Manager task counts normally against the node's concurrent task limit, so this is only relevant if the node allows multiple concurrent tasks. The default value is true.
- RunExclusive *bool `json:"runExclusive,omitempty"`
- // ApplicationPackageReferences - Application packages are downloaded and deployed to a shared directory, not the task directory. Therefore, if a referenced package is already on the compute node, and is up to date, then it is not re-downloaded; the existing copy on the compute node is used. If a referenced application package cannot be installed, for example because the package has been deleted or because download failed, the task fails with a scheduling error. This property is currently not supported on jobs running on pools created using the virtualMachineConfiguration (IaaS) property. If a task specifying applicationPackageReferences runs on such a pool, it fails with a scheduling error with code TaskSchedulingConstraintFailed.
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
-}
-
-// JobPatchParameter ...
-type JobPatchParameter struct {
- // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. If omitted, the priority of the job is left unchanged.
- Priority *int32 `json:"priority,omitempty"`
- // OnAllTasksComplete - If omitted, the completion behavior is left unchanged. You may not change the value from terminatejob to noaction – that is, once you have engaged automatic job termination, you cannot turn it off again. If you try to do this, the request fails with an 'invalid property value' error response; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). Possible values include: 'NoAction', 'TerminateJob'
- OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"`
- // Constraints - If omitted, the existing execution constraints are left unchanged.
- Constraints *JobConstraints `json:"constraints,omitempty"`
- // PoolInfo - You may change the pool for a job only when the job is disabled. The Patch Job call will fail if you include the poolInfo element and the job is not disabled. If you specify an autoPoolSpecification specification in the poolInfo, only the keepAlive property can be updated, and then only if the auto pool has a poolLifetimeOption of job. If omitted, the job continues to run on its current pool.
- PoolInfo *PoolInformation `json:"poolInfo,omitempty"`
- // Metadata - If omitted, the existing job metadata is left unchanged.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// JobPreparationAndReleaseTaskExecutionInformation ...
-type JobPreparationAndReleaseTaskExecutionInformation struct {
- PoolID *string `json:"poolId,omitempty"`
- NodeID *string `json:"nodeId,omitempty"`
- NodeURL *string `json:"nodeUrl,omitempty"`
- JobPreparationTaskExecutionInfo *JobPreparationTaskExecutionInformation `json:"jobPreparationTaskExecutionInfo,omitempty"`
- // JobReleaseTaskExecutionInfo - This property is set only if the Job Release task has run on the node.
- JobReleaseTaskExecutionInfo *JobReleaseTaskExecutionInformation `json:"jobReleaseTaskExecutionInfo,omitempty"`
-}
-
-// JobPreparationTask ...
-type JobPreparationTask struct {
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobpreparation'. No other task in the job can have the same id as the Job Preparation task. If you try to submit a task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobPreparationTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict).
- ID *string `json:"id,omitempty"`
- // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux.
- CommandLine *string `json:"commandLine,omitempty"`
- // ResourceFiles - Files listed under this element are located in the task's working directory.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- Constraints *TaskConstraints `json:"constraints,omitempty"`
- // WaitForSuccess - If true and the Job Preparation task fails on a compute node, the Batch service retries the Job Preparation task up to its maximum retry count (as specified in the constraints element). If the task has still not completed successfully after all retries, then the Batch service will not schedule tasks of the job to the compute node. The compute node remains active and eligible to run tasks of other jobs. If false, the Batch service will not wait for the Job Preparation task to complete. In this case, other tasks of the job can start executing on the compute node while the Job Preparation task is still running; and even if the Job Preparation task fails, new tasks will continue to be scheduled on the node. The default value is true.
- WaitForSuccess *bool `json:"waitForSuccess,omitempty"`
- RunElevated *bool `json:"runElevated,omitempty"`
- // RerunOnNodeRebootAfterSuccess - The Job Preparation task is always rerun if a compute node is reimaged, or if the Job Preparation task did not complete (e.g. because the reboot occurred while the task was running). Therefore, you should always write a Job Preparation task to be idempotent and to behave correctly if run multiple times. The default value is true.
- RerunOnNodeRebootAfterSuccess *bool `json:"rerunOnNodeRebootAfterSuccess,omitempty"`
-}
-
-// JobPreparationTaskExecutionInformation ...
-type JobPreparationTaskExecutionInformation struct {
- // StartTime - Note that every time the task is restarted, this value is updated.
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - This property is set only if the task is in the Completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
- // State - Possible values are: running – the task is currently running (including retrying). completed – the task has exited with exit code 0, or the task has exhausted its retry limit, or the Batch service was unable to start the task due to scheduling errors. Possible values include: 'JobPreparationTaskStateRunning', 'JobPreparationTaskStateCompleted'
- State JobPreparationTaskState `json:"state,omitempty"`
- TaskRootDirectory *string `json:"taskRootDirectory,omitempty"`
- TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"`
- // ExitCode - This parameter is returned only if the task is in the completed state. The exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. Note that the exit code may also be generated by the compute node operating system, such as when a process is forcibly terminated.
- ExitCode *int32 `json:"exitCode,omitempty"`
- SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"`
- RetryCount *int32 `json:"retryCount,omitempty"`
- // LastRetryTime - This property is set only if the task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the task has been restarted for reasons other than retry; for example, if the compute node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not.
- LastRetryTime *date.Time `json:"lastRetryTime,omitempty"`
-}
-
-// JobReleaseTask ...
-type JobReleaseTask struct {
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobrelease'. No other task in the job can have the same id as the Job Release task. If you try to submit a task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobReleaseTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict).
- ID *string `json:"id,omitempty"`
- // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux.
- CommandLine *string `json:"commandLine,omitempty"`
- // ResourceFiles - Files listed under this element are located in the task's working directory.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- MaxWallClockTime *string `json:"maxWallClockTime,omitempty"`
- // RetentionTime - The default is infinite, i.e. the task directory will be retained until the compute node is removed or reimaged.
- RetentionTime *string `json:"retentionTime,omitempty"`
- // RunElevated - The default value is false.
- RunElevated *bool `json:"runElevated,omitempty"`
-}
-
-// JobReleaseTaskExecutionInformation ...
-type JobReleaseTaskExecutionInformation struct {
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - This property is set only if the task is in the Completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
- // State - Possible values are: running – the task is currently running (including retrying). completed – the task has exited, or the Batch service was unable to start the task due to scheduling errors. Possible values include: 'JobReleaseTaskStateRunning', 'JobReleaseTaskStateCompleted'
- State JobReleaseTaskState `json:"state,omitempty"`
- TaskRootDirectory *string `json:"taskRootDirectory,omitempty"`
- TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"`
- // ExitCode - This parameter is returned only if the task is in the completed state. The exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. Note that the exit code may also be generated by the compute node operating system, such as when a process is forcibly terminated.
- ExitCode *int32 `json:"exitCode,omitempty"`
- SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"`
-}
-
-// JobScheduleAddParameter ...
-type JobScheduleAddParameter struct {
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The id is case-preserving and case-insensitive (that is, you may not have two ids within an account that differ only by case).
- ID *string `json:"id,omitempty"`
- // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- Schedule *Schedule `json:"schedule,omitempty"`
- JobSpecification *JobSpecification `json:"jobSpecification,omitempty"`
- // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// JobScheduleExecutionInformation ...
-type JobScheduleExecutionInformation struct {
- // NextRunTime - This property is meaningful only if the schedule is in the active state when the time comes around. For example, if the schedule is disabled, no job will be created at nextRunTime unless the job is enabled before then.
- NextRunTime *date.Time `json:"nextRunTime,omitempty"`
- // RecentJob - This property is present only if the at least one job has run under the schedule.
- RecentJob *RecentJob `json:"recentJob,omitempty"`
- // EndTime - This property is set only if the job schedule is in the completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
-}
-
-// JobSchedulePatchParameter ...
-type JobSchedulePatchParameter struct {
- // Schedule - If you do not specify this element, the existing schedule is left unchanged.
- Schedule *Schedule `json:"schedule,omitempty"`
- // JobSpecification - Updates affect only jobs that are started after the update has taken place. Any currently active job continues with the older specification.
- JobSpecification *JobSpecification `json:"jobSpecification,omitempty"`
- // Metadata - If you do not specify this element, existing metadata is left unchanged.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// JobScheduleStatistics ...
-type JobScheduleStatistics struct {
- URL *string `json:"url,omitempty"`
- StartTime *date.Time `json:"startTime,omitempty"`
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- UserCPUTime *string `json:"userCPUTime,omitempty"`
- KernelCPUTime *string `json:"kernelCPUTime,omitempty"`
- // WallClockTime - The wall clock time is the elapsed time from when the task started running on a compute node to when it finished (or to the last time the statistics were updated, if the task had not finished by then). If a task was retried, this includes the wall clock time of all the task retries.
- WallClockTime *string `json:"wallClockTime,omitempty"`
- ReadIOps *int64 `json:"readIOps,omitempty"`
- WriteIOps *int64 `json:"writeIOps,omitempty"`
- ReadIOGiB *float64 `json:"readIOGiB,omitempty"`
- WriteIOGiB *float64 `json:"writeIOGiB,omitempty"`
- NumSucceededTasks *int64 `json:"numSucceededTasks,omitempty"`
- NumFailedTasks *int64 `json:"numFailedTasks,omitempty"`
- NumTaskRetries *int64 `json:"numTaskRetries,omitempty"`
- // WaitTime - This value is only reported in the account lifetime statistics; it is not included in the job statistics.
- WaitTime *string `json:"waitTime,omitempty"`
-}
-
-// JobScheduleUpdateParameter ...
-type JobScheduleUpdateParameter struct {
- // Schedule - If you do not specify this element, it is equivalent to passing the default schedule: that is, a single job scheduled to run immediately.
- Schedule *Schedule `json:"schedule,omitempty"`
- // JobSpecification - Updates affect only jobs that are started after the update has taken place. Any currently active job continues with the older specification.
- JobSpecification *JobSpecification `json:"jobSpecification,omitempty"`
- // Metadata - If you do not specify this element, it takes the default value of an empty list; in effect, any existing metadata is deleted.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// JobSchedulingError ...
-type JobSchedulingError struct {
- // Category - Possible values include: 'SchedulingErrorCategoryUsererror', 'SchedulingErrorCategoryServererror', 'SchedulingErrorCategoryUnmapped'
- Category SchedulingErrorCategory `json:"category,omitempty"`
- Code *string `json:"code,omitempty"`
- Message *string `json:"message,omitempty"`
- Details *[]NameValuePair `json:"details,omitempty"`
-}
-
-// JobSpecification ...
-type JobSpecification struct {
- // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0. This priority is used as the default for all jobs under the job schedule. You can update a job's priority after it has been created using by using the update job API.
- Priority *int32 `json:"priority,omitempty"`
- // DisplayName - The name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"`
- // OnAllTasksComplete - Note that if a job contains no tasks, then all tasks are considered complete. This option is therefore most commonly used with a job manager task; if you want to use automatic job termination without a job manager, you should initially set onAllTasksComplete to noaction and update the job properties to set onAllTasksComplete to terminatejob once you have finished adding tasks. The default is noaction. Possible values include: 'NoAction', 'TerminateJob'
- OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"`
- // OnTaskFailure - The default is noaction. Possible values include: 'OnTaskFailureNoAction', 'OnTaskFailurePerformExitOptionsJobAction'
- OnTaskFailure OnTaskFailure `json:"onTaskFailure,omitempty"`
- Constraints *JobConstraints `json:"constraints,omitempty"`
- // JobManagerTask - If the job does not specify a Job Manager task, the user must explicitly add tasks to the job using the Task API. If the job does specify a Job Manager task, the Batch service creates the Job Manager task when the job is created, and will try to schedule the Job Manager task before scheduling other tasks in the job.
- JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"`
- // JobPreparationTask - If a job has a Job Preparation task, the Batch service will run the Job Preparation task on a compute node before starting any tasks of that job on that compute node.
- JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"`
- // JobReleaseTask - The primary purpose of the Job Release task is to undo changes to compute nodes made by the Job Preparation task. Example activities include deleting local files, or shutting down services that were started as part of job preparation. A Job Release task cannot be specified without also specifying a Job Preparation task for the job. The Batch service runs the Job Release task on the compute nodes that have run the Job Preparation task.
- JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"`
- // CommonEnvironmentSettings - Individual tasks can override an environment setting specified here by specifying the same setting name with a different value.
- CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"`
- PoolInfo *PoolInformation `json:"poolInfo,omitempty"`
- // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// JobStatistics ...
-type JobStatistics struct {
- autorest.Response `json:"-"`
- URL *string `json:"url,omitempty"`
- StartTime *date.Time `json:"startTime,omitempty"`
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- UserCPUTime *string `json:"userCPUTime,omitempty"`
- KernelCPUTime *string `json:"kernelCPUTime,omitempty"`
- WallClockTime *string `json:"wallClockTime,omitempty"`
- ReadIOps *int64 `json:"readIOps,omitempty"`
- WriteIOps *int64 `json:"writeIOps,omitempty"`
- ReadIOGiB *float64 `json:"readIOGiB,omitempty"`
- WriteIOGiB *float64 `json:"writeIOGiB,omitempty"`
- // NumSucceededTasks - A task completes successfully if it returns exit code 0.
- NumSucceededTasks *int64 `json:"numSucceededTasks,omitempty"`
- // NumFailedTasks - A task fails if it exhausts its maximum retry count without returning exit code 0.
- NumFailedTasks *int64 `json:"numFailedTasks,omitempty"`
- NumTaskRetries *int64 `json:"numTaskRetries,omitempty"`
- // WaitTime - The wait time for a task is defined as the elapsed time between the creation of the task and the start of task execution. (If the task is retried due to failures, the wait time is the time to the most recent task execution.) This value is only reported in the account lifetime statistics; it is not included in the job statistics.
- WaitTime *string `json:"waitTime,omitempty"`
-}
-
-// JobTerminateParameter ...
-type JobTerminateParameter struct {
- TerminateReason *string `json:"terminateReason,omitempty"`
-}
-
-// JobUpdateParameter ...
-type JobUpdateParameter struct {
- // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. If omitted, it is set to the default value 0.
- Priority *int32 `json:"priority,omitempty"`
- // Constraints - If omitted, the constraints are cleared.
- Constraints *JobConstraints `json:"constraints,omitempty"`
- // PoolInfo - You may change the pool for a job only when the job is disabled. The Update Job call will fail if you include the poolInfo element and the job is not disabled. If you specify an autoPoolSpecification specification in the poolInfo, only the keepAlive property can be updated, and then only if the auto pool has a poolLifetimeOption of job.
- PoolInfo *PoolInformation `json:"poolInfo,omitempty"`
- // Metadata - If omitted, it takes the default value of an empty list; in effect, any existing metadata is deleted.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
- // OnAllTasksComplete - If omitted, the completion behavior is set to noaction. If the current value is terminatejob, this is an error because a job's completion behavior may not be changed from terminatejob to noaction. Possible values include: 'NoAction', 'TerminateJob'
- OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"`
-}
-
-// MetadataItem the Batch service does not assign any meaning to this metadata; it is solely for the use of user
-// code.
-type MetadataItem struct {
- Name *string `json:"name,omitempty"`
- Value *string `json:"value,omitempty"`
-}
-
-// MultiInstanceSettings multi-instance tasks are commonly used to support MPI tasks.
-type MultiInstanceSettings struct {
- NumberOfInstances *int32 `json:"numberOfInstances,omitempty"`
- // CoordinationCommandLine - A typical coordination command line launches a background service and verifies that the service is ready to process inter-node messages.
- CoordinationCommandLine *string `json:"coordinationCommandLine,omitempty"`
- // CommonResourceFiles - The difference between common resource files and task resource files is that common resource files are downloaded for all subtasks including the primary, whereas task resource files are downloaded only for the primary.
- CommonResourceFiles *[]ResourceFile `json:"commonResourceFiles,omitempty"`
-}
-
-// NameValuePair ...
-type NameValuePair struct {
- Name *string `json:"name,omitempty"`
- Value *string `json:"value,omitempty"`
-}
-
-// NetworkConfiguration the network configuration for a pool.
-type NetworkConfiguration struct {
- // SubnetID - The virtual network must be in the same region and subscription as the Azure Batch account. The specified subnet should have enough free IP addresses to accommodate the number of nodes in the pool. If the subnet doesn't have enough free IP addresses, the pool will partially allocate compute nodes, and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to be able to schedule tasks on the compute nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the compute nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the compute nodes to unusable. This property can only be specified for pools created with a cloudServiceConfiguration.
- SubnetID *string `json:"subnetId,omitempty"`
-}
-
-// NodeAgentSku the Batch node agent is a program that runs on each node in the pool, and provides the
-// command-and-control interface between the node and the Batch service. There are different implementations of the
-// node agent, known as SKUs, for different operating systems.
-type NodeAgentSku struct {
- ID *string `json:"id,omitempty"`
- // VerifiedImageReferences - This collection is not exhaustive (the node agent may be compatible with other images).
- VerifiedImageReferences *[]ImageReference `json:"verifiedImageReferences,omitempty"`
- // OsType - Possible values include: 'OSTypeLinux', 'OSTypeWindows', 'OSTypeUnmapped'
- OsType OSType `json:"osType,omitempty"`
-}
-
-// NodeDisableSchedulingParameter ...
-type NodeDisableSchedulingParameter struct {
- // NodeDisableSchedulingOption - The default value is requeue. Possible values include: 'DisableComputeNodeSchedulingOptionRequeue', 'DisableComputeNodeSchedulingOptionTerminate', 'DisableComputeNodeSchedulingOptionTaskcompletion'
- NodeDisableSchedulingOption DisableComputeNodeSchedulingOption `json:"nodeDisableSchedulingOption,omitempty"`
-}
-
-// NodeFile ...
-type NodeFile struct {
- Name *string `json:"name,omitempty"`
- URL *string `json:"url,omitempty"`
- IsDirectory *bool `json:"isDirectory,omitempty"`
- Properties *FileProperties `json:"properties,omitempty"`
-}
-
-// NodeFileListResult ...
-type NodeFileListResult struct {
- autorest.Response `json:"-"`
- Value *[]NodeFile `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// NodeFileListResultIterator provides access to a complete listing of NodeFile values.
-type NodeFileListResultIterator struct {
- i int
- page NodeFileListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *NodeFileListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter NodeFileListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter NodeFileListResultIterator) Response() NodeFileListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter NodeFileListResultIterator) Value() NodeFile {
- if !iter.page.NotDone() {
- return NodeFile{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (nflr NodeFileListResult) IsEmpty() bool {
- return nflr.Value == nil || len(*nflr.Value) == 0
-}
-
-// nodeFileListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (nflr NodeFileListResult) nodeFileListResultPreparer() (*http.Request, error) {
- if nflr.OdataNextLink == nil || len(to.String(nflr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(nflr.OdataNextLink)))
-}
-
-// NodeFileListResultPage contains a page of NodeFile values.
-type NodeFileListResultPage struct {
- fn func(NodeFileListResult) (NodeFileListResult, error)
- nflr NodeFileListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *NodeFileListResultPage) Next() error {
- next, err := page.fn(page.nflr)
- if err != nil {
- return err
- }
- page.nflr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page NodeFileListResultPage) NotDone() bool {
- return !page.nflr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page NodeFileListResultPage) Response() NodeFileListResult {
- return page.nflr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page NodeFileListResultPage) Values() []NodeFile {
- if page.nflr.IsEmpty() {
- return nil
- }
- return *page.nflr.Value
-}
-
-// NodeRebootParameter ...
-type NodeRebootParameter struct {
- // NodeRebootOption - The default value is requeue. Possible values include: 'ComputeNodeRebootOptionRequeue', 'ComputeNodeRebootOptionTerminate', 'ComputeNodeRebootOptionTaskcompletion', 'ComputeNodeRebootOptionRetaineddata'
- NodeRebootOption ComputeNodeRebootOption `json:"nodeRebootOption,omitempty"`
-}
-
-// NodeReimageParameter ...
-type NodeReimageParameter struct {
- // NodeReimageOption - The default value is requeue. Possible values include: 'ComputeNodeReimageOptionRequeue', 'ComputeNodeReimageOptionTerminate', 'ComputeNodeReimageOptionTaskcompletion', 'ComputeNodeReimageOptionRetaineddata'
- NodeReimageOption ComputeNodeReimageOption `json:"nodeReimageOption,omitempty"`
-}
-
-// NodeRemoveParameter ...
-type NodeRemoveParameter struct {
- NodeList *[]string `json:"nodeList,omitempty"`
- // ResizeTimeout - The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- ResizeTimeout *string `json:"resizeTimeout,omitempty"`
- // NodeDeallocationOption - The default value is requeue. Possible values include: 'Requeue', 'Terminate', 'Taskcompletion', 'Retaineddata'
- NodeDeallocationOption ComputeNodeDeallocationOption `json:"nodeDeallocationOption,omitempty"`
-}
-
-// NodeUpdateUserParameter ...
-type NodeUpdateUserParameter struct {
- // Password - The password is required for Windows nodes (those created with 'cloudServiceConfiguration', or created with 'virtualMachineConfiguration' using a Windows image reference). For Linux compute nodes, the password can optionally be specified along with the sshPublicKey property. If omitted, any existing password is removed.
- Password *string `json:"password,omitempty"`
- // ExpiryTime - If omitted, the default is 1 day from the current time. For Linux compute nodes, the expiryTime has a precision up to a day.
- ExpiryTime *date.Time `json:"expiryTime,omitempty"`
- // SSHPublicKey - The public key should be compatible with OpenSSH encoding and should be base 64 encoded. This property can be specified only for Linux nodes. If this is specified for a Windows node, then the Batch service rejects the request; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). If omitted, any existing SSH public key is removed.
- SSHPublicKey *string `json:"sshPublicKey,omitempty"`
-}
-
-// PoolAddParameter ...
-type PoolAddParameter struct {
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two pool IDs within an account that differ only by case).
- ID *string `json:"id,omitempty"`
- // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series).
- VMSize *string `json:"vmSize,omitempty"`
- // CloudServiceConfiguration - This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified.
- CloudServiceConfiguration *CloudServiceConfiguration `json:"cloudServiceConfiguration,omitempty"`
- // VirtualMachineConfiguration - This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified.
- VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"`
- // ResizeTimeout - This timeout applies only to manual scaling; it has no effect when enableAutoScale is set to true. The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- ResizeTimeout *string `json:"resizeTimeout,omitempty"`
- // TargetDedicated - This property must have the default value if enableAutoScale is true. It is required if enableAutoScale is false.
- TargetDedicated *int32 `json:"targetDedicated,omitempty"`
- // EnableAutoScale - If true, the autoScaleFormula property must be set. If false, the targetDedicated property must be set. The default value is false.
- EnableAutoScale *bool `json:"enableAutoScale,omitempty"`
- // AutoScaleFormula - This property must not be specified if enableAutoScale is set to false. It is required if enableAutoScale is set to true. The formula is checked for validity before the pool is created. If the formula is not valid, the Batch service rejects the request with detailed error information. For more information about specifying this formula, see 'Automatically scale compute nodes in an Azure Batch pool' (https://azure.microsoft.com/documentation/articles/batch-automatic-scaling/).
- AutoScaleFormula *string `json:"autoScaleFormula,omitempty"`
- // AutoScaleEvaluationInterval - The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"`
- // EnableInterNodeCommunication - Enabling inter-node communication limits the maximum size of the pool due to deployment restrictions on the nodes of the pool. This may result in the pool not reaching its desired size. The default value is false.
- EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"`
- NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"`
- // StartTask - The task runs when the node is added to the pool or when the node is restarted.
- StartTask *StartTask `json:"startTask,omitempty"`
- // CertificateReferences - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of remoteuser, a certs directory is created in the user's home directory (e.g., /home//certs) where certificates are placed.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- // ApplicationPackageReferences - This property is currently not supported on pools created using the virtualMachineConfiguration (IaaS) property.
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // MaxTasksPerNode - The default value is 1. The maximum value of this setting depends on the size of the compute nodes in the pool (the vmSize setting).
- MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"`
- TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"`
- // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// PoolEnableAutoScaleParameter ...
-type PoolEnableAutoScaleParameter struct {
- // AutoScaleFormula - The formula is checked for validity before it is applied to the pool. If the formula is not valid, the Batch service rejects the request with detailed error information. For more information about specifying this formula, see Automatically scale compute nodes in an Azure Batch pool (https://azure.microsoft.com/en-us/documentation/articles/batch-automatic-scaling).
- AutoScaleFormula *string `json:"autoScaleFormula,omitempty"`
- // AutoScaleEvaluationInterval - The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service rejects the request with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). If you specify a new interval, then the existing autoscale evaluation schedule will be stopped and a new autoscale evaluation schedule will be started, with its starting time being the time when this request was issued.
- AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"`
-}
-
-// PoolEvaluateAutoScaleParameter ...
-type PoolEvaluateAutoScaleParameter struct {
- // AutoScaleFormula - The formula is validated and its results calculated, but it is not applied to the pool. To apply the formula to the pool, 'Enable automatic scaling on a pool'. For more information about specifying this formula, see Automatically scale compute nodes in an Azure Batch pool (https://azure.microsoft.com/en-us/documentation/articles/batch-automatic-scaling).
- AutoScaleFormula *string `json:"autoScaleFormula,omitempty"`
-}
-
-// PoolInformation ...
-type PoolInformation struct {
- // PoolID - You must ensure that the pool referenced by this property exists. If the pool does not exist at the time the Batch service tries to schedule a job, no tasks for the job will run until you create a pool with that id. Note that the Batch service will not reject the job request; it will simply not run tasks until the pool exists. You must specify either the pool ID or the auto pool specification, but not both.
- PoolID *string `json:"poolId,omitempty"`
- // AutoPoolSpecification - If auto pool creation fails, the Batch service moves the job to a completed state, and the pool creation error is set in the job's scheduling error property. The Batch service manages the lifetime (both creation and, unless keepAlive is specified, deletion) of the auto pool. Any user actions that affect the lifetime of the auto pool while the job is active will result in unexpected behavior. You must specify either the pool ID or the auto pool specification, but not both.
- AutoPoolSpecification *AutoPoolSpecification `json:"autoPoolSpecification,omitempty"`
-}
-
-// PoolListPoolUsageMetricsResult ...
-type PoolListPoolUsageMetricsResult struct {
- autorest.Response `json:"-"`
- Value *[]PoolUsageMetrics `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// PoolListPoolUsageMetricsResultIterator provides access to a complete listing of PoolUsageMetrics values.
-type PoolListPoolUsageMetricsResultIterator struct {
- i int
- page PoolListPoolUsageMetricsResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *PoolListPoolUsageMetricsResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter PoolListPoolUsageMetricsResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter PoolListPoolUsageMetricsResultIterator) Response() PoolListPoolUsageMetricsResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter PoolListPoolUsageMetricsResultIterator) Value() PoolUsageMetrics {
- if !iter.page.NotDone() {
- return PoolUsageMetrics{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (plpumr PoolListPoolUsageMetricsResult) IsEmpty() bool {
- return plpumr.Value == nil || len(*plpumr.Value) == 0
-}
-
-// poolListPoolUsageMetricsResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (plpumr PoolListPoolUsageMetricsResult) poolListPoolUsageMetricsResultPreparer() (*http.Request, error) {
- if plpumr.OdataNextLink == nil || len(to.String(plpumr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(plpumr.OdataNextLink)))
-}
-
-// PoolListPoolUsageMetricsResultPage contains a page of PoolUsageMetrics values.
-type PoolListPoolUsageMetricsResultPage struct {
- fn func(PoolListPoolUsageMetricsResult) (PoolListPoolUsageMetricsResult, error)
- plpumr PoolListPoolUsageMetricsResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *PoolListPoolUsageMetricsResultPage) Next() error {
- next, err := page.fn(page.plpumr)
- if err != nil {
- return err
- }
- page.plpumr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page PoolListPoolUsageMetricsResultPage) NotDone() bool {
- return !page.plpumr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page PoolListPoolUsageMetricsResultPage) Response() PoolListPoolUsageMetricsResult {
- return page.plpumr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page PoolListPoolUsageMetricsResultPage) Values() []PoolUsageMetrics {
- if page.plpumr.IsEmpty() {
- return nil
- }
- return *page.plpumr.Value
-}
-
-// PoolPatchParameter ...
-type PoolPatchParameter struct {
- // StartTask - If omitted, any existing start task is left unchanged.
- StartTask *StartTask `json:"startTask,omitempty"`
- // CertificateReferences - If omitted, any existing certificate references are left unchanged. For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of remoteuser, a certs directory is created in the user's home directory (e.g., /home//certs) where certificates are placed.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- // ApplicationPackageReferences - Changes to application package references affect all new compute nodes joining the pool, but do not affect compute nodes that are already in the pool until they are rebooted or reimaged. If this element is present, it replaces any existing application package references. If you specify an empty collection, then all application package references are removed from the pool. If omitted, any existing application package references are left unchanged.
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // Metadata - If this element is present, it replaces any existing metadata configured on the pool. If you specify an empty collection, any metadata is removed from the pool. If omitted, any existing metadata is left unchanged.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// PoolResizeParameter ...
-type PoolResizeParameter struct {
- TargetDedicated *int32 `json:"targetDedicated,omitempty"`
- // ResizeTimeout - The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- ResizeTimeout *string `json:"resizeTimeout,omitempty"`
- // NodeDeallocationOption - The default value is requeue. Possible values include: 'Requeue', 'Terminate', 'Taskcompletion', 'Retaineddata'
- NodeDeallocationOption ComputeNodeDeallocationOption `json:"nodeDeallocationOption,omitempty"`
-}
-
-// PoolSpecification ...
-type PoolSpecification struct {
- // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series).
- VMSize *string `json:"vmSize,omitempty"`
- // CloudServiceConfiguration - This property must be specified if the pool needs to be created with Azure PaaS VMs. This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. If neither is specified then the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- CloudServiceConfiguration *CloudServiceConfiguration `json:"cloudServiceConfiguration,omitempty"`
- // VirtualMachineConfiguration - This property must be specified if the pool needs to be created with Azure IaaS VMs. This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified. If neither is specified then the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"`
- // MaxTasksPerNode - The default value is 1. The maximum value of this setting depends on the size of the compute nodes in the pool (the vmSize setting).
- MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"`
- // TaskSchedulingPolicy - How tasks are distributed among compute nodes in the pool.
- TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"`
- // ResizeTimeout - This timeout applies only to manual scaling; it has no effect when enableAutoScale is set to true. The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service rejects the request with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- ResizeTimeout *string `json:"resizeTimeout,omitempty"`
- // TargetDedicated - This property must not be specified if enableAutoScale is set to true. It is required if enableAutoScale is set to false.
- TargetDedicated *int32 `json:"targetDedicated,omitempty"`
- // EnableAutoScale - If false, the targetDedicated element is required. If true, the autoScaleFormula element is required. The pool automatically resizes according to the formula. The default value is false.
- EnableAutoScale *bool `json:"enableAutoScale,omitempty"`
- // AutoScaleFormula - This property must not be specified if enableAutoScale is set to false. It is required if enableAutoScale is set to true. The formula is checked for validity before the pool is created. If the formula is not valid, the Batch service rejects the request with detailed error information.
- AutoScaleFormula *string `json:"autoScaleFormula,omitempty"`
- // AutoScaleEvaluationInterval - The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service rejects the request with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"`
- // EnableInterNodeCommunication - Enabling inter-node communication limits the maximum size of the pool due to deployment restrictions on the nodes of the pool. This may result in the pool not reaching its desired size. The default value is false.
- EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"`
- NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"`
- StartTask *StartTask `json:"startTask,omitempty"`
- // CertificateReferences - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of remoteuser, a certs directory is created in the user's home directory (e.g., /home//certs) where certificates are placed.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- // ApplicationPackageReferences - This property is currently not supported on auto pools created with the virtualMachineConfiguration (IaaS) property.
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// PoolStatistics ...
-type PoolStatistics struct {
- autorest.Response `json:"-"`
- URL *string `json:"url,omitempty"`
- StartTime *date.Time `json:"startTime,omitempty"`
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- UsageStats *UsageStatistics `json:"usageStats,omitempty"`
- ResourceStats *ResourceStatistics `json:"resourceStats,omitempty"`
-}
-
-// PoolUpdatePropertiesParameter ...
-type PoolUpdatePropertiesParameter struct {
- // StartTask - If this element is present, it overwrites any existing start task. If omitted, any existing start task is removed from the pool.
- StartTask *StartTask `json:"startTask,omitempty"`
- // CertificateReferences - If you specify an empty collection, any existing certificate references are removed from the pool. For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of remoteuser, a certs directory is created in the user's home directory (e.g., /home//certs) where certificates are placed.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- // ApplicationPackageReferences - Changes to application package references affect all new compute nodes joining the pool, but do not affect compute nodes that are already in the pool until they are rebooted or reimaged. The list replaces any existing application package references. If omitted, or if you specify an empty collection, any existing application packages references are removed from the pool.
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // Metadata - This list replaces any existing metadata configured on the pool. If omitted, or if you specify an empty collection, any existing metadata is removed from the pool.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// PoolUpgradeOSParameter ...
-type PoolUpgradeOSParameter struct {
- TargetOSVersion *string `json:"targetOSVersion,omitempty"`
-}
-
-// PoolUsageMetrics ...
-type PoolUsageMetrics struct {
- PoolID *string `json:"poolId,omitempty"`
- StartTime *date.Time `json:"startTime,omitempty"`
- EndTime *date.Time `json:"endTime,omitempty"`
- // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series).
- VMSize *string `json:"vmSize,omitempty"`
- TotalCoreHours *float64 `json:"totalCoreHours,omitempty"`
- DataIngressGiB *float64 `json:"dataIngressGiB,omitempty"`
- DataEgressGiB *float64 `json:"dataEgressGiB,omitempty"`
-}
-
-// ReadCloser ...
-type ReadCloser struct {
- autorest.Response `json:"-"`
- Value *io.ReadCloser `json:"value,omitempty"`
-}
-
-// RecentJob ...
-type RecentJob struct {
- ID *string `json:"id,omitempty"`
- URL *string `json:"url,omitempty"`
-}
-
-// ResizeError ...
-type ResizeError struct {
- Code *string `json:"code,omitempty"`
- Message *string `json:"message,omitempty"`
- Values *[]NameValuePair `json:"values,omitempty"`
-}
-
-// ResourceFile ...
-type ResourceFile struct {
- // BlobSource - This URL must be readable using anonymous access; that is, the Batch service does not present any credentials when downloading the blob. There are two ways to get such a URL for a blob in Azure storage: include a Shared Access Signature (SAS) granting read permissions on the blob, or set the ACL for the blob or its container to allow public access.
- BlobSource *string `json:"blobSource,omitempty"`
- FilePath *string `json:"filePath,omitempty"`
- // FileMode - This property applies only to files being downloaded to Linux compute nodes. It will be ignored if it is specified for a resourceFile which will be downloaded to a Windows node. If this property is not specified for a Linux node, then a default value of 0770 is applied to the file.
- FileMode *string `json:"fileMode,omitempty"`
-}
-
-// ResourceStatistics ...
-type ResourceStatistics struct {
- StartTime *date.Time `json:"startTime,omitempty"`
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- AvgCPUPercentage *float64 `json:"avgCPUPercentage,omitempty"`
- AvgMemoryGiB *float64 `json:"avgMemoryGiB,omitempty"`
- PeakMemoryGiB *float64 `json:"peakMemoryGiB,omitempty"`
- AvgDiskGiB *float64 `json:"avgDiskGiB,omitempty"`
- PeakDiskGiB *float64 `json:"peakDiskGiB,omitempty"`
- DiskReadIOps *int64 `json:"diskReadIOps,omitempty"`
- DiskWriteIOps *int64 `json:"diskWriteIOps,omitempty"`
- DiskReadGiB *float64 `json:"diskReadGiB,omitempty"`
- DiskWriteGiB *float64 `json:"diskWriteGiB,omitempty"`
- NetworkReadGiB *float64 `json:"networkReadGiB,omitempty"`
- NetworkWriteGiB *float64 `json:"networkWriteGiB,omitempty"`
-}
-
-// Schedule ...
-type Schedule struct {
- // DoNotRunUntil - If you do not specify a doNotRunUntil time, the schedule becomes ready to create jobs immediately.
- DoNotRunUntil *date.Time `json:"doNotRunUntil,omitempty"`
- // DoNotRunAfter - If you do not specify a doNotRunAfter time, and you are creating a recurring job schedule, the job schedule will remain active until you explicitly terminate it.
- DoNotRunAfter *date.Time `json:"doNotRunAfter,omitempty"`
- // StartWindow - If a job is not created within the startWindow interval, then the 'opportunity' is lost; no job will be created until the next recurrence of the schedule. If the schedule is recurring, and the startWindow is longer than the recurrence interval, then this is equivalent to an infinite startWindow, because the job that is 'due' in one recurrenceInterval is not carried forward into the next recurrence interval. The default is infinite. The minimum value is 1 minute. If you specify a lower value, the Batch service rejects the schedule with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- StartWindow *string `json:"startWindow,omitempty"`
- // RecurrenceInterval - Because a job schedule can have at most one active job under it at any given time, if it is time to create a new job under a job schedule, but the previous job is still running, the Batch service will not create the new job until the previous job finishes. If the previous job does not finish within the startWindow period of the new recurrenceInterval, then no new job will be scheduled for that interval. For recurring jobs, you should normally specify a jobManagerTask in the jobSpecification. If you do not use jobManagerTask, you will need an external process to monitor when jobs are created, add tasks to the jobs and terminate the jobs ready for the next recurrence. The default is that the schedule does not recur: one job is created, within the startWindow after the doNotRunUntil time, and the schedule is complete as soon as that job finishes. The minimum value is 1 minute. If you specify a lower value, the Batch service rejects the schedule with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- RecurrenceInterval *string `json:"recurrenceInterval,omitempty"`
-}
-
-// StartTask ...
-type StartTask struct {
- // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux.
- CommandLine *string `json:"commandLine,omitempty"`
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- RunElevated *bool `json:"runElevated,omitempty"`
- // MaxTaskRetryCount - The Batch service retries a task if its exit code is nonzero. Note that this value specifically controls the number of retries. The Batch service will try the task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the task. If the maximum retry count is -1, the Batch service retries the task without limit.
- MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"`
- // WaitForSuccess - If true and the start task fails on a compute node, the Batch service retries the start task up to its maximum retry count (maxTaskRetryCount). If the task has still not completed successfully after all retries, then the Batch service marks the compute node unusable, and will not schedule tasks to it. This condition can be detected via the node state and scheduling error detail. If false, the Batch service will not wait for the start task to complete. In this case, other tasks can start executing on the compute node while the start task is still running; and even if the start task fails, new tasks will continue to be scheduled on the node. The default is false.
- WaitForSuccess *bool `json:"waitForSuccess,omitempty"`
-}
-
-// StartTaskInformation ...
-type StartTaskInformation struct {
- // State - Possible values are: running – The start task is currently running. completed – The start task has exited with exit code 0, or the start task has failed and the retry limit has reached, or the start task process did not run due to scheduling errors. Possible values include: 'StartTaskStateRunning', 'StartTaskStateCompleted'
- State StartTaskState `json:"state,omitempty"`
- // StartTime - This value is reset every time the task is restarted or retried (that is, this is the most recent time at which the start task started running).
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - This is the end time of the most recent run of the start task, if that run has completed (even if that run failed and a retry is pending). This element is not present if the start task is currently running.
- EndTime *date.Time `json:"endTime,omitempty"`
- // ExitCode - This property is set only if the start task is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the start task (due to timeout, or user termination via the API) you may see an operating system-defined exit code.
- ExitCode *int32 `json:"exitCode,omitempty"`
- SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"`
- // RetryCount - The task is retried if it exits with a nonzero exit code, up to the specified MaxTaskRetryCount.
- RetryCount *int32 `json:"retryCount,omitempty"`
- // LastRetryTime - This element is present only if the task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the task has been restarted for reasons other than retry; for example, if the compute node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not.
- LastRetryTime *date.Time `json:"lastRetryTime,omitempty"`
-}
-
-// SubtaskInformation ...
-type SubtaskInformation struct {
- ID *int32 `json:"id,omitempty"`
- NodeInfo *ComputeNodeInformation `json:"nodeInfo,omitempty"`
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - This property is set only if the subtask is in the Completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
- // ExitCode - This property is set only if the subtask is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the subtask (due to timeout, or user termination via the API) you may see an operating system-defined exit code.
- ExitCode *int32 `json:"exitCode,omitempty"`
- SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"`
- // State - Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted'
- State TaskState `json:"state,omitempty"`
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // PreviousState - This property is not set if the subtask is in its initial running state. Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted'
- PreviousState TaskState `json:"previousState,omitempty"`
- // PreviousStateTransitionTime - This property is not set if the subtask is in its initial running state.
- PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"`
-}
-
-// TaskAddCollectionParameter ...
-type TaskAddCollectionParameter struct {
- Value *[]TaskAddParameter `json:"value,omitempty"`
-}
-
-// TaskAddCollectionResult ...
-type TaskAddCollectionResult struct {
- autorest.Response `json:"-"`
- Value *[]TaskAddResult `json:"value,omitempty"`
-}
-
-// TaskAddParameter ...
-type TaskAddParameter struct {
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within a job that differ only by case).
- ID *string `json:"id,omitempty"`
- // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- // CommandLine - For multi-instance tasks, the command line is executed as the primary task, after the primary task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux.
- CommandLine *string `json:"commandLine,omitempty"`
- // ExitConditions - How the Batch service should respond when the task completes.
- ExitConditions *ExitConditions `json:"exitConditions,omitempty"`
- // ResourceFiles - For multi-instance tasks, the resource files will only be downloaded to the compute node on which the primary task is executed.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- AffinityInfo *AffinityInformation `json:"affinityInfo,omitempty"`
- // Constraints - If you do not specify constraints, the maxTaskRetryCount is the maxTaskRetryCount specified for the job, and the maxWallClockTime and retentionTime are infinite.
- Constraints *TaskConstraints `json:"constraints,omitempty"`
- // RunElevated - The default value is false.
- RunElevated *bool `json:"runElevated,omitempty"`
- MultiInstanceSettings *MultiInstanceSettings `json:"multiInstanceSettings,omitempty"`
- // DependsOn - The task will not be scheduled until all depended-on tasks have completed successfully. (If any depended-on tasks fail and exhaust their retry counts, the task will never be scheduled.) If the job does not have usesTaskDependencies set to true, and this element is present, the request fails with error code TaskDependenciesNotSpecifiedOnJob.
- DependsOn *TaskDependencies `json:"dependsOn,omitempty"`
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
-}
-
-// TaskAddResult ...
-type TaskAddResult struct {
- // Status - Possible values include: 'TaskAddStatusSuccess', 'TaskAddStatusClienterror', 'TaskAddStatusServererror', 'TaskAddStatusUnmapped'
- Status TaskAddStatus `json:"status,omitempty"`
- TaskID *string `json:"taskId,omitempty"`
- ETag *string `json:"eTag,omitempty"`
- LastModified *date.Time `json:"lastModified,omitempty"`
- Location *string `json:"location,omitempty"`
- Error *Error `json:"error,omitempty"`
-}
-
-// TaskConstraints ...
-type TaskConstraints struct {
- // MaxWallClockTime - If this is not specified, there is no time limit on how long the task may run.
- MaxWallClockTime *string `json:"maxWallClockTime,omitempty"`
- // RetentionTime - The default is infinite, i.e. the task directory will be retained until the compute node is removed or reimaged.
- RetentionTime *string `json:"retentionTime,omitempty"`
- // MaxTaskRetryCount - Note that this value specifically controls the number of retries. The Batch service will try the task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the task. If the maximum retry count is -1, the Batch service retries the task without limit.
- MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"`
-}
-
-// TaskDependencies ...
-type TaskDependencies struct {
- TaskIds *[]string `json:"taskIds,omitempty"`
- TaskIDRanges *[]TaskIDRange `json:"taskIdRanges,omitempty"`
-}
-
-// TaskExecutionInformation ...
-type TaskExecutionInformation struct {
- // StartTime - 'Running' corresponds to the running state, so if the task specifies resource files or application packages, then the start time reflects the time at which the task started downloading or deploying these. If the task has been restarted or retried, this is the most recent time at which the task started running. This property is present only for tasks that are in the running or completed state.
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - This property is set only if the task is in the Completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
- // ExitCode - This property is set only if the task is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the task (due to timeout, or user termination via the API) you may see an operating system-defined exit code.
- ExitCode *int32 `json:"exitCode,omitempty"`
- // SchedulingError - This property is set only if the task is in the completed state.
- SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"`
- // RetryCount - The task is retried if it exits with a nonzero exit code, up to the specified maxTaskRetryCount.
- RetryCount *int32 `json:"retryCount,omitempty"`
- // LastRetryTime - This element is present only if the task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the task has been restarted for reasons other than retry; for example, if the compute node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not.
- LastRetryTime *date.Time `json:"lastRetryTime,omitempty"`
- // RequeueCount - When the user removes nodes from a pool (by resizing/shrinking the pool) or when the job is being disabled, the user can specify that running tasks on the nodes be requeued for execution. This count tracks how many times the task has been requeued for these reasons.
- RequeueCount *int32 `json:"requeueCount,omitempty"`
- // LastRequeueTime - This property is set only if the requeueCount is nonzero.
- LastRequeueTime *date.Time `json:"lastRequeueTime,omitempty"`
-}
-
-// TaskIDRange the start and end of the range are inclusive. For example, if a range has start 9 and end 12, then
-// it represents tasks '9', '10', '11' and '12'.
-type TaskIDRange struct {
- Start *int32 `json:"start,omitempty"`
- End *int32 `json:"end,omitempty"`
-}
-
-// TaskInformation ...
-type TaskInformation struct {
- TaskURL *string `json:"taskUrl,omitempty"`
- JobID *string `json:"jobId,omitempty"`
- TaskID *string `json:"taskId,omitempty"`
- SubtaskID *int32 `json:"subtaskId,omitempty"`
- // TaskState - Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted'
- TaskState TaskState `json:"taskState,omitempty"`
- ExecutionInfo *TaskExecutionInformation `json:"executionInfo,omitempty"`
-}
-
-// TaskSchedulingError ...
-type TaskSchedulingError struct {
- // Category - Possible values include: 'SchedulingErrorCategoryUsererror', 'SchedulingErrorCategoryServererror', 'SchedulingErrorCategoryUnmapped'
- Category SchedulingErrorCategory `json:"category,omitempty"`
- Code *string `json:"code,omitempty"`
- Message *string `json:"message,omitempty"`
- Details *[]NameValuePair `json:"details,omitempty"`
-}
-
-// TaskSchedulingPolicy ...
-type TaskSchedulingPolicy struct {
- // NodeFillType - Possible values include: 'ComputeNodeFillTypeSpread', 'ComputeNodeFillTypePack', 'ComputeNodeFillTypeUnmapped'
- NodeFillType ComputeNodeFillType `json:"nodeFillType,omitempty"`
-}
-
-// TaskStatistics ...
-type TaskStatistics struct {
- URL *string `json:"url,omitempty"`
- StartTime *date.Time `json:"startTime,omitempty"`
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- UserCPUTime *string `json:"userCPUTime,omitempty"`
- KernelCPUTime *string `json:"kernelCPUTime,omitempty"`
- // WallClockTime - The wall clock time is the elapsed time from when the task started running on a compute node to when it finished (or to the last time the statistics were updated, if the task had not finished by then). If the task was retried, this includes the wall clock time of all the task retries.
- WallClockTime *string `json:"wallClockTime,omitempty"`
- ReadIOps *int64 `json:"readIOps,omitempty"`
- WriteIOps *int64 `json:"writeIOps,omitempty"`
- ReadIOGiB *float64 `json:"readIOGiB,omitempty"`
- WriteIOGiB *float64 `json:"writeIOGiB,omitempty"`
- WaitTime *string `json:"waitTime,omitempty"`
-}
-
-// TaskUpdateParameter ...
-type TaskUpdateParameter struct {
- // Constraints - If omitted, the task is given the default constraints.
- Constraints *TaskConstraints `json:"constraints,omitempty"`
-}
-
-// UsageStatistics ...
-type UsageStatistics struct {
- StartTime *date.Time `json:"startTime,omitempty"`
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- DedicatedCoreTime *string `json:"dedicatedCoreTime,omitempty"`
-}
-
-// VirtualMachineConfiguration ...
-type VirtualMachineConfiguration struct {
- ImageReference *ImageReference `json:"imageReference,omitempty"`
- // NodeAgentSKUID - The Batch node agent is a program that runs on each node in the pool, and provides the command-and-control interface between the node and the Batch service. There are different implementations of the node agent, known as SKUs, for different operating systems. You must specify a node agent SKU which matches the selected image reference. To get the list of supported node agent SKUs along with their list of verified image references, see the 'List supported node agent SKUs' operation.
- NodeAgentSKUID *string `json:"nodeAgentSKUId,omitempty"`
- // WindowsConfiguration - This property must not be specified if the imageReference property specifies a Linux OS image.
- WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"`
-}
-
-// WindowsConfiguration ...
-type WindowsConfiguration struct {
- // EnableAutomaticUpdates - If omitted, the default value is true.
- EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"`
-}
diff --git a/services/batch/2016-07-01.3.1/batch/pool.go b/services/batch/2016-07-01.3.1/batch/pool.go
deleted file mode 100644
index a7f5f70c77bd..000000000000
--- a/services/batch/2016-07-01.3.1/batch/pool.go
+++ /dev/null
@@ -1,1842 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "net/http"
-)
-
-// PoolClient is the a client for issuing REST requests to the Azure Batch service.
-type PoolClient struct {
- BaseClient
-}
-
-// NewPoolClient creates an instance of the PoolClient client.
-func NewPoolClient() PoolClient {
- return NewPoolClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewPoolClientWithBaseURI creates an instance of the PoolClient client.
-func NewPoolClientWithBaseURI(baseURI string) PoolClient {
- return PoolClient{NewWithBaseURI(baseURI)}
-}
-
-// Add when naming pools, avoid including sensitive information such as user names or secret project names. This
-// information may appear in telemetry logs accessible to Microsoft Support engineers.
-//
-// pool is the pool to be added. timeout is the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a
-// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. If not specified, this header will be automatically populated with the current system clock time.
-func (client PoolClient) Add(ctx context.Context, pool PoolAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: pool,
- Constraints: []validation.Constraint{{Target: "pool.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "pool.VMSize", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "pool.CloudServiceConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "pool.StartTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "Add", err.Error())
- }
-
- req, err := client.AddPreparer(ctx, pool, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPreparer prepares the Add request.
-func (client PoolClient) AddPreparer(ctx context.Context, pool PoolAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/pools"),
- autorest.WithJSON(pool),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSender sends the Add request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) AddSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddResponder handles the response to the Add request. The method always
-// closes the http.Response Body.
-func (client PoolClient) AddResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Delete when you request that a pool be deleted, the following actions occur: the pool state is set to deleting; any
-// ongoing resize operation on the pool are stopped; the Batch service starts resizing the pool to zero nodes; any
-// tasks running on existing nodes are terminated and requeued (as if a resize pool operation had been requested with
-// the default requeue option); finally, the pool is removed from the system. Because running tasks are requeued, the
-// user can rerun these tasks by updating their job to target a different pool. The tasks can then run on the new pool.
-// If you want to override the requeue behavior, then you should call resize pool explicitly to shrink the pool to zero
-// size before deleting the pool. If you call an Update, Patch or Delete API on a pool in the deleting state, it will
-// fail with HTTP status code 409 with error code PoolBeingDeleted.
-//
-// poolID is the ID of the pool to delete. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. If not specified, this header will be automatically populated with the current
-// system clock time. ifMatch is an ETag is specified. Specify this header to perform the operation only if the
-// resource's ETag is an exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to
-// perform the operation only if the resource's ETag does not match the specified ETag. ifModifiedSince is specify
-// this header to perform the operation only if the resource has been modified since the specified date/time.
-// ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been modified
-// since the specified date/time.
-func (client PoolClient) Delete(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeletePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client PoolClient) DeletePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client PoolClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// DisableAutoScale sends the disable auto scale request.
-//
-// poolID is the ID of the pool on which to disable automatic scaling. timeout is the maximum time that the server
-// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated
-// request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time.
-func (client PoolClient) DisableAutoScale(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DisableAutoScalePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DisableAutoScaleSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", resp, "Failure sending request")
- return
- }
-
- result, err = client.DisableAutoScaleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DisableAutoScalePreparer prepares the DisableAutoScale request.
-func (client PoolClient) DisableAutoScalePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/disableautoscale", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DisableAutoScaleSender sends the DisableAutoScale request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) DisableAutoScaleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DisableAutoScaleResponder handles the response to the DisableAutoScale request. The method always
-// closes the http.Response Body.
-func (client PoolClient) DisableAutoScaleResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// EnableAutoScale you cannot enable automatic scaling on a pool if a resize operation is in progress on the pool. If
-// automatic scaling of the pool is currently disabled, you must specify a valid autoscale formula as part of the
-// request. If automatic scaling of the pool is already enabled, you may specify a new autoscale formula and/or a new
-// evaluation interval. You cannot call this API for the same pool more than once every 30 seconds.
-//
-// poolID is the ID of the pool on which to enable automatic scaling. poolEnableAutoScaleParameter is the
-// parameters for the request. timeout is the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a
-// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. If not specified, this header will be automatically populated with the current system clock time.
-// ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag is an
-// exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only
-// if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the
-// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify
-// this header to perform the operation only if the resource has not been modified since the specified date/time.
-func (client PoolClient) EnableAutoScale(ctx context.Context, poolID string, poolEnableAutoScaleParameter PoolEnableAutoScaleParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.EnableAutoScalePreparer(ctx, poolID, poolEnableAutoScaleParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.EnableAutoScaleSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", resp, "Failure sending request")
- return
- }
-
- result, err = client.EnableAutoScaleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", resp, "Failure responding to request")
- }
-
- return
-}
-
-// EnableAutoScalePreparer prepares the EnableAutoScale request.
-func (client PoolClient) EnableAutoScalePreparer(ctx context.Context, poolID string, poolEnableAutoScaleParameter PoolEnableAutoScaleParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/enableautoscale", pathParameters),
- autorest.WithJSON(poolEnableAutoScaleParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// EnableAutoScaleSender sends the EnableAutoScale request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) EnableAutoScaleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// EnableAutoScaleResponder handles the response to the EnableAutoScale request. The method always
-// closes the http.Response Body.
-func (client PoolClient) EnableAutoScaleResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// EvaluateAutoScale this API is primarily for validating an autoscale formula, as it simply returns the result without
-// applying the formula to the pool.
-//
-// poolID is the ID of the pool on which to evaluate the automatic scaling formula. poolEvaluateAutoScaleParameter
-// is the parameters for the request. timeout is the maximum time that the server can spend processing the request,
-// in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of
-// a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. If not specified, this header will be automatically populated with the current system clock time.
-func (client PoolClient) EvaluateAutoScale(ctx context.Context, poolID string, poolEvaluateAutoScaleParameter PoolEvaluateAutoScaleParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result AutoScaleRun, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: poolEvaluateAutoScaleParameter,
- Constraints: []validation.Constraint{{Target: "poolEvaluateAutoScaleParameter.AutoScaleFormula", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "EvaluateAutoScale", err.Error())
- }
-
- req, err := client.EvaluateAutoScalePreparer(ctx, poolID, poolEvaluateAutoScaleParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.EvaluateAutoScaleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", resp, "Failure sending request")
- return
- }
-
- result, err = client.EvaluateAutoScaleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", resp, "Failure responding to request")
- }
-
- return
-}
-
-// EvaluateAutoScalePreparer prepares the EvaluateAutoScale request.
-func (client PoolClient) EvaluateAutoScalePreparer(ctx context.Context, poolID string, poolEvaluateAutoScaleParameter PoolEvaluateAutoScaleParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/evaluateautoscale", pathParameters),
- autorest.WithJSON(poolEvaluateAutoScaleParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// EvaluateAutoScaleSender sends the EvaluateAutoScale request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) EvaluateAutoScaleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// EvaluateAutoScaleResponder handles the response to the EvaluateAutoScale request. The method always
-// closes the http.Response Body.
-func (client PoolClient) EvaluateAutoScaleResponder(resp *http.Response) (result AutoScaleRun, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Exists gets basic properties of a pool.
-//
-// poolID is the ID of the pool to get. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. If not specified, this header will be automatically populated with the current
-// system clock time. ifMatch is an ETag is specified. Specify this header to perform the operation only if the
-// resource's ETag is an exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to
-// perform the operation only if the resource's ETag does not match the specified ETag. ifModifiedSince is specify
-// this header to perform the operation only if the resource has been modified since the specified date/time.
-// ifUnmodifiedSince is specify this header to perform the operation only if the resource has not been modified
-// since the specified date/time.
-func (client PoolClient) Exists(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.ExistsPreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ExistsSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", resp, "Failure sending request")
- return
- }
-
- result, err = client.ExistsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ExistsPreparer prepares the Exists request.
-func (client PoolClient) ExistsPreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsHead(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ExistsSender sends the Exists request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) ExistsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ExistsResponder handles the response to the Exists request. The method always
-// closes the http.Response Body.
-func (client PoolClient) ExistsResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get gets information about the specified pool.
-//
-// poolID is the ID of the pool to get. selectParameter is an OData $select clause. expand is an OData $expand
-// clause. timeout is the maximum time that the server can spend processing the request, in seconds. The default is
-// 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration
-// such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server
-// should return the client-request-id in the response. ocpDate is the time the request was issued. If not
-// specified, this header will be automatically populated with the current system clock time. ifMatch is an ETag is
-// specified. Specify this header to perform the operation only if the resource's ETag is an exact match as
-// specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the
-// resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the
-// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify
-// this header to perform the operation only if the resource has not been modified since the specified date/time.
-func (client PoolClient) Get(ctx context.Context, poolID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudPool, err error) {
- req, err := client.GetPreparer(ctx, poolID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client PoolClient) GetPreparer(ctx context.Context, poolID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client PoolClient) GetResponder(resp *http.Response) (result CloudPool, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetAllPoolsLifetimeStatistics statistics are aggregated across all pools that have ever existed in the account, from
-// account creation to the last update time of the statistics.
-//
-// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30
-// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such
-// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should
-// return the client-request-id in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client PoolClient) GetAllPoolsLifetimeStatistics(ctx context.Context, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolStatistics, err error) {
- req, err := client.GetAllPoolsLifetimeStatisticsPreparer(ctx, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllPoolsLifetimeStatistics", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetAllPoolsLifetimeStatisticsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllPoolsLifetimeStatistics", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetAllPoolsLifetimeStatisticsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllPoolsLifetimeStatistics", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetAllPoolsLifetimeStatisticsPreparer prepares the GetAllPoolsLifetimeStatistics request.
-func (client PoolClient) GetAllPoolsLifetimeStatisticsPreparer(ctx context.Context, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/lifetimepoolstats"),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetAllPoolsLifetimeStatisticsSender sends the GetAllPoolsLifetimeStatistics request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) GetAllPoolsLifetimeStatisticsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetAllPoolsLifetimeStatisticsResponder handles the response to the GetAllPoolsLifetimeStatistics request. The method always
-// closes the http.Response Body.
-func (client PoolClient) GetAllPoolsLifetimeStatisticsResponder(resp *http.Response) (result PoolStatistics, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List sends the list request.
-//
-// filter is an OData $filter clause. selectParameter is an OData $select clause. expand is an OData $expand
-// clause. maxResults is the maximum number of items to return in the response. A maximum of 1000 pools can be
-// returned. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. If not
-// specified, this header will be automatically populated with the current system clock time.
-func (client PoolClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudPoolListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "List", err.Error())
- }
-
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.cplr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", resp, "Failure sending request")
- return
- }
-
- result.cplr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client PoolClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/pools"),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client PoolClient) ListResponder(resp *http.Response) (result CloudPoolListResult, 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 PoolClient) listNextResults(lastResults CloudPoolListResult) (result CloudPoolListResult, err error) {
- req, err := lastResults.cloudPoolListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.PoolClient", "listNextResults", 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.PoolClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client PoolClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudPoolListResultIterator, err error) {
- result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// ListPoolUsageMetrics if you do not specify a $filter clause including a poolId, the response includes all pools that
-// existed in the account in the time range of the returned aggregation intervals.
-//
-// startTime is the earliest time from which to include metrics. This must be at least two and a half hours before
-// the current time. If not specified this defaults to the start time of the last aggregation interval currently
-// available. endTime is the latest time from which to include metrics. This must be at least two hours before the
-// current time. If not specified this defaults to the end time of the last aggregation interval currently
-// available. filter is an OData $filter clause. If this is not specified the response includes all pools that
-// existed in the account in the time range of the returned aggregation intervals. maxResults is the maximum number
-// of items to return in the response. A maximum of 1000 results will be returned. timeout is the maximum time that
-// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time.
-func (client PoolClient) ListPoolUsageMetrics(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolListPoolUsageMetricsResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "ListPoolUsageMetrics", err.Error())
- }
-
- result.fn = client.listPoolUsageMetricsNextResults
- req, err := client.ListPoolUsageMetricsPreparer(ctx, startTime, endTime, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListPoolUsageMetrics", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListPoolUsageMetricsSender(req)
- if err != nil {
- result.plpumr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListPoolUsageMetrics", resp, "Failure sending request")
- return
- }
-
- result.plpumr, err = client.ListPoolUsageMetricsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListPoolUsageMetrics", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPoolUsageMetricsPreparer prepares the ListPoolUsageMetrics request.
-func (client PoolClient) ListPoolUsageMetricsPreparer(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if startTime != nil {
- queryParameters["starttime"] = autorest.Encode("query", *startTime)
- }
- if endTime != nil {
- queryParameters["endtime"] = autorest.Encode("query", *endTime)
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/poolusagemetrics"),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListPoolUsageMetricsSender sends the ListPoolUsageMetrics request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) ListPoolUsageMetricsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListPoolUsageMetricsResponder handles the response to the ListPoolUsageMetrics request. The method always
-// closes the http.Response Body.
-func (client PoolClient) ListPoolUsageMetricsResponder(resp *http.Response) (result PoolListPoolUsageMetricsResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listPoolUsageMetricsNextResults retrieves the next set of results, if any.
-func (client PoolClient) listPoolUsageMetricsNextResults(lastResults PoolListPoolUsageMetricsResult) (result PoolListPoolUsageMetricsResult, err error) {
- req, err := lastResults.poolListPoolUsageMetricsResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.PoolClient", "listPoolUsageMetricsNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListPoolUsageMetricsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.PoolClient", "listPoolUsageMetricsNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListPoolUsageMetricsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "listPoolUsageMetricsNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListPoolUsageMetricsComplete enumerates all values, automatically crossing page boundaries as required.
-func (client PoolClient) ListPoolUsageMetricsComplete(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolListPoolUsageMetricsResultIterator, err error) {
- result.page, err = client.ListPoolUsageMetrics(ctx, startTime, endTime, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// Patch this only replaces the pool properties specified in the request. For example, if the pool has a start task
-// associated with it, and a request does not specify a start task element, then the pool keeps the existing start
-// task.
-//
-// poolID is the ID of the pool to update. poolPatchParameter is the parameters for the request. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time. ifMatch is an ETag is specified. Specify
-// this header to perform the operation only if the resource's ETag is an exact match as specified. ifNoneMatch is
-// an ETag is specified. Specify this header to perform the operation only if the resource's ETag does not match
-// the specified ETag. ifModifiedSince is specify this header to perform the operation only if the resource has
-// been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform the operation
-// only if the resource has not been modified since the specified date/time.
-func (client PoolClient) Patch(ctx context.Context, poolID string, poolPatchParameter PoolPatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.PatchPreparer(ctx, poolID, poolPatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.PatchSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", resp, "Failure sending request")
- return
- }
-
- result, err = client.PatchResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", resp, "Failure responding to request")
- }
-
- return
-}
-
-// PatchPreparer prepares the Patch request.
-func (client PoolClient) PatchPreparer(ctx context.Context, poolID string, poolPatchParameter PoolPatchParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPatch(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}", pathParameters),
- autorest.WithJSON(poolPatchParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// PatchSender sends the Patch request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) PatchSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// PatchResponder handles the response to the Patch request. The method always
-// closes the http.Response Body.
-func (client PoolClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// RemoveNodes this operation can only run when the allocation state of the pool is steady. When this operation runs,
-// the allocation state changes from steady to resizing.
-//
-// poolID is the ID of the pool from which you want to remove nodes. nodeRemoveParameter is the parameters for the
-// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. If not
-// specified, this header will be automatically populated with the current system clock time. ifMatch is an ETag is
-// specified. Specify this header to perform the operation only if the resource's ETag is an exact match as
-// specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only if the
-// resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the
-// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify
-// this header to perform the operation only if the resource has not been modified since the specified date/time.
-func (client PoolClient) RemoveNodes(ctx context.Context, poolID string, nodeRemoveParameter NodeRemoveParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: nodeRemoveParameter,
- Constraints: []validation.Constraint{{Target: "nodeRemoveParameter.NodeList", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "nodeRemoveParameter.NodeList", Name: validation.MaxItems, Rule: 100, Chain: nil}}}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "RemoveNodes", err.Error())
- }
-
- req, err := client.RemoveNodesPreparer(ctx, poolID, nodeRemoveParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.RemoveNodesSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", resp, "Failure sending request")
- return
- }
-
- result, err = client.RemoveNodesResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", resp, "Failure responding to request")
- }
-
- return
-}
-
-// RemoveNodesPreparer prepares the RemoveNodes request.
-func (client PoolClient) RemoveNodesPreparer(ctx context.Context, poolID string, nodeRemoveParameter NodeRemoveParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/removenodes", pathParameters),
- autorest.WithJSON(nodeRemoveParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// RemoveNodesSender sends the RemoveNodes request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) RemoveNodesSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// RemoveNodesResponder handles the response to the RemoveNodes request. The method always
-// closes the http.Response Body.
-func (client PoolClient) RemoveNodesResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Resize you can only resize a pool when its allocation state is steady. If the pool is already resizing, the request
-// fails with status code 409. When you resize a pool, the pool's allocation state changes from steady to resizing. You
-// cannot resize pools which are configured for automatic scaling. If you try to do this, the Batch service returns an
-// error 409. If you resize a pool downwards, the Batch service chooses which nodes to remove. To remove specific
-// nodes, use the pool remove nodes API instead.
-//
-// poolID is the ID of the pool to resize. poolResizeParameter is the parameters for the request. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time. ifMatch is an ETag is specified. Specify
-// this header to perform the operation only if the resource's ETag is an exact match as specified. ifNoneMatch is
-// an ETag is specified. Specify this header to perform the operation only if the resource's ETag does not match
-// the specified ETag. ifModifiedSince is specify this header to perform the operation only if the resource has
-// been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform the operation
-// only if the resource has not been modified since the specified date/time.
-func (client PoolClient) Resize(ctx context.Context, poolID string, poolResizeParameter PoolResizeParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: poolResizeParameter,
- Constraints: []validation.Constraint{{Target: "poolResizeParameter.TargetDedicated", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "Resize", err.Error())
- }
-
- req, err := client.ResizePreparer(ctx, poolID, poolResizeParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ResizeSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", resp, "Failure sending request")
- return
- }
-
- result, err = client.ResizeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ResizePreparer prepares the Resize request.
-func (client PoolClient) ResizePreparer(ctx context.Context, poolID string, poolResizeParameter PoolResizeParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/resize", pathParameters),
- autorest.WithJSON(poolResizeParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ResizeSender sends the Resize request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) ResizeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ResizeResponder handles the response to the Resize request. The method always
-// closes the http.Response Body.
-func (client PoolClient) ResizeResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// StopResize this does not restore the pool to its previous state before the resize operation: it only stops any
-// further changes being made, and the pool maintains its current state. A resize operation need not be an explicit
-// resize pool request; this API can also be used to halt the initial sizing of the pool when it is created.
-//
-// poolID is the ID of the pool whose resizing you want to stop. timeout is the maximum time that the server can
-// spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated
-// request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time. ifMatch is an ETag is specified. Specify
-// this header to perform the operation only if the resource's ETag is an exact match as specified. ifNoneMatch is
-// an ETag is specified. Specify this header to perform the operation only if the resource's ETag does not match
-// the specified ETag. ifModifiedSince is specify this header to perform the operation only if the resource has
-// been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform the operation
-// only if the resource has not been modified since the specified date/time.
-func (client PoolClient) StopResize(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.StopResizePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.StopResizeSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", resp, "Failure sending request")
- return
- }
-
- result, err = client.StopResizeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", resp, "Failure responding to request")
- }
-
- return
-}
-
-// StopResizePreparer prepares the StopResize request.
-func (client PoolClient) StopResizePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/stopresize", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// StopResizeSender sends the StopResize request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) StopResizeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// StopResizeResponder handles the response to the StopResize request. The method always
-// closes the http.Response Body.
-func (client PoolClient) StopResizeResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// UpdateProperties this fully replaces all the updateable properties of the pool. For example, if the pool has a start
-// task associated with it and if start task is not specified with this request, then the Batch service will remove the
-// existing start task.
-//
-// poolID is the ID of the pool to update. poolUpdatePropertiesParameter is the parameters for the request. timeout
-// is the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time.
-func (client PoolClient) UpdateProperties(ctx context.Context, poolID string, poolUpdatePropertiesParameter PoolUpdatePropertiesParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: poolUpdatePropertiesParameter,
- Constraints: []validation.Constraint{{Target: "poolUpdatePropertiesParameter.StartTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "poolUpdatePropertiesParameter.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "poolUpdatePropertiesParameter.CertificateReferences", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "poolUpdatePropertiesParameter.ApplicationPackageReferences", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "poolUpdatePropertiesParameter.Metadata", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "UpdateProperties", err.Error())
- }
-
- req, err := client.UpdatePropertiesPreparer(ctx, poolID, poolUpdatePropertiesParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdatePropertiesSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdatePropertiesResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePropertiesPreparer prepares the UpdateProperties request.
-func (client PoolClient) UpdatePropertiesPreparer(ctx context.Context, poolID string, poolUpdatePropertiesParameter PoolUpdatePropertiesParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/updateproperties", pathParameters),
- autorest.WithJSON(poolUpdatePropertiesParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdatePropertiesSender sends the UpdateProperties request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) UpdatePropertiesSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdatePropertiesResponder handles the response to the UpdateProperties request. The method always
-// closes the http.Response Body.
-func (client PoolClient) UpdatePropertiesResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// UpgradeOS during an upgrade, the Batch service upgrades each compute node in the pool. When a compute node is chosen
-// for upgrade, any tasks running on that node are removed from the node and returned to the queue to be rerun later
-// (or on a different compute node). The node will be unavailable until the upgrade is complete. This operation results
-// in temporarily reduced pool capacity as nodes are taken out of service to be upgraded. Although the Batch service
-// tries to avoid upgrading all compute nodes at the same time, it does not guarantee to do this (particularly on small
-// pools); therefore, the pool may be temporarily unavailable to run tasks. When this operation runs, the pool state
-// changes to upgrading. When all compute nodes have finished upgrading, the pool state returns to active.
-//
-// poolID is the ID of the pool to upgrade. poolUpgradeOSParameter is the parameters for the request. timeout is
-// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time. ifMatch is an ETag is specified. Specify
-// this header to perform the operation only if the resource's ETag is an exact match as specified. ifNoneMatch is
-// an ETag is specified. Specify this header to perform the operation only if the resource's ETag does not match
-// the specified ETag. ifModifiedSince is specify this header to perform the operation only if the resource has
-// been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform the operation
-// only if the resource has not been modified since the specified date/time.
-func (client PoolClient) UpgradeOS(ctx context.Context, poolID string, poolUpgradeOSParameter PoolUpgradeOSParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: poolUpgradeOSParameter,
- Constraints: []validation.Constraint{{Target: "poolUpgradeOSParameter.TargetOSVersion", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "UpgradeOS", err.Error())
- }
-
- req, err := client.UpgradeOSPreparer(ctx, poolID, poolUpgradeOSParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpgradeOSSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpgradeOSResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpgradeOSPreparer prepares the UpgradeOS request.
-func (client PoolClient) UpgradeOSPreparer(ctx context.Context, poolID string, poolUpgradeOSParameter PoolUpgradeOSParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/upgradeos", pathParameters),
- autorest.WithJSON(poolUpgradeOSParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpgradeOSSender sends the UpgradeOS request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) UpgradeOSSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpgradeOSResponder handles the response to the UpgradeOS request. The method always
-// closes the http.Response Body.
-func (client PoolClient) UpgradeOSResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff --git a/services/batch/2016-07-01.3.1/batch/task.go b/services/batch/2016-07-01.3.1/batch/task.go
deleted file mode 100644
index add2cd69a295..000000000000
--- a/services/batch/2016-07-01.3.1/batch/task.go
+++ /dev/null
@@ -1,1051 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "net/http"
-)
-
-// TaskClient is the a client for issuing REST requests to the Azure Batch service.
-type TaskClient struct {
- BaseClient
-}
-
-// NewTaskClient creates an instance of the TaskClient client.
-func NewTaskClient() TaskClient {
- return NewTaskClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewTaskClientWithBaseURI creates an instance of the TaskClient client.
-func NewTaskClientWithBaseURI(baseURI string) TaskClient {
- return TaskClient{NewWithBaseURI(baseURI)}
-}
-
-// Add sends the add request.
-//
-// jobID is the ID of the job to which the task is to be added. task is the task to be added. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time.
-func (client TaskClient) Add(ctx context.Context, jobID string, task TaskAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: task,
- Constraints: []validation.Constraint{{Target: "task.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "task.CommandLine", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "task.AffinityInfo", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "task.AffinityInfo.AffinityID", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "task.MultiInstanceSettings", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "task.MultiInstanceSettings.NumberOfInstances", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil {
- return result, validation.NewError("batch.TaskClient", "Add", err.Error())
- }
-
- req, err := client.AddPreparer(ctx, jobID, task, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPreparer prepares the Add request.
-func (client TaskClient) AddPreparer(ctx context.Context, jobID string, task TaskAddParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks", pathParameters),
- autorest.WithJSON(task),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSender sends the Add request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) AddSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddResponder handles the response to the Add request. The method always
-// closes the http.Response Body.
-func (client TaskClient) AddResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// AddCollection note that each task must have a unique ID. The Batch service may not return the results for each task
-// in the same order the tasks were submitted in this request. If the server times out or the connection is closed
-// during the request, the request may have been partially or fully processed, or not at all. In such cases, the user
-// should re-issue the request. Note that it is up to the user to correctly handle failures when re-issuing a request.
-// For example, you should use the same task ids during a retry so that if the prior operation succeeded, the retry
-// will not create extra tasks unexpectedly.
-//
-// jobID is the ID of the job to which the task collection is to be added. taskCollection is the tasks to be added.
-// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30
-// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such
-// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should
-// return the client-request-id in the response. ocpDate is the time the request was issued. If not specified, this
-// header will be automatically populated with the current system clock time.
-func (client TaskClient) AddCollection(ctx context.Context, jobID string, taskCollection TaskAddCollectionParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result TaskAddCollectionResult, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: taskCollection,
- Constraints: []validation.Constraint{{Target: "taskCollection.Value", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "taskCollection.Value", Name: validation.MaxItems, Rule: 100, Chain: nil}}}}}}); err != nil {
- return result, validation.NewError("batch.TaskClient", "AddCollection", err.Error())
- }
-
- req, err := client.AddCollectionPreparer(ctx, jobID, taskCollection, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "AddCollection", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddCollectionSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "AddCollection", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddCollectionResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "AddCollection", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddCollectionPreparer prepares the AddCollection request.
-func (client TaskClient) AddCollectionPreparer(ctx context.Context, jobID string, taskCollection TaskAddCollectionParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/addtaskcollection", pathParameters),
- autorest.WithJSON(taskCollection),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddCollectionSender sends the AddCollection request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) AddCollectionSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddCollectionResponder handles the response to the AddCollection request. The method always
-// closes the http.Response Body.
-func (client TaskClient) AddCollectionResponder(resp *http.Response) (result TaskAddCollectionResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Delete when a task is deleted, all of the files in its directory on the compute node where it ran are also deleted
-// (regardless of the retention time). For multi-instance tasks, the delete task operation applies synchronously to the
-// primary task; subtasks and their files are then deleted asynchronously in the background.
-//
-// jobID is the ID of the job from which to delete the task. taskID is the ID of the task to delete. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time. ifMatch is an ETag is specified. Specify
-// this header to perform the operation only if the resource's ETag is an exact match as specified. ifNoneMatch is
-// an ETag is specified. Specify this header to perform the operation only if the resource's ETag does not match
-// the specified ETag. ifModifiedSince is specify this header to perform the operation only if the resource has
-// been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform the operation
-// only if the resource has not been modified since the specified date/time.
-func (client TaskClient) Delete(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeletePreparer(ctx, jobID, taskID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client TaskClient) DeletePreparer(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client TaskClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get for multi-instance tasks, information such as affinityId, executionInfo and nodeInfo refer to the primary task.
-// Use the list subtasks API to retrieve information about subtasks.
-//
-// jobID is the ID of the job that contains the task. taskID is the ID of the task to get information about.
-// selectParameter is an OData $select clause. expand is an OData $expand clause. timeout is the maximum time that
-// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time. ifMatch is an ETag is specified. Specify
-// this header to perform the operation only if the resource's ETag is an exact match as specified. ifNoneMatch is
-// an ETag is specified. Specify this header to perform the operation only if the resource's ETag does not match
-// the specified ETag. ifModifiedSince is specify this header to perform the operation only if the resource has
-// been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform the operation
-// only if the resource has not been modified since the specified date/time.
-func (client TaskClient) Get(ctx context.Context, jobID string, taskID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudTask, err error) {
- req, err := client.GetPreparer(ctx, jobID, taskID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client TaskClient) GetPreparer(ctx context.Context, jobID string, taskID string, selectParameter string, expand string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client TaskClient) GetResponder(resp *http.Response) (result CloudTask, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List for multi-instance tasks, information such as affinityId, executionInfo and nodeInfo refer to the primary task.
-// Use the list subtasks API to retrieve information about subtasks.
-//
-// jobID is the ID of the job. filter is an OData $filter clause. selectParameter is an OData $select clause.
-// expand is an OData $expand clause. maxResults is the maximum number of items to return in the response. A
-// maximum of 1000 tasks can be returned. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. If not specified, this header will be automatically populated with the current
-// system clock time.
-func (client TaskClient) List(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.TaskClient", "List", err.Error())
- }
-
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, jobID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.ctlr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", resp, "Failure sending request")
- return
- }
-
- result.ctlr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client TaskClient) ListPreparer(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client TaskClient) ListResponder(resp *http.Response) (result CloudTaskListResult, 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 TaskClient) listNextResults(lastResults CloudTaskListResult) (result CloudTaskListResult, err error) {
- req, err := lastResults.cloudTaskListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.TaskClient", "listNextResults", 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.TaskClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client TaskClient) ListComplete(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListResultIterator, err error) {
- result.page, err = client.List(ctx, jobID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// ListSubtasks if the task is not a multi-instance task then this returns an empty collection.
-//
-// jobID is the ID of the job. taskID is the ID of the task. selectParameter is an OData $select clause. timeout is
-// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time.
-func (client TaskClient) ListSubtasks(ctx context.Context, jobID string, taskID string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListSubtasksResult, err error) {
- req, err := client.ListSubtasksPreparer(ctx, jobID, taskID, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSubtasksSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListSubtasksResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListSubtasksPreparer prepares the ListSubtasks request.
-func (client TaskClient) ListSubtasksPreparer(ctx context.Context, jobID string, taskID string, selectParameter string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/subtasksinfo", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSubtasksSender sends the ListSubtasks request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) ListSubtasksSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListSubtasksResponder handles the response to the ListSubtasks request. The method always
-// closes the http.Response Body.
-func (client TaskClient) ListSubtasksResponder(resp *http.Response) (result CloudTaskListSubtasksResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Reactivate reactivation makes a task eligible to be retried again up to its maximum retry count. The task's state is
-// changed to active. As the task is no longer in the completed state, any previous exit code or scheduling error is no
-// longer available after reactivation. This will fail for tasks that are not completed or that previously completed
-// successfully (with an exit code of 0). Additionally, this will fail if the job has completed (or is terminating or
-// deleting).
-//
-// jobID is the ID of the job containing the task. taskID is the ID of the task to reactivate. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time. ifMatch is an ETag is specified. Specify
-// this header to perform the operation only if the resource's ETag is an exact match as specified. ifNoneMatch is
-// an ETag is specified. Specify this header to perform the operation only if the resource's ETag does not match
-// the specified ETag. ifModifiedSince is specify this header to perform the operation only if the resource has
-// been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform the operation
-// only if the resource has not been modified since the specified date/time.
-func (client TaskClient) Reactivate(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.ReactivatePreparer(ctx, jobID, taskID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Reactivate", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ReactivateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Reactivate", resp, "Failure sending request")
- return
- }
-
- result, err = client.ReactivateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Reactivate", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ReactivatePreparer prepares the Reactivate request.
-func (client TaskClient) ReactivatePreparer(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/reactivate", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ReactivateSender sends the Reactivate request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) ReactivateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ReactivateResponder handles the response to the Reactivate request. The method always
-// closes the http.Response Body.
-func (client TaskClient) ReactivateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Terminate when the task has been terminated, it moves to the completed state. For multi-instance tasks, the
-// terminate task operation applies synchronously to the primary task; subtasks are then terminated asynchronously in
-// the background.
-//
-// jobID is the ID of the job containing the task. taskID is the ID of the task to terminate. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. If not specified, this header
-// will be automatically populated with the current system clock time. ifMatch is an ETag is specified. Specify
-// this header to perform the operation only if the resource's ETag is an exact match as specified. ifNoneMatch is
-// an ETag is specified. Specify this header to perform the operation only if the resource's ETag does not match
-// the specified ETag. ifModifiedSince is specify this header to perform the operation only if the resource has
-// been modified since the specified date/time. ifUnmodifiedSince is specify this header to perform the operation
-// only if the resource has not been modified since the specified date/time.
-func (client TaskClient) Terminate(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.TerminatePreparer(ctx, jobID, taskID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.TerminateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", resp, "Failure sending request")
- return
- }
-
- result, err = client.TerminateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", resp, "Failure responding to request")
- }
-
- return
-}
-
-// TerminatePreparer prepares the Terminate request.
-func (client TaskClient) TerminatePreparer(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/terminate", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// TerminateSender sends the Terminate request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) TerminateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// TerminateResponder handles the response to the Terminate request. The method always
-// closes the http.Response Body.
-func (client TaskClient) TerminateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Update updates the properties of the specified task.
-//
-// jobID is the ID of the job containing the task. taskID is the ID of the task to update. taskUpdateParameter is
-// the parameters for the request. timeout is the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a
-// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. If not specified, this header will be automatically populated with the current system clock time.
-// ifMatch is an ETag is specified. Specify this header to perform the operation only if the resource's ETag is an
-// exact match as specified. ifNoneMatch is an ETag is specified. Specify this header to perform the operation only
-// if the resource's ETag does not match the specified ETag. ifModifiedSince is specify this header to perform the
-// operation only if the resource has been modified since the specified date/time. ifUnmodifiedSince is specify
-// this header to perform the operation only if the resource has not been modified since the specified date/time.
-func (client TaskClient) Update(ctx context.Context, jobID string, taskID string, taskUpdateParameter TaskUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.UpdatePreparer(ctx, jobID, taskID, taskUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePreparer prepares the Update request.
-func (client TaskClient) UpdatePreparer(ctx context.Context, jobID string, taskID string, taskUpdateParameter TaskUpdateParameter, timeout *int32, clientRequestID string, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2016-07-01.3.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters),
- autorest.WithJSON(taskUpdateParameter),
- autorest.WithQueryParameters(queryParameters))
- if len(clientRequestID) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSender sends the Update request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) UpdateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateResponder handles the response to the Update request. The method always
-// closes the http.Response Body.
-func (client TaskClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff --git a/services/batch/2017-01-01.4.0/batch/account.go b/services/batch/2017-01-01.4.0/batch/account.go
deleted file mode 100644
index 0c3f3b055069..000000000000
--- a/services/batch/2017-01-01.4.0/batch/account.go
+++ /dev/null
@@ -1,174 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// AccountClient is the a client for issuing REST requests to the Azure Batch service.
-type AccountClient struct {
- BaseClient
-}
-
-// NewAccountClient creates an instance of the AccountClient client.
-func NewAccountClient() AccountClient {
- return NewAccountClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewAccountClientWithBaseURI creates an instance of the AccountClient client.
-func NewAccountClientWithBaseURI(baseURI string) AccountClient {
- return AccountClient{NewWithBaseURI(baseURI)}
-}
-
-// ListNodeAgentSkus sends the list node agent skus request.
-//
-// filter is an OData $filter clause. maxResults is the maximum number of items to return in the response. A
-// maximum of 1000 results will be returned. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. Client libraries typically set this to the current system clock time; set it
-// explicitly if you are calling the REST API directly.
-func (client AccountClient) ListNodeAgentSkus(ctx context.Context, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result AccountListNodeAgentSkusResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.AccountClient", "ListNodeAgentSkus", err.Error())
- }
-
- result.fn = client.listNodeAgentSkusNextResults
- req, err := client.ListNodeAgentSkusPreparer(ctx, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListNodeAgentSkus", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListNodeAgentSkusSender(req)
- if err != nil {
- result.alnasr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListNodeAgentSkus", resp, "Failure sending request")
- return
- }
-
- result.alnasr, err = client.ListNodeAgentSkusResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListNodeAgentSkus", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListNodeAgentSkusPreparer prepares the ListNodeAgentSkus request.
-func (client AccountClient) ListNodeAgentSkusPreparer(ctx context.Context, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/nodeagentskus"),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListNodeAgentSkusSender sends the ListNodeAgentSkus request. The method will close the
-// http.Response Body if it receives an error.
-func (client AccountClient) ListNodeAgentSkusSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListNodeAgentSkusResponder handles the response to the ListNodeAgentSkus request. The method always
-// closes the http.Response Body.
-func (client AccountClient) ListNodeAgentSkusResponder(resp *http.Response) (result AccountListNodeAgentSkusResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listNodeAgentSkusNextResults retrieves the next set of results, if any.
-func (client AccountClient) listNodeAgentSkusNextResults(lastResults AccountListNodeAgentSkusResult) (result AccountListNodeAgentSkusResult, err error) {
- req, err := lastResults.accountListNodeAgentSkusResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.AccountClient", "listNodeAgentSkusNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListNodeAgentSkusSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.AccountClient", "listNodeAgentSkusNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListNodeAgentSkusResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.AccountClient", "listNodeAgentSkusNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListNodeAgentSkusComplete enumerates all values, automatically crossing page boundaries as required.
-func (client AccountClient) ListNodeAgentSkusComplete(ctx context.Context, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result AccountListNodeAgentSkusResultIterator, err error) {
- result.page, err = client.ListNodeAgentSkus(ctx, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
diff --git a/services/batch/2017-01-01.4.0/batch/application.go b/services/batch/2017-01-01.4.0/batch/application.go
deleted file mode 100644
index 4a444aa78ab3..000000000000
--- a/services/batch/2017-01-01.4.0/batch/application.go
+++ /dev/null
@@ -1,262 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// ApplicationClient is the a client for issuing REST requests to the Azure Batch service.
-type ApplicationClient struct {
- BaseClient
-}
-
-// NewApplicationClient creates an instance of the ApplicationClient client.
-func NewApplicationClient() ApplicationClient {
- return NewApplicationClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewApplicationClientWithBaseURI creates an instance of the ApplicationClient client.
-func NewApplicationClientWithBaseURI(baseURI string) ApplicationClient {
- return ApplicationClient{NewWithBaseURI(baseURI)}
-}
-
-// Get sends the get request.
-//
-// applicationID is the ID of the application. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. Client libraries typically set this to the current system clock time; set it
-// explicitly if you are calling the REST API directly.
-func (client ApplicationClient) Get(ctx context.Context, applicationID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationSummary, err error) {
- req, err := client.GetPreparer(ctx, applicationID, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client ApplicationClient) GetPreparer(ctx context.Context, applicationID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "applicationId": autorest.Encode("path", applicationID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/applications/{applicationId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client ApplicationClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client ApplicationClient) GetResponder(resp *http.Response) (result ApplicationSummary, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List this operation returns only applications and versions that are available for use on compute nodes; that is,
-// that can be used in an application package reference. For administrator information about applications and versions
-// that are not yet available to compute nodes, use the Azure portal or the Azure Resource Manager API.
-//
-// maxResults is the maximum number of items to return in the response. A maximum of 1000 applications can be
-// returned. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client
-// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API
-// directly.
-func (client ApplicationClient) List(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.ApplicationClient", "List", err.Error())
- }
-
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.alr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "List", resp, "Failure sending request")
- return
- }
-
- result.alr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client ApplicationClient) ListPreparer(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/applications"),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client ApplicationClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client ApplicationClient) ListResponder(resp *http.Response) (result ApplicationListResult, 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 ApplicationClient) listNextResults(lastResults ApplicationListResult) (result ApplicationListResult, err error) {
- req, err := lastResults.applicationListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.ApplicationClient", "listNextResults", 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.ApplicationClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client ApplicationClient) ListComplete(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationListResultIterator, err error) {
- result.page, err = client.List(ctx, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
diff --git a/services/batch/2017-01-01.4.0/batch/certificate.go b/services/batch/2017-01-01.4.0/batch/certificate.go
deleted file mode 100644
index 83f1dddd501e..000000000000
--- a/services/batch/2017-01-01.4.0/batch/certificate.go
+++ /dev/null
@@ -1,555 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// CertificateClient is the a client for issuing REST requests to the Azure Batch service.
-type CertificateClient struct {
- BaseClient
-}
-
-// NewCertificateClient creates an instance of the CertificateClient client.
-func NewCertificateClient() CertificateClient {
- return NewCertificateClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewCertificateClientWithBaseURI creates an instance of the CertificateClient client.
-func NewCertificateClientWithBaseURI(baseURI string) CertificateClient {
- return CertificateClient{NewWithBaseURI(baseURI)}
-}
-
-// Add sends the add request.
-//
-// certificate is the certificate to be added. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. Client libraries typically set this to the current system clock time; set it
-// explicitly if you are calling the REST API directly.
-func (client CertificateClient) Add(ctx context.Context, certificate CertificateAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: certificate,
- Constraints: []validation.Constraint{{Target: "certificate.Thumbprint", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "certificate.ThumbprintAlgorithm", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "certificate.Data", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.CertificateClient", "Add", err.Error())
- }
-
- req, err := client.AddPreparer(ctx, certificate, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPreparer prepares the Add request.
-func (client CertificateClient) AddPreparer(ctx context.Context, certificate CertificateAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/certificates"),
- autorest.WithJSON(certificate),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSender sends the Add request. The method will close the
-// http.Response Body if it receives an error.
-func (client CertificateClient) AddSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddResponder handles the response to the Add request. The method always
-// closes the http.Response Body.
-func (client CertificateClient) AddResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// CancelDeletion if you try to delete a certificate that is being used by a pool or compute node, the status of the
-// certificate changes to deleteFailed. If you decide that you want to continue using the certificate, you can use this
-// operation to set the status of the certificate back to active. If you intend to delete the certificate, you do not
-// need to run this operation after the deletion failed. You must make sure that the certificate is not being used by
-// any resources, and then you can try again to delete the certificate.
-//
-// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is
-// the thumbprint of the certificate being deleted. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client CertificateClient) CancelDeletion(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.CancelDeletionPreparer(ctx, thumbprintAlgorithm, thumbprint, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.CancelDeletionSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", resp, "Failure sending request")
- return
- }
-
- result, err = client.CancelDeletionResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", resp, "Failure responding to request")
- }
-
- return
-}
-
-// CancelDeletionPreparer prepares the CancelDeletion request.
-func (client CertificateClient) CancelDeletionPreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "thumbprint": autorest.Encode("path", thumbprint),
- "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})/canceldelete", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CancelDeletionSender sends the CancelDeletion request. The method will close the
-// http.Response Body if it receives an error.
-func (client CertificateClient) CancelDeletionSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// CancelDeletionResponder handles the response to the CancelDeletion request. The method always
-// closes the http.Response Body.
-func (client CertificateClient) CancelDeletionResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Delete you cannot delete a certificate if a resource (pool or compute node) is using it. Before you can delete a
-// certificate, you must therefore make sure that the certificate is not associated with any existing pools, the
-// certificate is not installed on any compute nodes (even if you remove a certificate from a pool, it is not removed
-// from existing compute nodes in that pool until they restart), and no running tasks depend on the certificate. If you
-// try to delete a certificate that is in use, the deletion fails. The certificate status changes to deleteFailed. You
-// can use Cancel Delete Certificate to set the status back to active if you decide that you want to continue using the
-// certificate.
-//
-// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is
-// the thumbprint of the certificate to be deleted. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client CertificateClient) Delete(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeletePreparer(ctx, thumbprintAlgorithm, thumbprint, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client CertificateClient) DeletePreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "thumbprint": autorest.Encode("path", thumbprint),
- "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client CertificateClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client CertificateClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get gets information about the specified certificate.
-//
-// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is
-// the thumbprint of the certificate to get. selectParameter is an OData $select clause. timeout is the maximum
-// time that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is
-// the caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client CertificateClient) Get(ctx context.Context, thumbprintAlgorithm string, thumbprint string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result Certificate, err error) {
- req, err := client.GetPreparer(ctx, thumbprintAlgorithm, thumbprint, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client CertificateClient) GetPreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "thumbprint": autorest.Encode("path", thumbprint),
- "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client CertificateClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client CertificateClient) GetResponder(resp *http.Response) (result Certificate, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List sends the list request.
-//
-// filter is an OData $filter clause. selectParameter is an OData $select clause. maxResults is the maximum number
-// of items to return in the response. A maximum of 1000 certificates can be returned. timeout is the maximum time
-// that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client CertificateClient) List(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CertificateListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.CertificateClient", "List", err.Error())
- }
-
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.clr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "List", resp, "Failure sending request")
- return
- }
-
- result.clr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client CertificateClient) ListPreparer(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/certificates"),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client CertificateClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client CertificateClient) ListResponder(resp *http.Response) (result CertificateListResult, 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 CertificateClient) listNextResults(lastResults CertificateListResult) (result CertificateListResult, err error) {
- req, err := lastResults.certificateListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.CertificateClient", "listNextResults", 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.CertificateClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client CertificateClient) ListComplete(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CertificateListResultIterator, err error) {
- result.page, err = client.List(ctx, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
diff --git a/services/batch/2017-01-01.4.0/batch/client.go b/services/batch/2017-01-01.4.0/batch/client.go
deleted file mode 100644
index 6412d400441d..000000000000
--- a/services/batch/2017-01-01.4.0/batch/client.go
+++ /dev/null
@@ -1,49 +0,0 @@
-// Package batch implements the Azure ARM Batch service API version 2017-01-01.4.0.
-//
-// A client for issuing REST requests to the Azure Batch service.
-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"
-)
-
-const (
- // DefaultBaseURI is the default URI used for the service Batch
- DefaultBaseURI = "https://batch.core.windows.net"
-)
-
-// BaseClient is the base client for Batch.
-type BaseClient struct {
- autorest.Client
- BaseURI string
-}
-
-// New creates an instance of the BaseClient client.
-func New() BaseClient {
- return NewWithBaseURI(DefaultBaseURI)
-}
-
-// NewWithBaseURI creates an instance of the BaseClient client.
-func NewWithBaseURI(baseURI string) BaseClient {
- return BaseClient{
- Client: autorest.NewClientWithUserAgent(UserAgent()),
- BaseURI: baseURI,
- }
-}
diff --git a/services/batch/2017-01-01.4.0/batch/computenode.go b/services/batch/2017-01-01.4.0/batch/computenode.go
deleted file mode 100644
index ea4a9afffd81..000000000000
--- a/services/batch/2017-01-01.4.0/batch/computenode.go
+++ /dev/null
@@ -1,1121 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// ComputeNodeClient is the a client for issuing REST requests to the Azure Batch service.
-type ComputeNodeClient struct {
- BaseClient
-}
-
-// NewComputeNodeClient creates an instance of the ComputeNodeClient client.
-func NewComputeNodeClient() ComputeNodeClient {
- return NewComputeNodeClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewComputeNodeClientWithBaseURI creates an instance of the ComputeNodeClient client.
-func NewComputeNodeClientWithBaseURI(baseURI string) ComputeNodeClient {
- return ComputeNodeClient{NewWithBaseURI(baseURI)}
-}
-
-// AddUser you can add a user account to a node only when it is in the idle or running state.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the machine on which you want
-// to create a user account. userParameter is the user account to be created. timeout is the maximum time that the
-// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client ComputeNodeClient) AddUser(ctx context.Context, poolID string, nodeID string, userParameter ComputeNodeUser, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: userParameter,
- Constraints: []validation.Constraint{{Target: "userParameter.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.ComputeNodeClient", "AddUser", err.Error())
- }
-
- req, err := client.AddUserPreparer(ctx, poolID, nodeID, userParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddUserSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddUserResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddUserPreparer prepares the AddUser request.
-func (client ComputeNodeClient) AddUserPreparer(ctx context.Context, poolID string, nodeID string, userParameter ComputeNodeUser, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users", pathParameters),
- autorest.WithJSON(userParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddUserSender sends the AddUser request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) AddUserSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddUserResponder handles the response to the AddUser request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) AddUserResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// DeleteUser you can delete a user account to a node only when it is in the idle or running state.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the machine on which you want
-// to delete a user account. userName is the name of the user account to delete. timeout is the maximum time that
-// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client ComputeNodeClient) DeleteUser(ctx context.Context, poolID string, nodeID string, userName string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeleteUserPreparer(ctx, poolID, nodeID, userName, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteUserSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteUserResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteUserPreparer prepares the DeleteUser request.
-func (client ComputeNodeClient) DeleteUserPreparer(ctx context.Context, poolID string, nodeID string, userName string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- "userName": autorest.Encode("path", userName),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users/{userName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteUserSender sends the DeleteUser request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) DeleteUserSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteUserResponder handles the response to the DeleteUser request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) DeleteUserResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// DisableScheduling sends the disable scheduling request.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node on which you
-// want to disable task scheduling. nodeDisableSchedulingParameter is the parameters for the request. timeout is
-// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client ComputeNodeClient) DisableScheduling(ctx context.Context, poolID string, nodeID string, nodeDisableSchedulingParameter *NodeDisableSchedulingParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DisableSchedulingPreparer(ctx, poolID, nodeID, nodeDisableSchedulingParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DisableSchedulingSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", resp, "Failure sending request")
- return
- }
-
- result, err = client.DisableSchedulingResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DisableSchedulingPreparer prepares the DisableScheduling request.
-func (client ComputeNodeClient) DisableSchedulingPreparer(ctx context.Context, poolID string, nodeID string, nodeDisableSchedulingParameter *NodeDisableSchedulingParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/disablescheduling", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if nodeDisableSchedulingParameter != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(nodeDisableSchedulingParameter))
- }
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DisableSchedulingSender sends the DisableScheduling request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) DisableSchedulingSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DisableSchedulingResponder handles the response to the DisableScheduling request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) DisableSchedulingResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// EnableScheduling sends the enable scheduling request.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node on which you
-// want to enable task scheduling. timeout is the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a
-// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are
-// calling the REST API directly.
-func (client ComputeNodeClient) EnableScheduling(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.EnableSchedulingPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.EnableSchedulingSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", resp, "Failure sending request")
- return
- }
-
- result, err = client.EnableSchedulingResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", resp, "Failure responding to request")
- }
-
- return
-}
-
-// EnableSchedulingPreparer prepares the EnableScheduling request.
-func (client ComputeNodeClient) EnableSchedulingPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/enablescheduling", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// EnableSchedulingSender sends the EnableScheduling request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) EnableSchedulingSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// EnableSchedulingResponder handles the response to the EnableScheduling request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) EnableSchedulingResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get sends the get request.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that you want
-// to get information about. selectParameter is an OData $select clause. timeout is the maximum time that the
-// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client ComputeNodeClient) Get(ctx context.Context, poolID string, nodeID string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNode, err error) {
- req, err := client.GetPreparer(ctx, poolID, nodeID, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client ComputeNodeClient) GetPreparer(ctx context.Context, poolID string, nodeID string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) GetResponder(resp *http.Response) (result ComputeNode, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetRemoteDesktop before you can access a node by using the RDP file, you must create a user account on the node.
-// This API can only be invoked on pools created with the cloud service configuration property.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node for which you
-// want to get the Remote Desktop Protocol file. timeout is the maximum time that the server can spend processing
-// the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in
-// the form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. Client libraries typically set this to the current system clock time; set it
-// explicitly if you are calling the REST API directly.
-func (client ComputeNodeClient) GetRemoteDesktop(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ReadCloser, err error) {
- req, err := client.GetRemoteDesktopPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetRemoteDesktopSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetRemoteDesktopResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetRemoteDesktopPreparer prepares the GetRemoteDesktop request.
-func (client ComputeNodeClient) GetRemoteDesktopPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/rdp", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetRemoteDesktopSender sends the GetRemoteDesktop request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) GetRemoteDesktopSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetRemoteDesktopResponder handles the response to the GetRemoteDesktop request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) GetRemoteDesktopResponder(resp *http.Response) (result ReadCloser, err error) {
- result.Value = &resp.Body
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK))
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetRemoteLoginSettings before you can remotely login to a node using the remote login settings, you must create a
-// user account on the node. This API can be invoked only on pools created with the virtual machine configuration
-// property.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node for which to
-// obtain the remote login settings. timeout is the maximum time that the server can spend processing the request,
-// in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of
-// a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are
-// calling the REST API directly.
-func (client ComputeNodeClient) GetRemoteLoginSettings(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeGetRemoteLoginSettingsResult, err error) {
- req, err := client.GetRemoteLoginSettingsPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteLoginSettings", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetRemoteLoginSettingsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteLoginSettings", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetRemoteLoginSettingsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteLoginSettings", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetRemoteLoginSettingsPreparer prepares the GetRemoteLoginSettings request.
-func (client ComputeNodeClient) GetRemoteLoginSettingsPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/remoteloginsettings", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetRemoteLoginSettingsSender sends the GetRemoteLoginSettings request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) GetRemoteLoginSettingsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetRemoteLoginSettingsResponder handles the response to the GetRemoteLoginSettings request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) GetRemoteLoginSettingsResponder(resp *http.Response) (result ComputeNodeGetRemoteLoginSettingsResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List sends the list request.
-//
-// poolID is the ID of the pool from which you want to list nodes. filter is an OData $filter clause..
-// selectParameter is an OData $select clause. maxResults is the maximum number of items to return in the response.
-// A maximum of 1000 nodes can be returned. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. Client libraries typically set this to the current system clock time; set it
-// explicitly if you are calling the REST API directly.
-func (client ComputeNodeClient) List(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.ComputeNodeClient", "List", err.Error())
- }
-
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, poolID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.cnlr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", resp, "Failure sending request")
- return
- }
-
- result.cnlr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client ComputeNodeClient) ListPreparer(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) ListResponder(resp *http.Response) (result ComputeNodeListResult, 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 ComputeNodeClient) listNextResults(lastResults ComputeNodeListResult) (result ComputeNodeListResult, err error) {
- req, err := lastResults.computeNodeListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "listNextResults", 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.ComputeNodeClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client ComputeNodeClient) ListComplete(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeListResultIterator, err error) {
- result.page, err = client.List(ctx, poolID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// Reboot you can restart a node only if it is in an idle or running state.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that you want
-// to restart. nodeRebootParameter is the parameters for the request. timeout is the maximum time that the server
-// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated
-// request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client ComputeNodeClient) Reboot(ctx context.Context, poolID string, nodeID string, nodeRebootParameter *NodeRebootParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.RebootPreparer(ctx, poolID, nodeID, nodeRebootParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.RebootSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", resp, "Failure sending request")
- return
- }
-
- result, err = client.RebootResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", resp, "Failure responding to request")
- }
-
- return
-}
-
-// RebootPreparer prepares the Reboot request.
-func (client ComputeNodeClient) RebootPreparer(ctx context.Context, poolID string, nodeID string, nodeRebootParameter *NodeRebootParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/reboot", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if nodeRebootParameter != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(nodeRebootParameter))
- }
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// RebootSender sends the Reboot request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) RebootSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// RebootResponder handles the response to the Reboot request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) RebootResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Reimage you can reinstall the operating system on a node only if it is in an idle or running state. This API can be
-// invoked only on pools created with the cloud service configuration property.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that you want
-// to restart. nodeReimageParameter is the parameters for the request. timeout is the maximum time that the server
-// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated
-// request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client ComputeNodeClient) Reimage(ctx context.Context, poolID string, nodeID string, nodeReimageParameter *NodeReimageParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.ReimagePreparer(ctx, poolID, nodeID, nodeReimageParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ReimageSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", resp, "Failure sending request")
- return
- }
-
- result, err = client.ReimageResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ReimagePreparer prepares the Reimage request.
-func (client ComputeNodeClient) ReimagePreparer(ctx context.Context, poolID string, nodeID string, nodeReimageParameter *NodeReimageParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/reimage", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if nodeReimageParameter != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(nodeReimageParameter))
- }
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ReimageSender sends the Reimage request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) ReimageSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ReimageResponder handles the response to the Reimage request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// UpdateUser this operation replaces of all the updateable properties of the account. For example, if the expiryTime
-// element is not specified, the current value is replaced with the default value, not left unmodified. You can update
-// a user account on a node only when it is in the idle or running state.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the machine on which you want
-// to update a user account. userName is the name of the user account to update. nodeUpdateUserParameter is the
-// parameters for the request. timeout is the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a
-// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are
-// calling the REST API directly.
-func (client ComputeNodeClient) UpdateUser(ctx context.Context, poolID string, nodeID string, userName string, nodeUpdateUserParameter NodeUpdateUserParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.UpdateUserPreparer(ctx, poolID, nodeID, userName, nodeUpdateUserParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateUserSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateUserResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdateUserPreparer prepares the UpdateUser request.
-func (client ComputeNodeClient) UpdateUserPreparer(ctx context.Context, poolID string, nodeID string, userName string, nodeUpdateUserParameter NodeUpdateUserParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- "userName": autorest.Encode("path", userName),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users/{userName}", pathParameters),
- autorest.WithJSON(nodeUpdateUserParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateUserSender sends the UpdateUser request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) UpdateUserSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateUserResponder handles the response to the UpdateUser request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) UpdateUserResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff --git a/services/batch/2017-01-01.4.0/batch/file.go b/services/batch/2017-01-01.4.0/batch/file.go
deleted file mode 100644
index f5aebe769c6a..000000000000
--- a/services/batch/2017-01-01.4.0/batch/file.go
+++ /dev/null
@@ -1,942 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// FileClient is the a client for issuing REST requests to the Azure Batch service.
-type FileClient struct {
- BaseClient
-}
-
-// NewFileClient creates an instance of the FileClient client.
-func NewFileClient() FileClient {
- return NewFileClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewFileClientWithBaseURI creates an instance of the FileClient client.
-func NewFileClientWithBaseURI(baseURI string) FileClient {
- return FileClient{NewWithBaseURI(baseURI)}
-}
-
-// DeleteFromComputeNode sends the delete from compute node request.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node from which you
-// want to delete the file. filePath is the path to the file that you want to delete. recursive is whether to
-// delete children of a directory. If the filePath parameter represents a directory instead of a file, you can set
-// recursive to true to delete the directory and all of the files and subdirectories in it. If recursive is false
-// then the directory must be empty or deletion will fail. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client FileClient) DeleteFromComputeNode(ctx context.Context, poolID string, nodeID string, filePath string, recursive *bool, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeleteFromComputeNodePreparer(ctx, poolID, nodeID, filePath, recursive, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteFromComputeNodeSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteFromComputeNodeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteFromComputeNodePreparer prepares the DeleteFromComputeNode request.
-func (client FileClient) DeleteFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, filePath string, recursive *bool, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "filePath": autorest.Encode("path", filePath),
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if recursive != nil {
- queryParameters["recursive"] = autorest.Encode("query", *recursive)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{filePath}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteFromComputeNodeSender sends the DeleteFromComputeNode request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) DeleteFromComputeNodeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteFromComputeNodeResponder handles the response to the DeleteFromComputeNode request. The method always
-// closes the http.Response Body.
-func (client FileClient) DeleteFromComputeNodeResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// DeleteFromTask sends the delete from task request.
-//
-// jobID is the ID of the job that contains the task. taskID is the ID of the task whose file you want to delete.
-// filePath is the path to the task file that you want to delete. recursive is whether to delete children of a
-// directory. If the filePath parameter represents a directory instead of a file, you can set recursive to true to
-// delete the directory and all of the files and subdirectories in it. If recursive is false then the directory
-// must be empty or deletion will fail. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. Client libraries typically set this to the current system clock time; set it
-// explicitly if you are calling the REST API directly.
-func (client FileClient) DeleteFromTask(ctx context.Context, jobID string, taskID string, filePath string, recursive *bool, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeleteFromTaskPreparer(ctx, jobID, taskID, filePath, recursive, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteFromTaskSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteFromTaskResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteFromTaskPreparer prepares the DeleteFromTask request.
-func (client FileClient) DeleteFromTaskPreparer(ctx context.Context, jobID string, taskID string, filePath string, recursive *bool, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "filePath": autorest.Encode("path", filePath),
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if recursive != nil {
- queryParameters["recursive"] = autorest.Encode("query", *recursive)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{filePath}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteFromTaskSender sends the DeleteFromTask request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) DeleteFromTaskSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteFromTaskResponder handles the response to the DeleteFromTask request. The method always
-// closes the http.Response Body.
-func (client FileClient) DeleteFromTaskResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// GetFromComputeNode returns the content of the specified compute node file.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that contains
-// the file. filePath is the path to the compute node file that you want to get the content of. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ocpRange is
-// the byte range to be retrieved. The default is to retrieve the entire file. The format is
-// bytes=startRange-endRange. ifModifiedSince is a timestamp indicating the last modified time of the resource
-// known to the client. The operation will be performed only if the resource on the service has been modified since
-// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to
-// the client. The operation will be performed only if the resource on the service has not been modified since the
-// specified time.
-func (client FileClient) GetFromComputeNode(ctx context.Context, poolID string, nodeID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result ReadCloser, err error) {
- req, err := client.GetFromComputeNodePreparer(ctx, poolID, nodeID, filePath, timeout, clientRequestID, returnClientRequestID, ocpDate, ocpRange, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetFromComputeNodeSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetFromComputeNodeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetFromComputeNodePreparer prepares the GetFromComputeNode request.
-func (client FileClient) GetFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "filePath": autorest.Encode("path", filePath),
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{filePath}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ocpRange) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-range", autorest.String(ocpRange)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetFromComputeNodeSender sends the GetFromComputeNode request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) GetFromComputeNodeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetFromComputeNodeResponder handles the response to the GetFromComputeNode request. The method always
-// closes the http.Response Body.
-func (client FileClient) GetFromComputeNodeResponder(resp *http.Response) (result ReadCloser, err error) {
- result.Value = &resp.Body
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK))
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetFromTask returns the content of the specified task file.
-//
-// jobID is the ID of the job that contains the task. taskID is the ID of the task whose file you want to retrieve.
-// filePath is the path to the task file that you want to get the content of. timeout is the maximum time that the
-// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ocpRange is
-// the byte range to be retrieved. The default is to retrieve the entire file. The format is
-// bytes=startRange-endRange. ifModifiedSince is a timestamp indicating the last modified time of the resource
-// known to the client. The operation will be performed only if the resource on the service has been modified since
-// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to
-// the client. The operation will be performed only if the resource on the service has not been modified since the
-// specified time.
-func (client FileClient) GetFromTask(ctx context.Context, jobID string, taskID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result ReadCloser, err error) {
- req, err := client.GetFromTaskPreparer(ctx, jobID, taskID, filePath, timeout, clientRequestID, returnClientRequestID, ocpDate, ocpRange, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetFromTaskSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetFromTaskResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetFromTaskPreparer prepares the GetFromTask request.
-func (client FileClient) GetFromTaskPreparer(ctx context.Context, jobID string, taskID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "filePath": autorest.Encode("path", filePath),
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{filePath}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ocpRange) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-range", autorest.String(ocpRange)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetFromTaskSender sends the GetFromTask request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) GetFromTaskSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetFromTaskResponder handles the response to the GetFromTask request. The method always
-// closes the http.Response Body.
-func (client FileClient) GetFromTaskResponder(resp *http.Response) (result ReadCloser, err error) {
- result.Value = &resp.Body
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK))
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetPropertiesFromComputeNode gets the properties of the specified compute node file.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that contains
-// the file. filePath is the path to the compute node file that you want to get the properties of. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client FileClient) GetPropertiesFromComputeNode(ctx context.Context, poolID string, nodeID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.GetPropertiesFromComputeNodePreparer(ctx, poolID, nodeID, filePath, timeout, clientRequestID, returnClientRequestID, ocpDate, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromComputeNode", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetPropertiesFromComputeNodeSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromComputeNode", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetPropertiesFromComputeNodeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromComputeNode", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPropertiesFromComputeNodePreparer prepares the GetPropertiesFromComputeNode request.
-func (client FileClient) GetPropertiesFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "filePath": autorest.Encode("path", filePath),
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsHead(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{filePath}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetPropertiesFromComputeNodeSender sends the GetPropertiesFromComputeNode request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) GetPropertiesFromComputeNodeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetPropertiesFromComputeNodeResponder handles the response to the GetPropertiesFromComputeNode request. The method always
-// closes the http.Response Body.
-func (client FileClient) GetPropertiesFromComputeNodeResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// GetPropertiesFromTask gets the properties of the specified task file.
-//
-// jobID is the ID of the job that contains the task. taskID is the ID of the task whose file you want to get the
-// properties of. filePath is the path to the task file that you want to get the properties of. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client FileClient) GetPropertiesFromTask(ctx context.Context, jobID string, taskID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.GetPropertiesFromTaskPreparer(ctx, jobID, taskID, filePath, timeout, clientRequestID, returnClientRequestID, ocpDate, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromTask", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetPropertiesFromTaskSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromTask", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetPropertiesFromTaskResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromTask", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPropertiesFromTaskPreparer prepares the GetPropertiesFromTask request.
-func (client FileClient) GetPropertiesFromTaskPreparer(ctx context.Context, jobID string, taskID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "filePath": autorest.Encode("path", filePath),
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsHead(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{filePath}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetPropertiesFromTaskSender sends the GetPropertiesFromTask request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) GetPropertiesFromTaskSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetPropertiesFromTaskResponder handles the response to the GetPropertiesFromTask request. The method always
-// closes the http.Response Body.
-func (client FileClient) GetPropertiesFromTaskResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// ListFromComputeNode sends the list from compute node request.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node whose files
-// you want to list. filter is an OData $filter clause. recursive is whether to list children of a directory.
-// maxResults is the maximum number of items to return in the response. A maximum of 1000 files can be returned.
-// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30
-// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such
-// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should
-// return the client-request-id in the response. ocpDate is the time the request was issued. Client libraries
-// typically set this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client FileClient) ListFromComputeNode(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.FileClient", "ListFromComputeNode", err.Error())
- }
-
- result.fn = client.listFromComputeNodeNextResults
- req, err := client.ListFromComputeNodePreparer(ctx, poolID, nodeID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListFromComputeNodeSender(req)
- if err != nil {
- result.nflr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", resp, "Failure sending request")
- return
- }
-
- result.nflr, err = client.ListFromComputeNodeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListFromComputeNodePreparer prepares the ListFromComputeNode request.
-func (client FileClient) ListFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if recursive != nil {
- queryParameters["recursive"] = autorest.Encode("query", *recursive)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListFromComputeNodeSender sends the ListFromComputeNode request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) ListFromComputeNodeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListFromComputeNodeResponder handles the response to the ListFromComputeNode request. The method always
-// closes the http.Response Body.
-func (client FileClient) ListFromComputeNodeResponder(resp *http.Response) (result NodeFileListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listFromComputeNodeNextResults retrieves the next set of results, if any.
-func (client FileClient) listFromComputeNodeNextResults(lastResults NodeFileListResult) (result NodeFileListResult, err error) {
- req, err := lastResults.nodeFileListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListFromComputeNodeSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListFromComputeNodeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListFromComputeNodeComplete enumerates all values, automatically crossing page boundaries as required.
-func (client FileClient) ListFromComputeNodeComplete(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultIterator, err error) {
- result.page, err = client.ListFromComputeNode(ctx, poolID, nodeID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// ListFromTask sends the list from task request.
-//
-// jobID is the ID of the job that contains the task. taskID is the ID of the task whose files you want to list.
-// filter is an OData $filter clause. recursive is whether to list children of a directory. This parameter can be
-// used in combination with the filter parameter to list specific type of files. maxResults is the maximum number
-// of items to return in the response. A maximum of 1000 files can be returned. timeout is the maximum time that
-// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client FileClient) ListFromTask(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.FileClient", "ListFromTask", err.Error())
- }
-
- result.fn = client.listFromTaskNextResults
- req, err := client.ListFromTaskPreparer(ctx, jobID, taskID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListFromTaskSender(req)
- if err != nil {
- result.nflr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", resp, "Failure sending request")
- return
- }
-
- result.nflr, err = client.ListFromTaskResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListFromTaskPreparer prepares the ListFromTask request.
-func (client FileClient) ListFromTaskPreparer(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if recursive != nil {
- queryParameters["recursive"] = autorest.Encode("query", *recursive)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListFromTaskSender sends the ListFromTask request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) ListFromTaskSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListFromTaskResponder handles the response to the ListFromTask request. The method always
-// closes the http.Response Body.
-func (client FileClient) ListFromTaskResponder(resp *http.Response) (result NodeFileListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listFromTaskNextResults retrieves the next set of results, if any.
-func (client FileClient) listFromTaskNextResults(lastResults NodeFileListResult) (result NodeFileListResult, err error) {
- req, err := lastResults.nodeFileListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListFromTaskSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListFromTaskResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListFromTaskComplete enumerates all values, automatically crossing page boundaries as required.
-func (client FileClient) ListFromTaskComplete(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultIterator, err error) {
- result.page, err = client.ListFromTask(ctx, jobID, taskID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
diff --git a/services/batch/2017-01-01.4.0/batch/job.go b/services/batch/2017-01-01.4.0/batch/job.go
deleted file mode 100644
index 77ac65a2f627..000000000000
--- a/services/batch/2017-01-01.4.0/batch/job.go
+++ /dev/null
@@ -1,1519 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// JobClient is the a client for issuing REST requests to the Azure Batch service.
-type JobClient struct {
- BaseClient
-}
-
-// NewJobClient creates an instance of the JobClient client.
-func NewJobClient() JobClient {
- return NewJobClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewJobClientWithBaseURI creates an instance of the JobClient client.
-func NewJobClientWithBaseURI(baseURI string) JobClient {
- return JobClient{NewWithBaseURI(baseURI)}
-}
-
-// Add the Batch service supports two ways to control the work done as part of a job. In the first approach, the user
-// specifies a Job Manager task. The Batch service launches this task when it is ready to start the job. The Job
-// Manager task controls all other tasks that run under this job, by using the Task APIs. In the second approach, the
-// user directly controls the execution of tasks under an active job, by using the Task APIs. Also note: when naming
-// jobs, avoid including sensitive information such as user names or secret project names. This information may appear
-// in telemetry logs accessible to Microsoft Support engineers.
-//
-// job is the job to be added. timeout is the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a
-// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are
-// calling the REST API directly.
-func (client JobClient) Add(ctx context.Context, job JobAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: job,
- Constraints: []validation.Constraint{{Target: "job.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.JobManagerTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.JobManagerTask.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.JobManagerTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "job.JobPreparationTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.JobPreparationTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "job.JobReleaseTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.JobReleaseTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "job.PoolInfo", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.VMSize", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.OsDisk", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.OsDisk.ImageUris", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.StartTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}},
- }},
- }},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobClient", "Add", err.Error())
- }
-
- req, err := client.AddPreparer(ctx, job, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPreparer prepares the Add request.
-func (client JobClient) AddPreparer(ctx context.Context, job JobAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/jobs"),
- autorest.WithJSON(job),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSender sends the Add request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) AddSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddResponder handles the response to the Add request. The method always
-// closes the http.Response Body.
-func (client JobClient) AddResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Delete deleting a job also deletes all tasks that are part of that job, and all job statistics. This also overrides
-// the retention period for task data; that is, if the job contains tasks which are still retained on compute nodes,
-// the Batch services deletes those tasks' working directories and all their contents.
-//
-// jobID is the ID of the job to delete. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. Client libraries typically set this to the current system clock time; set it
-// explicitly if you are calling the REST API directly. ifMatch is an ETag value associated with the version of the
-// resource known to the client. The operation will be performed only if the resource's current ETag on the service
-// exactly matches the value specified by the client. ifNoneMatch is an ETag value associated with the version of
-// the resource known to the client. The operation will be performed only if the resource's current ETag on the
-// service does not match the value specified by the client. ifModifiedSince is a timestamp indicating the last
-// modified time of the resource known to the client. The operation will be performed only if the resource on the
-// service has been modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last
-// modified time of the resource known to the client. The operation will be performed only if the resource on the
-// service has not been modified since the specified time.
-func (client JobClient) Delete(ctx context.Context, jobID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeletePreparer(ctx, jobID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client JobClient) DeletePreparer(ctx context.Context, jobID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client JobClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Disable the Batch Service immediately moves the job to the disabling state. Batch then uses the disableTasks
-// parameter to determine what to do with the currently running tasks of the job. The job remains in the disabling
-// state until the disable operation is completed and all tasks have been dealt with according to the disableTasks
-// option; the job then moves to the disabled state. No new tasks are started under the job until it moves back to
-// active state. If you try to disable a job that is in any state other than active, disabling, or disabled, the
-// request fails with status code 409.
-//
-// jobID is the ID of the job to disable. jobDisableParameter is the parameters for the request. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client JobClient) Disable(ctx context.Context, jobID string, jobDisableParameter JobDisableParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DisablePreparer(ctx, jobID, jobDisableParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DisableSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", resp, "Failure sending request")
- return
- }
-
- result, err = client.DisableResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DisablePreparer prepares the Disable request.
-func (client JobClient) DisablePreparer(ctx context.Context, jobID string, jobDisableParameter JobDisableParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/disable", pathParameters),
- autorest.WithJSON(jobDisableParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DisableSender sends the Disable request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) DisableSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DisableResponder handles the response to the Disable request. The method always
-// closes the http.Response Body.
-func (client JobClient) DisableResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Enable when you call this API, the Batch service sets a disabled job to the enabling state. After the this operation
-// is completed, the job moves to the active state, and scheduling of new tasks under the job resumes. The Batch
-// service does not allow a task to remain in the active state for more than 7 days. Therefore, if you enable a job
-// containing active tasks which were added more than 7 days ago, those tasks will not run.
-//
-// jobID is the ID of the job to enable. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. Client libraries typically set this to the current system clock time; set it
-// explicitly if you are calling the REST API directly. ifMatch is an ETag value associated with the version of the
-// resource known to the client. The operation will be performed only if the resource's current ETag on the service
-// exactly matches the value specified by the client. ifNoneMatch is an ETag value associated with the version of
-// the resource known to the client. The operation will be performed only if the resource's current ETag on the
-// service does not match the value specified by the client. ifModifiedSince is a timestamp indicating the last
-// modified time of the resource known to the client. The operation will be performed only if the resource on the
-// service has been modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last
-// modified time of the resource known to the client. The operation will be performed only if the resource on the
-// service has not been modified since the specified time.
-func (client JobClient) Enable(ctx context.Context, jobID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.EnablePreparer(ctx, jobID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.EnableSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", resp, "Failure sending request")
- return
- }
-
- result, err = client.EnableResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", resp, "Failure responding to request")
- }
-
- return
-}
-
-// EnablePreparer prepares the Enable request.
-func (client JobClient) EnablePreparer(ctx context.Context, jobID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/enable", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// EnableSender sends the Enable request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) EnableSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// EnableResponder handles the response to the Enable request. The method always
-// closes the http.Response Body.
-func (client JobClient) EnableResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get sends the get request.
-//
-// jobID is the ID of the job. selectParameter is an OData $select clause. expand is an OData $expand clause.
-// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30
-// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such
-// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should
-// return the client-request-id in the response. ocpDate is the time the request was issued. Client libraries
-// typically set this to the current system clock time; set it explicitly if you are calling the REST API directly.
-// ifMatch is an ETag value associated with the version of the resource known to the client. The operation will be
-// performed only if the resource's current ETag on the service exactly matches the value specified by the client.
-// ifNoneMatch is an ETag value associated with the version of the resource known to the client. The operation will
-// be performed only if the resource's current ETag on the service does not match the value specified by the
-// client. ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client.
-// The operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client JobClient) Get(ctx context.Context, jobID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudJob, err error) {
- req, err := client.GetPreparer(ctx, jobID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client JobClient) GetPreparer(ctx context.Context, jobID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client JobClient) GetResponder(resp *http.Response) (result CloudJob, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetAllLifetimeStatistics statistics are aggregated across all jobs that have ever existed in the account, from
-// account creation to the last update time of the statistics.
-//
-// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30
-// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such
-// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should
-// return the client-request-id in the response. ocpDate is the time the request was issued. Client libraries
-// typically set this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client JobClient) GetAllLifetimeStatistics(ctx context.Context, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result JobStatistics, err error) {
- req, err := client.GetAllLifetimeStatisticsPreparer(ctx, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllLifetimeStatistics", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetAllLifetimeStatisticsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllLifetimeStatistics", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetAllLifetimeStatisticsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllLifetimeStatistics", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetAllLifetimeStatisticsPreparer prepares the GetAllLifetimeStatistics request.
-func (client JobClient) GetAllLifetimeStatisticsPreparer(ctx context.Context, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/lifetimejobstats"),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetAllLifetimeStatisticsSender sends the GetAllLifetimeStatistics request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) GetAllLifetimeStatisticsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetAllLifetimeStatisticsResponder handles the response to the GetAllLifetimeStatistics request. The method always
-// closes the http.Response Body.
-func (client JobClient) GetAllLifetimeStatisticsResponder(resp *http.Response) (result JobStatistics, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List sends the list request.
-//
-// filter is an OData $filter clause. selectParameter is an OData $select clause. expand is an OData $expand
-// clause. maxResults is the maximum number of items to return in the response. A maximum of 1000 jobs can be
-// returned. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client
-// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API
-// directly.
-func (client JobClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobClient", "List", err.Error())
- }
-
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.cjlr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobClient", "List", resp, "Failure sending request")
- return
- }
-
- result.cjlr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client JobClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/jobs"),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client JobClient) ListResponder(resp *http.Response) (result CloudJobListResult, 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 JobClient) listNextResults(lastResults CloudJobListResult) (result CloudJobListResult, err error) {
- req, err := lastResults.cloudJobListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.JobClient", "listNextResults", 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.JobClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client JobClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultIterator, err error) {
- result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// ListFromJobSchedule sends the list from job schedule request.
-//
-// jobScheduleID is the ID of the job schedule from which you want to get a list of jobs. filter is an OData
-// $filter clause. selectParameter is an OData $select clause. expand is an OData $expand clause. maxResults is the
-// maximum number of items to return in the response. A maximum of 1000 jobs can be returned. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client JobClient) ListFromJobSchedule(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobClient", "ListFromJobSchedule", err.Error())
- }
-
- result.fn = client.listFromJobScheduleNextResults
- req, err := client.ListFromJobSchedulePreparer(ctx, jobScheduleID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListFromJobScheduleSender(req)
- if err != nil {
- result.cjlr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", resp, "Failure sending request")
- return
- }
-
- result.cjlr, err = client.ListFromJobScheduleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListFromJobSchedulePreparer prepares the ListFromJobSchedule request.
-func (client JobClient) ListFromJobSchedulePreparer(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}/jobs", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListFromJobScheduleSender sends the ListFromJobSchedule request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) ListFromJobScheduleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListFromJobScheduleResponder handles the response to the ListFromJobSchedule request. The method always
-// closes the http.Response Body.
-func (client JobClient) ListFromJobScheduleResponder(resp *http.Response) (result CloudJobListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listFromJobScheduleNextResults retrieves the next set of results, if any.
-func (client JobClient) listFromJobScheduleNextResults(lastResults CloudJobListResult) (result CloudJobListResult, err error) {
- req, err := lastResults.cloudJobListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListFromJobScheduleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListFromJobScheduleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListFromJobScheduleComplete enumerates all values, automatically crossing page boundaries as required.
-func (client JobClient) ListFromJobScheduleComplete(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultIterator, err error) {
- result.page, err = client.ListFromJobSchedule(ctx, jobScheduleID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// ListPreparationAndReleaseTaskStatus this API returns the Job Preparation and Job Release task status on all compute
-// nodes that have run the Job Preparation or Job Release task. This includes nodes which have since been removed from
-// the pool.
-//
-// jobID is the ID of the job. filter is an OData $filter clause. selectParameter is an OData $select clause.
-// maxResults is the maximum number of items to return in the response. A maximum of 1000 tasks can be returned.
-// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30
-// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such
-// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should
-// return the client-request-id in the response. ocpDate is the time the request was issued. Client libraries
-// typically set this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client JobClient) ListPreparationAndReleaseTaskStatus(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListPreparationAndReleaseTaskStatusResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobClient", "ListPreparationAndReleaseTaskStatus", err.Error())
- }
-
- result.fn = client.listPreparationAndReleaseTaskStatusNextResults
- req, err := client.ListPreparationAndReleaseTaskStatusPreparer(ctx, jobID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListPreparationAndReleaseTaskStatusSender(req)
- if err != nil {
- result.cjlpartsr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", resp, "Failure sending request")
- return
- }
-
- result.cjlpartsr, err = client.ListPreparationAndReleaseTaskStatusResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparationAndReleaseTaskStatusPreparer prepares the ListPreparationAndReleaseTaskStatus request.
-func (client JobClient) ListPreparationAndReleaseTaskStatusPreparer(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/jobpreparationandreleasetaskstatus", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListPreparationAndReleaseTaskStatusSender sends the ListPreparationAndReleaseTaskStatus request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) ListPreparationAndReleaseTaskStatusSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListPreparationAndReleaseTaskStatusResponder handles the response to the ListPreparationAndReleaseTaskStatus request. The method always
-// closes the http.Response Body.
-func (client JobClient) ListPreparationAndReleaseTaskStatusResponder(resp *http.Response) (result CloudJobListPreparationAndReleaseTaskStatusResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listPreparationAndReleaseTaskStatusNextResults retrieves the next set of results, if any.
-func (client JobClient) listPreparationAndReleaseTaskStatusNextResults(lastResults CloudJobListPreparationAndReleaseTaskStatusResult) (result CloudJobListPreparationAndReleaseTaskStatusResult, err error) {
- req, err := lastResults.cloudJobListPreparationAndReleaseTaskStatusResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListPreparationAndReleaseTaskStatusSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListPreparationAndReleaseTaskStatusResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListPreparationAndReleaseTaskStatusComplete enumerates all values, automatically crossing page boundaries as required.
-func (client JobClient) ListPreparationAndReleaseTaskStatusComplete(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListPreparationAndReleaseTaskStatusResultIterator, err error) {
- result.page, err = client.ListPreparationAndReleaseTaskStatus(ctx, jobID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// Patch this replaces only the job properties specified in the request. For example, if the job has constraints, and a
-// request does not specify the constraints element, then the job keeps the existing constraints.
-//
-// jobID is the ID of the job whose properties you want to update. jobPatchParameter is the parameters for the
-// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client
-// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API
-// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The
-// operation will be performed only if the resource's current ETag on the service exactly matches the value
-// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the
-// client. The operation will be performed only if the resource's current ETag on the service does not match the
-// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource
-// known to the client. The operation will be performed only if the resource on the service has been modified since
-// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to
-// the client. The operation will be performed only if the resource on the service has not been modified since the
-// specified time.
-func (client JobClient) Patch(ctx context.Context, jobID string, jobPatchParameter JobPatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.PatchPreparer(ctx, jobID, jobPatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.PatchSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", resp, "Failure sending request")
- return
- }
-
- result, err = client.PatchResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", resp, "Failure responding to request")
- }
-
- return
-}
-
-// PatchPreparer prepares the Patch request.
-func (client JobClient) PatchPreparer(ctx context.Context, jobID string, jobPatchParameter JobPatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPatch(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}", pathParameters),
- autorest.WithJSON(jobPatchParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// PatchSender sends the Patch request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) PatchSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// PatchResponder handles the response to the Patch request. The method always
-// closes the http.Response Body.
-func (client JobClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Terminate when a Terminate Job request is received, the Batch service sets the job to the terminating state. The
-// Batch service then terminates any active or running tasks associated with the job, and runs any required Job Release
-// tasks. The job then moves into the completed state.
-//
-// jobID is the ID of the job to terminate. jobTerminateParameter is the parameters for the request. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client JobClient) Terminate(ctx context.Context, jobID string, jobTerminateParameter *JobTerminateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.TerminatePreparer(ctx, jobID, jobTerminateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.TerminateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", resp, "Failure sending request")
- return
- }
-
- result, err = client.TerminateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", resp, "Failure responding to request")
- }
-
- return
-}
-
-// TerminatePreparer prepares the Terminate request.
-func (client JobClient) TerminatePreparer(ctx context.Context, jobID string, jobTerminateParameter *JobTerminateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/terminate", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if jobTerminateParameter != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(jobTerminateParameter))
- }
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// TerminateSender sends the Terminate request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) TerminateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// TerminateResponder handles the response to the Terminate request. The method always
-// closes the http.Response Body.
-func (client JobClient) TerminateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Update this fully replaces all the updateable properties of the job. For example, if the job has constraints
-// associated with it and if constraints is not specified with this request, then the Batch service will remove the
-// existing constraints.
-//
-// jobID is the ID of the job whose properties you want to update. jobUpdateParameter is the parameters for the
-// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client
-// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API
-// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The
-// operation will be performed only if the resource's current ETag on the service exactly matches the value
-// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the
-// client. The operation will be performed only if the resource's current ETag on the service does not match the
-// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource
-// known to the client. The operation will be performed only if the resource on the service has been modified since
-// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to
-// the client. The operation will be performed only if the resource on the service has not been modified since the
-// specified time.
-func (client JobClient) Update(ctx context.Context, jobID string, jobUpdateParameter JobUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: jobUpdateParameter,
- Constraints: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VMSize", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.OsDisk", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.OsDisk.ImageUris", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.StartTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}},
- }},
- }},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobClient", "Update", err.Error())
- }
-
- req, err := client.UpdatePreparer(ctx, jobID, jobUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePreparer prepares the Update request.
-func (client JobClient) UpdatePreparer(ctx context.Context, jobID string, jobUpdateParameter JobUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}", pathParameters),
- autorest.WithJSON(jobUpdateParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSender sends the Update request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) UpdateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateResponder handles the response to the Update request. The method always
-// closes the http.Response Body.
-func (client JobClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff --git a/services/batch/2017-01-01.4.0/batch/jobschedule.go b/services/batch/2017-01-01.4.0/batch/jobschedule.go
deleted file mode 100644
index 317390eb4d5d..000000000000
--- a/services/batch/2017-01-01.4.0/batch/jobschedule.go
+++ /dev/null
@@ -1,1261 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// JobScheduleClient is the a client for issuing REST requests to the Azure Batch service.
-type JobScheduleClient struct {
- BaseClient
-}
-
-// NewJobScheduleClient creates an instance of the JobScheduleClient client.
-func NewJobScheduleClient() JobScheduleClient {
- return NewJobScheduleClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewJobScheduleClientWithBaseURI creates an instance of the JobScheduleClient client.
-func NewJobScheduleClientWithBaseURI(baseURI string) JobScheduleClient {
- return JobScheduleClient{NewWithBaseURI(baseURI)}
-}
-
-// Add sends the add request.
-//
-// cloudJobSchedule is the job schedule to be added. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client JobScheduleClient) Add(ctx context.Context, cloudJobSchedule JobScheduleAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: cloudJobSchedule,
- Constraints: []validation.Constraint{{Target: "cloudJobSchedule.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.Schedule", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobManagerTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobManagerTask.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification.JobManagerTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "cloudJobSchedule.JobSpecification.JobPreparationTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobPreparationTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "cloudJobSchedule.JobSpecification.JobReleaseTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobReleaseTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VMSize", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.OsDisk", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.OsDisk.ImageUris", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}},
- }},
- }},
- }},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobScheduleClient", "Add", err.Error())
- }
-
- req, err := client.AddPreparer(ctx, cloudJobSchedule, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPreparer prepares the Add request.
-func (client JobScheduleClient) AddPreparer(ctx context.Context, cloudJobSchedule JobScheduleAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/jobschedules"),
- autorest.WithJSON(cloudJobSchedule),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSender sends the Add request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) AddSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddResponder handles the response to the Add request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) AddResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Delete when you delete a job schedule, this also deletes all jobs and tasks under that schedule. When tasks are
-// deleted, all the files in their working directories on the compute nodes are also deleted (the retention period is
-// ignored). The job schedule statistics are no longer accessible once the job schedule is deleted, though they are
-// still counted towards account lifetime statistics.
-//
-// jobScheduleID is the ID of the job schedule to delete. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client JobScheduleClient) Delete(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeletePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client JobScheduleClient) DeletePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Disable no new jobs will be created until the job schedule is enabled again.
-//
-// jobScheduleID is the ID of the job schedule to disable. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client JobScheduleClient) Disable(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DisablePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DisableSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", resp, "Failure sending request")
- return
- }
-
- result, err = client.DisableResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DisablePreparer prepares the Disable request.
-func (client JobScheduleClient) DisablePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}/disable", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DisableSender sends the Disable request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) DisableSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DisableResponder handles the response to the Disable request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) DisableResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Enable sends the enable request.
-//
-// jobScheduleID is the ID of the job schedule to enable. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client JobScheduleClient) Enable(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.EnablePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.EnableSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", resp, "Failure sending request")
- return
- }
-
- result, err = client.EnableResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", resp, "Failure responding to request")
- }
-
- return
-}
-
-// EnablePreparer prepares the Enable request.
-func (client JobScheduleClient) EnablePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}/enable", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// EnableSender sends the Enable request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) EnableSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// EnableResponder handles the response to the Enable request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) EnableResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Exists sends the exists request.
-//
-// jobScheduleID is the ID of the job schedule which you want to check. timeout is the maximum time that the server
-// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated
-// request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client JobScheduleClient) Exists(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.ExistsPreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ExistsSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", resp, "Failure sending request")
- return
- }
-
- result, err = client.ExistsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ExistsPreparer prepares the Exists request.
-func (client JobScheduleClient) ExistsPreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsHead(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ExistsSender sends the Exists request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) ExistsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ExistsResponder handles the response to the Exists request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) ExistsResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get gets information about the specified job schedule.
-//
-// jobScheduleID is the ID of the job schedule to get. selectParameter is an OData $select clause. expand is an
-// OData $expand clause. timeout is the maximum time that the server can spend processing the request, in seconds.
-// The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with
-// no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether
-// the server should return the client-request-id in the response. ocpDate is the time the request was issued.
-// Client libraries typically set this to the current system clock time; set it explicitly if you are calling the
-// REST API directly. ifMatch is an ETag value associated with the version of the resource known to the client. The
-// operation will be performed only if the resource's current ETag on the service exactly matches the value
-// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the
-// client. The operation will be performed only if the resource's current ETag on the service does not match the
-// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource
-// known to the client. The operation will be performed only if the resource on the service has been modified since
-// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to
-// the client. The operation will be performed only if the resource on the service has not been modified since the
-// specified time.
-func (client JobScheduleClient) Get(ctx context.Context, jobScheduleID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudJobSchedule, err error) {
- req, err := client.GetPreparer(ctx, jobScheduleID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client JobScheduleClient) GetPreparer(ctx context.Context, jobScheduleID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) GetResponder(resp *http.Response) (result CloudJobSchedule, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List sends the list request.
-//
-// filter is an OData $filter clause. selectParameter is an OData $select clause. expand is an OData $expand
-// clause. maxResults is the maximum number of items to return in the response. A maximum of 1000 job schedules can
-// be returned. timeout is the maximum time that the server can spend processing the request, in seconds. The
-// default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client
-// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API
-// directly.
-func (client JobScheduleClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobScheduleListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobScheduleClient", "List", err.Error())
- }
-
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.cjslr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", resp, "Failure sending request")
- return
- }
-
- result.cjslr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client JobScheduleClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/jobschedules"),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) ListResponder(resp *http.Response) (result CloudJobScheduleListResult, 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 JobScheduleClient) listNextResults(lastResults CloudJobScheduleListResult) (result CloudJobScheduleListResult, err error) {
- req, err := lastResults.cloudJobScheduleListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.JobScheduleClient", "listNextResults", 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.JobScheduleClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client JobScheduleClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobScheduleListResultIterator, err error) {
- result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// Patch this replaces only the job schedule properties specified in the request. For example, if the schedule property
-// is not specified with this request, then the Batch service will keep the existing schedule. Changes to a job
-// schedule only impact jobs created by the schedule after the update has taken place; currently running jobs are
-// unaffected.
-//
-// jobScheduleID is the ID of the job schedule to update. jobSchedulePatchParameter is the parameters for the
-// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client
-// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API
-// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The
-// operation will be performed only if the resource's current ETag on the service exactly matches the value
-// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the
-// client. The operation will be performed only if the resource's current ETag on the service does not match the
-// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource
-// known to the client. The operation will be performed only if the resource on the service has been modified since
-// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to
-// the client. The operation will be performed only if the resource on the service has not been modified since the
-// specified time.
-func (client JobScheduleClient) Patch(ctx context.Context, jobScheduleID string, jobSchedulePatchParameter JobSchedulePatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.PatchPreparer(ctx, jobScheduleID, jobSchedulePatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.PatchSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", resp, "Failure sending request")
- return
- }
-
- result, err = client.PatchResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", resp, "Failure responding to request")
- }
-
- return
-}
-
-// PatchPreparer prepares the Patch request.
-func (client JobScheduleClient) PatchPreparer(ctx context.Context, jobScheduleID string, jobSchedulePatchParameter JobSchedulePatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPatch(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters),
- autorest.WithJSON(jobSchedulePatchParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// PatchSender sends the Patch request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) PatchSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// PatchResponder handles the response to the Patch request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Terminate sends the terminate request.
-//
-// jobScheduleID is the ID of the job schedule to terminates. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client JobScheduleClient) Terminate(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.TerminatePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.TerminateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", resp, "Failure sending request")
- return
- }
-
- result, err = client.TerminateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", resp, "Failure responding to request")
- }
-
- return
-}
-
-// TerminatePreparer prepares the Terminate request.
-func (client JobScheduleClient) TerminatePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}/terminate", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// TerminateSender sends the Terminate request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) TerminateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// TerminateResponder handles the response to the Terminate request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) TerminateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Update this fully replaces all the updateable properties of the job schedule. For example, if the schedule property
-// is not specified with this request, then the Batch service will remove the existing schedule. Changes to a job
-// schedule only impact jobs created by the schedule after the update has taken place; currently running jobs are
-// unaffected.
-//
-// jobScheduleID is the ID of the job schedule to update. jobScheduleUpdateParameter is the parameters for the
-// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client
-// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API
-// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The
-// operation will be performed only if the resource's current ETag on the service exactly matches the value
-// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the
-// client. The operation will be performed only if the resource's current ETag on the service does not match the
-// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource
-// known to the client. The operation will be performed only if the resource on the service has been modified since
-// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to
-// the client. The operation will be performed only if the resource on the service has not been modified since the
-// specified time.
-func (client JobScheduleClient) Update(ctx context.Context, jobScheduleID string, jobScheduleUpdateParameter JobScheduleUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: jobScheduleUpdateParameter,
- Constraints: []validation.Constraint{{Target: "jobScheduleUpdateParameter.Schedule", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "jobScheduleUpdateParameter.JobSpecification.JobPreparationTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobPreparationTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "jobScheduleUpdateParameter.JobSpecification.JobReleaseTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobReleaseTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VMSize", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.OsDisk", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.OsDisk.ImageUris", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}},
- }},
- }},
- }},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobScheduleClient", "Update", err.Error())
- }
-
- req, err := client.UpdatePreparer(ctx, jobScheduleID, jobScheduleUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePreparer prepares the Update request.
-func (client JobScheduleClient) UpdatePreparer(ctx context.Context, jobScheduleID string, jobScheduleUpdateParameter JobScheduleUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters),
- autorest.WithJSON(jobScheduleUpdateParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSender sends the Update request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) UpdateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateResponder handles the response to the Update request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff --git a/services/batch/2017-01-01.4.0/batch/models.go b/services/batch/2017-01-01.4.0/batch/models.go
deleted file mode 100644
index b2ed4b95987d..000000000000
--- a/services/batch/2017-01-01.4.0/batch/models.go
+++ /dev/null
@@ -1,2989 +0,0 @@
-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/date"
- "github.com/Azure/go-autorest/autorest/to"
- "io"
- "net/http"
-)
-
-// AccessScope enumerates the values for access scope.
-type AccessScope string
-
-const (
- // Job ...
- Job AccessScope = "job"
-)
-
-// PossibleAccessScopeValues returns an array of possible values for the AccessScope const type.
-func PossibleAccessScopeValues() []AccessScope {
- return []AccessScope{Job}
-}
-
-// AllocationState enumerates the values for allocation state.
-type AllocationState string
-
-const (
- // Resizing ...
- Resizing AllocationState = "resizing"
- // Steady ...
- Steady AllocationState = "steady"
- // Stopping ...
- Stopping AllocationState = "stopping"
-)
-
-// PossibleAllocationStateValues returns an array of possible values for the AllocationState const type.
-func PossibleAllocationStateValues() []AllocationState {
- return []AllocationState{Resizing, Steady, Stopping}
-}
-
-// AutoUserScope enumerates the values for auto user scope.
-type AutoUserScope string
-
-const (
- // Pool ...
- Pool AutoUserScope = "pool"
- // Task ...
- Task AutoUserScope = "task"
-)
-
-// PossibleAutoUserScopeValues returns an array of possible values for the AutoUserScope const type.
-func PossibleAutoUserScopeValues() []AutoUserScope {
- return []AutoUserScope{Pool, Task}
-}
-
-// CachingType enumerates the values for caching type.
-type CachingType string
-
-const (
- // None ...
- None CachingType = "none"
- // ReadOnly ...
- ReadOnly CachingType = "readOnly"
- // ReadWrite ...
- ReadWrite CachingType = "readWrite"
-)
-
-// PossibleCachingTypeValues returns an array of possible values for the CachingType const type.
-func PossibleCachingTypeValues() []CachingType {
- return []CachingType{None, ReadOnly, ReadWrite}
-}
-
-// CertificateFormat enumerates the values for certificate format.
-type CertificateFormat string
-
-const (
- // Cer ...
- Cer CertificateFormat = "cer"
- // Pfx ...
- Pfx CertificateFormat = "pfx"
- // Unmapped ...
- Unmapped CertificateFormat = "unmapped"
-)
-
-// PossibleCertificateFormatValues returns an array of possible values for the CertificateFormat const type.
-func PossibleCertificateFormatValues() []CertificateFormat {
- return []CertificateFormat{Cer, Pfx, Unmapped}
-}
-
-// CertificateState enumerates the values for certificate state.
-type CertificateState string
-
-const (
- // Active ...
- Active CertificateState = "active"
- // DeleteFailed ...
- DeleteFailed CertificateState = "deleteFailed"
- // Deleting ...
- Deleting CertificateState = "deleting"
-)
-
-// PossibleCertificateStateValues returns an array of possible values for the CertificateState const type.
-func PossibleCertificateStateValues() []CertificateState {
- return []CertificateState{Active, DeleteFailed, Deleting}
-}
-
-// CertificateStoreLocation enumerates the values for certificate store location.
-type CertificateStoreLocation string
-
-const (
- // CertificateStoreLocationCurrentUser ...
- CertificateStoreLocationCurrentUser CertificateStoreLocation = "currentUser"
- // CertificateStoreLocationLocalMachine ...
- CertificateStoreLocationLocalMachine CertificateStoreLocation = "localMachine"
- // CertificateStoreLocationUnmapped ...
- CertificateStoreLocationUnmapped CertificateStoreLocation = "unmapped"
-)
-
-// PossibleCertificateStoreLocationValues returns an array of possible values for the CertificateStoreLocation const type.
-func PossibleCertificateStoreLocationValues() []CertificateStoreLocation {
- return []CertificateStoreLocation{CertificateStoreLocationCurrentUser, CertificateStoreLocationLocalMachine, CertificateStoreLocationUnmapped}
-}
-
-// CertificateVisibility enumerates the values for certificate visibility.
-type CertificateVisibility string
-
-const (
- // CertificateVisibilityRemoteUser ...
- CertificateVisibilityRemoteUser CertificateVisibility = "remoteUser"
- // CertificateVisibilityStartTask ...
- CertificateVisibilityStartTask CertificateVisibility = "startTask"
- // CertificateVisibilityTask ...
- CertificateVisibilityTask CertificateVisibility = "task"
- // CertificateVisibilityUnmapped ...
- CertificateVisibilityUnmapped CertificateVisibility = "unmapped"
-)
-
-// PossibleCertificateVisibilityValues returns an array of possible values for the CertificateVisibility const type.
-func PossibleCertificateVisibilityValues() []CertificateVisibility {
- return []CertificateVisibility{CertificateVisibilityRemoteUser, CertificateVisibilityStartTask, CertificateVisibilityTask, CertificateVisibilityUnmapped}
-}
-
-// ComputeNodeDeallocationOption enumerates the values for compute node deallocation option.
-type ComputeNodeDeallocationOption string
-
-const (
- // Requeue ...
- Requeue ComputeNodeDeallocationOption = "requeue"
- // RetainedData ...
- RetainedData ComputeNodeDeallocationOption = "retainedData"
- // TaskCompletion ...
- TaskCompletion ComputeNodeDeallocationOption = "taskCompletion"
- // Terminate ...
- Terminate ComputeNodeDeallocationOption = "terminate"
-)
-
-// PossibleComputeNodeDeallocationOptionValues returns an array of possible values for the ComputeNodeDeallocationOption const type.
-func PossibleComputeNodeDeallocationOptionValues() []ComputeNodeDeallocationOption {
- return []ComputeNodeDeallocationOption{Requeue, RetainedData, TaskCompletion, Terminate}
-}
-
-// ComputeNodeFillType enumerates the values for compute node fill type.
-type ComputeNodeFillType string
-
-const (
- // ComputeNodeFillTypePack ...
- ComputeNodeFillTypePack ComputeNodeFillType = "pack"
- // ComputeNodeFillTypeSpread ...
- ComputeNodeFillTypeSpread ComputeNodeFillType = "spread"
- // ComputeNodeFillTypeUnmapped ...
- ComputeNodeFillTypeUnmapped ComputeNodeFillType = "unmapped"
-)
-
-// PossibleComputeNodeFillTypeValues returns an array of possible values for the ComputeNodeFillType const type.
-func PossibleComputeNodeFillTypeValues() []ComputeNodeFillType {
- return []ComputeNodeFillType{ComputeNodeFillTypePack, ComputeNodeFillTypeSpread, ComputeNodeFillTypeUnmapped}
-}
-
-// ComputeNodeRebootOption enumerates the values for compute node reboot option.
-type ComputeNodeRebootOption string
-
-const (
- // ComputeNodeRebootOptionRequeue ...
- ComputeNodeRebootOptionRequeue ComputeNodeRebootOption = "requeue"
- // ComputeNodeRebootOptionRetainedData ...
- ComputeNodeRebootOptionRetainedData ComputeNodeRebootOption = "retainedData"
- // ComputeNodeRebootOptionTaskCompletion ...
- ComputeNodeRebootOptionTaskCompletion ComputeNodeRebootOption = "taskCompletion"
- // ComputeNodeRebootOptionTerminate ...
- ComputeNodeRebootOptionTerminate ComputeNodeRebootOption = "terminate"
-)
-
-// PossibleComputeNodeRebootOptionValues returns an array of possible values for the ComputeNodeRebootOption const type.
-func PossibleComputeNodeRebootOptionValues() []ComputeNodeRebootOption {
- return []ComputeNodeRebootOption{ComputeNodeRebootOptionRequeue, ComputeNodeRebootOptionRetainedData, ComputeNodeRebootOptionTaskCompletion, ComputeNodeRebootOptionTerminate}
-}
-
-// ComputeNodeReimageOption enumerates the values for compute node reimage option.
-type ComputeNodeReimageOption string
-
-const (
- // ComputeNodeReimageOptionRequeue ...
- ComputeNodeReimageOptionRequeue ComputeNodeReimageOption = "requeue"
- // ComputeNodeReimageOptionRetainedData ...
- ComputeNodeReimageOptionRetainedData ComputeNodeReimageOption = "retainedData"
- // ComputeNodeReimageOptionTaskCompletion ...
- ComputeNodeReimageOptionTaskCompletion ComputeNodeReimageOption = "taskCompletion"
- // ComputeNodeReimageOptionTerminate ...
- ComputeNodeReimageOptionTerminate ComputeNodeReimageOption = "terminate"
-)
-
-// PossibleComputeNodeReimageOptionValues returns an array of possible values for the ComputeNodeReimageOption const type.
-func PossibleComputeNodeReimageOptionValues() []ComputeNodeReimageOption {
- return []ComputeNodeReimageOption{ComputeNodeReimageOptionRequeue, ComputeNodeReimageOptionRetainedData, ComputeNodeReimageOptionTaskCompletion, ComputeNodeReimageOptionTerminate}
-}
-
-// ComputeNodeState enumerates the values for compute node state.
-type ComputeNodeState string
-
-const (
- // Creating ...
- Creating ComputeNodeState = "creating"
- // Idle ...
- Idle ComputeNodeState = "idle"
- // LeavingPool ...
- LeavingPool ComputeNodeState = "leavingPool"
- // Offline ...
- Offline ComputeNodeState = "offline"
- // Rebooting ...
- Rebooting ComputeNodeState = "rebooting"
- // Reimaging ...
- Reimaging ComputeNodeState = "reimaging"
- // Running ...
- Running ComputeNodeState = "running"
- // Starting ...
- Starting ComputeNodeState = "starting"
- // StartTaskFailed ...
- StartTaskFailed ComputeNodeState = "startTaskFailed"
- // Unknown ...
- Unknown ComputeNodeState = "unknown"
- // Unusable ...
- Unusable ComputeNodeState = "unusable"
- // WaitingForStartTask ...
- WaitingForStartTask ComputeNodeState = "waitingForStartTask"
-)
-
-// PossibleComputeNodeStateValues returns an array of possible values for the ComputeNodeState const type.
-func PossibleComputeNodeStateValues() []ComputeNodeState {
- return []ComputeNodeState{Creating, Idle, LeavingPool, Offline, Rebooting, Reimaging, Running, Starting, StartTaskFailed, Unknown, Unusable, WaitingForStartTask}
-}
-
-// DependencyAction enumerates the values for dependency action.
-type DependencyAction string
-
-const (
- // Block ...
- Block DependencyAction = "block"
- // Satisfy ...
- Satisfy DependencyAction = "satisfy"
-)
-
-// PossibleDependencyActionValues returns an array of possible values for the DependencyAction const type.
-func PossibleDependencyActionValues() []DependencyAction {
- return []DependencyAction{Block, Satisfy}
-}
-
-// DisableComputeNodeSchedulingOption enumerates the values for disable compute node scheduling option.
-type DisableComputeNodeSchedulingOption string
-
-const (
- // DisableComputeNodeSchedulingOptionRequeue ...
- DisableComputeNodeSchedulingOptionRequeue DisableComputeNodeSchedulingOption = "requeue"
- // DisableComputeNodeSchedulingOptionTaskCompletion ...
- DisableComputeNodeSchedulingOptionTaskCompletion DisableComputeNodeSchedulingOption = "taskCompletion"
- // DisableComputeNodeSchedulingOptionTerminate ...
- DisableComputeNodeSchedulingOptionTerminate DisableComputeNodeSchedulingOption = "terminate"
-)
-
-// PossibleDisableComputeNodeSchedulingOptionValues returns an array of possible values for the DisableComputeNodeSchedulingOption const type.
-func PossibleDisableComputeNodeSchedulingOptionValues() []DisableComputeNodeSchedulingOption {
- return []DisableComputeNodeSchedulingOption{DisableComputeNodeSchedulingOptionRequeue, DisableComputeNodeSchedulingOptionTaskCompletion, DisableComputeNodeSchedulingOptionTerminate}
-}
-
-// DisableJobOption enumerates the values for disable job option.
-type DisableJobOption string
-
-const (
- // DisableJobOptionRequeue ...
- DisableJobOptionRequeue DisableJobOption = "requeue"
- // DisableJobOptionTerminate ...
- DisableJobOptionTerminate DisableJobOption = "terminate"
- // DisableJobOptionWait ...
- DisableJobOptionWait DisableJobOption = "wait"
-)
-
-// PossibleDisableJobOptionValues returns an array of possible values for the DisableJobOption const type.
-func PossibleDisableJobOptionValues() []DisableJobOption {
- return []DisableJobOption{DisableJobOptionRequeue, DisableJobOptionTerminate, DisableJobOptionWait}
-}
-
-// ElevationLevel enumerates the values for elevation level.
-type ElevationLevel string
-
-const (
- // Admin ...
- Admin ElevationLevel = "admin"
- // NonAdmin ...
- NonAdmin ElevationLevel = "nonAdmin"
-)
-
-// PossibleElevationLevelValues returns an array of possible values for the ElevationLevel const type.
-func PossibleElevationLevelValues() []ElevationLevel {
- return []ElevationLevel{Admin, NonAdmin}
-}
-
-// JobAction enumerates the values for job action.
-type JobAction string
-
-const (
- // JobActionDisable ...
- JobActionDisable JobAction = "disable"
- // JobActionNone ...
- JobActionNone JobAction = "none"
- // JobActionTerminate ...
- JobActionTerminate JobAction = "terminate"
-)
-
-// PossibleJobActionValues returns an array of possible values for the JobAction const type.
-func PossibleJobActionValues() []JobAction {
- return []JobAction{JobActionDisable, JobActionNone, JobActionTerminate}
-}
-
-// JobPreparationTaskState enumerates the values for job preparation task state.
-type JobPreparationTaskState string
-
-const (
- // JobPreparationTaskStateCompleted ...
- JobPreparationTaskStateCompleted JobPreparationTaskState = "completed"
- // JobPreparationTaskStateRunning ...
- JobPreparationTaskStateRunning JobPreparationTaskState = "running"
-)
-
-// PossibleJobPreparationTaskStateValues returns an array of possible values for the JobPreparationTaskState const type.
-func PossibleJobPreparationTaskStateValues() []JobPreparationTaskState {
- return []JobPreparationTaskState{JobPreparationTaskStateCompleted, JobPreparationTaskStateRunning}
-}
-
-// JobReleaseTaskState enumerates the values for job release task state.
-type JobReleaseTaskState string
-
-const (
- // JobReleaseTaskStateCompleted ...
- JobReleaseTaskStateCompleted JobReleaseTaskState = "completed"
- // JobReleaseTaskStateRunning ...
- JobReleaseTaskStateRunning JobReleaseTaskState = "running"
-)
-
-// PossibleJobReleaseTaskStateValues returns an array of possible values for the JobReleaseTaskState const type.
-func PossibleJobReleaseTaskStateValues() []JobReleaseTaskState {
- return []JobReleaseTaskState{JobReleaseTaskStateCompleted, JobReleaseTaskStateRunning}
-}
-
-// JobScheduleState enumerates the values for job schedule state.
-type JobScheduleState string
-
-const (
- // JobScheduleStateActive ...
- JobScheduleStateActive JobScheduleState = "active"
- // JobScheduleStateCompleted ...
- JobScheduleStateCompleted JobScheduleState = "completed"
- // JobScheduleStateDeleting ...
- JobScheduleStateDeleting JobScheduleState = "deleting"
- // JobScheduleStateDisabled ...
- JobScheduleStateDisabled JobScheduleState = "disabled"
- // JobScheduleStateTerminating ...
- JobScheduleStateTerminating JobScheduleState = "terminating"
-)
-
-// PossibleJobScheduleStateValues returns an array of possible values for the JobScheduleState const type.
-func PossibleJobScheduleStateValues() []JobScheduleState {
- return []JobScheduleState{JobScheduleStateActive, JobScheduleStateCompleted, JobScheduleStateDeleting, JobScheduleStateDisabled, JobScheduleStateTerminating}
-}
-
-// JobState enumerates the values for job state.
-type JobState string
-
-const (
- // JobStateActive ...
- JobStateActive JobState = "active"
- // JobStateCompleted ...
- JobStateCompleted JobState = "completed"
- // JobStateDeleting ...
- JobStateDeleting JobState = "deleting"
- // JobStateDisabled ...
- JobStateDisabled JobState = "disabled"
- // JobStateDisabling ...
- JobStateDisabling JobState = "disabling"
- // JobStateEnabling ...
- JobStateEnabling JobState = "enabling"
- // JobStateTerminating ...
- JobStateTerminating JobState = "terminating"
-)
-
-// PossibleJobStateValues returns an array of possible values for the JobState const type.
-func PossibleJobStateValues() []JobState {
- return []JobState{JobStateActive, JobStateCompleted, JobStateDeleting, JobStateDisabled, JobStateDisabling, JobStateEnabling, JobStateTerminating}
-}
-
-// OnAllTasksComplete enumerates the values for on all tasks complete.
-type OnAllTasksComplete string
-
-const (
- // NoAction ...
- NoAction OnAllTasksComplete = "noAction"
- // TerminateJob ...
- TerminateJob OnAllTasksComplete = "terminateJob"
-)
-
-// PossibleOnAllTasksCompleteValues returns an array of possible values for the OnAllTasksComplete const type.
-func PossibleOnAllTasksCompleteValues() []OnAllTasksComplete {
- return []OnAllTasksComplete{NoAction, TerminateJob}
-}
-
-// OnTaskFailure enumerates the values for on task failure.
-type OnTaskFailure string
-
-const (
- // OnTaskFailureNoAction ...
- OnTaskFailureNoAction OnTaskFailure = "noAction"
- // OnTaskFailurePerformExitOptionsJobAction ...
- OnTaskFailurePerformExitOptionsJobAction OnTaskFailure = "performExitOptionsJobAction"
-)
-
-// PossibleOnTaskFailureValues returns an array of possible values for the OnTaskFailure const type.
-func PossibleOnTaskFailureValues() []OnTaskFailure {
- return []OnTaskFailure{OnTaskFailureNoAction, OnTaskFailurePerformExitOptionsJobAction}
-}
-
-// OSType enumerates the values for os type.
-type OSType string
-
-const (
- // OSTypeLinux ...
- OSTypeLinux OSType = "linux"
- // OSTypeUnmapped ...
- OSTypeUnmapped OSType = "unmapped"
- // OSTypeWindows ...
- OSTypeWindows OSType = "windows"
-)
-
-// PossibleOSTypeValues returns an array of possible values for the OSType const type.
-func PossibleOSTypeValues() []OSType {
- return []OSType{OSTypeLinux, OSTypeUnmapped, OSTypeWindows}
-}
-
-// PoolLifetimeOption enumerates the values for pool lifetime option.
-type PoolLifetimeOption string
-
-const (
- // PoolLifetimeOptionJob ...
- PoolLifetimeOptionJob PoolLifetimeOption = "job"
- // PoolLifetimeOptionJobSchedule ...
- PoolLifetimeOptionJobSchedule PoolLifetimeOption = "jobSchedule"
- // PoolLifetimeOptionUnmapped ...
- PoolLifetimeOptionUnmapped PoolLifetimeOption = "unmapped"
-)
-
-// PossiblePoolLifetimeOptionValues returns an array of possible values for the PoolLifetimeOption const type.
-func PossiblePoolLifetimeOptionValues() []PoolLifetimeOption {
- return []PoolLifetimeOption{PoolLifetimeOptionJob, PoolLifetimeOptionJobSchedule, PoolLifetimeOptionUnmapped}
-}
-
-// PoolState enumerates the values for pool state.
-type PoolState string
-
-const (
- // PoolStateActive ...
- PoolStateActive PoolState = "active"
- // PoolStateDeleting ...
- PoolStateDeleting PoolState = "deleting"
- // PoolStateUpgrading ...
- PoolStateUpgrading PoolState = "upgrading"
-)
-
-// PossiblePoolStateValues returns an array of possible values for the PoolState const type.
-func PossiblePoolStateValues() []PoolState {
- return []PoolState{PoolStateActive, PoolStateDeleting, PoolStateUpgrading}
-}
-
-// SchedulingErrorCategory enumerates the values for scheduling error category.
-type SchedulingErrorCategory string
-
-const (
- // SchedulingErrorCategoryServerError ...
- SchedulingErrorCategoryServerError SchedulingErrorCategory = "serverError"
- // SchedulingErrorCategoryUnmapped ...
- SchedulingErrorCategoryUnmapped SchedulingErrorCategory = "unmapped"
- // SchedulingErrorCategoryUserError ...
- SchedulingErrorCategoryUserError SchedulingErrorCategory = "userError"
-)
-
-// PossibleSchedulingErrorCategoryValues returns an array of possible values for the SchedulingErrorCategory const type.
-func PossibleSchedulingErrorCategoryValues() []SchedulingErrorCategory {
- return []SchedulingErrorCategory{SchedulingErrorCategoryServerError, SchedulingErrorCategoryUnmapped, SchedulingErrorCategoryUserError}
-}
-
-// SchedulingState enumerates the values for scheduling state.
-type SchedulingState string
-
-const (
- // Disabled ...
- Disabled SchedulingState = "disabled"
- // Enabled ...
- Enabled SchedulingState = "enabled"
-)
-
-// PossibleSchedulingStateValues returns an array of possible values for the SchedulingState const type.
-func PossibleSchedulingStateValues() []SchedulingState {
- return []SchedulingState{Disabled, Enabled}
-}
-
-// StartTaskState enumerates the values for start task state.
-type StartTaskState string
-
-const (
- // StartTaskStateCompleted ...
- StartTaskStateCompleted StartTaskState = "completed"
- // StartTaskStateRunning ...
- StartTaskStateRunning StartTaskState = "running"
-)
-
-// PossibleStartTaskStateValues returns an array of possible values for the StartTaskState const type.
-func PossibleStartTaskStateValues() []StartTaskState {
- return []StartTaskState{StartTaskStateCompleted, StartTaskStateRunning}
-}
-
-// SubtaskState enumerates the values for subtask state.
-type SubtaskState string
-
-const (
- // SubtaskStateCompleted ...
- SubtaskStateCompleted SubtaskState = "completed"
- // SubtaskStatePreparing ...
- SubtaskStatePreparing SubtaskState = "preparing"
- // SubtaskStateRunning ...
- SubtaskStateRunning SubtaskState = "running"
-)
-
-// PossibleSubtaskStateValues returns an array of possible values for the SubtaskState const type.
-func PossibleSubtaskStateValues() []SubtaskState {
- return []SubtaskState{SubtaskStateCompleted, SubtaskStatePreparing, SubtaskStateRunning}
-}
-
-// TaskAddStatus enumerates the values for task add status.
-type TaskAddStatus string
-
-const (
- // TaskAddStatusClientError ...
- TaskAddStatusClientError TaskAddStatus = "clientError"
- // TaskAddStatusServerError ...
- TaskAddStatusServerError TaskAddStatus = "serverError"
- // TaskAddStatusSuccess ...
- TaskAddStatusSuccess TaskAddStatus = "success"
- // TaskAddStatusUnmapped ...
- TaskAddStatusUnmapped TaskAddStatus = "unmapped"
-)
-
-// PossibleTaskAddStatusValues returns an array of possible values for the TaskAddStatus const type.
-func PossibleTaskAddStatusValues() []TaskAddStatus {
- return []TaskAddStatus{TaskAddStatusClientError, TaskAddStatusServerError, TaskAddStatusSuccess, TaskAddStatusUnmapped}
-}
-
-// TaskState enumerates the values for task state.
-type TaskState string
-
-const (
- // TaskStateActive ...
- TaskStateActive TaskState = "active"
- // TaskStateCompleted ...
- TaskStateCompleted TaskState = "completed"
- // TaskStatePreparing ...
- TaskStatePreparing TaskState = "preparing"
- // TaskStateRunning ...
- TaskStateRunning TaskState = "running"
-)
-
-// PossibleTaskStateValues returns an array of possible values for the TaskState const type.
-func PossibleTaskStateValues() []TaskState {
- return []TaskState{TaskStateActive, TaskStateCompleted, TaskStatePreparing, TaskStateRunning}
-}
-
-// AccountListNodeAgentSkusResult ...
-type AccountListNodeAgentSkusResult struct {
- autorest.Response `json:"-"`
- Value *[]NodeAgentSku `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// AccountListNodeAgentSkusResultIterator provides access to a complete listing of NodeAgentSku values.
-type AccountListNodeAgentSkusResultIterator struct {
- i int
- page AccountListNodeAgentSkusResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *AccountListNodeAgentSkusResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter AccountListNodeAgentSkusResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter AccountListNodeAgentSkusResultIterator) Response() AccountListNodeAgentSkusResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter AccountListNodeAgentSkusResultIterator) Value() NodeAgentSku {
- if !iter.page.NotDone() {
- return NodeAgentSku{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (alnasr AccountListNodeAgentSkusResult) IsEmpty() bool {
- return alnasr.Value == nil || len(*alnasr.Value) == 0
-}
-
-// accountListNodeAgentSkusResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (alnasr AccountListNodeAgentSkusResult) accountListNodeAgentSkusResultPreparer() (*http.Request, error) {
- if alnasr.OdataNextLink == nil || len(to.String(alnasr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(alnasr.OdataNextLink)))
-}
-
-// AccountListNodeAgentSkusResultPage contains a page of NodeAgentSku values.
-type AccountListNodeAgentSkusResultPage struct {
- fn func(AccountListNodeAgentSkusResult) (AccountListNodeAgentSkusResult, error)
- alnasr AccountListNodeAgentSkusResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *AccountListNodeAgentSkusResultPage) Next() error {
- next, err := page.fn(page.alnasr)
- if err != nil {
- return err
- }
- page.alnasr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page AccountListNodeAgentSkusResultPage) NotDone() bool {
- return !page.alnasr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page AccountListNodeAgentSkusResultPage) Response() AccountListNodeAgentSkusResult {
- return page.alnasr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page AccountListNodeAgentSkusResultPage) Values() []NodeAgentSku {
- if page.alnasr.IsEmpty() {
- return nil
- }
- return *page.alnasr.Value
-}
-
-// AffinityInformation ...
-type AffinityInformation struct {
- // AffinityID - You can pass the affinityId of a compute node or task to indicate that this task needs to be placed close to the node or task.
- AffinityID *string `json:"affinityId,omitempty"`
-}
-
-// ApplicationListResult ...
-type ApplicationListResult struct {
- autorest.Response `json:"-"`
- Value *[]ApplicationSummary `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// ApplicationListResultIterator provides access to a complete listing of ApplicationSummary values.
-type ApplicationListResultIterator struct {
- i int
- page ApplicationListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *ApplicationListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter ApplicationListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter ApplicationListResultIterator) Response() ApplicationListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter ApplicationListResultIterator) Value() ApplicationSummary {
- if !iter.page.NotDone() {
- return ApplicationSummary{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (alr ApplicationListResult) IsEmpty() bool {
- return alr.Value == nil || len(*alr.Value) == 0
-}
-
-// applicationListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (alr ApplicationListResult) applicationListResultPreparer() (*http.Request, error) {
- if alr.OdataNextLink == nil || len(to.String(alr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(alr.OdataNextLink)))
-}
-
-// ApplicationListResultPage contains a page of ApplicationSummary values.
-type ApplicationListResultPage struct {
- fn func(ApplicationListResult) (ApplicationListResult, error)
- alr ApplicationListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *ApplicationListResultPage) Next() error {
- next, err := page.fn(page.alr)
- if err != nil {
- return err
- }
- page.alr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page ApplicationListResultPage) NotDone() bool {
- return !page.alr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page ApplicationListResultPage) Response() ApplicationListResult {
- return page.alr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page ApplicationListResultPage) Values() []ApplicationSummary {
- if page.alr.IsEmpty() {
- return nil
- }
- return *page.alr.Value
-}
-
-// ApplicationPackageReference ...
-type ApplicationPackageReference struct {
- ApplicationID *string `json:"applicationId,omitempty"`
- // Version - If this is omitted, and no default version is specified for this application, the request fails with the error code InvalidApplicationPackageReferences. If you are calling the REST API directly, the HTTP status code is 409.
- Version *string `json:"version,omitempty"`
-}
-
-// ApplicationSummary ...
-type ApplicationSummary struct {
- autorest.Response `json:"-"`
- ID *string `json:"id,omitempty"`
- DisplayName *string `json:"displayName,omitempty"`
- Versions *[]string `json:"versions,omitempty"`
-}
-
-// AuthenticationTokenSettings ...
-type AuthenticationTokenSettings struct {
- // Access - The authentication token grants access to a limited set of Batch service operations. Currently the only supported value for the access property is 'job', which grants access to all operations related to the job which contains the task.
- Access *[]AccessScope `json:"access,omitempty"`
-}
-
-// AutoPoolSpecification ...
-type AutoPoolSpecification struct {
- // AutoPoolIDPrefix - The Batch service assigns each auto pool a unique identifier on creation. To distinguish between pools created for different purposes, you can specify this element to add a prefix to the id that is assigned. The prefix can be up to 20 characters long.
- AutoPoolIDPrefix *string `json:"autoPoolIdPrefix,omitempty"`
- // PoolLifetimeOption - When the pool lifetime scope is jobSchedule level, the Batch service keeps track of the last autopool created for the job schedule, and deletes that pool when the job schedule completes. Batch will also delete this pool if the user updates the auto pool specification in a way that changes this lifetime. Possible values include: 'PoolLifetimeOptionJobSchedule', 'PoolLifetimeOptionJob', 'PoolLifetimeOptionUnmapped'
- PoolLifetimeOption PoolLifetimeOption `json:"poolLifetimeOption,omitempty"`
- // KeepAlive - If false, the Batch service deletes the pool once its lifetime (as determined by the poolLifetimeOption setting) expires; that is, when the job or job schedule completes. If true, the Batch service does not delete the pool automatically. It is up to the user to delete auto pools created with this option.
- KeepAlive *bool `json:"keepAlive,omitempty"`
- Pool *PoolSpecification `json:"pool,omitempty"`
-}
-
-// AutoScaleRun ...
-type AutoScaleRun struct {
- autorest.Response `json:"-"`
- Timestamp *date.Time `json:"timestamp,omitempty"`
- // Results - Each variable value is returned in the form $variable=value, and variables are separated by semicolons.
- Results *string `json:"results,omitempty"`
- Error *AutoScaleRunError `json:"error,omitempty"`
-}
-
-// AutoScaleRunError ...
-type AutoScaleRunError struct {
- Code *string `json:"code,omitempty"`
- Message *string `json:"message,omitempty"`
- Values *[]NameValuePair `json:"values,omitempty"`
-}
-
-// AutoUserSpecification ...
-type AutoUserSpecification struct {
- // Scope - pool - specifies that the task runs as the common auto user account which is created on every node in a pool. task - specifies that the service should create a new user for the task. The default value is task. Possible values include: 'Task', 'Pool'
- Scope AutoUserScope `json:"scope,omitempty"`
- // ElevationLevel - nonAdmin - The auto user is a standard user without elevated access. admin - The auto user is a user with elevated access and operates with full Administrator permissions. The default value is nonAdmin. Possible values include: 'NonAdmin', 'Admin'
- ElevationLevel ElevationLevel `json:"elevationLevel,omitempty"`
-}
-
-// Certificate a certificate that can be installed on compute nodes and can be used to authenticate operations on
-// the machine.
-type Certificate struct {
- autorest.Response `json:"-"`
- Thumbprint *string `json:"thumbprint,omitempty"`
- ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"`
- URL *string `json:"url,omitempty"`
- // State - Possible values include: 'Active', 'Deleting', 'DeleteFailed'
- State CertificateState `json:"state,omitempty"`
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // PreviousState - This property is not set if the certificate is in its initial active state. Possible values include: 'Active', 'Deleting', 'DeleteFailed'
- PreviousState CertificateState `json:"previousState,omitempty"`
- // PreviousStateTransitionTime - This property is not set if the certificate is in its initial Active state.
- PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"`
- PublicData *string `json:"publicData,omitempty"`
- // DeleteCertificateError - This property is set only if the certificate is in the DeleteFailed state.
- DeleteCertificateError *DeleteCertificateError `json:"deleteCertificateError,omitempty"`
-}
-
-// CertificateAddParameter ...
-type CertificateAddParameter struct {
- Thumbprint *string `json:"thumbprint,omitempty"`
- ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"`
- Data *string `json:"data,omitempty"`
- // CertificateFormat - Possible values include: 'Pfx', 'Cer', 'Unmapped'
- CertificateFormat CertificateFormat `json:"certificateFormat,omitempty"`
- // Password - This is required if the certificate format is pfx. It should be omitted if the certificate format is cer.
- Password *string `json:"password,omitempty"`
-}
-
-// CertificateListResult ...
-type CertificateListResult struct {
- autorest.Response `json:"-"`
- Value *[]Certificate `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CertificateListResultIterator provides access to a complete listing of Certificate values.
-type CertificateListResultIterator struct {
- i int
- page CertificateListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CertificateListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CertificateListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CertificateListResultIterator) Response() CertificateListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CertificateListResultIterator) Value() Certificate {
- if !iter.page.NotDone() {
- return Certificate{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (clr CertificateListResult) IsEmpty() bool {
- return clr.Value == nil || len(*clr.Value) == 0
-}
-
-// certificateListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (clr CertificateListResult) certificateListResultPreparer() (*http.Request, error) {
- if clr.OdataNextLink == nil || len(to.String(clr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(clr.OdataNextLink)))
-}
-
-// CertificateListResultPage contains a page of Certificate values.
-type CertificateListResultPage struct {
- fn func(CertificateListResult) (CertificateListResult, error)
- clr CertificateListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CertificateListResultPage) Next() error {
- next, err := page.fn(page.clr)
- if err != nil {
- return err
- }
- page.clr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CertificateListResultPage) NotDone() bool {
- return !page.clr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CertificateListResultPage) Response() CertificateListResult {
- return page.clr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CertificateListResultPage) Values() []Certificate {
- if page.clr.IsEmpty() {
- return nil
- }
- return *page.clr.Value
-}
-
-// CertificateReference ...
-type CertificateReference struct {
- Thumbprint *string `json:"thumbprint,omitempty"`
- ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"`
- // StoreLocation - The default value is currentUser. This property is applicable only for pools configured with Windows nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows image reference). For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory. Possible values include: 'CertificateStoreLocationCurrentUser', 'CertificateStoreLocationLocalMachine', 'CertificateStoreLocationUnmapped'
- StoreLocation CertificateStoreLocation `json:"storeLocation,omitempty"`
- // StoreName - The default value is My. This property is applicable only for pools configured with Windows nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows image reference).
- StoreName *string `json:"storeName,omitempty"`
- // Visibility - The default is all accounts.
- Visibility *[]CertificateVisibility `json:"visibility,omitempty"`
-}
-
-// CloudJob ...
-type CloudJob struct {
- autorest.Response `json:"-"`
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. It is common to use a GUID for the id.
- ID *string `json:"id,omitempty"`
- DisplayName *string `json:"displayName,omitempty"`
- UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"`
- URL *string `json:"url,omitempty"`
- // ETag - This is an opaque string. You can use it to detect whether the job has changed between requests. In particular, you can be pass the ETag when updating a job to specify that your changes should take effect only if nobody else has modified the job in the meantime.
- ETag *string `json:"eTag,omitempty"`
- // LastModified - This is the last time at which the job level data, such as the job state or priority, changed. It does not factor in task-level changes such as adding new tasks or tasks changing state.
- LastModified *date.Time `json:"lastModified,omitempty"`
- CreationTime *date.Time `json:"creationTime,omitempty"`
- // State - Possible values include: 'JobStateActive', 'JobStateDisabling', 'JobStateDisabled', 'JobStateEnabling', 'JobStateTerminating', 'JobStateCompleted', 'JobStateDeleting'
- State JobState `json:"state,omitempty"`
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // PreviousState - This property is not set if the job is in its initial Active state. Possible values include: 'JobStateActive', 'JobStateDisabling', 'JobStateDisabled', 'JobStateEnabling', 'JobStateTerminating', 'JobStateCompleted', 'JobStateDeleting'
- PreviousState JobState `json:"previousState,omitempty"`
- // PreviousStateTransitionTime - This property is not set if the job is in its initial Active state.
- PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"`
- // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0.
- Priority *int32 `json:"priority,omitempty"`
- Constraints *JobConstraints `json:"constraints,omitempty"`
- JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"`
- // JobPreparationTask - The Job Preparation task is a special task run on each node before any other task of the job.
- JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"`
- // JobReleaseTask - The Job Release task is a special task run at the end of the job on each node that has run any other task of the job.
- JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"`
- CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"`
- PoolInfo *PoolInformation `json:"poolInfo,omitempty"`
- // OnAllTasksComplete - noAction - do nothing. The job remains active unless terminated or disabled by some other means. terminateJob - terminate the job. The job's terminateReason is set to 'AllTasksComplete'. The default is noAction. Possible values include: 'NoAction', 'TerminateJob'
- OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"`
- // OnTaskFailure - noAction - do nothing. performExitOptionsJobAction - take the action associated with the task exit condition in the task's exitConditions collection. (This may still result in no action being taken, if that is what the task specifies.) The default is noAction. Possible values include: 'OnTaskFailureNoAction', 'OnTaskFailurePerformExitOptionsJobAction'
- OnTaskFailure OnTaskFailure `json:"onTaskFailure,omitempty"`
- // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
- ExecutionInfo *JobExecutionInformation `json:"executionInfo,omitempty"`
- Stats *JobStatistics `json:"stats,omitempty"`
-}
-
-// CloudJobListPreparationAndReleaseTaskStatusResult ...
-type CloudJobListPreparationAndReleaseTaskStatusResult struct {
- autorest.Response `json:"-"`
- Value *[]JobPreparationAndReleaseTaskExecutionInformation `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CloudJobListPreparationAndReleaseTaskStatusResultIterator provides access to a complete listing of
-// JobPreparationAndReleaseTaskExecutionInformation values.
-type CloudJobListPreparationAndReleaseTaskStatusResultIterator struct {
- i int
- page CloudJobListPreparationAndReleaseTaskStatusResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CloudJobListPreparationAndReleaseTaskStatusResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CloudJobListPreparationAndReleaseTaskStatusResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CloudJobListPreparationAndReleaseTaskStatusResultIterator) Response() CloudJobListPreparationAndReleaseTaskStatusResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CloudJobListPreparationAndReleaseTaskStatusResultIterator) Value() JobPreparationAndReleaseTaskExecutionInformation {
- if !iter.page.NotDone() {
- return JobPreparationAndReleaseTaskExecutionInformation{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult) IsEmpty() bool {
- return cjlpartsr.Value == nil || len(*cjlpartsr.Value) == 0
-}
-
-// cloudJobListPreparationAndReleaseTaskStatusResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult) cloudJobListPreparationAndReleaseTaskStatusResultPreparer() (*http.Request, error) {
- if cjlpartsr.OdataNextLink == nil || len(to.String(cjlpartsr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(cjlpartsr.OdataNextLink)))
-}
-
-// CloudJobListPreparationAndReleaseTaskStatusResultPage contains a page of
-// JobPreparationAndReleaseTaskExecutionInformation values.
-type CloudJobListPreparationAndReleaseTaskStatusResultPage struct {
- fn func(CloudJobListPreparationAndReleaseTaskStatusResult) (CloudJobListPreparationAndReleaseTaskStatusResult, error)
- cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CloudJobListPreparationAndReleaseTaskStatusResultPage) Next() error {
- next, err := page.fn(page.cjlpartsr)
- if err != nil {
- return err
- }
- page.cjlpartsr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) NotDone() bool {
- return !page.cjlpartsr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) Response() CloudJobListPreparationAndReleaseTaskStatusResult {
- return page.cjlpartsr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) Values() []JobPreparationAndReleaseTaskExecutionInformation {
- if page.cjlpartsr.IsEmpty() {
- return nil
- }
- return *page.cjlpartsr.Value
-}
-
-// CloudJobListResult ...
-type CloudJobListResult struct {
- autorest.Response `json:"-"`
- Value *[]CloudJob `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CloudJobListResultIterator provides access to a complete listing of CloudJob values.
-type CloudJobListResultIterator struct {
- i int
- page CloudJobListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CloudJobListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CloudJobListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CloudJobListResultIterator) Response() CloudJobListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CloudJobListResultIterator) Value() CloudJob {
- if !iter.page.NotDone() {
- return CloudJob{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (cjlr CloudJobListResult) IsEmpty() bool {
- return cjlr.Value == nil || len(*cjlr.Value) == 0
-}
-
-// cloudJobListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (cjlr CloudJobListResult) cloudJobListResultPreparer() (*http.Request, error) {
- if cjlr.OdataNextLink == nil || len(to.String(cjlr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(cjlr.OdataNextLink)))
-}
-
-// CloudJobListResultPage contains a page of CloudJob values.
-type CloudJobListResultPage struct {
- fn func(CloudJobListResult) (CloudJobListResult, error)
- cjlr CloudJobListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CloudJobListResultPage) Next() error {
- next, err := page.fn(page.cjlr)
- if err != nil {
- return err
- }
- page.cjlr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CloudJobListResultPage) NotDone() bool {
- return !page.cjlr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CloudJobListResultPage) Response() CloudJobListResult {
- return page.cjlr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CloudJobListResultPage) Values() []CloudJob {
- if page.cjlr.IsEmpty() {
- return nil
- }
- return *page.cjlr.Value
-}
-
-// CloudJobSchedule ...
-type CloudJobSchedule struct {
- autorest.Response `json:"-"`
- // ID - It is common to use a GUID for the id.
- ID *string `json:"id,omitempty"`
- DisplayName *string `json:"displayName,omitempty"`
- URL *string `json:"url,omitempty"`
- // ETag - This is an opaque string. You can use it to detect whether the job schedule has changed between requests. In particular, you can be pass the ETag with an Update Job Schedule request to specify that your changes should take effect only if nobody else has modified the schedule in the meantime.
- ETag *string `json:"eTag,omitempty"`
- // LastModified - This is the last time at which the schedule level data, such as the job specification or recurrence information, changed. It does not factor in job-level changes such as new jobs being created or jobs changing state.
- LastModified *date.Time `json:"lastModified,omitempty"`
- CreationTime *date.Time `json:"creationTime,omitempty"`
- // State - Possible values include: 'JobScheduleStateActive', 'JobScheduleStateCompleted', 'JobScheduleStateDisabled', 'JobScheduleStateTerminating', 'JobScheduleStateDeleting'
- State JobScheduleState `json:"state,omitempty"`
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // PreviousState - This property is not present if the job schedule is in its initial active state. Possible values include: 'JobScheduleStateActive', 'JobScheduleStateCompleted', 'JobScheduleStateDisabled', 'JobScheduleStateTerminating', 'JobScheduleStateDeleting'
- PreviousState JobScheduleState `json:"previousState,omitempty"`
- // PreviousStateTransitionTime - This property is not present if the job schedule is in its initial active state.
- PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"`
- Schedule *Schedule `json:"schedule,omitempty"`
- JobSpecification *JobSpecification `json:"jobSpecification,omitempty"`
- ExecutionInfo *JobScheduleExecutionInformation `json:"executionInfo,omitempty"`
- // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
- Stats *JobScheduleStatistics `json:"stats,omitempty"`
-}
-
-// CloudJobScheduleListResult ...
-type CloudJobScheduleListResult struct {
- autorest.Response `json:"-"`
- Value *[]CloudJobSchedule `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CloudJobScheduleListResultIterator provides access to a complete listing of CloudJobSchedule values.
-type CloudJobScheduleListResultIterator struct {
- i int
- page CloudJobScheduleListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CloudJobScheduleListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CloudJobScheduleListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CloudJobScheduleListResultIterator) Response() CloudJobScheduleListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CloudJobScheduleListResultIterator) Value() CloudJobSchedule {
- if !iter.page.NotDone() {
- return CloudJobSchedule{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (cjslr CloudJobScheduleListResult) IsEmpty() bool {
- return cjslr.Value == nil || len(*cjslr.Value) == 0
-}
-
-// cloudJobScheduleListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (cjslr CloudJobScheduleListResult) cloudJobScheduleListResultPreparer() (*http.Request, error) {
- if cjslr.OdataNextLink == nil || len(to.String(cjslr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(cjslr.OdataNextLink)))
-}
-
-// CloudJobScheduleListResultPage contains a page of CloudJobSchedule values.
-type CloudJobScheduleListResultPage struct {
- fn func(CloudJobScheduleListResult) (CloudJobScheduleListResult, error)
- cjslr CloudJobScheduleListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CloudJobScheduleListResultPage) Next() error {
- next, err := page.fn(page.cjslr)
- if err != nil {
- return err
- }
- page.cjslr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CloudJobScheduleListResultPage) NotDone() bool {
- return !page.cjslr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CloudJobScheduleListResultPage) Response() CloudJobScheduleListResult {
- return page.cjslr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CloudJobScheduleListResultPage) Values() []CloudJobSchedule {
- if page.cjslr.IsEmpty() {
- return nil
- }
- return *page.cjslr.Value
-}
-
-// CloudPool ...
-type CloudPool struct {
- autorest.Response `json:"-"`
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. It is common to use a GUID for the id.
- ID *string `json:"id,omitempty"`
- // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- URL *string `json:"url,omitempty"`
- // ETag - This is an opaque string. You can use it to detect whether the pool has changed between requests. In particular, you can be pass the ETag when updating a pool to specify that your changes should take effect only if nobody else has modified the pool in the meantime.
- ETag *string `json:"eTag,omitempty"`
- // LastModified - This is the last time at which the pool level data, such as the targetDedicated or enableAutoscale settings, changed. It does not factor in node-level changes such as a compute node changing state.
- LastModified *date.Time `json:"lastModified,omitempty"`
- CreationTime *date.Time `json:"creationTime,omitempty"`
- // State - active - The pool is available to run tasks subject to the availability of compute nodes. deleting - The user has requested that the pool be deleted, but the delete operation has not yet completed. upgrading - The user has requested that the operating system of the pool's nodes be upgraded, but the upgrade operation has not yet completed (that is, some nodes in the pool have not yet been upgraded). While upgrading, the pool may be able to run tasks (with reduced capacity) but this is not guaranteed. Possible values include: 'PoolStateActive', 'PoolStateDeleting', 'PoolStateUpgrading'
- State PoolState `json:"state,omitempty"`
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // AllocationState - steady - The pool is not resizing. There are no changes to the number of nodes in the pool in progress. A pool enters this state when it is created and when no operations are being performed on the pool to change the number of dedicated nodes. resizing - The pool is resizing; that is, compute nodes are being added to or removed from the pool. stopping - The pool was resizing, but the user has requested that the resize be stopped, but the stop request has not yet been completed. Possible values include: 'Steady', 'Resizing', 'Stopping'
- AllocationState AllocationState `json:"allocationState,omitempty"`
- AllocationStateTransitionTime *date.Time `json:"allocationStateTransitionTime,omitempty"`
- // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series).
- VMSize *string `json:"vmSize,omitempty"`
- // CloudServiceConfiguration - This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. This property cannot be specified if the Batch account was created with its poolAllocationMode property set to 'UserSubscription'.
- CloudServiceConfiguration *CloudServiceConfiguration `json:"cloudServiceConfiguration,omitempty"`
- // VirtualMachineConfiguration - This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified.
- VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"`
- // ResizeTimeout - This is the timeout for the most recent resize operation. (The initial sizing when the pool is created counts as a resize.) The default value is 15 minutes.
- ResizeTimeout *string `json:"resizeTimeout,omitempty"`
- // ResizeError - This property is set only if an error occurred during the last pool resize, and only when the pool allocationState is Steady.
- ResizeError *ResizeError `json:"resizeError,omitempty"`
- CurrentDedicated *int32 `json:"currentDedicated,omitempty"`
- // TargetDedicated - This property is not set if enableAutoScale is true. It is required if enableAutoScale is false.
- TargetDedicated *int32 `json:"targetDedicated,omitempty"`
- // EnableAutoScale - If true, the autoScaleFormula property must be set. If false, the targetDedicated property must be set.
- EnableAutoScale *bool `json:"enableAutoScale,omitempty"`
- // AutoScaleFormula - This property is set only if the pool automatically scales, i.e. enableAutoScale is true.
- AutoScaleFormula *string `json:"autoScaleFormula,omitempty"`
- // AutoScaleEvaluationInterval - This property is set only if the pool automatically scales, i.e. enableAutoScale is true.
- AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"`
- // AutoScaleRun - This property is set only if the pool automatically scales, i.e. enableAutoScale is true.
- AutoScaleRun *AutoScaleRun `json:"autoScaleRun,omitempty"`
- // EnableInterNodeCommunication - This imposes restrictions on which nodes can be assigned to the pool. Specifying this value can reduce the chance of the requested number of nodes to be allocated in the pool.
- EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"`
- NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"`
- StartTask *StartTask `json:"startTask,omitempty"`
- // CertificateReferences - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"`
- TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"`
- UserAccounts *[]UserAccount `json:"userAccounts,omitempty"`
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
- Stats *PoolStatistics `json:"stats,omitempty"`
-}
-
-// CloudPoolListResult ...
-type CloudPoolListResult struct {
- autorest.Response `json:"-"`
- Value *[]CloudPool `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CloudPoolListResultIterator provides access to a complete listing of CloudPool values.
-type CloudPoolListResultIterator struct {
- i int
- page CloudPoolListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CloudPoolListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CloudPoolListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CloudPoolListResultIterator) Response() CloudPoolListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CloudPoolListResultIterator) Value() CloudPool {
- if !iter.page.NotDone() {
- return CloudPool{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (cplr CloudPoolListResult) IsEmpty() bool {
- return cplr.Value == nil || len(*cplr.Value) == 0
-}
-
-// cloudPoolListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (cplr CloudPoolListResult) cloudPoolListResultPreparer() (*http.Request, error) {
- if cplr.OdataNextLink == nil || len(to.String(cplr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(cplr.OdataNextLink)))
-}
-
-// CloudPoolListResultPage contains a page of CloudPool values.
-type CloudPoolListResultPage struct {
- fn func(CloudPoolListResult) (CloudPoolListResult, error)
- cplr CloudPoolListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CloudPoolListResultPage) Next() error {
- next, err := page.fn(page.cplr)
- if err != nil {
- return err
- }
- page.cplr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CloudPoolListResultPage) NotDone() bool {
- return !page.cplr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CloudPoolListResultPage) Response() CloudPoolListResult {
- return page.cplr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CloudPoolListResultPage) Values() []CloudPool {
- if page.cplr.IsEmpty() {
- return nil
- }
- return *page.cplr.Value
-}
-
-// CloudServiceConfiguration ...
-type CloudServiceConfiguration struct {
- // OsFamily - Possible values are: 2 - OS Family 2, equivalent to Windows Server 2008 R2 SP1. 3 - OS Family 3, equivalent to Windows Server 2012. 4 - OS Family 4, equivalent to Windows Server 2012 R2. 5 - OS Family 5, equivalent to Windows Server 2016. For more information, see Azure Guest OS Releases (https://azure.microsoft.com/documentation/articles/cloud-services-guestos-update-matrix/#releases).
- OsFamily *string `json:"osFamily,omitempty"`
- // TargetOSVersion - The default value is * which specifies the latest operating system version for the specified OS family.
- TargetOSVersion *string `json:"targetOSVersion,omitempty"`
- // CurrentOSVersion - This may differ from targetOSVersion if the pool state is Upgrading. In this case some virtual machines may be on the targetOSVersion and some may be on the currentOSVersion during the upgrade process. Once all virtual machines have upgraded, currentOSVersion is updated to be the same as targetOSVersion.
- CurrentOSVersion *string `json:"currentOSVersion,omitempty"`
-}
-
-// CloudTask ...
-type CloudTask struct {
- autorest.Response `json:"-"`
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters.
- ID *string `json:"id,omitempty"`
- // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- URL *string `json:"url,omitempty"`
- // ETag - This is an opaque string. You can use it to detect whether the task has changed between requests. In particular, you can be pass the ETag when updating a task to specify that your changes should take effect only if nobody else has modified the task in the meantime.
- ETag *string `json:"eTag,omitempty"`
- LastModified *date.Time `json:"lastModified,omitempty"`
- CreationTime *date.Time `json:"creationTime,omitempty"`
- // ExitConditions - How the Batch service should respond when the task completes.
- ExitConditions *ExitConditions `json:"exitConditions,omitempty"`
- // State - Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted'
- State TaskState `json:"state,omitempty"`
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // PreviousState - This property is not set if the task is in its initial Active state. Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted'
- PreviousState TaskState `json:"previousState,omitempty"`
- // PreviousStateTransitionTime - This property is not set if the task is in its initial Active state.
- PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"`
- // CommandLine - For multi-instance tasks, the command line is executed as the primary task, after the primary task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux.
- CommandLine *string `json:"commandLine,omitempty"`
- // ResourceFiles - For multi-instance tasks, the resource files will only be downloaded to the compute node on which the primary task is executed.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- AffinityInfo *AffinityInformation `json:"affinityInfo,omitempty"`
- Constraints *TaskConstraints `json:"constraints,omitempty"`
- // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task.
- UserIdentity *UserIdentity `json:"userIdentity,omitempty"`
- ExecutionInfo *TaskExecutionInformation `json:"executionInfo,omitempty"`
- NodeInfo *ComputeNodeInformation `json:"nodeInfo,omitempty"`
- MultiInstanceSettings *MultiInstanceSettings `json:"multiInstanceSettings,omitempty"`
- Stats *TaskStatistics `json:"stats,omitempty"`
- // DependsOn - This task will not be scheduled until all tasks that it depends on have completed successfully. If any of those tasks fail and exhaust their retry counts, this task will never be scheduled.
- DependsOn *TaskDependencies `json:"dependsOn,omitempty"`
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // AuthenticationTokenSettings - If this property is set, the Batch service provides the task with an authentication token which can be used to authenticate Batch service operations without requiring an account access key. The token is provided via the AZ_BATCH_AUTHENTICATION_TOKEN environment variable. The operations that the task can carry out using the token depend on the settings. For example, a task can request job permissions in order to add other tasks to the job, or check the status of the job or of other tasks under the job.
- AuthenticationTokenSettings *AuthenticationTokenSettings `json:"authenticationTokenSettings,omitempty"`
-}
-
-// CloudTaskListResult ...
-type CloudTaskListResult struct {
- autorest.Response `json:"-"`
- Value *[]CloudTask `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CloudTaskListResultIterator provides access to a complete listing of CloudTask values.
-type CloudTaskListResultIterator struct {
- i int
- page CloudTaskListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CloudTaskListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CloudTaskListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CloudTaskListResultIterator) Response() CloudTaskListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CloudTaskListResultIterator) Value() CloudTask {
- if !iter.page.NotDone() {
- return CloudTask{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (ctlr CloudTaskListResult) IsEmpty() bool {
- return ctlr.Value == nil || len(*ctlr.Value) == 0
-}
-
-// cloudTaskListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (ctlr CloudTaskListResult) cloudTaskListResultPreparer() (*http.Request, error) {
- if ctlr.OdataNextLink == nil || len(to.String(ctlr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(ctlr.OdataNextLink)))
-}
-
-// CloudTaskListResultPage contains a page of CloudTask values.
-type CloudTaskListResultPage struct {
- fn func(CloudTaskListResult) (CloudTaskListResult, error)
- ctlr CloudTaskListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CloudTaskListResultPage) Next() error {
- next, err := page.fn(page.ctlr)
- if err != nil {
- return err
- }
- page.ctlr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CloudTaskListResultPage) NotDone() bool {
- return !page.ctlr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CloudTaskListResultPage) Response() CloudTaskListResult {
- return page.ctlr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CloudTaskListResultPage) Values() []CloudTask {
- if page.ctlr.IsEmpty() {
- return nil
- }
- return *page.ctlr.Value
-}
-
-// CloudTaskListSubtasksResult ...
-type CloudTaskListSubtasksResult struct {
- autorest.Response `json:"-"`
- Value *[]SubtaskInformation `json:"value,omitempty"`
-}
-
-// ComputeNode ...
-type ComputeNode struct {
- autorest.Response `json:"-"`
- // ID - Every node that is added to a pool is assigned a unique ID. Whenever a node is removed from a pool, all of its local files are deleted, and the ID is reclaimed and could be reused for new nodes.
- ID *string `json:"id,omitempty"`
- URL *string `json:"url,omitempty"`
- // State - Possible values include: 'Idle', 'Rebooting', 'Reimaging', 'Running', 'Unusable', 'Creating', 'Starting', 'WaitingForStartTask', 'StartTaskFailed', 'Unknown', 'LeavingPool', 'Offline'
- State ComputeNodeState `json:"state,omitempty"`
- // SchedulingState - enabled - Tasks can be scheduled on the node. disabled - No new tasks will be scheduled on the node. Tasks already running on the node may still run to completion. All nodes start with scheduling enabled. Possible values include: 'Enabled', 'Disabled'
- SchedulingState SchedulingState `json:"schedulingState,omitempty"`
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // LastBootTime - This property may not be present if the node state is unusable.
- LastBootTime *date.Time `json:"lastBootTime,omitempty"`
- AllocationTime *date.Time `json:"allocationTime,omitempty"`
- // IPAddress - Every node that is added to a pool is assigned a unique IP address. Whenever a node is removed from a pool, all of its local files are deleted, and the IP address is reclaimed and could be reused for new nodes.
- IPAddress *string `json:"ipAddress,omitempty"`
- AffinityID *string `json:"affinityId,omitempty"`
- // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series).
- VMSize *string `json:"vmSize,omitempty"`
- TotalTasksRun *int32 `json:"totalTasksRun,omitempty"`
- RunningTasksCount *int32 `json:"runningTasksCount,omitempty"`
- TotalTasksSucceeded *int32 `json:"totalTasksSucceeded,omitempty"`
- RecentTasks *[]TaskInformation `json:"recentTasks,omitempty"`
- StartTask *StartTask `json:"startTask,omitempty"`
- StartTaskInfo *StartTaskInformation `json:"startTaskInfo,omitempty"`
- // CertificateReferences - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- Errors *[]ComputeNodeError `json:"errors,omitempty"`
-}
-
-// ComputeNodeError ...
-type ComputeNodeError struct {
- Code *string `json:"code,omitempty"`
- Message *string `json:"message,omitempty"`
- ErrorDetails *[]NameValuePair `json:"errorDetails,omitempty"`
-}
-
-// ComputeNodeGetRemoteLoginSettingsResult ...
-type ComputeNodeGetRemoteLoginSettingsResult struct {
- autorest.Response `json:"-"`
- RemoteLoginIPAddress *string `json:"remoteLoginIPAddress,omitempty"`
- RemoteLoginPort *int32 `json:"remoteLoginPort,omitempty"`
-}
-
-// ComputeNodeInformation ...
-type ComputeNodeInformation struct {
- AffinityID *string `json:"affinityId,omitempty"`
- NodeURL *string `json:"nodeUrl,omitempty"`
- PoolID *string `json:"poolId,omitempty"`
- NodeID *string `json:"nodeId,omitempty"`
- TaskRootDirectory *string `json:"taskRootDirectory,omitempty"`
- TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"`
-}
-
-// ComputeNodeListResult ...
-type ComputeNodeListResult struct {
- autorest.Response `json:"-"`
- Value *[]ComputeNode `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// ComputeNodeListResultIterator provides access to a complete listing of ComputeNode values.
-type ComputeNodeListResultIterator struct {
- i int
- page ComputeNodeListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *ComputeNodeListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter ComputeNodeListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter ComputeNodeListResultIterator) Response() ComputeNodeListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter ComputeNodeListResultIterator) Value() ComputeNode {
- if !iter.page.NotDone() {
- return ComputeNode{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (cnlr ComputeNodeListResult) IsEmpty() bool {
- return cnlr.Value == nil || len(*cnlr.Value) == 0
-}
-
-// computeNodeListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (cnlr ComputeNodeListResult) computeNodeListResultPreparer() (*http.Request, error) {
- if cnlr.OdataNextLink == nil || len(to.String(cnlr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(cnlr.OdataNextLink)))
-}
-
-// ComputeNodeListResultPage contains a page of ComputeNode values.
-type ComputeNodeListResultPage struct {
- fn func(ComputeNodeListResult) (ComputeNodeListResult, error)
- cnlr ComputeNodeListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *ComputeNodeListResultPage) Next() error {
- next, err := page.fn(page.cnlr)
- if err != nil {
- return err
- }
- page.cnlr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page ComputeNodeListResultPage) NotDone() bool {
- return !page.cnlr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page ComputeNodeListResultPage) Response() ComputeNodeListResult {
- return page.cnlr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page ComputeNodeListResultPage) Values() []ComputeNode {
- if page.cnlr.IsEmpty() {
- return nil
- }
- return *page.cnlr.Value
-}
-
-// ComputeNodeUser ...
-type ComputeNodeUser struct {
- Name *string `json:"name,omitempty"`
- // IsAdmin - The default value is false.
- IsAdmin *bool `json:"isAdmin,omitempty"`
- // ExpiryTime - If omitted, the default is 1 day from the current time. For Linux compute nodes, the expiryTime has a precision up to a day.
- ExpiryTime *date.Time `json:"expiryTime,omitempty"`
- // Password - The password is required for Windows nodes (those created with 'cloudServiceConfiguration', or created with 'virtualMachineConfiguration' using a Windows image reference). For Linux compute nodes, the password can optionally be specified along with the sshPublicKey property.
- Password *string `json:"password,omitempty"`
- // SSHPublicKey - The public key should be compatible with OpenSSH encoding and should be base 64 encoded. This property can be specified only for Linux nodes. If this is specified for a Windows node, then the Batch service rejects the request; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- SSHPublicKey *string `json:"sshPublicKey,omitempty"`
-}
-
-// DeleteCertificateError ...
-type DeleteCertificateError struct {
- Code *string `json:"code,omitempty"`
- Message *string `json:"message,omitempty"`
- // Values - This list includes details such as the active pools and nodes referencing this certificate. However, if a large number of resources reference the certificate, the list contains only about the first hundred.
- Values *[]NameValuePair `json:"values,omitempty"`
-}
-
-// EnvironmentSetting ...
-type EnvironmentSetting struct {
- Name *string `json:"name,omitempty"`
- Value *string `json:"value,omitempty"`
-}
-
-// Error ...
-type Error struct {
- Code *string `json:"code,omitempty"`
- Message *ErrorMessage `json:"message,omitempty"`
- Values *[]ErrorDetail `json:"values,omitempty"`
-}
-
-// ErrorDetail ...
-type ErrorDetail struct {
- Key *string `json:"key,omitempty"`
- Value *string `json:"value,omitempty"`
-}
-
-// ErrorMessage ...
-type ErrorMessage struct {
- Lang *string `json:"lang,omitempty"`
- Value *string `json:"value,omitempty"`
-}
-
-// ExitCodeMapping ...
-type ExitCodeMapping struct {
- Code *int32 `json:"code,omitempty"`
- ExitOptions *ExitOptions `json:"exitOptions,omitempty"`
-}
-
-// ExitCodeRangeMapping ...
-type ExitCodeRangeMapping struct {
- Start *int32 `json:"start,omitempty"`
- End *int32 `json:"end,omitempty"`
- ExitOptions *ExitOptions `json:"exitOptions,omitempty"`
-}
-
-// ExitConditions ...
-type ExitConditions struct {
- ExitCodes *[]ExitCodeMapping `json:"exitCodes,omitempty"`
- ExitCodeRanges *[]ExitCodeRangeMapping `json:"exitCodeRanges,omitempty"`
- SchedulingError *ExitOptions `json:"schedulingError,omitempty"`
- // Default - Note that the default condition does not include exit code 0. If you want non-default behaviour on exit code 0, you must list it explicitly using the exitCodes or exitCodeRanges collection.
- Default *ExitOptions `json:"default,omitempty"`
-}
-
-// ExitOptions ...
-type ExitOptions struct {
- // JobAction - The default is none for exit code 0 and terminate for all other exit conditions. If the job's onTaskFailed property is noAction, then specify this property returns an error. The add task request fails with an invalid property value error;; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). Possible values include: 'JobActionNone', 'JobActionDisable', 'JobActionTerminate'
- JobAction JobAction `json:"jobAction,omitempty"`
- // DependencyAction - The default is 'satisfy' for exit code 0, and 'block' for all other exit conditions. If the job's usesTaskDependencies property is set to false, then specifying the dependencyAction property returns an error. The add task request fails with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). Possible values include: 'Satisfy', 'Block'
- DependencyAction DependencyAction `json:"dependencyAction,omitempty"`
-}
-
-// FileProperties ...
-type FileProperties struct {
- // CreationTime - The creation time is not returned for files on Linux compute nodes.
- CreationTime *date.Time `json:"creationTime,omitempty"`
- LastModified *date.Time `json:"lastModified,omitempty"`
- ContentLength *int64 `json:"contentLength,omitempty"`
- ContentType *string `json:"contentType,omitempty"`
- // FileMode - The file mode is returned only for files on Linux compute nodes.
- FileMode *string `json:"fileMode,omitempty"`
-}
-
-// ImageReference ...
-type ImageReference struct {
- // Publisher - For example, Canonical or MicrosoftWindowsServer.
- Publisher *string `json:"publisher,omitempty"`
- // Offer - For example, UbuntuServer or WindowsServer.
- Offer *string `json:"offer,omitempty"`
- // Sku - For example, 14.04.0-LTS or 2012-R2-Datacenter.
- Sku *string `json:"sku,omitempty"`
- // Version - A value of 'latest' can be specified to select the latest version of an image. If omitted, the default is 'latest'.
- Version *string `json:"version,omitempty"`
-}
-
-// JobAddParameter ...
-type JobAddParameter struct {
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. It is common to use a GUID for the id.
- ID *string `json:"id,omitempty"`
- // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0.
- Priority *int32 `json:"priority,omitempty"`
- // Constraints - The execution constraints for the job.
- Constraints *JobConstraints `json:"constraints,omitempty"`
- // JobManagerTask - If the job does not specify a Job Manager task, the user must explicitly add tasks to the job. If the job does specify a Job Manager task, the Batch service creates the Job Manager task when the job is created, and will try to schedule the Job Manager task before scheduling other tasks in the job. The Job Manager task's typical purpose is to control and/or monitor job execution, for example by deciding what additional tasks to run, determining when the work is complete, etc. (However, a Job Manager task is not restricted to these activities - it is a fully-fledged task in the system and perform whatever actions are required for the job.) For example, a Job Manager task might download a file specified as a parameter, analyze the contents of that file and submit additional tasks based on those contents.
- JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"`
- // JobPreparationTask - If a job has a Job Preparation task, the Batch service will run the Job Preparation task on a compute node before starting any tasks of that job on that compute node.
- JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"`
- // JobReleaseTask - A Job Release task cannot be specified without also specifying a Job Preparation task for the job. The Batch service runs the Job Release task on the compute nodes that have run the Job Preparation task. The primary purpose of the Job Release task is to undo changes to compute nodes made by the Job Preparation task. Example activities include deleting local files, or shutting down services that were started as part of job preparation.
- JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"`
- CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"`
- PoolInfo *PoolInformation `json:"poolInfo,omitempty"`
- // OnAllTasksComplete - Note that if a job contains no tasks, then all tasks are considered complete. This option is therefore most commonly used with a Job Manager task; if you want to use automatic job termination without a Job Manager, you should initially set onAllTasksComplete to noAction and update the job properties to set onAllTasksComplete to terminateJob once you have finished adding tasks. Permitted values are: noAction - do nothing. The job remains active unless terminated or disabled by some other means. terminateJob - terminate the job. The job's terminateReason is set to 'AllTasksComplete'. The default is noAction. Possible values include: 'NoAction', 'TerminateJob'
- OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"`
- // OnTaskFailure - noAction - do nothing. performExitOptionsJobAction - take the action associated with the task exit condition in the task's exitConditions collection. (This may still result in no action being taken, if that is what the task specifies.) The default is noAction. Possible values include: 'OnTaskFailureNoAction', 'OnTaskFailurePerformExitOptionsJobAction'
- OnTaskFailure OnTaskFailure `json:"onTaskFailure,omitempty"`
- // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
- UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"`
-}
-
-// JobConstraints ...
-type JobConstraints struct {
- // MaxWallClockTime - If the job does not complete within the time limit, the Batch service terminates it and any tasks that are still running. In this case, the termination reason will be MaxWallClockTimeExpiry. If this property is not specified, there is no time limit on how long the job may run.
- MaxWallClockTime *string `json:"maxWallClockTime,omitempty"`
- // MaxTaskRetryCount - Note that this value specifically controls the number of retries. The Batch service will try each task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries a task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry tasks. If the maximum retry count is -1, the Batch service retries tasks without limit. The default value is 0 (no retries).
- MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"`
-}
-
-// JobDisableParameter ...
-type JobDisableParameter struct {
- // DisableTasks - requeue - Terminate running tasks and requeue them. The tasks will run again when the job is enabled. terminate - Terminate running tasks. The tasks will not run again. wait - Allow currently running tasks to complete. Possible values include: 'DisableJobOptionRequeue', 'DisableJobOptionTerminate', 'DisableJobOptionWait'
- DisableTasks DisableJobOption `json:"disableTasks,omitempty"`
-}
-
-// JobExecutionInformation ...
-type JobExecutionInformation struct {
- // StartTime - This is the time at which the job was created.
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - This property is set only if the job is in the completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
- // PoolID - This element contains the actual pool where the job is assigned. When you get job details from the service, they also contain a poolInfo element, which contains the pool configuration data from when the job was added or updated. That poolInfo element may also contain a poolId element. If it does, the two IDs are the same. If it does not, it means the job ran on an auto pool, and this property contains the id of that auto pool.
- PoolID *string `json:"poolId,omitempty"`
- // SchedulingError - This property is not set if there was no error starting the job.
- SchedulingError *JobSchedulingError `json:"schedulingError,omitempty"`
- // TerminateReason - This property is set only if the job is in the completed state. If the Batch service terminates the job, it sets the reason as follows: JMComplete - the Job Manager task completed, and killJobOnCompletion was set to true. MaxWallClockTimeExpiry - the job reached its maxWallClockTime constraint. TerminateJobSchedule - the job ran as part of a schedule, and the schedule terminated. AllTasksComplete - the job's onAllTasksComplete attribute is set to terminateJob, and all tasks in the job are complete. TaskFailed - the job's onTaskFailure attribute is set to performExitOptionsJobAction, and a task in the job failed with an exit condition that specified a jobAction of terminateJob. Any other string is a user-defined reason specified in a call to the 'Terminate a job' operation.
- TerminateReason *string `json:"terminateReason,omitempty"`
-}
-
-// JobManagerTask ...
-type JobManagerTask struct {
- // ID - The id can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters.
- ID *string `json:"id,omitempty"`
- // DisplayName - It need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux.
- CommandLine *string `json:"commandLine,omitempty"`
- // ResourceFiles - Files listed under this element are located in the task's working directory.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- Constraints *TaskConstraints `json:"constraints,omitempty"`
- // KillJobOnCompletion - If true, when the Job Manager task completes, the Batch service marks the job as complete. If any tasks are still running at this time (other than Job Release), those tasks are terminated. If false, the completion of the Job Manager task does not affect the job status. In this case, you should either use the onAllTasksComplete attribute to terminate the job, or have a client or user terminate the job explicitly. An example of this is if the Job Manager creates a set of tasks but then takes no further role in their execution. The default value is true. If you are using the onAllTasksComplete and onTaskFailure attributes to control job lifetime, and using the Job Manager task only to create the tasks for the job (not to monitor progress), then it is important to set killJobOnCompletion to false.
- KillJobOnCompletion *bool `json:"killJobOnCompletion,omitempty"`
- // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task.
- UserIdentity *UserIdentity `json:"userIdentity,omitempty"`
- // RunExclusive - If true, no other tasks will run on the same compute node for as long as the Job Manager is running. If false, other tasks can run simultaneously with the Job Manager on a compute node. The Job Manager task counts normally against the node's concurrent task limit, so this is only relevant if the node allows multiple concurrent tasks. The default value is true.
- RunExclusive *bool `json:"runExclusive,omitempty"`
- // ApplicationPackageReferences - Application packages are downloaded and deployed to a shared directory, not the task directory. Therefore, if a referenced package is already on the compute node, and is up to date, then it is not re-downloaded; the existing copy on the compute node is used. If a referenced application package cannot be installed, for example because the package has been deleted or because download failed, the task fails with a scheduling error. This property is currently not supported on jobs running on pools created using the virtualMachineConfiguration (IaaS) property. If a task specifying applicationPackageReferences runs on such a pool, it fails with a scheduling error with code TaskSchedulingConstraintFailed.
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // AuthenticationTokenSettings - If this property is set, the Batch service provides the task with an authentication token which can be used to authenticate Batch service operations without requiring an account access key. The token is provided via the AZ_BATCH_AUTHENTICATION_TOKEN environment variable. The operations that the task can carry out using the token depend on the settings. For example, a task can request job permissions in order to add other tasks to the job, or check the status of the job or of other tasks under the job.
- AuthenticationTokenSettings *AuthenticationTokenSettings `json:"authenticationTokenSettings,omitempty"`
-}
-
-// JobPatchParameter ...
-type JobPatchParameter struct {
- // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. If omitted, the priority of the job is left unchanged.
- Priority *int32 `json:"priority,omitempty"`
- // OnAllTasksComplete - If omitted, the completion behavior is left unchanged. You may not change the value from terminateJob to noAction - that is, once you have engaged automatic job termination, you cannot turn it off again. If you try to do this, the request fails with an 'invalid property value' error response; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). Possible values include: 'NoAction', 'TerminateJob'
- OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"`
- // Constraints - If omitted, the existing execution constraints are left unchanged.
- Constraints *JobConstraints `json:"constraints,omitempty"`
- // PoolInfo - You may change the pool for a job only when the job is disabled. The Patch Job call will fail if you include the poolInfo element and the job is not disabled. If you specify an autoPoolSpecification specification in the poolInfo, only the keepAlive property can be updated, and then only if the auto pool has a poolLifetimeOption of job. If omitted, the job continues to run on its current pool.
- PoolInfo *PoolInformation `json:"poolInfo,omitempty"`
- // Metadata - If omitted, the existing job metadata is left unchanged.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// JobPreparationAndReleaseTaskExecutionInformation ...
-type JobPreparationAndReleaseTaskExecutionInformation struct {
- PoolID *string `json:"poolId,omitempty"`
- NodeID *string `json:"nodeId,omitempty"`
- NodeURL *string `json:"nodeUrl,omitempty"`
- JobPreparationTaskExecutionInfo *JobPreparationTaskExecutionInformation `json:"jobPreparationTaskExecutionInfo,omitempty"`
- // JobReleaseTaskExecutionInfo - This property is set only if the Job Release task has run on the node.
- JobReleaseTaskExecutionInfo *JobReleaseTaskExecutionInformation `json:"jobReleaseTaskExecutionInfo,omitempty"`
-}
-
-// JobPreparationTask ...
-type JobPreparationTask struct {
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobpreparation'. No other task in the job can have the same id as the Job Preparation task. If you try to submit a task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobPreparationTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict).
- ID *string `json:"id,omitempty"`
- // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux.
- CommandLine *string `json:"commandLine,omitempty"`
- // ResourceFiles - Files listed under this element are located in the task's working directory.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- Constraints *TaskConstraints `json:"constraints,omitempty"`
- // WaitForSuccess - If true and the Job Preparation task fails on a compute node, the Batch service retries the Job Preparation task up to its maximum retry count (as specified in the constraints element). If the task has still not completed successfully after all retries, then the Batch service will not schedule tasks of the job to the compute node. The compute node remains active and eligible to run tasks of other jobs. If false, the Batch service will not wait for the Job Preparation task to complete. In this case, other tasks of the job can start executing on the compute node while the Job Preparation task is still running; and even if the Job Preparation task fails, new tasks will continue to be scheduled on the node. The default value is true.
- WaitForSuccess *bool `json:"waitForSuccess,omitempty"`
- // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task.
- UserIdentity *UserIdentity `json:"userIdentity,omitempty"`
- // RerunOnNodeRebootAfterSuccess - The Job Preparation task is always rerun if a compute node is reimaged, or if the Job Preparation task did not complete (e.g. because the reboot occurred while the task was running). Therefore, you should always write a Job Preparation task to be idempotent and to behave correctly if run multiple times. The default value is true.
- RerunOnNodeRebootAfterSuccess *bool `json:"rerunOnNodeRebootAfterSuccess,omitempty"`
-}
-
-// JobPreparationTaskExecutionInformation ...
-type JobPreparationTaskExecutionInformation struct {
- // StartTime - Note that every time the task is restarted, this value is updated.
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - This property is set only if the task is in the Completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
- // State - running - the task is currently running (including retrying). completed - the task has exited with exit code 0, or the task has exhausted its retry limit, or the Batch service was unable to start the task due to scheduling errors. Possible values include: 'JobPreparationTaskStateRunning', 'JobPreparationTaskStateCompleted'
- State JobPreparationTaskState `json:"state,omitempty"`
- TaskRootDirectory *string `json:"taskRootDirectory,omitempty"`
- TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"`
- // ExitCode - This parameter is returned only if the task is in the completed state. The exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. Note that the exit code may also be generated by the compute node operating system, such as when a process is forcibly terminated.
- ExitCode *int32 `json:"exitCode,omitempty"`
- SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"`
- RetryCount *int32 `json:"retryCount,omitempty"`
- // LastRetryTime - This property is set only if the task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the task has been restarted for reasons other than retry; for example, if the compute node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not.
- LastRetryTime *date.Time `json:"lastRetryTime,omitempty"`
-}
-
-// JobReleaseTask ...
-type JobReleaseTask struct {
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobrelease'. No other task in the job can have the same id as the Job Release task. If you try to submit a task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobReleaseTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict).
- ID *string `json:"id,omitempty"`
- // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux.
- CommandLine *string `json:"commandLine,omitempty"`
- // ResourceFiles - Files listed under this element are located in the task's working directory.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- MaxWallClockTime *string `json:"maxWallClockTime,omitempty"`
- // RetentionTime - The default is infinite, i.e. the task directory will be retained until the compute node is removed or reimaged.
- RetentionTime *string `json:"retentionTime,omitempty"`
- // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task.
- UserIdentity *UserIdentity `json:"userIdentity,omitempty"`
-}
-
-// JobReleaseTaskExecutionInformation ...
-type JobReleaseTaskExecutionInformation struct {
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - This property is set only if the task is in the Completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
- // State - running - the task is currently running (including retrying). completed - the task has exited, or the Batch service was unable to start the task due to scheduling errors. Possible values include: 'JobReleaseTaskStateRunning', 'JobReleaseTaskStateCompleted'
- State JobReleaseTaskState `json:"state,omitempty"`
- TaskRootDirectory *string `json:"taskRootDirectory,omitempty"`
- TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"`
- // ExitCode - This parameter is returned only if the task is in the completed state. The exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. Note that the exit code may also be generated by the compute node operating system, such as when a process is forcibly terminated.
- ExitCode *int32 `json:"exitCode,omitempty"`
- SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"`
-}
-
-// JobScheduleAddParameter ...
-type JobScheduleAddParameter struct {
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The id is case-preserving and case-insensitive (that is, you may not have two ids within an account that differ only by case).
- ID *string `json:"id,omitempty"`
- // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- Schedule *Schedule `json:"schedule,omitempty"`
- JobSpecification *JobSpecification `json:"jobSpecification,omitempty"`
- // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// JobScheduleExecutionInformation ...
-type JobScheduleExecutionInformation struct {
- // NextRunTime - This property is meaningful only if the schedule is in the active state when the time comes around. For example, if the schedule is disabled, no job will be created at nextRunTime unless the job is enabled before then.
- NextRunTime *date.Time `json:"nextRunTime,omitempty"`
- // RecentJob - This property is present only if the at least one job has run under the schedule.
- RecentJob *RecentJob `json:"recentJob,omitempty"`
- // EndTime - This property is set only if the job schedule is in the completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
-}
-
-// JobSchedulePatchParameter ...
-type JobSchedulePatchParameter struct {
- // Schedule - If you do not specify this element, the existing schedule is left unchanged.
- Schedule *Schedule `json:"schedule,omitempty"`
- // JobSpecification - Updates affect only jobs that are started after the update has taken place. Any currently active job continues with the older specification.
- JobSpecification *JobSpecification `json:"jobSpecification,omitempty"`
- // Metadata - If you do not specify this element, existing metadata is left unchanged.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// JobScheduleStatistics ...
-type JobScheduleStatistics struct {
- URL *string `json:"url,omitempty"`
- StartTime *date.Time `json:"startTime,omitempty"`
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- UserCPUTime *string `json:"userCPUTime,omitempty"`
- KernelCPUTime *string `json:"kernelCPUTime,omitempty"`
- // WallClockTime - The wall clock time is the elapsed time from when the task started running on a compute node to when it finished (or to the last time the statistics were updated, if the task had not finished by then). If a task was retried, this includes the wall clock time of all the task retries.
- WallClockTime *string `json:"wallClockTime,omitempty"`
- ReadIOps *int64 `json:"readIOps,omitempty"`
- WriteIOps *int64 `json:"writeIOps,omitempty"`
- ReadIOGiB *float64 `json:"readIOGiB,omitempty"`
- WriteIOGiB *float64 `json:"writeIOGiB,omitempty"`
- NumSucceededTasks *int64 `json:"numSucceededTasks,omitempty"`
- NumFailedTasks *int64 `json:"numFailedTasks,omitempty"`
- NumTaskRetries *int64 `json:"numTaskRetries,omitempty"`
- // WaitTime - This value is only reported in the account lifetime statistics; it is not included in the job statistics.
- WaitTime *string `json:"waitTime,omitempty"`
-}
-
-// JobScheduleUpdateParameter ...
-type JobScheduleUpdateParameter struct {
- // Schedule - If you do not specify this element, it is equivalent to passing the default schedule: that is, a single job scheduled to run immediately.
- Schedule *Schedule `json:"schedule,omitempty"`
- // JobSpecification - Updates affect only jobs that are started after the update has taken place. Any currently active job continues with the older specification.
- JobSpecification *JobSpecification `json:"jobSpecification,omitempty"`
- // Metadata - If you do not specify this element, it takes the default value of an empty list; in effect, any existing metadata is deleted.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// JobSchedulingError ...
-type JobSchedulingError struct {
- // Category - Possible values include: 'SchedulingErrorCategoryUserError', 'SchedulingErrorCategoryServerError', 'SchedulingErrorCategoryUnmapped'
- Category SchedulingErrorCategory `json:"category,omitempty"`
- Code *string `json:"code,omitempty"`
- Message *string `json:"message,omitempty"`
- Details *[]NameValuePair `json:"details,omitempty"`
-}
-
-// JobSpecification ...
-type JobSpecification struct {
- // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0. This priority is used as the default for all jobs under the job schedule. You can update a job's priority after it has been created using by using the update job API.
- Priority *int32 `json:"priority,omitempty"`
- // DisplayName - The name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"`
- // OnAllTasksComplete - Note that if a job contains no tasks, then all tasks are considered complete. This option is therefore most commonly used with a Job Manager task; if you want to use automatic job termination without a Job Manager, you should initially set onAllTasksComplete to noAction and update the job properties to set onAllTasksComplete to terminateJob once you have finished adding tasks. The default is noAction. Possible values include: 'NoAction', 'TerminateJob'
- OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"`
- // OnTaskFailure - The default is noAction. Possible values include: 'OnTaskFailureNoAction', 'OnTaskFailurePerformExitOptionsJobAction'
- OnTaskFailure OnTaskFailure `json:"onTaskFailure,omitempty"`
- Constraints *JobConstraints `json:"constraints,omitempty"`
- // JobManagerTask - If the job does not specify a Job Manager task, the user must explicitly add tasks to the job using the Task API. If the job does specify a Job Manager task, the Batch service creates the Job Manager task when the job is created, and will try to schedule the Job Manager task before scheduling other tasks in the job.
- JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"`
- // JobPreparationTask - If a job has a Job Preparation task, the Batch service will run the Job Preparation task on a compute node before starting any tasks of that job on that compute node.
- JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"`
- // JobReleaseTask - The primary purpose of the Job Release task is to undo changes to compute nodes made by the Job Preparation task. Example activities include deleting local files, or shutting down services that were started as part of job preparation. A Job Release task cannot be specified without also specifying a Job Preparation task for the job. The Batch service runs the Job Release task on the compute nodes that have run the Job Preparation task.
- JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"`
- // CommonEnvironmentSettings - Individual tasks can override an environment setting specified here by specifying the same setting name with a different value.
- CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"`
- PoolInfo *PoolInformation `json:"poolInfo,omitempty"`
- // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// JobStatistics ...
-type JobStatistics struct {
- autorest.Response `json:"-"`
- URL *string `json:"url,omitempty"`
- StartTime *date.Time `json:"startTime,omitempty"`
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- UserCPUTime *string `json:"userCPUTime,omitempty"`
- KernelCPUTime *string `json:"kernelCPUTime,omitempty"`
- WallClockTime *string `json:"wallClockTime,omitempty"`
- ReadIOps *int64 `json:"readIOps,omitempty"`
- WriteIOps *int64 `json:"writeIOps,omitempty"`
- ReadIOGiB *float64 `json:"readIOGiB,omitempty"`
- WriteIOGiB *float64 `json:"writeIOGiB,omitempty"`
- // NumSucceededTasks - A task completes successfully if it returns exit code 0.
- NumSucceededTasks *int64 `json:"numSucceededTasks,omitempty"`
- // NumFailedTasks - A task fails if it exhausts its maximum retry count without returning exit code 0.
- NumFailedTasks *int64 `json:"numFailedTasks,omitempty"`
- NumTaskRetries *int64 `json:"numTaskRetries,omitempty"`
- // WaitTime - The wait time for a task is defined as the elapsed time between the creation of the task and the start of task execution. (If the task is retried due to failures, the wait time is the time to the most recent task execution.) This value is only reported in the account lifetime statistics; it is not included in the job statistics.
- WaitTime *string `json:"waitTime,omitempty"`
-}
-
-// JobTerminateParameter ...
-type JobTerminateParameter struct {
- TerminateReason *string `json:"terminateReason,omitempty"`
-}
-
-// JobUpdateParameter ...
-type JobUpdateParameter struct {
- // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. If omitted, it is set to the default value 0.
- Priority *int32 `json:"priority,omitempty"`
- // Constraints - If omitted, the constraints are cleared.
- Constraints *JobConstraints `json:"constraints,omitempty"`
- // PoolInfo - You may change the pool for a job only when the job is disabled. The Update Job call will fail if you include the poolInfo element and the job is not disabled. If you specify an autoPoolSpecification specification in the poolInfo, only the keepAlive property can be updated, and then only if the auto pool has a poolLifetimeOption of job.
- PoolInfo *PoolInformation `json:"poolInfo,omitempty"`
- // Metadata - If omitted, it takes the default value of an empty list; in effect, any existing metadata is deleted.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
- // OnAllTasksComplete - If omitted, the completion behavior is set to noAction. If the current value is terminateJob, this is an error because a job's completion behavior may not be changed from terminateJob to noAction. Possible values include: 'NoAction', 'TerminateJob'
- OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"`
-}
-
-// MetadataItem the Batch service does not assign any meaning to this metadata; it is solely for the use of user
-// code.
-type MetadataItem struct {
- Name *string `json:"name,omitempty"`
- Value *string `json:"value,omitempty"`
-}
-
-// MultiInstanceSettings multi-instance tasks are commonly used to support MPI tasks.
-type MultiInstanceSettings struct {
- NumberOfInstances *int32 `json:"numberOfInstances,omitempty"`
- // CoordinationCommandLine - A typical coordination command line launches a background service and verifies that the service is ready to process inter-node messages.
- CoordinationCommandLine *string `json:"coordinationCommandLine,omitempty"`
- // CommonResourceFiles - The difference between common resource files and task resource files is that common resource files are downloaded for all subtasks including the primary, whereas task resource files are downloaded only for the primary.
- CommonResourceFiles *[]ResourceFile `json:"commonResourceFiles,omitempty"`
-}
-
-// NameValuePair ...
-type NameValuePair struct {
- Name *string `json:"name,omitempty"`
- Value *string `json:"value,omitempty"`
-}
-
-// NetworkConfiguration the network configuration for a pool.
-type NetworkConfiguration struct {
- // SubnetID - The virtual network must be in the same region and subscription as the Azure Batch account. The specified subnet should have enough free IP addresses to accommodate the number of nodes in the pool. If the subnet doesn't have enough free IP addresses, the pool will partially allocate compute nodes, and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to be able to schedule tasks on the compute nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the compute nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the compute nodes to unusable. This property can only be specified for pools created with a cloudServiceConfiguration.
- SubnetID *string `json:"subnetId,omitempty"`
-}
-
-// NodeAgentSku the Batch node agent is a program that runs on each node in the pool, and provides the
-// command-and-control interface between the node and the Batch service. There are different implementations of the
-// node agent, known as SKUs, for different operating systems.
-type NodeAgentSku struct {
- ID *string `json:"id,omitempty"`
- // VerifiedImageReferences - This collection is not exhaustive (the node agent may be compatible with other images).
- VerifiedImageReferences *[]ImageReference `json:"verifiedImageReferences,omitempty"`
- // OsType - Possible values include: 'OSTypeLinux', 'OSTypeWindows', 'OSTypeUnmapped'
- OsType OSType `json:"osType,omitempty"`
-}
-
-// NodeDisableSchedulingParameter ...
-type NodeDisableSchedulingParameter struct {
- // NodeDisableSchedulingOption - The default value is requeue. Possible values include: 'DisableComputeNodeSchedulingOptionRequeue', 'DisableComputeNodeSchedulingOptionTerminate', 'DisableComputeNodeSchedulingOptionTaskCompletion'
- NodeDisableSchedulingOption DisableComputeNodeSchedulingOption `json:"nodeDisableSchedulingOption,omitempty"`
-}
-
-// NodeFile ...
-type NodeFile struct {
- Name *string `json:"name,omitempty"`
- URL *string `json:"url,omitempty"`
- IsDirectory *bool `json:"isDirectory,omitempty"`
- Properties *FileProperties `json:"properties,omitempty"`
-}
-
-// NodeFileListResult ...
-type NodeFileListResult struct {
- autorest.Response `json:"-"`
- Value *[]NodeFile `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// NodeFileListResultIterator provides access to a complete listing of NodeFile values.
-type NodeFileListResultIterator struct {
- i int
- page NodeFileListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *NodeFileListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter NodeFileListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter NodeFileListResultIterator) Response() NodeFileListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter NodeFileListResultIterator) Value() NodeFile {
- if !iter.page.NotDone() {
- return NodeFile{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (nflr NodeFileListResult) IsEmpty() bool {
- return nflr.Value == nil || len(*nflr.Value) == 0
-}
-
-// nodeFileListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (nflr NodeFileListResult) nodeFileListResultPreparer() (*http.Request, error) {
- if nflr.OdataNextLink == nil || len(to.String(nflr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(nflr.OdataNextLink)))
-}
-
-// NodeFileListResultPage contains a page of NodeFile values.
-type NodeFileListResultPage struct {
- fn func(NodeFileListResult) (NodeFileListResult, error)
- nflr NodeFileListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *NodeFileListResultPage) Next() error {
- next, err := page.fn(page.nflr)
- if err != nil {
- return err
- }
- page.nflr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page NodeFileListResultPage) NotDone() bool {
- return !page.nflr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page NodeFileListResultPage) Response() NodeFileListResult {
- return page.nflr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page NodeFileListResultPage) Values() []NodeFile {
- if page.nflr.IsEmpty() {
- return nil
- }
- return *page.nflr.Value
-}
-
-// NodeRebootParameter ...
-type NodeRebootParameter struct {
- // NodeRebootOption - The default value is requeue. Possible values include: 'ComputeNodeRebootOptionRequeue', 'ComputeNodeRebootOptionTerminate', 'ComputeNodeRebootOptionTaskCompletion', 'ComputeNodeRebootOptionRetainedData'
- NodeRebootOption ComputeNodeRebootOption `json:"nodeRebootOption,omitempty"`
-}
-
-// NodeReimageParameter ...
-type NodeReimageParameter struct {
- // NodeReimageOption - The default value is requeue. Possible values include: 'ComputeNodeReimageOptionRequeue', 'ComputeNodeReimageOptionTerminate', 'ComputeNodeReimageOptionTaskCompletion', 'ComputeNodeReimageOptionRetainedData'
- NodeReimageOption ComputeNodeReimageOption `json:"nodeReimageOption,omitempty"`
-}
-
-// NodeRemoveParameter ...
-type NodeRemoveParameter struct {
- NodeList *[]string `json:"nodeList,omitempty"`
- // ResizeTimeout - The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- ResizeTimeout *string `json:"resizeTimeout,omitempty"`
- // NodeDeallocationOption - The default value is requeue. Possible values include: 'Requeue', 'Terminate', 'TaskCompletion', 'RetainedData'
- NodeDeallocationOption ComputeNodeDeallocationOption `json:"nodeDeallocationOption,omitempty"`
-}
-
-// NodeUpdateUserParameter ...
-type NodeUpdateUserParameter struct {
- // Password - The password is required for Windows nodes (those created with 'cloudServiceConfiguration', or created with 'virtualMachineConfiguration' using a Windows image reference). For Linux compute nodes, the password can optionally be specified along with the sshPublicKey property. If omitted, any existing password is removed.
- Password *string `json:"password,omitempty"`
- // ExpiryTime - If omitted, the default is 1 day from the current time. For Linux compute nodes, the expiryTime has a precision up to a day.
- ExpiryTime *date.Time `json:"expiryTime,omitempty"`
- // SSHPublicKey - The public key should be compatible with OpenSSH encoding and should be base 64 encoded. This property can be specified only for Linux nodes. If this is specified for a Windows node, then the Batch service rejects the request; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). If omitted, any existing SSH public key is removed.
- SSHPublicKey *string `json:"sshPublicKey,omitempty"`
-}
-
-// OSDisk ...
-type OSDisk struct {
- // ImageUris - All the VHDs must be identical and must reside in an Azure Storage account within the same subscription and same region as the Batch account. For best performance, it is recommended that each VHD resides in a separate Azure Storage account. Each VHD can serve upto 20 Windows compute nodes or 40 Linux compute nodes. You must supply enough VHD URIs to satisfy the 'targetDedicated' property of the pool. If you do not supply enough VHD URIs, the pool will partially allocate compute nodes, and a resize error will occur.
- ImageUris *[]string `json:"imageUris,omitempty"`
- // Caching - none - The caching mode for the disk is not enabled. readOnly - The caching mode for the disk is read only. readWrite - The caching mode for the disk is read and write. The default value for caching is none. For information about the caching options see: https://blogs.msdn.microsoft.com/windowsazurestorage/2012/06/27/exploring-windows-azure-drives-disks-and-images/. Possible values include: 'None', 'ReadOnly', 'ReadWrite'
- Caching CachingType `json:"caching,omitempty"`
-}
-
-// PoolAddParameter ...
-type PoolAddParameter struct {
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two pool IDs within an account that differ only by case).
- ID *string `json:"id,omitempty"`
- // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series).
- VMSize *string `json:"vmSize,omitempty"`
- // CloudServiceConfiguration - This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. This property cannot be specified if the Batch account was created with its poolAllocationMode property set to 'UserSubscription'.
- CloudServiceConfiguration *CloudServiceConfiguration `json:"cloudServiceConfiguration,omitempty"`
- // VirtualMachineConfiguration - This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified.
- VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"`
- // ResizeTimeout - This timeout applies only to manual scaling; it has no effect when enableAutoScale is set to true. The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- ResizeTimeout *string `json:"resizeTimeout,omitempty"`
- // TargetDedicated - This property must have the default value if enableAutoScale is true. It is required if enableAutoScale is false.
- TargetDedicated *int32 `json:"targetDedicated,omitempty"`
- // EnableAutoScale - If true, the autoScaleFormula property must be set. If false, the targetDedicated property must be set. The default value is false.
- EnableAutoScale *bool `json:"enableAutoScale,omitempty"`
- // AutoScaleFormula - This property must not be specified if enableAutoScale is set to false. It is required if enableAutoScale is set to true. The formula is checked for validity before the pool is created. If the formula is not valid, the Batch service rejects the request with detailed error information. For more information about specifying this formula, see 'Automatically scale compute nodes in an Azure Batch pool' (https://azure.microsoft.com/documentation/articles/batch-automatic-scaling/).
- AutoScaleFormula *string `json:"autoScaleFormula,omitempty"`
- // AutoScaleEvaluationInterval - The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"`
- // EnableInterNodeCommunication - Enabling inter-node communication limits the maximum size of the pool due to deployment restrictions on the nodes of the pool. This may result in the pool not reaching its desired size. The default value is false.
- EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"`
- NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"`
- // StartTask - The task runs when the node is added to the pool or when the node is restarted.
- StartTask *StartTask `json:"startTask,omitempty"`
- // CertificateReferences - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- // ApplicationPackageReferences - This property is currently not supported on pools created using the virtualMachineConfiguration (IaaS) property.
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // MaxTasksPerNode - The default value is 1. The maximum value of this setting depends on the size of the compute nodes in the pool (the vmSize setting).
- MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"`
- TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"`
- UserAccounts *[]UserAccount `json:"userAccounts,omitempty"`
- // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// PoolEnableAutoScaleParameter ...
-type PoolEnableAutoScaleParameter struct {
- // AutoScaleFormula - The formula is checked for validity before it is applied to the pool. If the formula is not valid, the Batch service rejects the request with detailed error information. For more information about specifying this formula, see Automatically scale compute nodes in an Azure Batch pool (https://azure.microsoft.com/en-us/documentation/articles/batch-automatic-scaling).
- AutoScaleFormula *string `json:"autoScaleFormula,omitempty"`
- // AutoScaleEvaluationInterval - The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service rejects the request with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). If you specify a new interval, then the existing autoscale evaluation schedule will be stopped and a new autoscale evaluation schedule will be started, with its starting time being the time when this request was issued.
- AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"`
-}
-
-// PoolEvaluateAutoScaleParameter ...
-type PoolEvaluateAutoScaleParameter struct {
- // AutoScaleFormula - The formula is validated and its results calculated, but it is not applied to the pool. To apply the formula to the pool, 'Enable automatic scaling on a pool'. For more information about specifying this formula, see Automatically scale compute nodes in an Azure Batch pool (https://azure.microsoft.com/en-us/documentation/articles/batch-automatic-scaling).
- AutoScaleFormula *string `json:"autoScaleFormula,omitempty"`
-}
-
-// PoolInformation ...
-type PoolInformation struct {
- // PoolID - You must ensure that the pool referenced by this property exists. If the pool does not exist at the time the Batch service tries to schedule a job, no tasks for the job will run until you create a pool with that id. Note that the Batch service will not reject the job request; it will simply not run tasks until the pool exists. You must specify either the pool ID or the auto pool specification, but not both.
- PoolID *string `json:"poolId,omitempty"`
- // AutoPoolSpecification - If auto pool creation fails, the Batch service moves the job to a completed state, and the pool creation error is set in the job's scheduling error property. The Batch service manages the lifetime (both creation and, unless keepAlive is specified, deletion) of the auto pool. Any user actions that affect the lifetime of the auto pool while the job is active will result in unexpected behavior. You must specify either the pool ID or the auto pool specification, but not both.
- AutoPoolSpecification *AutoPoolSpecification `json:"autoPoolSpecification,omitempty"`
-}
-
-// PoolListUsageMetricsResult ...
-type PoolListUsageMetricsResult struct {
- autorest.Response `json:"-"`
- Value *[]PoolUsageMetrics `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// PoolListUsageMetricsResultIterator provides access to a complete listing of PoolUsageMetrics values.
-type PoolListUsageMetricsResultIterator struct {
- i int
- page PoolListUsageMetricsResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *PoolListUsageMetricsResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter PoolListUsageMetricsResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter PoolListUsageMetricsResultIterator) Response() PoolListUsageMetricsResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter PoolListUsageMetricsResultIterator) Value() PoolUsageMetrics {
- if !iter.page.NotDone() {
- return PoolUsageMetrics{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (plumr PoolListUsageMetricsResult) IsEmpty() bool {
- return plumr.Value == nil || len(*plumr.Value) == 0
-}
-
-// poolListUsageMetricsResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (plumr PoolListUsageMetricsResult) poolListUsageMetricsResultPreparer() (*http.Request, error) {
- if plumr.OdataNextLink == nil || len(to.String(plumr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(plumr.OdataNextLink)))
-}
-
-// PoolListUsageMetricsResultPage contains a page of PoolUsageMetrics values.
-type PoolListUsageMetricsResultPage struct {
- fn func(PoolListUsageMetricsResult) (PoolListUsageMetricsResult, error)
- plumr PoolListUsageMetricsResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *PoolListUsageMetricsResultPage) Next() error {
- next, err := page.fn(page.plumr)
- if err != nil {
- return err
- }
- page.plumr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page PoolListUsageMetricsResultPage) NotDone() bool {
- return !page.plumr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page PoolListUsageMetricsResultPage) Response() PoolListUsageMetricsResult {
- return page.plumr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page PoolListUsageMetricsResultPage) Values() []PoolUsageMetrics {
- if page.plumr.IsEmpty() {
- return nil
- }
- return *page.plumr.Value
-}
-
-// PoolPatchParameter ...
-type PoolPatchParameter struct {
- // StartTask - If omitted, any existing start task is left unchanged.
- StartTask *StartTask `json:"startTask,omitempty"`
- // CertificateReferences - If omitted, any existing certificate references are left unchanged. For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- // ApplicationPackageReferences - Changes to application package references affect all new compute nodes joining the pool, but do not affect compute nodes that are already in the pool until they are rebooted or reimaged. If this element is present, it replaces any existing application package references. If you specify an empty collection, then all application package references are removed from the pool. If omitted, any existing application package references are left unchanged.
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // Metadata - If this element is present, it replaces any existing metadata configured on the pool. If you specify an empty collection, any metadata is removed from the pool. If omitted, any existing metadata is left unchanged.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// PoolResizeParameter ...
-type PoolResizeParameter struct {
- TargetDedicated *int32 `json:"targetDedicated,omitempty"`
- // ResizeTimeout - The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- ResizeTimeout *string `json:"resizeTimeout,omitempty"`
- // NodeDeallocationOption - The default value is requeue. Possible values include: 'Requeue', 'Terminate', 'TaskCompletion', 'RetainedData'
- NodeDeallocationOption ComputeNodeDeallocationOption `json:"nodeDeallocationOption,omitempty"`
-}
-
-// PoolSpecification ...
-type PoolSpecification struct {
- // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series).
- VMSize *string `json:"vmSize,omitempty"`
- // CloudServiceConfiguration - This property must be specified if the pool needs to be created with Azure PaaS VMs. This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. If neither is specified then the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). This property cannot be specified if the Batch account was created with its poolAllocationMode property set to 'UserSubscription'.
- CloudServiceConfiguration *CloudServiceConfiguration `json:"cloudServiceConfiguration,omitempty"`
- // VirtualMachineConfiguration - This property must be specified if the pool needs to be created with Azure IaaS VMs. This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified. If neither is specified then the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"`
- // MaxTasksPerNode - The default value is 1. The maximum value of this setting depends on the size of the compute nodes in the pool (the vmSize setting).
- MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"`
- // TaskSchedulingPolicy - How tasks are distributed among compute nodes in the pool.
- TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"`
- // ResizeTimeout - This timeout applies only to manual scaling; it has no effect when enableAutoScale is set to true. The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service rejects the request with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- ResizeTimeout *string `json:"resizeTimeout,omitempty"`
- // TargetDedicated - This property must not be specified if enableAutoScale is set to true. It is required if enableAutoScale is set to false.
- TargetDedicated *int32 `json:"targetDedicated,omitempty"`
- // EnableAutoScale - If false, the targetDedicated element is required. If true, the autoScaleFormula element is required. The pool automatically resizes according to the formula. The default value is false.
- EnableAutoScale *bool `json:"enableAutoScale,omitempty"`
- // AutoScaleFormula - This property must not be specified if enableAutoScale is set to false. It is required if enableAutoScale is set to true. The formula is checked for validity before the pool is created. If the formula is not valid, the Batch service rejects the request with detailed error information.
- AutoScaleFormula *string `json:"autoScaleFormula,omitempty"`
- // AutoScaleEvaluationInterval - The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service rejects the request with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"`
- // EnableInterNodeCommunication - Enabling inter-node communication limits the maximum size of the pool due to deployment restrictions on the nodes of the pool. This may result in the pool not reaching its desired size. The default value is false.
- EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"`
- NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"`
- StartTask *StartTask `json:"startTask,omitempty"`
- // CertificateReferences - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- // ApplicationPackageReferences - This property is currently not supported on auto pools created with the virtualMachineConfiguration (IaaS) property.
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- UserAccounts *[]UserAccount `json:"userAccounts,omitempty"`
- // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// PoolStatistics ...
-type PoolStatistics struct {
- autorest.Response `json:"-"`
- URL *string `json:"url,omitempty"`
- StartTime *date.Time `json:"startTime,omitempty"`
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- UsageStats *UsageStatistics `json:"usageStats,omitempty"`
- ResourceStats *ResourceStatistics `json:"resourceStats,omitempty"`
-}
-
-// PoolUpdatePropertiesParameter ...
-type PoolUpdatePropertiesParameter struct {
- // StartTask - If this element is present, it overwrites any existing start task. If omitted, any existing start task is removed from the pool.
- StartTask *StartTask `json:"startTask,omitempty"`
- // CertificateReferences - If you specify an empty collection, any existing certificate references are removed from the pool. For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- // ApplicationPackageReferences - Changes to application package references affect all new compute nodes joining the pool, but do not affect compute nodes that are already in the pool until they are rebooted or reimaged. The list replaces any existing application package references. If omitted, or if you specify an empty collection, any existing application packages references are removed from the pool.
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // Metadata - This list replaces any existing metadata configured on the pool. If omitted, or if you specify an empty collection, any existing metadata is removed from the pool.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// PoolUpgradeOSParameter ...
-type PoolUpgradeOSParameter struct {
- TargetOSVersion *string `json:"targetOSVersion,omitempty"`
-}
-
-// PoolUsageMetrics ...
-type PoolUsageMetrics struct {
- PoolID *string `json:"poolId,omitempty"`
- StartTime *date.Time `json:"startTime,omitempty"`
- EndTime *date.Time `json:"endTime,omitempty"`
- // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series).
- VMSize *string `json:"vmSize,omitempty"`
- TotalCoreHours *float64 `json:"totalCoreHours,omitempty"`
- DataIngressGiB *float64 `json:"dataIngressGiB,omitempty"`
- DataEgressGiB *float64 `json:"dataEgressGiB,omitempty"`
-}
-
-// ReadCloser ...
-type ReadCloser struct {
- autorest.Response `json:"-"`
- Value *io.ReadCloser `json:"value,omitempty"`
-}
-
-// RecentJob ...
-type RecentJob struct {
- ID *string `json:"id,omitempty"`
- URL *string `json:"url,omitempty"`
-}
-
-// ResizeError ...
-type ResizeError struct {
- Code *string `json:"code,omitempty"`
- Message *string `json:"message,omitempty"`
- Values *[]NameValuePair `json:"values,omitempty"`
-}
-
-// ResourceFile ...
-type ResourceFile struct {
- // BlobSource - This URL must be readable using anonymous access; that is, the Batch service does not present any credentials when downloading the blob. There are two ways to get such a URL for a blob in Azure storage: include a Shared Access Signature (SAS) granting read permissions on the blob, or set the ACL for the blob or its container to allow public access.
- BlobSource *string `json:"blobSource,omitempty"`
- FilePath *string `json:"filePath,omitempty"`
- // FileMode - This property applies only to files being downloaded to Linux compute nodes. It will be ignored if it is specified for a resourceFile which will be downloaded to a Windows node. If this property is not specified for a Linux node, then a default value of 0770 is applied to the file.
- FileMode *string `json:"fileMode,omitempty"`
-}
-
-// ResourceStatistics ...
-type ResourceStatistics struct {
- StartTime *date.Time `json:"startTime,omitempty"`
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- AvgCPUPercentage *float64 `json:"avgCPUPercentage,omitempty"`
- AvgMemoryGiB *float64 `json:"avgMemoryGiB,omitempty"`
- PeakMemoryGiB *float64 `json:"peakMemoryGiB,omitempty"`
- AvgDiskGiB *float64 `json:"avgDiskGiB,omitempty"`
- PeakDiskGiB *float64 `json:"peakDiskGiB,omitempty"`
- DiskReadIOps *int64 `json:"diskReadIOps,omitempty"`
- DiskWriteIOps *int64 `json:"diskWriteIOps,omitempty"`
- DiskReadGiB *float64 `json:"diskReadGiB,omitempty"`
- DiskWriteGiB *float64 `json:"diskWriteGiB,omitempty"`
- NetworkReadGiB *float64 `json:"networkReadGiB,omitempty"`
- NetworkWriteGiB *float64 `json:"networkWriteGiB,omitempty"`
-}
-
-// Schedule ...
-type Schedule struct {
- // DoNotRunUntil - If you do not specify a doNotRunUntil time, the schedule becomes ready to create jobs immediately.
- DoNotRunUntil *date.Time `json:"doNotRunUntil,omitempty"`
- // DoNotRunAfter - If you do not specify a doNotRunAfter time, and you are creating a recurring job schedule, the job schedule will remain active until you explicitly terminate it.
- DoNotRunAfter *date.Time `json:"doNotRunAfter,omitempty"`
- // StartWindow - If a job is not created within the startWindow interval, then the 'opportunity' is lost; no job will be created until the next recurrence of the schedule. If the schedule is recurring, and the startWindow is longer than the recurrence interval, then this is equivalent to an infinite startWindow, because the job that is 'due' in one recurrenceInterval is not carried forward into the next recurrence interval. The default is infinite. The minimum value is 1 minute. If you specify a lower value, the Batch service rejects the schedule with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- StartWindow *string `json:"startWindow,omitempty"`
- // RecurrenceInterval - Because a job schedule can have at most one active job under it at any given time, if it is time to create a new job under a job schedule, but the previous job is still running, the Batch service will not create the new job until the previous job finishes. If the previous job does not finish within the startWindow period of the new recurrenceInterval, then no new job will be scheduled for that interval. For recurring jobs, you should normally specify a jobManagerTask in the jobSpecification. If you do not use jobManagerTask, you will need an external process to monitor when jobs are created, add tasks to the jobs and terminate the jobs ready for the next recurrence. The default is that the schedule does not recur: one job is created, within the startWindow after the doNotRunUntil time, and the schedule is complete as soon as that job finishes. The minimum value is 1 minute. If you specify a lower value, the Batch service rejects the schedule with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- RecurrenceInterval *string `json:"recurrenceInterval,omitempty"`
-}
-
-// StartTask ...
-type StartTask struct {
- // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux.
- CommandLine *string `json:"commandLine,omitempty"`
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task.
- UserIdentity *UserIdentity `json:"userIdentity,omitempty"`
- // MaxTaskRetryCount - The Batch service retries a task if its exit code is nonzero. Note that this value specifically controls the number of retries. The Batch service will try the task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the task. If the maximum retry count is -1, the Batch service retries the task without limit.
- MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"`
- // WaitForSuccess - If true and the start task fails on a compute node, the Batch service retries the start task up to its maximum retry count (maxTaskRetryCount). If the task has still not completed successfully after all retries, then the Batch service marks the compute node unusable, and will not schedule tasks to it. This condition can be detected via the node state and scheduling error detail. If false, the Batch service will not wait for the start task to complete. In this case, other tasks can start executing on the compute node while the start task is still running; and even if the start task fails, new tasks will continue to be scheduled on the node. The default is false.
- WaitForSuccess *bool `json:"waitForSuccess,omitempty"`
-}
-
-// StartTaskInformation ...
-type StartTaskInformation struct {
- // State - running - The start task is currently running. completed - The start task has exited with exit code 0, or the start task has failed and the retry limit has reached, or the start task process did not run due to scheduling errors. Possible values include: 'StartTaskStateRunning', 'StartTaskStateCompleted'
- State StartTaskState `json:"state,omitempty"`
- // StartTime - This value is reset every time the task is restarted or retried (that is, this is the most recent time at which the start task started running).
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - This is the end time of the most recent run of the start task, if that run has completed (even if that run failed and a retry is pending). This element is not present if the start task is currently running.
- EndTime *date.Time `json:"endTime,omitempty"`
- // ExitCode - This property is set only if the start task is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the start task (due to timeout, or user termination via the API) you may see an operating system-defined exit code.
- ExitCode *int32 `json:"exitCode,omitempty"`
- SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"`
- // RetryCount - The task is retried if it exits with a nonzero exit code, up to the specified MaxTaskRetryCount.
- RetryCount *int32 `json:"retryCount,omitempty"`
- // LastRetryTime - This element is present only if the task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the task has been restarted for reasons other than retry; for example, if the compute node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not.
- LastRetryTime *date.Time `json:"lastRetryTime,omitempty"`
-}
-
-// SubtaskInformation ...
-type SubtaskInformation struct {
- ID *int32 `json:"id,omitempty"`
- NodeInfo *ComputeNodeInformation `json:"nodeInfo,omitempty"`
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - This property is set only if the subtask is in the Completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
- // ExitCode - This property is set only if the subtask is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the subtask (due to timeout, or user termination via the API) you may see an operating system-defined exit code.
- ExitCode *int32 `json:"exitCode,omitempty"`
- SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"`
- // State - Possible values include: 'SubtaskStatePreparing', 'SubtaskStateRunning', 'SubtaskStateCompleted'
- State SubtaskState `json:"state,omitempty"`
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // PreviousState - This property is not set if the subtask is in its initial running state. Possible values include: 'SubtaskStatePreparing', 'SubtaskStateRunning', 'SubtaskStateCompleted'
- PreviousState SubtaskState `json:"previousState,omitempty"`
- // PreviousStateTransitionTime - This property is not set if the subtask is in its initial running state.
- PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"`
-}
-
-// TaskAddCollectionParameter ...
-type TaskAddCollectionParameter struct {
- Value *[]TaskAddParameter `json:"value,omitempty"`
-}
-
-// TaskAddCollectionResult ...
-type TaskAddCollectionResult struct {
- autorest.Response `json:"-"`
- Value *[]TaskAddResult `json:"value,omitempty"`
-}
-
-// TaskAddParameter ...
-type TaskAddParameter struct {
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within a job that differ only by case).
- ID *string `json:"id,omitempty"`
- // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- // CommandLine - For multi-instance tasks, the command line is executed as the primary task, after the primary task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux.
- CommandLine *string `json:"commandLine,omitempty"`
- // ExitConditions - How the Batch service should respond when the task completes.
- ExitConditions *ExitConditions `json:"exitConditions,omitempty"`
- // ResourceFiles - For multi-instance tasks, the resource files will only be downloaded to the compute node on which the primary task is executed.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- AffinityInfo *AffinityInformation `json:"affinityInfo,omitempty"`
- // Constraints - If you do not specify constraints, the maxTaskRetryCount is the maxTaskRetryCount specified for the job, and the maxWallClockTime and retentionTime are infinite.
- Constraints *TaskConstraints `json:"constraints,omitempty"`
- // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task.
- UserIdentity *UserIdentity `json:"userIdentity,omitempty"`
- MultiInstanceSettings *MultiInstanceSettings `json:"multiInstanceSettings,omitempty"`
- // DependsOn - This task will not be scheduled until all tasks that it depends on have completed successfully. If any of those tasks fail and exhaust their retry counts, this task will never be scheduled. If the job does not have usesTaskDependencies set to true, and this element is present, the request fails with error code TaskDependenciesNotSpecifiedOnJob.
- DependsOn *TaskDependencies `json:"dependsOn,omitempty"`
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // AuthenticationTokenSettings - If this property is set, the Batch service provides the task with an authentication token which can be used to authenticate Batch service operations without requiring an account access key. The token is provided via the AZ_BATCH_AUTHENTICATION_TOKEN environment variable. The operations that the task can carry out using the token depend on the settings. For example, a task can request job permissions in order to add other tasks to the job, or check the status of the job or of other tasks under the job.
- AuthenticationTokenSettings *AuthenticationTokenSettings `json:"authenticationTokenSettings,omitempty"`
-}
-
-// TaskAddResult ...
-type TaskAddResult struct {
- // Status - Possible values include: 'TaskAddStatusSuccess', 'TaskAddStatusClientError', 'TaskAddStatusServerError', 'TaskAddStatusUnmapped'
- Status TaskAddStatus `json:"status,omitempty"`
- TaskID *string `json:"taskId,omitempty"`
- ETag *string `json:"eTag,omitempty"`
- LastModified *date.Time `json:"lastModified,omitempty"`
- Location *string `json:"location,omitempty"`
- Error *Error `json:"error,omitempty"`
-}
-
-// TaskConstraints ...
-type TaskConstraints struct {
- // MaxWallClockTime - If this is not specified, there is no time limit on how long the task may run.
- MaxWallClockTime *string `json:"maxWallClockTime,omitempty"`
- // RetentionTime - The default is infinite, i.e. the task directory will be retained until the compute node is removed or reimaged.
- RetentionTime *string `json:"retentionTime,omitempty"`
- // MaxTaskRetryCount - Note that this value specifically controls the number of retries. The Batch service will try the task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the task. If the maximum retry count is -1, the Batch service retries the task without limit.
- MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"`
-}
-
-// TaskDependencies ...
-type TaskDependencies struct {
- TaskIds *[]string `json:"taskIds,omitempty"`
- TaskIDRanges *[]TaskIDRange `json:"taskIdRanges,omitempty"`
-}
-
-// TaskExecutionInformation ...
-type TaskExecutionInformation struct {
- // StartTime - 'Running' corresponds to the running state, so if the task specifies resource files or application packages, then the start time reflects the time at which the task started downloading or deploying these. If the task has been restarted or retried, this is the most recent time at which the task started running. This property is present only for tasks that are in the running or completed state.
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - This property is set only if the task is in the Completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
- // ExitCode - This property is set only if the task is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the task (due to timeout, or user termination via the API) you may see an operating system-defined exit code.
- ExitCode *int32 `json:"exitCode,omitempty"`
- // SchedulingError - This property is set only if the task is in the completed state.
- SchedulingError *TaskSchedulingError `json:"schedulingError,omitempty"`
- // RetryCount - The task is retried if it exits with a nonzero exit code, up to the specified maxTaskRetryCount.
- RetryCount *int32 `json:"retryCount,omitempty"`
- // LastRetryTime - This element is present only if the task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the task has been restarted for reasons other than retry; for example, if the compute node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not.
- LastRetryTime *date.Time `json:"lastRetryTime,omitempty"`
- // RequeueCount - When the user removes nodes from a pool (by resizing/shrinking the pool) or when the job is being disabled, the user can specify that running tasks on the nodes be requeued for execution. This count tracks how many times the task has been requeued for these reasons.
- RequeueCount *int32 `json:"requeueCount,omitempty"`
- // LastRequeueTime - This property is set only if the requeueCount is nonzero.
- LastRequeueTime *date.Time `json:"lastRequeueTime,omitempty"`
-}
-
-// TaskIDRange the start and end of the range are inclusive. For example, if a range has start 9 and end 12, then
-// it represents tasks '9', '10', '11' and '12'.
-type TaskIDRange struct {
- Start *int32 `json:"start,omitempty"`
- End *int32 `json:"end,omitempty"`
-}
-
-// TaskInformation ...
-type TaskInformation struct {
- TaskURL *string `json:"taskUrl,omitempty"`
- JobID *string `json:"jobId,omitempty"`
- TaskID *string `json:"taskId,omitempty"`
- SubtaskID *int32 `json:"subtaskId,omitempty"`
- // TaskState - Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted'
- TaskState TaskState `json:"taskState,omitempty"`
- ExecutionInfo *TaskExecutionInformation `json:"executionInfo,omitempty"`
-}
-
-// TaskSchedulingError ...
-type TaskSchedulingError struct {
- // Category - Possible values include: 'SchedulingErrorCategoryUserError', 'SchedulingErrorCategoryServerError', 'SchedulingErrorCategoryUnmapped'
- Category SchedulingErrorCategory `json:"category,omitempty"`
- Code *string `json:"code,omitempty"`
- Message *string `json:"message,omitempty"`
- Details *[]NameValuePair `json:"details,omitempty"`
-}
-
-// TaskSchedulingPolicy ...
-type TaskSchedulingPolicy struct {
- // NodeFillType - Possible values include: 'ComputeNodeFillTypeSpread', 'ComputeNodeFillTypePack', 'ComputeNodeFillTypeUnmapped'
- NodeFillType ComputeNodeFillType `json:"nodeFillType,omitempty"`
-}
-
-// TaskStatistics ...
-type TaskStatistics struct {
- URL *string `json:"url,omitempty"`
- StartTime *date.Time `json:"startTime,omitempty"`
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- UserCPUTime *string `json:"userCPUTime,omitempty"`
- KernelCPUTime *string `json:"kernelCPUTime,omitempty"`
- // WallClockTime - The wall clock time is the elapsed time from when the task started running on a compute node to when it finished (or to the last time the statistics were updated, if the task had not finished by then). If the task was retried, this includes the wall clock time of all the task retries.
- WallClockTime *string `json:"wallClockTime,omitempty"`
- ReadIOps *int64 `json:"readIOps,omitempty"`
- WriteIOps *int64 `json:"writeIOps,omitempty"`
- ReadIOGiB *float64 `json:"readIOGiB,omitempty"`
- WriteIOGiB *float64 `json:"writeIOGiB,omitempty"`
- WaitTime *string `json:"waitTime,omitempty"`
-}
-
-// TaskUpdateParameter ...
-type TaskUpdateParameter struct {
- // Constraints - If omitted, the task is given the default constraints.
- Constraints *TaskConstraints `json:"constraints,omitempty"`
-}
-
-// UsageStatistics ...
-type UsageStatistics struct {
- StartTime *date.Time `json:"startTime,omitempty"`
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- DedicatedCoreTime *string `json:"dedicatedCoreTime,omitempty"`
-}
-
-// UserAccount ...
-type UserAccount struct {
- Name *string `json:"name,omitempty"`
- Password *string `json:"password,omitempty"`
- // ElevationLevel - nonAdmin - The auto user is a standard user without elevated access. admin - The auto user is a user with elevated access and operates with full Administrator permissions. The default value is nonAdmin. Possible values include: 'NonAdmin', 'Admin'
- ElevationLevel ElevationLevel `json:"elevationLevel,omitempty"`
- // SSHPrivateKey - The SSH private key establishes password-less SSH between nodes in a Linux pool when the pool's enableInterNodeCommunication property is true. This property will be ignored in a Windows pool.
- SSHPrivateKey *string `json:"sshPrivateKey,omitempty"`
-}
-
-// UserIdentity specify either the userName or autoUser property, but not both.
-type UserIdentity struct {
- // UserName - The userName and autoUser properties are mutually exclusive; you must specify one but not both.
- UserName *string `json:"username,omitempty"`
- // AutoUser - The userName and autoUser properties are mutually exclusive; you must specify one but not both.
- AutoUser *AutoUserSpecification `json:"autoUser,omitempty"`
-}
-
-// VirtualMachineConfiguration ...
-type VirtualMachineConfiguration struct {
- // ImageReference - This property and osDisk are mutually exclusive and one of the properties must be specified.
- ImageReference *ImageReference `json:"imageReference,omitempty"`
- // OsDisk - This property can be specified only if the Batch account was created with its poolAllocationMode property set to 'UserSubscription'. This property and imageReference are mutually exclusive and one of the properties must be specified.
- OsDisk *OSDisk `json:"osDisk,omitempty"`
- // NodeAgentSKUID - The Batch node agent is a program that runs on each node in the pool, and provides the command-and-control interface between the node and the Batch service. There are different implementations of the node agent, known as SKUs, for different operating systems. You must specify a node agent SKU which matches the selected image reference. To get the list of supported node agent SKUs along with their list of verified image references, see the 'List supported node agent SKUs' operation.
- NodeAgentSKUID *string `json:"nodeAgentSKUId,omitempty"`
- // WindowsConfiguration - This property must not be specified if the imageReference or osDisk property specifies a Linux OS image.
- WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"`
-}
-
-// WindowsConfiguration ...
-type WindowsConfiguration struct {
- // EnableAutomaticUpdates - If omitted, the default value is true.
- EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"`
-}
diff --git a/services/batch/2017-01-01.4.0/batch/pool.go b/services/batch/2017-01-01.4.0/batch/pool.go
deleted file mode 100644
index a43ed39b7eee..000000000000
--- a/services/batch/2017-01-01.4.0/batch/pool.go
+++ /dev/null
@@ -1,1878 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// PoolClient is the a client for issuing REST requests to the Azure Batch service.
-type PoolClient struct {
- BaseClient
-}
-
-// NewPoolClient creates an instance of the PoolClient client.
-func NewPoolClient() PoolClient {
- return NewPoolClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewPoolClientWithBaseURI creates an instance of the PoolClient client.
-func NewPoolClientWithBaseURI(baseURI string) PoolClient {
- return PoolClient{NewWithBaseURI(baseURI)}
-}
-
-// Add when naming pools, avoid including sensitive information such as user names or secret project names. This
-// information may appear in telemetry logs accessible to Microsoft Support engineers.
-//
-// pool is the pool to be added. timeout is the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a
-// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are
-// calling the REST API directly.
-func (client PoolClient) Add(ctx context.Context, pool PoolAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: pool,
- Constraints: []validation.Constraint{{Target: "pool.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "pool.VMSize", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "pool.CloudServiceConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "pool.VirtualMachineConfiguration.OsDisk", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "pool.VirtualMachineConfiguration.OsDisk.ImageUris", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "pool.StartTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "Add", err.Error())
- }
-
- req, err := client.AddPreparer(ctx, pool, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPreparer prepares the Add request.
-func (client PoolClient) AddPreparer(ctx context.Context, pool PoolAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/pools"),
- autorest.WithJSON(pool),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSender sends the Add request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) AddSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddResponder handles the response to the Add request. The method always
-// closes the http.Response Body.
-func (client PoolClient) AddResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Delete when you request that a pool be deleted, the following actions occur: the pool state is set to deleting; any
-// ongoing resize operation on the pool are stopped; the Batch service starts resizing the pool to zero nodes; any
-// tasks running on existing nodes are terminated and requeued (as if a resize pool operation had been requested with
-// the default requeue option); finally, the pool is removed from the system. Because running tasks are requeued, the
-// user can rerun these tasks by updating their job to target a different pool. The tasks can then run on the new pool.
-// If you want to override the requeue behavior, then you should call resize pool explicitly to shrink the pool to zero
-// size before deleting the pool. If you call an Update, Patch or Delete API on a pool in the deleting state, it will
-// fail with HTTP status code 409 with error code PoolBeingDeleted.
-//
-// poolID is the ID of the pool to delete. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. Client libraries typically set this to the current system clock time; set it
-// explicitly if you are calling the REST API directly. ifMatch is an ETag value associated with the version of the
-// resource known to the client. The operation will be performed only if the resource's current ETag on the service
-// exactly matches the value specified by the client. ifNoneMatch is an ETag value associated with the version of
-// the resource known to the client. The operation will be performed only if the resource's current ETag on the
-// service does not match the value specified by the client. ifModifiedSince is a timestamp indicating the last
-// modified time of the resource known to the client. The operation will be performed only if the resource on the
-// service has been modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last
-// modified time of the resource known to the client. The operation will be performed only if the resource on the
-// service has not been modified since the specified time.
-func (client PoolClient) Delete(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeletePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client PoolClient) DeletePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client PoolClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// DisableAutoScale sends the disable auto scale request.
-//
-// poolID is the ID of the pool on which to disable automatic scaling. timeout is the maximum time that the server
-// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated
-// request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client PoolClient) DisableAutoScale(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DisableAutoScalePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DisableAutoScaleSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", resp, "Failure sending request")
- return
- }
-
- result, err = client.DisableAutoScaleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DisableAutoScalePreparer prepares the DisableAutoScale request.
-func (client PoolClient) DisableAutoScalePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/disableautoscale", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DisableAutoScaleSender sends the DisableAutoScale request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) DisableAutoScaleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DisableAutoScaleResponder handles the response to the DisableAutoScale request. The method always
-// closes the http.Response Body.
-func (client PoolClient) DisableAutoScaleResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// EnableAutoScale you cannot enable automatic scaling on a pool if a resize operation is in progress on the pool. If
-// automatic scaling of the pool is currently disabled, you must specify a valid autoscale formula as part of the
-// request. If automatic scaling of the pool is already enabled, you may specify a new autoscale formula and/or a new
-// evaluation interval. You cannot call this API for the same pool more than once every 30 seconds.
-//
-// poolID is the ID of the pool on which to enable automatic scaling. poolEnableAutoScaleParameter is the
-// parameters for the request. timeout is the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a
-// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are
-// calling the REST API directly. ifMatch is an ETag value associated with the version of the resource known to the
-// client. The operation will be performed only if the resource's current ETag on the service exactly matches the
-// value specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to
-// the client. The operation will be performed only if the resource's current ETag on the service does not match
-// the value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the
-// resource known to the client. The operation will be performed only if the resource on the service has been
-// modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the
-// resource known to the client. The operation will be performed only if the resource on the service has not been
-// modified since the specified time.
-func (client PoolClient) EnableAutoScale(ctx context.Context, poolID string, poolEnableAutoScaleParameter PoolEnableAutoScaleParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.EnableAutoScalePreparer(ctx, poolID, poolEnableAutoScaleParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.EnableAutoScaleSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", resp, "Failure sending request")
- return
- }
-
- result, err = client.EnableAutoScaleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", resp, "Failure responding to request")
- }
-
- return
-}
-
-// EnableAutoScalePreparer prepares the EnableAutoScale request.
-func (client PoolClient) EnableAutoScalePreparer(ctx context.Context, poolID string, poolEnableAutoScaleParameter PoolEnableAutoScaleParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/enableautoscale", pathParameters),
- autorest.WithJSON(poolEnableAutoScaleParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// EnableAutoScaleSender sends the EnableAutoScale request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) EnableAutoScaleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// EnableAutoScaleResponder handles the response to the EnableAutoScale request. The method always
-// closes the http.Response Body.
-func (client PoolClient) EnableAutoScaleResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// EvaluateAutoScale this API is primarily for validating an autoscale formula, as it simply returns the result without
-// applying the formula to the pool.
-//
-// poolID is the ID of the pool on which to evaluate the automatic scaling formula. poolEvaluateAutoScaleParameter
-// is the parameters for the request. timeout is the maximum time that the server can spend processing the request,
-// in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of
-// a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are
-// calling the REST API directly.
-func (client PoolClient) EvaluateAutoScale(ctx context.Context, poolID string, poolEvaluateAutoScaleParameter PoolEvaluateAutoScaleParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result AutoScaleRun, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: poolEvaluateAutoScaleParameter,
- Constraints: []validation.Constraint{{Target: "poolEvaluateAutoScaleParameter.AutoScaleFormula", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "EvaluateAutoScale", err.Error())
- }
-
- req, err := client.EvaluateAutoScalePreparer(ctx, poolID, poolEvaluateAutoScaleParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.EvaluateAutoScaleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", resp, "Failure sending request")
- return
- }
-
- result, err = client.EvaluateAutoScaleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", resp, "Failure responding to request")
- }
-
- return
-}
-
-// EvaluateAutoScalePreparer prepares the EvaluateAutoScale request.
-func (client PoolClient) EvaluateAutoScalePreparer(ctx context.Context, poolID string, poolEvaluateAutoScaleParameter PoolEvaluateAutoScaleParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/evaluateautoscale", pathParameters),
- autorest.WithJSON(poolEvaluateAutoScaleParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// EvaluateAutoScaleSender sends the EvaluateAutoScale request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) EvaluateAutoScaleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// EvaluateAutoScaleResponder handles the response to the EvaluateAutoScale request. The method always
-// closes the http.Response Body.
-func (client PoolClient) EvaluateAutoScaleResponder(resp *http.Response) (result AutoScaleRun, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Exists gets basic properties of a pool.
-//
-// poolID is the ID of the pool to get. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. Client libraries typically set this to the current system clock time; set it
-// explicitly if you are calling the REST API directly. ifMatch is an ETag value associated with the version of the
-// resource known to the client. The operation will be performed only if the resource's current ETag on the service
-// exactly matches the value specified by the client. ifNoneMatch is an ETag value associated with the version of
-// the resource known to the client. The operation will be performed only if the resource's current ETag on the
-// service does not match the value specified by the client. ifModifiedSince is a timestamp indicating the last
-// modified time of the resource known to the client. The operation will be performed only if the resource on the
-// service has been modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last
-// modified time of the resource known to the client. The operation will be performed only if the resource on the
-// service has not been modified since the specified time.
-func (client PoolClient) Exists(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.ExistsPreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ExistsSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", resp, "Failure sending request")
- return
- }
-
- result, err = client.ExistsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ExistsPreparer prepares the Exists request.
-func (client PoolClient) ExistsPreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsHead(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ExistsSender sends the Exists request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) ExistsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ExistsResponder handles the response to the Exists request. The method always
-// closes the http.Response Body.
-func (client PoolClient) ExistsResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get gets information about the specified pool.
-//
-// poolID is the ID of the pool to get. selectParameter is an OData $select clause. expand is an OData $expand
-// clause. timeout is the maximum time that the server can spend processing the request, in seconds. The default is
-// 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration
-// such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server
-// should return the client-request-id in the response. ocpDate is the time the request was issued. Client
-// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API
-// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The
-// operation will be performed only if the resource's current ETag on the service exactly matches the value
-// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the
-// client. The operation will be performed only if the resource's current ETag on the service does not match the
-// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource
-// known to the client. The operation will be performed only if the resource on the service has been modified since
-// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to
-// the client. The operation will be performed only if the resource on the service has not been modified since the
-// specified time.
-func (client PoolClient) Get(ctx context.Context, poolID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudPool, err error) {
- req, err := client.GetPreparer(ctx, poolID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client PoolClient) GetPreparer(ctx context.Context, poolID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client PoolClient) GetResponder(resp *http.Response) (result CloudPool, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetAllLifetimeStatistics statistics are aggregated across all pools that have ever existed in the account, from
-// account creation to the last update time of the statistics.
-//
-// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30
-// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such
-// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should
-// return the client-request-id in the response. ocpDate is the time the request was issued. Client libraries
-// typically set this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client PoolClient) GetAllLifetimeStatistics(ctx context.Context, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolStatistics, err error) {
- req, err := client.GetAllLifetimeStatisticsPreparer(ctx, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllLifetimeStatistics", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetAllLifetimeStatisticsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllLifetimeStatistics", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetAllLifetimeStatisticsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllLifetimeStatistics", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetAllLifetimeStatisticsPreparer prepares the GetAllLifetimeStatistics request.
-func (client PoolClient) GetAllLifetimeStatisticsPreparer(ctx context.Context, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/lifetimepoolstats"),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetAllLifetimeStatisticsSender sends the GetAllLifetimeStatistics request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) GetAllLifetimeStatisticsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetAllLifetimeStatisticsResponder handles the response to the GetAllLifetimeStatistics request. The method always
-// closes the http.Response Body.
-func (client PoolClient) GetAllLifetimeStatisticsResponder(resp *http.Response) (result PoolStatistics, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List sends the list request.
-//
-// filter is an OData $filter clause. selectParameter is an OData $select clause. expand is an OData $expand
-// clause. maxResults is the maximum number of items to return in the response. A maximum of 1000 pools can be
-// returned. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client
-// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API
-// directly.
-func (client PoolClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudPoolListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "List", err.Error())
- }
-
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.cplr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", resp, "Failure sending request")
- return
- }
-
- result.cplr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client PoolClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/pools"),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client PoolClient) ListResponder(resp *http.Response) (result CloudPoolListResult, 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 PoolClient) listNextResults(lastResults CloudPoolListResult) (result CloudPoolListResult, err error) {
- req, err := lastResults.cloudPoolListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.PoolClient", "listNextResults", 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.PoolClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client PoolClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudPoolListResultIterator, err error) {
- result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// ListUsageMetrics if you do not specify a $filter clause including a poolId, the response includes all pools that
-// existed in the account in the time range of the returned aggregation intervals.
-//
-// startTime is the earliest time from which to include metrics. This must be at least two and a half hours before
-// the current time. If not specified this defaults to the start time of the last aggregation interval currently
-// available. endTime is the latest time from which to include metrics. This must be at least two hours before the
-// current time. If not specified this defaults to the end time of the last aggregation interval currently
-// available. filter is an OData $filter clause. If this is not specified the response includes all pools that
-// existed in the account in the time range of the returned aggregation intervals. maxResults is the maximum number
-// of items to return in the response. A maximum of 1000 results will be returned. timeout is the maximum time that
-// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client PoolClient) ListUsageMetrics(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolListUsageMetricsResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "ListUsageMetrics", err.Error())
- }
-
- result.fn = client.listUsageMetricsNextResults
- req, err := client.ListUsageMetricsPreparer(ctx, startTime, endTime, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListUsageMetrics", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListUsageMetricsSender(req)
- if err != nil {
- result.plumr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListUsageMetrics", resp, "Failure sending request")
- return
- }
-
- result.plumr, err = client.ListUsageMetricsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListUsageMetrics", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListUsageMetricsPreparer prepares the ListUsageMetrics request.
-func (client PoolClient) ListUsageMetricsPreparer(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if startTime != nil {
- queryParameters["starttime"] = autorest.Encode("query", *startTime)
- }
- if endTime != nil {
- queryParameters["endtime"] = autorest.Encode("query", *endTime)
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/poolusagemetrics"),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListUsageMetricsSender sends the ListUsageMetrics request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) ListUsageMetricsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListUsageMetricsResponder handles the response to the ListUsageMetrics request. The method always
-// closes the http.Response Body.
-func (client PoolClient) ListUsageMetricsResponder(resp *http.Response) (result PoolListUsageMetricsResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listUsageMetricsNextResults retrieves the next set of results, if any.
-func (client PoolClient) listUsageMetricsNextResults(lastResults PoolListUsageMetricsResult) (result PoolListUsageMetricsResult, err error) {
- req, err := lastResults.poolListUsageMetricsResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.PoolClient", "listUsageMetricsNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListUsageMetricsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.PoolClient", "listUsageMetricsNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListUsageMetricsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "listUsageMetricsNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListUsageMetricsComplete enumerates all values, automatically crossing page boundaries as required.
-func (client PoolClient) ListUsageMetricsComplete(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolListUsageMetricsResultIterator, err error) {
- result.page, err = client.ListUsageMetrics(ctx, startTime, endTime, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// Patch this only replaces the pool properties specified in the request. For example, if the pool has a start task
-// associated with it, and a request does not specify a start task element, then the pool keeps the existing start
-// task.
-//
-// poolID is the ID of the pool to update. poolPatchParameter is the parameters for the request. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client PoolClient) Patch(ctx context.Context, poolID string, poolPatchParameter PoolPatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.PatchPreparer(ctx, poolID, poolPatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.PatchSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", resp, "Failure sending request")
- return
- }
-
- result, err = client.PatchResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", resp, "Failure responding to request")
- }
-
- return
-}
-
-// PatchPreparer prepares the Patch request.
-func (client PoolClient) PatchPreparer(ctx context.Context, poolID string, poolPatchParameter PoolPatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPatch(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}", pathParameters),
- autorest.WithJSON(poolPatchParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// PatchSender sends the Patch request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) PatchSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// PatchResponder handles the response to the Patch request. The method always
-// closes the http.Response Body.
-func (client PoolClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// RemoveNodes this operation can only run when the allocation state of the pool is steady. When this operation runs,
-// the allocation state changes from steady to resizing.
-//
-// poolID is the ID of the pool from which you want to remove nodes. nodeRemoveParameter is the parameters for the
-// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client
-// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API
-// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The
-// operation will be performed only if the resource's current ETag on the service exactly matches the value
-// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the
-// client. The operation will be performed only if the resource's current ETag on the service does not match the
-// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource
-// known to the client. The operation will be performed only if the resource on the service has been modified since
-// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to
-// the client. The operation will be performed only if the resource on the service has not been modified since the
-// specified time.
-func (client PoolClient) RemoveNodes(ctx context.Context, poolID string, nodeRemoveParameter NodeRemoveParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: nodeRemoveParameter,
- Constraints: []validation.Constraint{{Target: "nodeRemoveParameter.NodeList", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "nodeRemoveParameter.NodeList", Name: validation.MaxItems, Rule: 100, Chain: nil}}}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "RemoveNodes", err.Error())
- }
-
- req, err := client.RemoveNodesPreparer(ctx, poolID, nodeRemoveParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.RemoveNodesSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", resp, "Failure sending request")
- return
- }
-
- result, err = client.RemoveNodesResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", resp, "Failure responding to request")
- }
-
- return
-}
-
-// RemoveNodesPreparer prepares the RemoveNodes request.
-func (client PoolClient) RemoveNodesPreparer(ctx context.Context, poolID string, nodeRemoveParameter NodeRemoveParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/removenodes", pathParameters),
- autorest.WithJSON(nodeRemoveParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// RemoveNodesSender sends the RemoveNodes request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) RemoveNodesSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// RemoveNodesResponder handles the response to the RemoveNodes request. The method always
-// closes the http.Response Body.
-func (client PoolClient) RemoveNodesResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Resize you can only resize a pool when its allocation state is steady. If the pool is already resizing, the request
-// fails with status code 409. When you resize a pool, the pool's allocation state changes from steady to resizing. You
-// cannot resize pools which are configured for automatic scaling. If you try to do this, the Batch service returns an
-// error 409. If you resize a pool downwards, the Batch service chooses which nodes to remove. To remove specific
-// nodes, use the pool remove nodes API instead.
-//
-// poolID is the ID of the pool to resize. poolResizeParameter is the parameters for the request. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client PoolClient) Resize(ctx context.Context, poolID string, poolResizeParameter PoolResizeParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: poolResizeParameter,
- Constraints: []validation.Constraint{{Target: "poolResizeParameter.TargetDedicated", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "Resize", err.Error())
- }
-
- req, err := client.ResizePreparer(ctx, poolID, poolResizeParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ResizeSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", resp, "Failure sending request")
- return
- }
-
- result, err = client.ResizeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ResizePreparer prepares the Resize request.
-func (client PoolClient) ResizePreparer(ctx context.Context, poolID string, poolResizeParameter PoolResizeParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/resize", pathParameters),
- autorest.WithJSON(poolResizeParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ResizeSender sends the Resize request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) ResizeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ResizeResponder handles the response to the Resize request. The method always
-// closes the http.Response Body.
-func (client PoolClient) ResizeResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// StopResize this does not restore the pool to its previous state before the resize operation: it only stops any
-// further changes being made, and the pool maintains its current state. A resize operation need not be an explicit
-// resize pool request; this API can also be used to halt the initial sizing of the pool when it is created.
-//
-// poolID is the ID of the pool whose resizing you want to stop. timeout is the maximum time that the server can
-// spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated
-// request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client PoolClient) StopResize(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.StopResizePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.StopResizeSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", resp, "Failure sending request")
- return
- }
-
- result, err = client.StopResizeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", resp, "Failure responding to request")
- }
-
- return
-}
-
-// StopResizePreparer prepares the StopResize request.
-func (client PoolClient) StopResizePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/stopresize", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// StopResizeSender sends the StopResize request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) StopResizeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// StopResizeResponder handles the response to the StopResize request. The method always
-// closes the http.Response Body.
-func (client PoolClient) StopResizeResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// UpdateProperties this fully replaces all the updateable properties of the pool. For example, if the pool has a start
-// task associated with it and if start task is not specified with this request, then the Batch service will remove the
-// existing start task.
-//
-// poolID is the ID of the pool to update. poolUpdatePropertiesParameter is the parameters for the request. timeout
-// is the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client PoolClient) UpdateProperties(ctx context.Context, poolID string, poolUpdatePropertiesParameter PoolUpdatePropertiesParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: poolUpdatePropertiesParameter,
- Constraints: []validation.Constraint{{Target: "poolUpdatePropertiesParameter.StartTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "poolUpdatePropertiesParameter.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "poolUpdatePropertiesParameter.CertificateReferences", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "poolUpdatePropertiesParameter.ApplicationPackageReferences", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "poolUpdatePropertiesParameter.Metadata", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "UpdateProperties", err.Error())
- }
-
- req, err := client.UpdatePropertiesPreparer(ctx, poolID, poolUpdatePropertiesParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdatePropertiesSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdatePropertiesResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePropertiesPreparer prepares the UpdateProperties request.
-func (client PoolClient) UpdatePropertiesPreparer(ctx context.Context, poolID string, poolUpdatePropertiesParameter PoolUpdatePropertiesParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/updateproperties", pathParameters),
- autorest.WithJSON(poolUpdatePropertiesParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdatePropertiesSender sends the UpdateProperties request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) UpdatePropertiesSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdatePropertiesResponder handles the response to the UpdateProperties request. The method always
-// closes the http.Response Body.
-func (client PoolClient) UpdatePropertiesResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// UpgradeOS during an upgrade, the Batch service upgrades each compute node in the pool. When a compute node is chosen
-// for upgrade, any tasks running on that node are removed from the node and returned to the queue to be rerun later
-// (or on a different compute node). The node will be unavailable until the upgrade is complete. This operation results
-// in temporarily reduced pool capacity as nodes are taken out of service to be upgraded. Although the Batch service
-// tries to avoid upgrading all compute nodes at the same time, it does not guarantee to do this (particularly on small
-// pools); therefore, the pool may be temporarily unavailable to run tasks. When this operation runs, the pool state
-// changes to upgrading. When all compute nodes have finished upgrading, the pool state returns to active.
-//
-// poolID is the ID of the pool to upgrade. poolUpgradeOSParameter is the parameters for the request. timeout is
-// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client PoolClient) UpgradeOS(ctx context.Context, poolID string, poolUpgradeOSParameter PoolUpgradeOSParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: poolUpgradeOSParameter,
- Constraints: []validation.Constraint{{Target: "poolUpgradeOSParameter.TargetOSVersion", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "UpgradeOS", err.Error())
- }
-
- req, err := client.UpgradeOSPreparer(ctx, poolID, poolUpgradeOSParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpgradeOSSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpgradeOSResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpgradeOSPreparer prepares the UpgradeOS request.
-func (client PoolClient) UpgradeOSPreparer(ctx context.Context, poolID string, poolUpgradeOSParameter PoolUpgradeOSParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/upgradeos", pathParameters),
- autorest.WithJSON(poolUpgradeOSParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpgradeOSSender sends the UpgradeOS request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) UpgradeOSSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpgradeOSResponder handles the response to the UpgradeOS request. The method always
-// closes the http.Response Body.
-func (client PoolClient) UpgradeOSResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff --git a/services/batch/2017-01-01.4.0/batch/task.go b/services/batch/2017-01-01.4.0/batch/task.go
deleted file mode 100644
index 8d068742ac73..000000000000
--- a/services/batch/2017-01-01.4.0/batch/task.go
+++ /dev/null
@@ -1,1068 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// TaskClient is the a client for issuing REST requests to the Azure Batch service.
-type TaskClient struct {
- BaseClient
-}
-
-// NewTaskClient creates an instance of the TaskClient client.
-func NewTaskClient() TaskClient {
- return NewTaskClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewTaskClientWithBaseURI creates an instance of the TaskClient client.
-func NewTaskClientWithBaseURI(baseURI string) TaskClient {
- return TaskClient{NewWithBaseURI(baseURI)}
-}
-
-// Add sends the add request.
-//
-// jobID is the ID of the job to which the task is to be added. task is the task to be added. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client TaskClient) Add(ctx context.Context, jobID string, task TaskAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: task,
- Constraints: []validation.Constraint{{Target: "task.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "task.CommandLine", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "task.AffinityInfo", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "task.AffinityInfo.AffinityID", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "task.MultiInstanceSettings", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "task.MultiInstanceSettings.NumberOfInstances", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil {
- return result, validation.NewError("batch.TaskClient", "Add", err.Error())
- }
-
- req, err := client.AddPreparer(ctx, jobID, task, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPreparer prepares the Add request.
-func (client TaskClient) AddPreparer(ctx context.Context, jobID string, task TaskAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks", pathParameters),
- autorest.WithJSON(task),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSender sends the Add request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) AddSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddResponder handles the response to the Add request. The method always
-// closes the http.Response Body.
-func (client TaskClient) AddResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// AddCollection note that each task must have a unique ID. The Batch service may not return the results for each task
-// in the same order the tasks were submitted in this request. If the server times out or the connection is closed
-// during the request, the request may have been partially or fully processed, or not at all. In such cases, the user
-// should re-issue the request. Note that it is up to the user to correctly handle failures when re-issuing a request.
-// For example, you should use the same task ids during a retry so that if the prior operation succeeded, the retry
-// will not create extra tasks unexpectedly.
-//
-// jobID is the ID of the job to which the task collection is to be added. taskCollection is the tasks to be added.
-// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30
-// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such
-// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should
-// return the client-request-id in the response. ocpDate is the time the request was issued. Client libraries
-// typically set this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client TaskClient) AddCollection(ctx context.Context, jobID string, taskCollection TaskAddCollectionParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result TaskAddCollectionResult, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: taskCollection,
- Constraints: []validation.Constraint{{Target: "taskCollection.Value", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "taskCollection.Value", Name: validation.MaxItems, Rule: 100, Chain: nil}}}}}}); err != nil {
- return result, validation.NewError("batch.TaskClient", "AddCollection", err.Error())
- }
-
- req, err := client.AddCollectionPreparer(ctx, jobID, taskCollection, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "AddCollection", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddCollectionSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "AddCollection", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddCollectionResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "AddCollection", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddCollectionPreparer prepares the AddCollection request.
-func (client TaskClient) AddCollectionPreparer(ctx context.Context, jobID string, taskCollection TaskAddCollectionParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/addtaskcollection", pathParameters),
- autorest.WithJSON(taskCollection),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddCollectionSender sends the AddCollection request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) AddCollectionSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddCollectionResponder handles the response to the AddCollection request. The method always
-// closes the http.Response Body.
-func (client TaskClient) AddCollectionResponder(resp *http.Response) (result TaskAddCollectionResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Delete when a task is deleted, all of the files in its directory on the compute node where it ran are also deleted
-// (regardless of the retention time). For multi-instance tasks, the delete task operation applies synchronously to the
-// primary task; subtasks and their files are then deleted asynchronously in the background.
-//
-// jobID is the ID of the job from which to delete the task. taskID is the ID of the task to delete. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client TaskClient) Delete(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeletePreparer(ctx, jobID, taskID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client TaskClient) DeletePreparer(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client TaskClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get for multi-instance tasks, information such as affinityId, executionInfo and nodeInfo refer to the primary task.
-// Use the list subtasks API to retrieve information about subtasks.
-//
-// jobID is the ID of the job that contains the task. taskID is the ID of the task to get information about.
-// selectParameter is an OData $select clause. expand is an OData $expand clause. timeout is the maximum time that
-// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client TaskClient) Get(ctx context.Context, jobID string, taskID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudTask, err error) {
- req, err := client.GetPreparer(ctx, jobID, taskID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client TaskClient) GetPreparer(ctx context.Context, jobID string, taskID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client TaskClient) GetResponder(resp *http.Response) (result CloudTask, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List for multi-instance tasks, information such as affinityId, executionInfo and nodeInfo refer to the primary task.
-// Use the list subtasks API to retrieve information about subtasks.
-//
-// jobID is the ID of the job. filter is an OData $filter clause. selectParameter is an OData $select clause.
-// expand is an OData $expand clause. maxResults is the maximum number of items to return in the response. A
-// maximum of 1000 tasks can be returned. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. Client libraries typically set this to the current system clock time; set it
-// explicitly if you are calling the REST API directly.
-func (client TaskClient) List(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.TaskClient", "List", err.Error())
- }
-
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, jobID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.ctlr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", resp, "Failure sending request")
- return
- }
-
- result.ctlr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client TaskClient) ListPreparer(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client TaskClient) ListResponder(resp *http.Response) (result CloudTaskListResult, 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 TaskClient) listNextResults(lastResults CloudTaskListResult) (result CloudTaskListResult, err error) {
- req, err := lastResults.cloudTaskListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.TaskClient", "listNextResults", 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.TaskClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client TaskClient) ListComplete(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListResultIterator, err error) {
- result.page, err = client.List(ctx, jobID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// ListSubtasks if the task is not a multi-instance task then this returns an empty collection.
-//
-// jobID is the ID of the job. taskID is the ID of the task. selectParameter is an OData $select clause. timeout is
-// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client TaskClient) ListSubtasks(ctx context.Context, jobID string, taskID string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListSubtasksResult, err error) {
- req, err := client.ListSubtasksPreparer(ctx, jobID, taskID, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSubtasksSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListSubtasksResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListSubtasksPreparer prepares the ListSubtasks request.
-func (client TaskClient) ListSubtasksPreparer(ctx context.Context, jobID string, taskID string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/subtasksinfo", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSubtasksSender sends the ListSubtasks request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) ListSubtasksSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListSubtasksResponder handles the response to the ListSubtasks request. The method always
-// closes the http.Response Body.
-func (client TaskClient) ListSubtasksResponder(resp *http.Response) (result CloudTaskListSubtasksResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Reactivate reactivation makes a task eligible to be retried again up to its maximum retry count. The task's state is
-// changed to active. As the task is no longer in the completed state, any previous exit code or scheduling error is no
-// longer available after reactivation. This will fail for tasks that are not completed or that previously completed
-// successfully (with an exit code of 0). Additionally, this will fail if the job has completed (or is terminating or
-// deleting).
-//
-// jobID is the ID of the job containing the task. taskID is the ID of the task to reactivate. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client TaskClient) Reactivate(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.ReactivatePreparer(ctx, jobID, taskID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Reactivate", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ReactivateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Reactivate", resp, "Failure sending request")
- return
- }
-
- result, err = client.ReactivateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Reactivate", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ReactivatePreparer prepares the Reactivate request.
-func (client TaskClient) ReactivatePreparer(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/reactivate", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ReactivateSender sends the Reactivate request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) ReactivateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ReactivateResponder handles the response to the Reactivate request. The method always
-// closes the http.Response Body.
-func (client TaskClient) ReactivateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Terminate when the task has been terminated, it moves to the completed state. For multi-instance tasks, the
-// terminate task operation applies synchronously to the primary task; subtasks are then terminated asynchronously in
-// the background.
-//
-// jobID is the ID of the job containing the task. taskID is the ID of the task to terminate. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client TaskClient) Terminate(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.TerminatePreparer(ctx, jobID, taskID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.TerminateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", resp, "Failure sending request")
- return
- }
-
- result, err = client.TerminateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", resp, "Failure responding to request")
- }
-
- return
-}
-
-// TerminatePreparer prepares the Terminate request.
-func (client TaskClient) TerminatePreparer(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/terminate", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// TerminateSender sends the Terminate request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) TerminateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// TerminateResponder handles the response to the Terminate request. The method always
-// closes the http.Response Body.
-func (client TaskClient) TerminateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Update updates the properties of the specified task.
-//
-// jobID is the ID of the job containing the task. taskID is the ID of the task to update. taskUpdateParameter is
-// the parameters for the request. timeout is the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a
-// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are
-// calling the REST API directly. ifMatch is an ETag value associated with the version of the resource known to the
-// client. The operation will be performed only if the resource's current ETag on the service exactly matches the
-// value specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to
-// the client. The operation will be performed only if the resource's current ETag on the service does not match
-// the value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the
-// resource known to the client. The operation will be performed only if the resource on the service has been
-// modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the
-// resource known to the client. The operation will be performed only if the resource on the service has not been
-// modified since the specified time.
-func (client TaskClient) Update(ctx context.Context, jobID string, taskID string, taskUpdateParameter TaskUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.UpdatePreparer(ctx, jobID, taskID, taskUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePreparer prepares the Update request.
-func (client TaskClient) UpdatePreparer(ctx context.Context, jobID string, taskID string, taskUpdateParameter TaskUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2017-01-01.4.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters),
- autorest.WithJSON(taskUpdateParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSender sends the Update request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) UpdateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateResponder handles the response to the Update request. The method always
-// closes the http.Response Body.
-func (client TaskClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff --git a/services/batch/2017-01-01.4.0/batch/version.go b/services/batch/2017-01-01.4.0/batch/version.go
deleted file mode 100644
index e9ce3c3a44d0..000000000000
--- a/services/batch/2017-01-01.4.0/batch/version.go
+++ /dev/null
@@ -1,30 +0,0 @@
-package batch
-
-import "github.com/Azure/azure-sdk-for-go/version"
-
-// 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.
-
-// UserAgent returns the UserAgent string to use when sending http.Requests.
-func UserAgent() string {
- return "Azure-SDK-For-Go/" + version.Number + " batch/2017-01-01.4.0"
-}
-
-// Version returns the semantic version (see http://semver.org) of the client.
-func Version() string {
- return version.Number
-}
diff --git a/services/batch/2017-06-01.5.1/batch/account.go b/services/batch/2017-06-01.5.1/batch/account.go
deleted file mode 100644
index 081728c758e3..000000000000
--- a/services/batch/2017-06-01.5.1/batch/account.go
+++ /dev/null
@@ -1,174 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// AccountClient is the a client for issuing REST requests to the Azure Batch service.
-type AccountClient struct {
- BaseClient
-}
-
-// NewAccountClient creates an instance of the AccountClient client.
-func NewAccountClient() AccountClient {
- return NewAccountClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewAccountClientWithBaseURI creates an instance of the AccountClient client.
-func NewAccountClientWithBaseURI(baseURI string) AccountClient {
- return AccountClient{NewWithBaseURI(baseURI)}
-}
-
-// ListNodeAgentSkus sends the list node agent skus request.
-//
-// filter is an OData $filter clause. maxResults is the maximum number of items to return in the response. A
-// maximum of 1000 results will be returned. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. Client libraries typically set this to the current system clock time; set it
-// explicitly if you are calling the REST API directly.
-func (client AccountClient) ListNodeAgentSkus(ctx context.Context, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result AccountListNodeAgentSkusResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.AccountClient", "ListNodeAgentSkus", err.Error())
- }
-
- result.fn = client.listNodeAgentSkusNextResults
- req, err := client.ListNodeAgentSkusPreparer(ctx, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListNodeAgentSkus", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListNodeAgentSkusSender(req)
- if err != nil {
- result.alnasr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListNodeAgentSkus", resp, "Failure sending request")
- return
- }
-
- result.alnasr, err = client.ListNodeAgentSkusResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListNodeAgentSkus", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListNodeAgentSkusPreparer prepares the ListNodeAgentSkus request.
-func (client AccountClient) ListNodeAgentSkusPreparer(ctx context.Context, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/nodeagentskus"),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListNodeAgentSkusSender sends the ListNodeAgentSkus request. The method will close the
-// http.Response Body if it receives an error.
-func (client AccountClient) ListNodeAgentSkusSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListNodeAgentSkusResponder handles the response to the ListNodeAgentSkus request. The method always
-// closes the http.Response Body.
-func (client AccountClient) ListNodeAgentSkusResponder(resp *http.Response) (result AccountListNodeAgentSkusResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listNodeAgentSkusNextResults retrieves the next set of results, if any.
-func (client AccountClient) listNodeAgentSkusNextResults(lastResults AccountListNodeAgentSkusResult) (result AccountListNodeAgentSkusResult, err error) {
- req, err := lastResults.accountListNodeAgentSkusResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.AccountClient", "listNodeAgentSkusNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListNodeAgentSkusSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.AccountClient", "listNodeAgentSkusNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListNodeAgentSkusResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.AccountClient", "listNodeAgentSkusNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListNodeAgentSkusComplete enumerates all values, automatically crossing page boundaries as required.
-func (client AccountClient) ListNodeAgentSkusComplete(ctx context.Context, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result AccountListNodeAgentSkusResultIterator, err error) {
- result.page, err = client.ListNodeAgentSkus(ctx, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
diff --git a/services/batch/2017-06-01.5.1/batch/application.go b/services/batch/2017-06-01.5.1/batch/application.go
deleted file mode 100644
index 9b10977be59d..000000000000
--- a/services/batch/2017-06-01.5.1/batch/application.go
+++ /dev/null
@@ -1,264 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// ApplicationClient is the a client for issuing REST requests to the Azure Batch service.
-type ApplicationClient struct {
- BaseClient
-}
-
-// NewApplicationClient creates an instance of the ApplicationClient client.
-func NewApplicationClient() ApplicationClient {
- return NewApplicationClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewApplicationClientWithBaseURI creates an instance of the ApplicationClient client.
-func NewApplicationClientWithBaseURI(baseURI string) ApplicationClient {
- return ApplicationClient{NewWithBaseURI(baseURI)}
-}
-
-// Get this operation returns only applications and versions that are available for use on compute nodes; that is, that
-// can be used in an application package reference. For administrator information about applications and versions that
-// are not yet available to compute nodes, use the Azure portal or the Azure Resource Manager API.
-//
-// applicationID is the ID of the application. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. Client libraries typically set this to the current system clock time; set it
-// explicitly if you are calling the REST API directly.
-func (client ApplicationClient) Get(ctx context.Context, applicationID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationSummary, err error) {
- req, err := client.GetPreparer(ctx, applicationID, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client ApplicationClient) GetPreparer(ctx context.Context, applicationID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "applicationId": autorest.Encode("path", applicationID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/applications/{applicationId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client ApplicationClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client ApplicationClient) GetResponder(resp *http.Response) (result ApplicationSummary, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List this operation returns only applications and versions that are available for use on compute nodes; that is,
-// that can be used in an application package reference. For administrator information about applications and versions
-// that are not yet available to compute nodes, use the Azure portal or the Azure Resource Manager API.
-//
-// maxResults is the maximum number of items to return in the response. A maximum of 1000 applications can be
-// returned. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client
-// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API
-// directly.
-func (client ApplicationClient) List(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.ApplicationClient", "List", err.Error())
- }
-
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.alr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "List", resp, "Failure sending request")
- return
- }
-
- result.alr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client ApplicationClient) ListPreparer(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/applications"),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client ApplicationClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client ApplicationClient) ListResponder(resp *http.Response) (result ApplicationListResult, 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 ApplicationClient) listNextResults(lastResults ApplicationListResult) (result ApplicationListResult, err error) {
- req, err := lastResults.applicationListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.ApplicationClient", "listNextResults", 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.ApplicationClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client ApplicationClient) ListComplete(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationListResultIterator, err error) {
- result.page, err = client.List(ctx, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
diff --git a/services/batch/2017-06-01.5.1/batch/certificate.go b/services/batch/2017-06-01.5.1/batch/certificate.go
deleted file mode 100644
index 8dc630d474a5..000000000000
--- a/services/batch/2017-06-01.5.1/batch/certificate.go
+++ /dev/null
@@ -1,555 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// CertificateClient is the a client for issuing REST requests to the Azure Batch service.
-type CertificateClient struct {
- BaseClient
-}
-
-// NewCertificateClient creates an instance of the CertificateClient client.
-func NewCertificateClient() CertificateClient {
- return NewCertificateClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewCertificateClientWithBaseURI creates an instance of the CertificateClient client.
-func NewCertificateClientWithBaseURI(baseURI string) CertificateClient {
- return CertificateClient{NewWithBaseURI(baseURI)}
-}
-
-// Add sends the add request.
-//
-// certificate is the certificate to be added. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. Client libraries typically set this to the current system clock time; set it
-// explicitly if you are calling the REST API directly.
-func (client CertificateClient) Add(ctx context.Context, certificate CertificateAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: certificate,
- Constraints: []validation.Constraint{{Target: "certificate.Thumbprint", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "certificate.ThumbprintAlgorithm", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "certificate.Data", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.CertificateClient", "Add", err.Error())
- }
-
- req, err := client.AddPreparer(ctx, certificate, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPreparer prepares the Add request.
-func (client CertificateClient) AddPreparer(ctx context.Context, certificate CertificateAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/certificates"),
- autorest.WithJSON(certificate),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSender sends the Add request. The method will close the
-// http.Response Body if it receives an error.
-func (client CertificateClient) AddSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddResponder handles the response to the Add request. The method always
-// closes the http.Response Body.
-func (client CertificateClient) AddResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// CancelDeletion if you try to delete a certificate that is being used by a pool or compute node, the status of the
-// certificate changes to deleteFailed. If you decide that you want to continue using the certificate, you can use this
-// operation to set the status of the certificate back to active. If you intend to delete the certificate, you do not
-// need to run this operation after the deletion failed. You must make sure that the certificate is not being used by
-// any resources, and then you can try again to delete the certificate.
-//
-// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is
-// the thumbprint of the certificate being deleted. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client CertificateClient) CancelDeletion(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.CancelDeletionPreparer(ctx, thumbprintAlgorithm, thumbprint, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.CancelDeletionSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", resp, "Failure sending request")
- return
- }
-
- result, err = client.CancelDeletionResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", resp, "Failure responding to request")
- }
-
- return
-}
-
-// CancelDeletionPreparer prepares the CancelDeletion request.
-func (client CertificateClient) CancelDeletionPreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "thumbprint": autorest.Encode("path", thumbprint),
- "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})/canceldelete", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CancelDeletionSender sends the CancelDeletion request. The method will close the
-// http.Response Body if it receives an error.
-func (client CertificateClient) CancelDeletionSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// CancelDeletionResponder handles the response to the CancelDeletion request. The method always
-// closes the http.Response Body.
-func (client CertificateClient) CancelDeletionResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Delete you cannot delete a certificate if a resource (pool or compute node) is using it. Before you can delete a
-// certificate, you must therefore make sure that the certificate is not associated with any existing pools, the
-// certificate is not installed on any compute nodes (even if you remove a certificate from a pool, it is not removed
-// from existing compute nodes in that pool until they restart), and no running tasks depend on the certificate. If you
-// try to delete a certificate that is in use, the deletion fails. The certificate status changes to deleteFailed. You
-// can use Cancel Delete Certificate to set the status back to active if you decide that you want to continue using the
-// certificate.
-//
-// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is
-// the thumbprint of the certificate to be deleted. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client CertificateClient) Delete(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeletePreparer(ctx, thumbprintAlgorithm, thumbprint, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client CertificateClient) DeletePreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "thumbprint": autorest.Encode("path", thumbprint),
- "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client CertificateClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client CertificateClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get gets information about the specified certificate.
-//
-// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is
-// the thumbprint of the certificate to get. selectParameter is an OData $select clause. timeout is the maximum
-// time that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is
-// the caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client CertificateClient) Get(ctx context.Context, thumbprintAlgorithm string, thumbprint string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result Certificate, err error) {
- req, err := client.GetPreparer(ctx, thumbprintAlgorithm, thumbprint, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client CertificateClient) GetPreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "thumbprint": autorest.Encode("path", thumbprint),
- "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client CertificateClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client CertificateClient) GetResponder(resp *http.Response) (result Certificate, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List sends the list request.
-//
-// filter is an OData $filter clause. selectParameter is an OData $select clause. maxResults is the maximum number
-// of items to return in the response. A maximum of 1000 certificates can be returned. timeout is the maximum time
-// that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client CertificateClient) List(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CertificateListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.CertificateClient", "List", err.Error())
- }
-
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.clr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "List", resp, "Failure sending request")
- return
- }
-
- result.clr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client CertificateClient) ListPreparer(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/certificates"),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client CertificateClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client CertificateClient) ListResponder(resp *http.Response) (result CertificateListResult, 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 CertificateClient) listNextResults(lastResults CertificateListResult) (result CertificateListResult, err error) {
- req, err := lastResults.certificateListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.CertificateClient", "listNextResults", 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.CertificateClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client CertificateClient) ListComplete(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CertificateListResultIterator, err error) {
- result.page, err = client.List(ctx, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
diff --git a/services/batch/2017-06-01.5.1/batch/client.go b/services/batch/2017-06-01.5.1/batch/client.go
deleted file mode 100644
index 4cbdacf8cdcf..000000000000
--- a/services/batch/2017-06-01.5.1/batch/client.go
+++ /dev/null
@@ -1,49 +0,0 @@
-// Package batch implements the Azure ARM Batch service API version 2017-06-01.5.1.
-//
-// A client for issuing REST requests to the Azure Batch service.
-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"
-)
-
-const (
- // DefaultBaseURI is the default URI used for the service Batch
- DefaultBaseURI = "https://batch.core.windows.net"
-)
-
-// BaseClient is the base client for Batch.
-type BaseClient struct {
- autorest.Client
- BaseURI string
-}
-
-// New creates an instance of the BaseClient client.
-func New() BaseClient {
- return NewWithBaseURI(DefaultBaseURI)
-}
-
-// NewWithBaseURI creates an instance of the BaseClient client.
-func NewWithBaseURI(baseURI string) BaseClient {
- return BaseClient{
- Client: autorest.NewClientWithUserAgent(UserAgent()),
- BaseURI: baseURI,
- }
-}
diff --git a/services/batch/2017-06-01.5.1/batch/computenode.go b/services/batch/2017-06-01.5.1/batch/computenode.go
deleted file mode 100644
index 8ce773c2a9a4..000000000000
--- a/services/batch/2017-06-01.5.1/batch/computenode.go
+++ /dev/null
@@ -1,1122 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// ComputeNodeClient is the a client for issuing REST requests to the Azure Batch service.
-type ComputeNodeClient struct {
- BaseClient
-}
-
-// NewComputeNodeClient creates an instance of the ComputeNodeClient client.
-func NewComputeNodeClient() ComputeNodeClient {
- return NewComputeNodeClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewComputeNodeClientWithBaseURI creates an instance of the ComputeNodeClient client.
-func NewComputeNodeClientWithBaseURI(baseURI string) ComputeNodeClient {
- return ComputeNodeClient{NewWithBaseURI(baseURI)}
-}
-
-// AddUser you can add a user account to a node only when it is in the idle or running state.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the machine on which you want
-// to create a user account. userParameter is the user account to be created. timeout is the maximum time that the
-// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client ComputeNodeClient) AddUser(ctx context.Context, poolID string, nodeID string, userParameter ComputeNodeUser, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: userParameter,
- Constraints: []validation.Constraint{{Target: "userParameter.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.ComputeNodeClient", "AddUser", err.Error())
- }
-
- req, err := client.AddUserPreparer(ctx, poolID, nodeID, userParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddUserSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddUserResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddUserPreparer prepares the AddUser request.
-func (client ComputeNodeClient) AddUserPreparer(ctx context.Context, poolID string, nodeID string, userParameter ComputeNodeUser, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users", pathParameters),
- autorest.WithJSON(userParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddUserSender sends the AddUser request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) AddUserSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddUserResponder handles the response to the AddUser request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) AddUserResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// DeleteUser you can delete a user account to a node only when it is in the idle or running state.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the machine on which you want
-// to delete a user account. userName is the name of the user account to delete. timeout is the maximum time that
-// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client ComputeNodeClient) DeleteUser(ctx context.Context, poolID string, nodeID string, userName string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeleteUserPreparer(ctx, poolID, nodeID, userName, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteUserSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteUserResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteUserPreparer prepares the DeleteUser request.
-func (client ComputeNodeClient) DeleteUserPreparer(ctx context.Context, poolID string, nodeID string, userName string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- "userName": autorest.Encode("path", userName),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users/{userName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteUserSender sends the DeleteUser request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) DeleteUserSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteUserResponder handles the response to the DeleteUser request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) DeleteUserResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// DisableScheduling you can disable task scheduling on a node only if its current scheduling state is enabled.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node on which you
-// want to disable task scheduling. nodeDisableSchedulingParameter is the parameters for the request. timeout is
-// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client ComputeNodeClient) DisableScheduling(ctx context.Context, poolID string, nodeID string, nodeDisableSchedulingParameter *NodeDisableSchedulingParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DisableSchedulingPreparer(ctx, poolID, nodeID, nodeDisableSchedulingParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DisableSchedulingSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", resp, "Failure sending request")
- return
- }
-
- result, err = client.DisableSchedulingResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DisableSchedulingPreparer prepares the DisableScheduling request.
-func (client ComputeNodeClient) DisableSchedulingPreparer(ctx context.Context, poolID string, nodeID string, nodeDisableSchedulingParameter *NodeDisableSchedulingParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/disablescheduling", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if nodeDisableSchedulingParameter != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(nodeDisableSchedulingParameter))
- }
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DisableSchedulingSender sends the DisableScheduling request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) DisableSchedulingSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DisableSchedulingResponder handles the response to the DisableScheduling request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) DisableSchedulingResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// EnableScheduling you can enable task scheduling on a node only if its current scheduling state is disabled
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node on which you
-// want to enable task scheduling. timeout is the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a
-// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are
-// calling the REST API directly.
-func (client ComputeNodeClient) EnableScheduling(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.EnableSchedulingPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.EnableSchedulingSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", resp, "Failure sending request")
- return
- }
-
- result, err = client.EnableSchedulingResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", resp, "Failure responding to request")
- }
-
- return
-}
-
-// EnableSchedulingPreparer prepares the EnableScheduling request.
-func (client ComputeNodeClient) EnableSchedulingPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/enablescheduling", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// EnableSchedulingSender sends the EnableScheduling request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) EnableSchedulingSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// EnableSchedulingResponder handles the response to the EnableScheduling request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) EnableSchedulingResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get sends the get request.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that you want
-// to get information about. selectParameter is an OData $select clause. timeout is the maximum time that the
-// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client ComputeNodeClient) Get(ctx context.Context, poolID string, nodeID string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNode, err error) {
- req, err := client.GetPreparer(ctx, poolID, nodeID, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client ComputeNodeClient) GetPreparer(ctx context.Context, poolID string, nodeID string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) GetResponder(resp *http.Response) (result ComputeNode, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetRemoteDesktop before you can access a node by using the RDP file, you must create a user account on the node.
-// This API can only be invoked on pools created with a cloud service configuration. For pools created with a virtual
-// machine configuration, see the GetRemoteLoginSettings API.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node for which you
-// want to get the Remote Desktop Protocol file. timeout is the maximum time that the server can spend processing
-// the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in
-// the form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. Client libraries typically set this to the current system clock time; set it
-// explicitly if you are calling the REST API directly.
-func (client ComputeNodeClient) GetRemoteDesktop(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ReadCloser, err error) {
- req, err := client.GetRemoteDesktopPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetRemoteDesktopSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetRemoteDesktopResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetRemoteDesktopPreparer prepares the GetRemoteDesktop request.
-func (client ComputeNodeClient) GetRemoteDesktopPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/rdp", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetRemoteDesktopSender sends the GetRemoteDesktop request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) GetRemoteDesktopSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetRemoteDesktopResponder handles the response to the GetRemoteDesktop request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) GetRemoteDesktopResponder(resp *http.Response) (result ReadCloser, err error) {
- result.Value = &resp.Body
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK))
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetRemoteLoginSettings before you can remotely login to a node using the remote login settings, you must create a
-// user account on the node. This API can be invoked only on pools created with the virtual machine configuration
-// property. For pools created with a cloud service configuration, see the GetRemoteDesktop API.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node for which to
-// obtain the remote login settings. timeout is the maximum time that the server can spend processing the request,
-// in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of
-// a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are
-// calling the REST API directly.
-func (client ComputeNodeClient) GetRemoteLoginSettings(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeGetRemoteLoginSettingsResult, err error) {
- req, err := client.GetRemoteLoginSettingsPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteLoginSettings", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetRemoteLoginSettingsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteLoginSettings", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetRemoteLoginSettingsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteLoginSettings", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetRemoteLoginSettingsPreparer prepares the GetRemoteLoginSettings request.
-func (client ComputeNodeClient) GetRemoteLoginSettingsPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/remoteloginsettings", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetRemoteLoginSettingsSender sends the GetRemoteLoginSettings request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) GetRemoteLoginSettingsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetRemoteLoginSettingsResponder handles the response to the GetRemoteLoginSettings request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) GetRemoteLoginSettingsResponder(resp *http.Response) (result ComputeNodeGetRemoteLoginSettingsResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List sends the list request.
-//
-// poolID is the ID of the pool from which you want to list nodes. filter is an OData $filter clause..
-// selectParameter is an OData $select clause. maxResults is the maximum number of items to return in the response.
-// A maximum of 1000 nodes can be returned. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. Client libraries typically set this to the current system clock time; set it
-// explicitly if you are calling the REST API directly.
-func (client ComputeNodeClient) List(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.ComputeNodeClient", "List", err.Error())
- }
-
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, poolID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.cnlr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", resp, "Failure sending request")
- return
- }
-
- result.cnlr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client ComputeNodeClient) ListPreparer(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) ListResponder(resp *http.Response) (result ComputeNodeListResult, 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 ComputeNodeClient) listNextResults(lastResults ComputeNodeListResult) (result ComputeNodeListResult, err error) {
- req, err := lastResults.computeNodeListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "listNextResults", 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.ComputeNodeClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client ComputeNodeClient) ListComplete(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeListResultIterator, err error) {
- result.page, err = client.List(ctx, poolID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// Reboot you can restart a node only if it is in an idle or running state.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that you want
-// to restart. nodeRebootParameter is the parameters for the request. timeout is the maximum time that the server
-// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated
-// request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client ComputeNodeClient) Reboot(ctx context.Context, poolID string, nodeID string, nodeRebootParameter *NodeRebootParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.RebootPreparer(ctx, poolID, nodeID, nodeRebootParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.RebootSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", resp, "Failure sending request")
- return
- }
-
- result, err = client.RebootResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", resp, "Failure responding to request")
- }
-
- return
-}
-
-// RebootPreparer prepares the Reboot request.
-func (client ComputeNodeClient) RebootPreparer(ctx context.Context, poolID string, nodeID string, nodeRebootParameter *NodeRebootParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/reboot", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if nodeRebootParameter != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(nodeRebootParameter))
- }
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// RebootSender sends the Reboot request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) RebootSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// RebootResponder handles the response to the Reboot request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) RebootResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Reimage you can reinstall the operating system on a node only if it is in an idle or running state. This API can be
-// invoked only on pools created with the cloud service configuration property.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that you want
-// to restart. nodeReimageParameter is the parameters for the request. timeout is the maximum time that the server
-// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated
-// request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client ComputeNodeClient) Reimage(ctx context.Context, poolID string, nodeID string, nodeReimageParameter *NodeReimageParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.ReimagePreparer(ctx, poolID, nodeID, nodeReimageParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ReimageSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", resp, "Failure sending request")
- return
- }
-
- result, err = client.ReimageResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ReimagePreparer prepares the Reimage request.
-func (client ComputeNodeClient) ReimagePreparer(ctx context.Context, poolID string, nodeID string, nodeReimageParameter *NodeReimageParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/reimage", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if nodeReimageParameter != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(nodeReimageParameter))
- }
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ReimageSender sends the Reimage request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) ReimageSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ReimageResponder handles the response to the Reimage request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// UpdateUser this operation replaces of all the updateable properties of the account. For example, if the expiryTime
-// element is not specified, the current value is replaced with the default value, not left unmodified. You can update
-// a user account on a node only when it is in the idle or running state.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the machine on which you want
-// to update a user account. userName is the name of the user account to update. nodeUpdateUserParameter is the
-// parameters for the request. timeout is the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a
-// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are
-// calling the REST API directly.
-func (client ComputeNodeClient) UpdateUser(ctx context.Context, poolID string, nodeID string, userName string, nodeUpdateUserParameter NodeUpdateUserParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.UpdateUserPreparer(ctx, poolID, nodeID, userName, nodeUpdateUserParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateUserSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateUserResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdateUserPreparer prepares the UpdateUser request.
-func (client ComputeNodeClient) UpdateUserPreparer(ctx context.Context, poolID string, nodeID string, userName string, nodeUpdateUserParameter NodeUpdateUserParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- "userName": autorest.Encode("path", userName),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users/{userName}", pathParameters),
- autorest.WithJSON(nodeUpdateUserParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateUserSender sends the UpdateUser request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) UpdateUserSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateUserResponder handles the response to the UpdateUser request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) UpdateUserResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff --git a/services/batch/2017-06-01.5.1/batch/file.go b/services/batch/2017-06-01.5.1/batch/file.go
deleted file mode 100644
index 0049b60508f8..000000000000
--- a/services/batch/2017-06-01.5.1/batch/file.go
+++ /dev/null
@@ -1,942 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// FileClient is the a client for issuing REST requests to the Azure Batch service.
-type FileClient struct {
- BaseClient
-}
-
-// NewFileClient creates an instance of the FileClient client.
-func NewFileClient() FileClient {
- return NewFileClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewFileClientWithBaseURI creates an instance of the FileClient client.
-func NewFileClientWithBaseURI(baseURI string) FileClient {
- return FileClient{NewWithBaseURI(baseURI)}
-}
-
-// DeleteFromComputeNode sends the delete from compute node request.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node from which you
-// want to delete the file. filePath is the path to the file or directory that you want to delete. recursive is
-// whether to delete children of a directory. If the filePath parameter represents a directory instead of a file,
-// you can set recursive to true to delete the directory and all of the files and subdirectories in it. If
-// recursive is false then the directory must be empty or deletion will fail. timeout is the maximum time that the
-// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client FileClient) DeleteFromComputeNode(ctx context.Context, poolID string, nodeID string, filePath string, recursive *bool, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeleteFromComputeNodePreparer(ctx, poolID, nodeID, filePath, recursive, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteFromComputeNodeSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteFromComputeNodeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteFromComputeNodePreparer prepares the DeleteFromComputeNode request.
-func (client FileClient) DeleteFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, filePath string, recursive *bool, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "filePath": autorest.Encode("path", filePath),
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if recursive != nil {
- queryParameters["recursive"] = autorest.Encode("query", *recursive)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{filePath}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteFromComputeNodeSender sends the DeleteFromComputeNode request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) DeleteFromComputeNodeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteFromComputeNodeResponder handles the response to the DeleteFromComputeNode request. The method always
-// closes the http.Response Body.
-func (client FileClient) DeleteFromComputeNodeResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// DeleteFromTask sends the delete from task request.
-//
-// jobID is the ID of the job that contains the task. taskID is the ID of the task whose file you want to delete.
-// filePath is the path to the task file or directory that you want to delete. recursive is whether to delete
-// children of a directory. If the filePath parameter represents a directory instead of a file, you can set
-// recursive to true to delete the directory and all of the files and subdirectories in it. If recursive is false
-// then the directory must be empty or deletion will fail. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client FileClient) DeleteFromTask(ctx context.Context, jobID string, taskID string, filePath string, recursive *bool, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeleteFromTaskPreparer(ctx, jobID, taskID, filePath, recursive, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteFromTaskSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteFromTaskResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteFromTaskPreparer prepares the DeleteFromTask request.
-func (client FileClient) DeleteFromTaskPreparer(ctx context.Context, jobID string, taskID string, filePath string, recursive *bool, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "filePath": autorest.Encode("path", filePath),
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if recursive != nil {
- queryParameters["recursive"] = autorest.Encode("query", *recursive)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{filePath}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteFromTaskSender sends the DeleteFromTask request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) DeleteFromTaskSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteFromTaskResponder handles the response to the DeleteFromTask request. The method always
-// closes the http.Response Body.
-func (client FileClient) DeleteFromTaskResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// GetFromComputeNode returns the content of the specified compute node file.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that contains
-// the file. filePath is the path to the compute node file that you want to get the content of. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ocpRange is
-// the byte range to be retrieved. The default is to retrieve the entire file. The format is
-// bytes=startRange-endRange. ifModifiedSince is a timestamp indicating the last modified time of the resource
-// known to the client. The operation will be performed only if the resource on the service has been modified since
-// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to
-// the client. The operation will be performed only if the resource on the service has not been modified since the
-// specified time.
-func (client FileClient) GetFromComputeNode(ctx context.Context, poolID string, nodeID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result ReadCloser, err error) {
- req, err := client.GetFromComputeNodePreparer(ctx, poolID, nodeID, filePath, timeout, clientRequestID, returnClientRequestID, ocpDate, ocpRange, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetFromComputeNodeSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetFromComputeNodeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetFromComputeNodePreparer prepares the GetFromComputeNode request.
-func (client FileClient) GetFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "filePath": autorest.Encode("path", filePath),
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{filePath}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ocpRange) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-range", autorest.String(ocpRange)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetFromComputeNodeSender sends the GetFromComputeNode request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) GetFromComputeNodeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetFromComputeNodeResponder handles the response to the GetFromComputeNode request. The method always
-// closes the http.Response Body.
-func (client FileClient) GetFromComputeNodeResponder(resp *http.Response) (result ReadCloser, err error) {
- result.Value = &resp.Body
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK))
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetFromTask returns the content of the specified task file.
-//
-// jobID is the ID of the job that contains the task. taskID is the ID of the task whose file you want to retrieve.
-// filePath is the path to the task file that you want to get the content of. timeout is the maximum time that the
-// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ocpRange is
-// the byte range to be retrieved. The default is to retrieve the entire file. The format is
-// bytes=startRange-endRange. ifModifiedSince is a timestamp indicating the last modified time of the resource
-// known to the client. The operation will be performed only if the resource on the service has been modified since
-// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to
-// the client. The operation will be performed only if the resource on the service has not been modified since the
-// specified time.
-func (client FileClient) GetFromTask(ctx context.Context, jobID string, taskID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result ReadCloser, err error) {
- req, err := client.GetFromTaskPreparer(ctx, jobID, taskID, filePath, timeout, clientRequestID, returnClientRequestID, ocpDate, ocpRange, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetFromTaskSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetFromTaskResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetFromTaskPreparer prepares the GetFromTask request.
-func (client FileClient) GetFromTaskPreparer(ctx context.Context, jobID string, taskID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "filePath": autorest.Encode("path", filePath),
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{filePath}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ocpRange) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-range", autorest.String(ocpRange)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetFromTaskSender sends the GetFromTask request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) GetFromTaskSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetFromTaskResponder handles the response to the GetFromTask request. The method always
-// closes the http.Response Body.
-func (client FileClient) GetFromTaskResponder(resp *http.Response) (result ReadCloser, err error) {
- result.Value = &resp.Body
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK))
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetPropertiesFromComputeNode gets the properties of the specified compute node file.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that contains
-// the file. filePath is the path to the compute node file that you want to get the properties of. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client FileClient) GetPropertiesFromComputeNode(ctx context.Context, poolID string, nodeID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.GetPropertiesFromComputeNodePreparer(ctx, poolID, nodeID, filePath, timeout, clientRequestID, returnClientRequestID, ocpDate, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromComputeNode", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetPropertiesFromComputeNodeSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromComputeNode", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetPropertiesFromComputeNodeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromComputeNode", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPropertiesFromComputeNodePreparer prepares the GetPropertiesFromComputeNode request.
-func (client FileClient) GetPropertiesFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "filePath": autorest.Encode("path", filePath),
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsHead(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{filePath}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetPropertiesFromComputeNodeSender sends the GetPropertiesFromComputeNode request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) GetPropertiesFromComputeNodeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetPropertiesFromComputeNodeResponder handles the response to the GetPropertiesFromComputeNode request. The method always
-// closes the http.Response Body.
-func (client FileClient) GetPropertiesFromComputeNodeResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// GetPropertiesFromTask gets the properties of the specified task file.
-//
-// jobID is the ID of the job that contains the task. taskID is the ID of the task whose file you want to get the
-// properties of. filePath is the path to the task file that you want to get the properties of. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client FileClient) GetPropertiesFromTask(ctx context.Context, jobID string, taskID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.GetPropertiesFromTaskPreparer(ctx, jobID, taskID, filePath, timeout, clientRequestID, returnClientRequestID, ocpDate, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromTask", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetPropertiesFromTaskSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromTask", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetPropertiesFromTaskResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromTask", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPropertiesFromTaskPreparer prepares the GetPropertiesFromTask request.
-func (client FileClient) GetPropertiesFromTaskPreparer(ctx context.Context, jobID string, taskID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "filePath": autorest.Encode("path", filePath),
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsHead(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{filePath}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetPropertiesFromTaskSender sends the GetPropertiesFromTask request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) GetPropertiesFromTaskSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetPropertiesFromTaskResponder handles the response to the GetPropertiesFromTask request. The method always
-// closes the http.Response Body.
-func (client FileClient) GetPropertiesFromTaskResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// ListFromComputeNode sends the list from compute node request.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node whose files
-// you want to list. filter is an OData $filter clause. recursive is whether to list children of a directory.
-// maxResults is the maximum number of items to return in the response. A maximum of 1000 files can be returned.
-// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30
-// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such
-// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should
-// return the client-request-id in the response. ocpDate is the time the request was issued. Client libraries
-// typically set this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client FileClient) ListFromComputeNode(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.FileClient", "ListFromComputeNode", err.Error())
- }
-
- result.fn = client.listFromComputeNodeNextResults
- req, err := client.ListFromComputeNodePreparer(ctx, poolID, nodeID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListFromComputeNodeSender(req)
- if err != nil {
- result.nflr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", resp, "Failure sending request")
- return
- }
-
- result.nflr, err = client.ListFromComputeNodeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListFromComputeNodePreparer prepares the ListFromComputeNode request.
-func (client FileClient) ListFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if recursive != nil {
- queryParameters["recursive"] = autorest.Encode("query", *recursive)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListFromComputeNodeSender sends the ListFromComputeNode request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) ListFromComputeNodeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListFromComputeNodeResponder handles the response to the ListFromComputeNode request. The method always
-// closes the http.Response Body.
-func (client FileClient) ListFromComputeNodeResponder(resp *http.Response) (result NodeFileListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listFromComputeNodeNextResults retrieves the next set of results, if any.
-func (client FileClient) listFromComputeNodeNextResults(lastResults NodeFileListResult) (result NodeFileListResult, err error) {
- req, err := lastResults.nodeFileListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListFromComputeNodeSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListFromComputeNodeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListFromComputeNodeComplete enumerates all values, automatically crossing page boundaries as required.
-func (client FileClient) ListFromComputeNodeComplete(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultIterator, err error) {
- result.page, err = client.ListFromComputeNode(ctx, poolID, nodeID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// ListFromTask sends the list from task request.
-//
-// jobID is the ID of the job that contains the task. taskID is the ID of the task whose files you want to list.
-// filter is an OData $filter clause. recursive is whether to list children of the task directory. This parameter
-// can be used in combination with the filter parameter to list specific type of files. maxResults is the maximum
-// number of items to return in the response. A maximum of 1000 files can be returned. timeout is the maximum time
-// that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client FileClient) ListFromTask(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.FileClient", "ListFromTask", err.Error())
- }
-
- result.fn = client.listFromTaskNextResults
- req, err := client.ListFromTaskPreparer(ctx, jobID, taskID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListFromTaskSender(req)
- if err != nil {
- result.nflr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", resp, "Failure sending request")
- return
- }
-
- result.nflr, err = client.ListFromTaskResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListFromTaskPreparer prepares the ListFromTask request.
-func (client FileClient) ListFromTaskPreparer(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if recursive != nil {
- queryParameters["recursive"] = autorest.Encode("query", *recursive)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListFromTaskSender sends the ListFromTask request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) ListFromTaskSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListFromTaskResponder handles the response to the ListFromTask request. The method always
-// closes the http.Response Body.
-func (client FileClient) ListFromTaskResponder(resp *http.Response) (result NodeFileListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listFromTaskNextResults retrieves the next set of results, if any.
-func (client FileClient) listFromTaskNextResults(lastResults NodeFileListResult) (result NodeFileListResult, err error) {
- req, err := lastResults.nodeFileListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListFromTaskSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListFromTaskResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListFromTaskComplete enumerates all values, automatically crossing page boundaries as required.
-func (client FileClient) ListFromTaskComplete(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultIterator, err error) {
- result.page, err = client.ListFromTask(ctx, jobID, taskID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
diff --git a/services/batch/2017-06-01.5.1/batch/job.go b/services/batch/2017-06-01.5.1/batch/job.go
deleted file mode 100644
index 03e165045e9d..000000000000
--- a/services/batch/2017-06-01.5.1/batch/job.go
+++ /dev/null
@@ -1,1625 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// JobClient is the a client for issuing REST requests to the Azure Batch service.
-type JobClient struct {
- BaseClient
-}
-
-// NewJobClient creates an instance of the JobClient client.
-func NewJobClient() JobClient {
- return NewJobClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewJobClientWithBaseURI creates an instance of the JobClient client.
-func NewJobClientWithBaseURI(baseURI string) JobClient {
- return JobClient{NewWithBaseURI(baseURI)}
-}
-
-// Add the Batch service supports two ways to control the work done as part of a job. In the first approach, the user
-// specifies a Job Manager task. The Batch service launches this task when it is ready to start the job. The Job
-// Manager task controls all other tasks that run under this job, by using the Task APIs. In the second approach, the
-// user directly controls the execution of tasks under an active job, by using the Task APIs. Also note: when naming
-// jobs, avoid including sensitive information such as user names or secret project names. This information may appear
-// in telemetry logs accessible to Microsoft Support engineers.
-//
-// job is the job to be added. timeout is the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a
-// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are
-// calling the REST API directly.
-func (client JobClient) Add(ctx context.Context, job JobAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: job,
- Constraints: []validation.Constraint{{Target: "job.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.JobManagerTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.JobManagerTask.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.JobManagerTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "job.JobPreparationTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.JobPreparationTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "job.JobReleaseTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.JobReleaseTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "job.PoolInfo", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.VMSize", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.OsDisk", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.OsDisk.ImageUris", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration.EndpointConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration.EndpointConfiguration.InboundNATPools", Name: validation.Null, Rule: true, Chain: nil}}},
- }},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.StartTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}},
- }},
- }},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobClient", "Add", err.Error())
- }
-
- req, err := client.AddPreparer(ctx, job, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPreparer prepares the Add request.
-func (client JobClient) AddPreparer(ctx context.Context, job JobAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/jobs"),
- autorest.WithJSON(job),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSender sends the Add request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) AddSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddResponder handles the response to the Add request. The method always
-// closes the http.Response Body.
-func (client JobClient) AddResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Delete deleting a job also deletes all tasks that are part of that job, and all job statistics. This also overrides
-// the retention period for task data; that is, if the job contains tasks which are still retained on compute nodes,
-// the Batch services deletes those tasks' working directories and all their contents. When a Delete Job request is
-// received, the Batch service sets the job to the deleting state. All update operations on a job that is in deleting
-// state will fail with status code 409 (Conflict), with additional information indicating that the job is being
-// deleted.
-//
-// jobID is the ID of the job to delete. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. Client libraries typically set this to the current system clock time; set it
-// explicitly if you are calling the REST API directly. ifMatch is an ETag value associated with the version of the
-// resource known to the client. The operation will be performed only if the resource's current ETag on the service
-// exactly matches the value specified by the client. ifNoneMatch is an ETag value associated with the version of
-// the resource known to the client. The operation will be performed only if the resource's current ETag on the
-// service does not match the value specified by the client. ifModifiedSince is a timestamp indicating the last
-// modified time of the resource known to the client. The operation will be performed only if the resource on the
-// service has been modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last
-// modified time of the resource known to the client. The operation will be performed only if the resource on the
-// service has not been modified since the specified time.
-func (client JobClient) Delete(ctx context.Context, jobID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeletePreparer(ctx, jobID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client JobClient) DeletePreparer(ctx context.Context, jobID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client JobClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Disable the Batch Service immediately moves the job to the disabling state. Batch then uses the disableTasks
-// parameter to determine what to do with the currently running tasks of the job. The job remains in the disabling
-// state until the disable operation is completed and all tasks have been dealt with according to the disableTasks
-// option; the job then moves to the disabled state. No new tasks are started under the job until it moves back to
-// active state. If you try to disable a job that is in any state other than active, disabling, or disabled, the
-// request fails with status code 409.
-//
-// jobID is the ID of the job to disable. jobDisableParameter is the parameters for the request. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client JobClient) Disable(ctx context.Context, jobID string, jobDisableParameter JobDisableParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DisablePreparer(ctx, jobID, jobDisableParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DisableSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", resp, "Failure sending request")
- return
- }
-
- result, err = client.DisableResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DisablePreparer prepares the Disable request.
-func (client JobClient) DisablePreparer(ctx context.Context, jobID string, jobDisableParameter JobDisableParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/disable", pathParameters),
- autorest.WithJSON(jobDisableParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DisableSender sends the Disable request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) DisableSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DisableResponder handles the response to the Disable request. The method always
-// closes the http.Response Body.
-func (client JobClient) DisableResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Enable when you call this API, the Batch service sets a disabled job to the enabling state. After the this operation
-// is completed, the job moves to the active state, and scheduling of new tasks under the job resumes. The Batch
-// service does not allow a task to remain in the active state for more than 7 days. Therefore, if you enable a job
-// containing active tasks which were added more than 7 days ago, those tasks will not run.
-//
-// jobID is the ID of the job to enable. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. Client libraries typically set this to the current system clock time; set it
-// explicitly if you are calling the REST API directly. ifMatch is an ETag value associated with the version of the
-// resource known to the client. The operation will be performed only if the resource's current ETag on the service
-// exactly matches the value specified by the client. ifNoneMatch is an ETag value associated with the version of
-// the resource known to the client. The operation will be performed only if the resource's current ETag on the
-// service does not match the value specified by the client. ifModifiedSince is a timestamp indicating the last
-// modified time of the resource known to the client. The operation will be performed only if the resource on the
-// service has been modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last
-// modified time of the resource known to the client. The operation will be performed only if the resource on the
-// service has not been modified since the specified time.
-func (client JobClient) Enable(ctx context.Context, jobID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.EnablePreparer(ctx, jobID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.EnableSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", resp, "Failure sending request")
- return
- }
-
- result, err = client.EnableResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", resp, "Failure responding to request")
- }
-
- return
-}
-
-// EnablePreparer prepares the Enable request.
-func (client JobClient) EnablePreparer(ctx context.Context, jobID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/enable", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// EnableSender sends the Enable request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) EnableSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// EnableResponder handles the response to the Enable request. The method always
-// closes the http.Response Body.
-func (client JobClient) EnableResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get sends the get request.
-//
-// jobID is the ID of the job. selectParameter is an OData $select clause. expand is an OData $expand clause.
-// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30
-// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such
-// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should
-// return the client-request-id in the response. ocpDate is the time the request was issued. Client libraries
-// typically set this to the current system clock time; set it explicitly if you are calling the REST API directly.
-// ifMatch is an ETag value associated with the version of the resource known to the client. The operation will be
-// performed only if the resource's current ETag on the service exactly matches the value specified by the client.
-// ifNoneMatch is an ETag value associated with the version of the resource known to the client. The operation will
-// be performed only if the resource's current ETag on the service does not match the value specified by the
-// client. ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client.
-// The operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client JobClient) Get(ctx context.Context, jobID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudJob, err error) {
- req, err := client.GetPreparer(ctx, jobID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client JobClient) GetPreparer(ctx context.Context, jobID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client JobClient) GetResponder(resp *http.Response) (result CloudJob, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetAllLifetimeStatistics statistics are aggregated across all jobs that have ever existed in the account, from
-// account creation to the last update time of the statistics.
-//
-// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30
-// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such
-// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should
-// return the client-request-id in the response. ocpDate is the time the request was issued. Client libraries
-// typically set this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client JobClient) GetAllLifetimeStatistics(ctx context.Context, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result JobStatistics, err error) {
- req, err := client.GetAllLifetimeStatisticsPreparer(ctx, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllLifetimeStatistics", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetAllLifetimeStatisticsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllLifetimeStatistics", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetAllLifetimeStatisticsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllLifetimeStatistics", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetAllLifetimeStatisticsPreparer prepares the GetAllLifetimeStatistics request.
-func (client JobClient) GetAllLifetimeStatisticsPreparer(ctx context.Context, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/lifetimejobstats"),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetAllLifetimeStatisticsSender sends the GetAllLifetimeStatistics request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) GetAllLifetimeStatisticsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetAllLifetimeStatisticsResponder handles the response to the GetAllLifetimeStatistics request. The method always
-// closes the http.Response Body.
-func (client JobClient) GetAllLifetimeStatisticsResponder(resp *http.Response) (result JobStatistics, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetTaskCounts task counts provide a count of the tasks by active, running or completed task state, and a count of
-// tasks which succeeded or failed. Tasks in the preparing state are counted as running. If the validationStatus is
-// unvalidated, then the Batch service has not been able to check state counts against the task states as reported in
-// the List Tasks API. The validationStatus may be unvalidated if the job contains more than 200,000 tasks.
-//
-// jobID is the ID of the job. timeout is the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a
-// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are
-// calling the REST API directly.
-func (client JobClient) GetTaskCounts(ctx context.Context, jobID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result TaskCounts, err error) {
- req, err := client.GetTaskCountsPreparer(ctx, jobID, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "GetTaskCounts", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetTaskCountsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobClient", "GetTaskCounts", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetTaskCountsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "GetTaskCounts", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetTaskCountsPreparer prepares the GetTaskCounts request.
-func (client JobClient) GetTaskCountsPreparer(ctx context.Context, jobID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/taskcounts", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetTaskCountsSender sends the GetTaskCounts request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) GetTaskCountsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetTaskCountsResponder handles the response to the GetTaskCounts request. The method always
-// closes the http.Response Body.
-func (client JobClient) GetTaskCountsResponder(resp *http.Response) (result TaskCounts, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List sends the list request.
-//
-// filter is an OData $filter clause. selectParameter is an OData $select clause. expand is an OData $expand
-// clause. maxResults is the maximum number of items to return in the response. A maximum of 1000 jobs can be
-// returned. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client
-// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API
-// directly.
-func (client JobClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobClient", "List", err.Error())
- }
-
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.cjlr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobClient", "List", resp, "Failure sending request")
- return
- }
-
- result.cjlr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client JobClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/jobs"),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client JobClient) ListResponder(resp *http.Response) (result CloudJobListResult, 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 JobClient) listNextResults(lastResults CloudJobListResult) (result CloudJobListResult, err error) {
- req, err := lastResults.cloudJobListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.JobClient", "listNextResults", 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.JobClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client JobClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultIterator, err error) {
- result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// ListFromJobSchedule sends the list from job schedule request.
-//
-// jobScheduleID is the ID of the job schedule from which you want to get a list of jobs. filter is an OData
-// $filter clause. selectParameter is an OData $select clause. expand is an OData $expand clause. maxResults is the
-// maximum number of items to return in the response. A maximum of 1000 jobs can be returned. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client JobClient) ListFromJobSchedule(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobClient", "ListFromJobSchedule", err.Error())
- }
-
- result.fn = client.listFromJobScheduleNextResults
- req, err := client.ListFromJobSchedulePreparer(ctx, jobScheduleID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListFromJobScheduleSender(req)
- if err != nil {
- result.cjlr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", resp, "Failure sending request")
- return
- }
-
- result.cjlr, err = client.ListFromJobScheduleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListFromJobSchedulePreparer prepares the ListFromJobSchedule request.
-func (client JobClient) ListFromJobSchedulePreparer(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}/jobs", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListFromJobScheduleSender sends the ListFromJobSchedule request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) ListFromJobScheduleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListFromJobScheduleResponder handles the response to the ListFromJobSchedule request. The method always
-// closes the http.Response Body.
-func (client JobClient) ListFromJobScheduleResponder(resp *http.Response) (result CloudJobListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listFromJobScheduleNextResults retrieves the next set of results, if any.
-func (client JobClient) listFromJobScheduleNextResults(lastResults CloudJobListResult) (result CloudJobListResult, err error) {
- req, err := lastResults.cloudJobListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListFromJobScheduleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListFromJobScheduleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListFromJobScheduleComplete enumerates all values, automatically crossing page boundaries as required.
-func (client JobClient) ListFromJobScheduleComplete(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultIterator, err error) {
- result.page, err = client.ListFromJobSchedule(ctx, jobScheduleID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// ListPreparationAndReleaseTaskStatus this API returns the Job Preparation and Job Release task status on all compute
-// nodes that have run the Job Preparation or Job Release task. This includes nodes which have since been removed from
-// the pool. If this API is invoked on a job which has no Job Preparation or Job Release task, the Batch service
-// returns HTTP status code 409 (Conflict) with an error code of JobPreparationTaskNotSpecified.
-//
-// jobID is the ID of the job. filter is an OData $filter clause. To get the status of the Job Preparation and Job
-// Release tasks on a specific compute node, use "nodeId eq '{desired-node-id}'" selectParameter is an OData
-// $select clause. maxResults is the maximum number of items to return in the response. A maximum of 1000 tasks can
-// be returned. timeout is the maximum time that the server can spend processing the request, in seconds. The
-// default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client
-// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API
-// directly.
-func (client JobClient) ListPreparationAndReleaseTaskStatus(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListPreparationAndReleaseTaskStatusResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobClient", "ListPreparationAndReleaseTaskStatus", err.Error())
- }
-
- result.fn = client.listPreparationAndReleaseTaskStatusNextResults
- req, err := client.ListPreparationAndReleaseTaskStatusPreparer(ctx, jobID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListPreparationAndReleaseTaskStatusSender(req)
- if err != nil {
- result.cjlpartsr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", resp, "Failure sending request")
- return
- }
-
- result.cjlpartsr, err = client.ListPreparationAndReleaseTaskStatusResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparationAndReleaseTaskStatusPreparer prepares the ListPreparationAndReleaseTaskStatus request.
-func (client JobClient) ListPreparationAndReleaseTaskStatusPreparer(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/jobpreparationandreleasetaskstatus", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListPreparationAndReleaseTaskStatusSender sends the ListPreparationAndReleaseTaskStatus request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) ListPreparationAndReleaseTaskStatusSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListPreparationAndReleaseTaskStatusResponder handles the response to the ListPreparationAndReleaseTaskStatus request. The method always
-// closes the http.Response Body.
-func (client JobClient) ListPreparationAndReleaseTaskStatusResponder(resp *http.Response) (result CloudJobListPreparationAndReleaseTaskStatusResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listPreparationAndReleaseTaskStatusNextResults retrieves the next set of results, if any.
-func (client JobClient) listPreparationAndReleaseTaskStatusNextResults(lastResults CloudJobListPreparationAndReleaseTaskStatusResult) (result CloudJobListPreparationAndReleaseTaskStatusResult, err error) {
- req, err := lastResults.cloudJobListPreparationAndReleaseTaskStatusResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListPreparationAndReleaseTaskStatusSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListPreparationAndReleaseTaskStatusResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListPreparationAndReleaseTaskStatusComplete enumerates all values, automatically crossing page boundaries as required.
-func (client JobClient) ListPreparationAndReleaseTaskStatusComplete(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListPreparationAndReleaseTaskStatusResultIterator, err error) {
- result.page, err = client.ListPreparationAndReleaseTaskStatus(ctx, jobID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// Patch this replaces only the job properties specified in the request. For example, if the job has constraints, and a
-// request does not specify the constraints element, then the job keeps the existing constraints.
-//
-// jobID is the ID of the job whose properties you want to update. jobPatchParameter is the parameters for the
-// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client
-// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API
-// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The
-// operation will be performed only if the resource's current ETag on the service exactly matches the value
-// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the
-// client. The operation will be performed only if the resource's current ETag on the service does not match the
-// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource
-// known to the client. The operation will be performed only if the resource on the service has been modified since
-// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to
-// the client. The operation will be performed only if the resource on the service has not been modified since the
-// specified time.
-func (client JobClient) Patch(ctx context.Context, jobID string, jobPatchParameter JobPatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.PatchPreparer(ctx, jobID, jobPatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.PatchSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", resp, "Failure sending request")
- return
- }
-
- result, err = client.PatchResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", resp, "Failure responding to request")
- }
-
- return
-}
-
-// PatchPreparer prepares the Patch request.
-func (client JobClient) PatchPreparer(ctx context.Context, jobID string, jobPatchParameter JobPatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPatch(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}", pathParameters),
- autorest.WithJSON(jobPatchParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// PatchSender sends the Patch request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) PatchSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// PatchResponder handles the response to the Patch request. The method always
-// closes the http.Response Body.
-func (client JobClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Terminate when a Terminate Job request is received, the Batch service sets the job to the terminating state. The
-// Batch service then terminates any active or running tasks associated with the job, and runs any required Job Release
-// tasks. The job then moves into the completed state.
-//
-// jobID is the ID of the job to terminate. jobTerminateParameter is the parameters for the request. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client JobClient) Terminate(ctx context.Context, jobID string, jobTerminateParameter *JobTerminateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.TerminatePreparer(ctx, jobID, jobTerminateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.TerminateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", resp, "Failure sending request")
- return
- }
-
- result, err = client.TerminateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", resp, "Failure responding to request")
- }
-
- return
-}
-
-// TerminatePreparer prepares the Terminate request.
-func (client JobClient) TerminatePreparer(ctx context.Context, jobID string, jobTerminateParameter *JobTerminateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/terminate", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if jobTerminateParameter != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(jobTerminateParameter))
- }
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// TerminateSender sends the Terminate request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) TerminateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// TerminateResponder handles the response to the Terminate request. The method always
-// closes the http.Response Body.
-func (client JobClient) TerminateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Update this fully replaces all the updateable properties of the job. For example, if the job has constraints
-// associated with it and if constraints is not specified with this request, then the Batch service will remove the
-// existing constraints.
-//
-// jobID is the ID of the job whose properties you want to update. jobUpdateParameter is the parameters for the
-// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client
-// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API
-// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The
-// operation will be performed only if the resource's current ETag on the service exactly matches the value
-// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the
-// client. The operation will be performed only if the resource's current ETag on the service does not match the
-// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource
-// known to the client. The operation will be performed only if the resource on the service has been modified since
-// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to
-// the client. The operation will be performed only if the resource on the service has not been modified since the
-// specified time.
-func (client JobClient) Update(ctx context.Context, jobID string, jobUpdateParameter JobUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: jobUpdateParameter,
- Constraints: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VMSize", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.OsDisk", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.OsDisk.ImageUris", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration.EndpointConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration.EndpointConfiguration.InboundNATPools", Name: validation.Null, Rule: true, Chain: nil}}},
- }},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.StartTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}},
- }},
- }},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobClient", "Update", err.Error())
- }
-
- req, err := client.UpdatePreparer(ctx, jobID, jobUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePreparer prepares the Update request.
-func (client JobClient) UpdatePreparer(ctx context.Context, jobID string, jobUpdateParameter JobUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}", pathParameters),
- autorest.WithJSON(jobUpdateParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSender sends the Update request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) UpdateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateResponder handles the response to the Update request. The method always
-// closes the http.Response Body.
-func (client JobClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff --git a/services/batch/2017-06-01.5.1/batch/jobschedule.go b/services/batch/2017-06-01.5.1/batch/jobschedule.go
deleted file mode 100644
index 7b93a9483216..000000000000
--- a/services/batch/2017-06-01.5.1/batch/jobschedule.go
+++ /dev/null
@@ -1,1269 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// JobScheduleClient is the a client for issuing REST requests to the Azure Batch service.
-type JobScheduleClient struct {
- BaseClient
-}
-
-// NewJobScheduleClient creates an instance of the JobScheduleClient client.
-func NewJobScheduleClient() JobScheduleClient {
- return NewJobScheduleClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewJobScheduleClientWithBaseURI creates an instance of the JobScheduleClient client.
-func NewJobScheduleClientWithBaseURI(baseURI string) JobScheduleClient {
- return JobScheduleClient{NewWithBaseURI(baseURI)}
-}
-
-// Add sends the add request.
-//
-// cloudJobSchedule is the job schedule to be added. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client JobScheduleClient) Add(ctx context.Context, cloudJobSchedule JobScheduleAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: cloudJobSchedule,
- Constraints: []validation.Constraint{{Target: "cloudJobSchedule.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.Schedule", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobManagerTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobManagerTask.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification.JobManagerTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "cloudJobSchedule.JobSpecification.JobPreparationTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobPreparationTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "cloudJobSchedule.JobSpecification.JobReleaseTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobReleaseTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VMSize", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.OsDisk", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.OsDisk.ImageUris", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration.EndpointConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration.EndpointConfiguration.InboundNATPools", Name: validation.Null, Rule: true, Chain: nil}}},
- }},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}},
- }},
- }},
- }},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobScheduleClient", "Add", err.Error())
- }
-
- req, err := client.AddPreparer(ctx, cloudJobSchedule, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPreparer prepares the Add request.
-func (client JobScheduleClient) AddPreparer(ctx context.Context, cloudJobSchedule JobScheduleAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/jobschedules"),
- autorest.WithJSON(cloudJobSchedule),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSender sends the Add request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) AddSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddResponder handles the response to the Add request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) AddResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Delete when you delete a job schedule, this also deletes all jobs and tasks under that schedule. When tasks are
-// deleted, all the files in their working directories on the compute nodes are also deleted (the retention period is
-// ignored). The job schedule statistics are no longer accessible once the job schedule is deleted, though they are
-// still counted towards account lifetime statistics.
-//
-// jobScheduleID is the ID of the job schedule to delete. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client JobScheduleClient) Delete(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeletePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client JobScheduleClient) DeletePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Disable no new jobs will be created until the job schedule is enabled again.
-//
-// jobScheduleID is the ID of the job schedule to disable. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client JobScheduleClient) Disable(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DisablePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DisableSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", resp, "Failure sending request")
- return
- }
-
- result, err = client.DisableResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DisablePreparer prepares the Disable request.
-func (client JobScheduleClient) DisablePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}/disable", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DisableSender sends the Disable request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) DisableSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DisableResponder handles the response to the Disable request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) DisableResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Enable sends the enable request.
-//
-// jobScheduleID is the ID of the job schedule to enable. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client JobScheduleClient) Enable(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.EnablePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.EnableSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", resp, "Failure sending request")
- return
- }
-
- result, err = client.EnableResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", resp, "Failure responding to request")
- }
-
- return
-}
-
-// EnablePreparer prepares the Enable request.
-func (client JobScheduleClient) EnablePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}/enable", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// EnableSender sends the Enable request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) EnableSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// EnableResponder handles the response to the Enable request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) EnableResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Exists sends the exists request.
-//
-// jobScheduleID is the ID of the job schedule which you want to check. timeout is the maximum time that the server
-// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated
-// request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client JobScheduleClient) Exists(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.ExistsPreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ExistsSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", resp, "Failure sending request")
- return
- }
-
- result, err = client.ExistsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ExistsPreparer prepares the Exists request.
-func (client JobScheduleClient) ExistsPreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsHead(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ExistsSender sends the Exists request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) ExistsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ExistsResponder handles the response to the Exists request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) ExistsResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get gets information about the specified job schedule.
-//
-// jobScheduleID is the ID of the job schedule to get. selectParameter is an OData $select clause. expand is an
-// OData $expand clause. timeout is the maximum time that the server can spend processing the request, in seconds.
-// The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with
-// no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether
-// the server should return the client-request-id in the response. ocpDate is the time the request was issued.
-// Client libraries typically set this to the current system clock time; set it explicitly if you are calling the
-// REST API directly. ifMatch is an ETag value associated with the version of the resource known to the client. The
-// operation will be performed only if the resource's current ETag on the service exactly matches the value
-// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the
-// client. The operation will be performed only if the resource's current ETag on the service does not match the
-// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource
-// known to the client. The operation will be performed only if the resource on the service has been modified since
-// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to
-// the client. The operation will be performed only if the resource on the service has not been modified since the
-// specified time.
-func (client JobScheduleClient) Get(ctx context.Context, jobScheduleID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudJobSchedule, err error) {
- req, err := client.GetPreparer(ctx, jobScheduleID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client JobScheduleClient) GetPreparer(ctx context.Context, jobScheduleID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) GetResponder(resp *http.Response) (result CloudJobSchedule, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List sends the list request.
-//
-// filter is an OData $filter clause. selectParameter is an OData $select clause. expand is an OData $expand
-// clause. maxResults is the maximum number of items to return in the response. A maximum of 1000 job schedules can
-// be returned. timeout is the maximum time that the server can spend processing the request, in seconds. The
-// default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client
-// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API
-// directly.
-func (client JobScheduleClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobScheduleListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobScheduleClient", "List", err.Error())
- }
-
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.cjslr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", resp, "Failure sending request")
- return
- }
-
- result.cjslr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client JobScheduleClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/jobschedules"),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) ListResponder(resp *http.Response) (result CloudJobScheduleListResult, 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 JobScheduleClient) listNextResults(lastResults CloudJobScheduleListResult) (result CloudJobScheduleListResult, err error) {
- req, err := lastResults.cloudJobScheduleListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.JobScheduleClient", "listNextResults", 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.JobScheduleClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client JobScheduleClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobScheduleListResultIterator, err error) {
- result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// Patch this replaces only the job schedule properties specified in the request. For example, if the schedule property
-// is not specified with this request, then the Batch service will keep the existing schedule. Changes to a job
-// schedule only impact jobs created by the schedule after the update has taken place; currently running jobs are
-// unaffected.
-//
-// jobScheduleID is the ID of the job schedule to update. jobSchedulePatchParameter is the parameters for the
-// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client
-// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API
-// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The
-// operation will be performed only if the resource's current ETag on the service exactly matches the value
-// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the
-// client. The operation will be performed only if the resource's current ETag on the service does not match the
-// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource
-// known to the client. The operation will be performed only if the resource on the service has been modified since
-// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to
-// the client. The operation will be performed only if the resource on the service has not been modified since the
-// specified time.
-func (client JobScheduleClient) Patch(ctx context.Context, jobScheduleID string, jobSchedulePatchParameter JobSchedulePatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.PatchPreparer(ctx, jobScheduleID, jobSchedulePatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.PatchSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", resp, "Failure sending request")
- return
- }
-
- result, err = client.PatchResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", resp, "Failure responding to request")
- }
-
- return
-}
-
-// PatchPreparer prepares the Patch request.
-func (client JobScheduleClient) PatchPreparer(ctx context.Context, jobScheduleID string, jobSchedulePatchParameter JobSchedulePatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPatch(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters),
- autorest.WithJSON(jobSchedulePatchParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// PatchSender sends the Patch request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) PatchSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// PatchResponder handles the response to the Patch request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Terminate sends the terminate request.
-//
-// jobScheduleID is the ID of the job schedule to terminates. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client JobScheduleClient) Terminate(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.TerminatePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.TerminateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", resp, "Failure sending request")
- return
- }
-
- result, err = client.TerminateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", resp, "Failure responding to request")
- }
-
- return
-}
-
-// TerminatePreparer prepares the Terminate request.
-func (client JobScheduleClient) TerminatePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}/terminate", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// TerminateSender sends the Terminate request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) TerminateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// TerminateResponder handles the response to the Terminate request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) TerminateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Update this fully replaces all the updateable properties of the job schedule. For example, if the schedule property
-// is not specified with this request, then the Batch service will remove the existing schedule. Changes to a job
-// schedule only impact jobs created by the schedule after the update has taken place; currently running jobs are
-// unaffected.
-//
-// jobScheduleID is the ID of the job schedule to update. jobScheduleUpdateParameter is the parameters for the
-// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client
-// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API
-// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The
-// operation will be performed only if the resource's current ETag on the service exactly matches the value
-// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the
-// client. The operation will be performed only if the resource's current ETag on the service does not match the
-// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource
-// known to the client. The operation will be performed only if the resource on the service has been modified since
-// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to
-// the client. The operation will be performed only if the resource on the service has not been modified since the
-// specified time.
-func (client JobScheduleClient) Update(ctx context.Context, jobScheduleID string, jobScheduleUpdateParameter JobScheduleUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: jobScheduleUpdateParameter,
- Constraints: []validation.Constraint{{Target: "jobScheduleUpdateParameter.Schedule", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "jobScheduleUpdateParameter.JobSpecification.JobPreparationTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobPreparationTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "jobScheduleUpdateParameter.JobSpecification.JobReleaseTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobReleaseTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VMSize", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.OsDisk", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.OsDisk.ImageUris", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration.EndpointConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration.EndpointConfiguration.InboundNATPools", Name: validation.Null, Rule: true, Chain: nil}}},
- }},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}},
- }},
- }},
- }},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobScheduleClient", "Update", err.Error())
- }
-
- req, err := client.UpdatePreparer(ctx, jobScheduleID, jobScheduleUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePreparer prepares the Update request.
-func (client JobScheduleClient) UpdatePreparer(ctx context.Context, jobScheduleID string, jobScheduleUpdateParameter JobScheduleUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters),
- autorest.WithJSON(jobScheduleUpdateParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSender sends the Update request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) UpdateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateResponder handles the response to the Update request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff --git a/services/batch/2017-06-01.5.1/batch/models.go b/services/batch/2017-06-01.5.1/batch/models.go
deleted file mode 100644
index f40101979dfd..000000000000
--- a/services/batch/2017-06-01.5.1/batch/models.go
+++ /dev/null
@@ -1,3293 +0,0 @@
-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/date"
- "github.com/Azure/go-autorest/autorest/to"
- "io"
- "net/http"
-)
-
-// AccessScope enumerates the values for access scope.
-type AccessScope string
-
-const (
- // Job ...
- Job AccessScope = "job"
-)
-
-// PossibleAccessScopeValues returns an array of possible values for the AccessScope const type.
-func PossibleAccessScopeValues() []AccessScope {
- return []AccessScope{Job}
-}
-
-// AllocationState enumerates the values for allocation state.
-type AllocationState string
-
-const (
- // Resizing ...
- Resizing AllocationState = "resizing"
- // Steady ...
- Steady AllocationState = "steady"
- // Stopping ...
- Stopping AllocationState = "stopping"
-)
-
-// PossibleAllocationStateValues returns an array of possible values for the AllocationState const type.
-func PossibleAllocationStateValues() []AllocationState {
- return []AllocationState{Resizing, Steady, Stopping}
-}
-
-// AutoUserScope enumerates the values for auto user scope.
-type AutoUserScope string
-
-const (
- // Pool ...
- Pool AutoUserScope = "pool"
- // Task ...
- Task AutoUserScope = "task"
-)
-
-// PossibleAutoUserScopeValues returns an array of possible values for the AutoUserScope const type.
-func PossibleAutoUserScopeValues() []AutoUserScope {
- return []AutoUserScope{Pool, Task}
-}
-
-// CachingType enumerates the values for caching type.
-type CachingType string
-
-const (
- // None ...
- None CachingType = "none"
- // ReadOnly ...
- ReadOnly CachingType = "readOnly"
- // ReadWrite ...
- ReadWrite CachingType = "readWrite"
-)
-
-// PossibleCachingTypeValues returns an array of possible values for the CachingType const type.
-func PossibleCachingTypeValues() []CachingType {
- return []CachingType{None, ReadOnly, ReadWrite}
-}
-
-// CertificateFormat enumerates the values for certificate format.
-type CertificateFormat string
-
-const (
- // Cer ...
- Cer CertificateFormat = "cer"
- // Pfx ...
- Pfx CertificateFormat = "pfx"
-)
-
-// PossibleCertificateFormatValues returns an array of possible values for the CertificateFormat const type.
-func PossibleCertificateFormatValues() []CertificateFormat {
- return []CertificateFormat{Cer, Pfx}
-}
-
-// CertificateState enumerates the values for certificate state.
-type CertificateState string
-
-const (
- // Active ...
- Active CertificateState = "active"
- // DeleteFailed ...
- DeleteFailed CertificateState = "deleteFailed"
- // Deleting ...
- Deleting CertificateState = "deleting"
-)
-
-// PossibleCertificateStateValues returns an array of possible values for the CertificateState const type.
-func PossibleCertificateStateValues() []CertificateState {
- return []CertificateState{Active, DeleteFailed, Deleting}
-}
-
-// CertificateStoreLocation enumerates the values for certificate store location.
-type CertificateStoreLocation string
-
-const (
- // CurrentUser ...
- CurrentUser CertificateStoreLocation = "currentUser"
- // LocalMachine ...
- LocalMachine CertificateStoreLocation = "localMachine"
-)
-
-// PossibleCertificateStoreLocationValues returns an array of possible values for the CertificateStoreLocation const type.
-func PossibleCertificateStoreLocationValues() []CertificateStoreLocation {
- return []CertificateStoreLocation{CurrentUser, LocalMachine}
-}
-
-// CertificateVisibility enumerates the values for certificate visibility.
-type CertificateVisibility string
-
-const (
- // CertificateVisibilityRemoteUser ...
- CertificateVisibilityRemoteUser CertificateVisibility = "remoteUser"
- // CertificateVisibilityStartTask ...
- CertificateVisibilityStartTask CertificateVisibility = "startTask"
- // CertificateVisibilityTask ...
- CertificateVisibilityTask CertificateVisibility = "task"
-)
-
-// PossibleCertificateVisibilityValues returns an array of possible values for the CertificateVisibility const type.
-func PossibleCertificateVisibilityValues() []CertificateVisibility {
- return []CertificateVisibility{CertificateVisibilityRemoteUser, CertificateVisibilityStartTask, CertificateVisibilityTask}
-}
-
-// ComputeNodeDeallocationOption enumerates the values for compute node deallocation option.
-type ComputeNodeDeallocationOption string
-
-const (
- // Requeue ...
- Requeue ComputeNodeDeallocationOption = "requeue"
- // RetainedData ...
- RetainedData ComputeNodeDeallocationOption = "retainedData"
- // TaskCompletion ...
- TaskCompletion ComputeNodeDeallocationOption = "taskCompletion"
- // Terminate ...
- Terminate ComputeNodeDeallocationOption = "terminate"
-)
-
-// PossibleComputeNodeDeallocationOptionValues returns an array of possible values for the ComputeNodeDeallocationOption const type.
-func PossibleComputeNodeDeallocationOptionValues() []ComputeNodeDeallocationOption {
- return []ComputeNodeDeallocationOption{Requeue, RetainedData, TaskCompletion, Terminate}
-}
-
-// ComputeNodeFillType enumerates the values for compute node fill type.
-type ComputeNodeFillType string
-
-const (
- // Pack ...
- Pack ComputeNodeFillType = "pack"
- // Spread ...
- Spread ComputeNodeFillType = "spread"
-)
-
-// PossibleComputeNodeFillTypeValues returns an array of possible values for the ComputeNodeFillType const type.
-func PossibleComputeNodeFillTypeValues() []ComputeNodeFillType {
- return []ComputeNodeFillType{Pack, Spread}
-}
-
-// ComputeNodeRebootOption enumerates the values for compute node reboot option.
-type ComputeNodeRebootOption string
-
-const (
- // ComputeNodeRebootOptionRequeue ...
- ComputeNodeRebootOptionRequeue ComputeNodeRebootOption = "requeue"
- // ComputeNodeRebootOptionRetainedData ...
- ComputeNodeRebootOptionRetainedData ComputeNodeRebootOption = "retainedData"
- // ComputeNodeRebootOptionTaskCompletion ...
- ComputeNodeRebootOptionTaskCompletion ComputeNodeRebootOption = "taskCompletion"
- // ComputeNodeRebootOptionTerminate ...
- ComputeNodeRebootOptionTerminate ComputeNodeRebootOption = "terminate"
-)
-
-// PossibleComputeNodeRebootOptionValues returns an array of possible values for the ComputeNodeRebootOption const type.
-func PossibleComputeNodeRebootOptionValues() []ComputeNodeRebootOption {
- return []ComputeNodeRebootOption{ComputeNodeRebootOptionRequeue, ComputeNodeRebootOptionRetainedData, ComputeNodeRebootOptionTaskCompletion, ComputeNodeRebootOptionTerminate}
-}
-
-// ComputeNodeReimageOption enumerates the values for compute node reimage option.
-type ComputeNodeReimageOption string
-
-const (
- // ComputeNodeReimageOptionRequeue ...
- ComputeNodeReimageOptionRequeue ComputeNodeReimageOption = "requeue"
- // ComputeNodeReimageOptionRetainedData ...
- ComputeNodeReimageOptionRetainedData ComputeNodeReimageOption = "retainedData"
- // ComputeNodeReimageOptionTaskCompletion ...
- ComputeNodeReimageOptionTaskCompletion ComputeNodeReimageOption = "taskCompletion"
- // ComputeNodeReimageOptionTerminate ...
- ComputeNodeReimageOptionTerminate ComputeNodeReimageOption = "terminate"
-)
-
-// PossibleComputeNodeReimageOptionValues returns an array of possible values for the ComputeNodeReimageOption const type.
-func PossibleComputeNodeReimageOptionValues() []ComputeNodeReimageOption {
- return []ComputeNodeReimageOption{ComputeNodeReimageOptionRequeue, ComputeNodeReimageOptionRetainedData, ComputeNodeReimageOptionTaskCompletion, ComputeNodeReimageOptionTerminate}
-}
-
-// ComputeNodeState enumerates the values for compute node state.
-type ComputeNodeState string
-
-const (
- // Creating ...
- Creating ComputeNodeState = "creating"
- // Idle ...
- Idle ComputeNodeState = "idle"
- // LeavingPool ...
- LeavingPool ComputeNodeState = "leavingPool"
- // Offline ...
- Offline ComputeNodeState = "offline"
- // Preempted ...
- Preempted ComputeNodeState = "preempted"
- // Rebooting ...
- Rebooting ComputeNodeState = "rebooting"
- // Reimaging ...
- Reimaging ComputeNodeState = "reimaging"
- // Running ...
- Running ComputeNodeState = "running"
- // Starting ...
- Starting ComputeNodeState = "starting"
- // StartTaskFailed ...
- StartTaskFailed ComputeNodeState = "startTaskFailed"
- // Unknown ...
- Unknown ComputeNodeState = "unknown"
- // Unusable ...
- Unusable ComputeNodeState = "unusable"
- // WaitingForStartTask ...
- WaitingForStartTask ComputeNodeState = "waitingForStartTask"
-)
-
-// PossibleComputeNodeStateValues returns an array of possible values for the ComputeNodeState const type.
-func PossibleComputeNodeStateValues() []ComputeNodeState {
- return []ComputeNodeState{Creating, Idle, LeavingPool, Offline, Preempted, Rebooting, Reimaging, Running, Starting, StartTaskFailed, Unknown, Unusable, WaitingForStartTask}
-}
-
-// DependencyAction enumerates the values for dependency action.
-type DependencyAction string
-
-const (
- // Block ...
- Block DependencyAction = "block"
- // Satisfy ...
- Satisfy DependencyAction = "satisfy"
-)
-
-// PossibleDependencyActionValues returns an array of possible values for the DependencyAction const type.
-func PossibleDependencyActionValues() []DependencyAction {
- return []DependencyAction{Block, Satisfy}
-}
-
-// DisableComputeNodeSchedulingOption enumerates the values for disable compute node scheduling option.
-type DisableComputeNodeSchedulingOption string
-
-const (
- // DisableComputeNodeSchedulingOptionRequeue ...
- DisableComputeNodeSchedulingOptionRequeue DisableComputeNodeSchedulingOption = "requeue"
- // DisableComputeNodeSchedulingOptionTaskCompletion ...
- DisableComputeNodeSchedulingOptionTaskCompletion DisableComputeNodeSchedulingOption = "taskCompletion"
- // DisableComputeNodeSchedulingOptionTerminate ...
- DisableComputeNodeSchedulingOptionTerminate DisableComputeNodeSchedulingOption = "terminate"
-)
-
-// PossibleDisableComputeNodeSchedulingOptionValues returns an array of possible values for the DisableComputeNodeSchedulingOption const type.
-func PossibleDisableComputeNodeSchedulingOptionValues() []DisableComputeNodeSchedulingOption {
- return []DisableComputeNodeSchedulingOption{DisableComputeNodeSchedulingOptionRequeue, DisableComputeNodeSchedulingOptionTaskCompletion, DisableComputeNodeSchedulingOptionTerminate}
-}
-
-// DisableJobOption enumerates the values for disable job option.
-type DisableJobOption string
-
-const (
- // DisableJobOptionRequeue ...
- DisableJobOptionRequeue DisableJobOption = "requeue"
- // DisableJobOptionTerminate ...
- DisableJobOptionTerminate DisableJobOption = "terminate"
- // DisableJobOptionWait ...
- DisableJobOptionWait DisableJobOption = "wait"
-)
-
-// PossibleDisableJobOptionValues returns an array of possible values for the DisableJobOption const type.
-func PossibleDisableJobOptionValues() []DisableJobOption {
- return []DisableJobOption{DisableJobOptionRequeue, DisableJobOptionTerminate, DisableJobOptionWait}
-}
-
-// ElevationLevel enumerates the values for elevation level.
-type ElevationLevel string
-
-const (
- // Admin ...
- Admin ElevationLevel = "admin"
- // NonAdmin ...
- NonAdmin ElevationLevel = "nonAdmin"
-)
-
-// PossibleElevationLevelValues returns an array of possible values for the ElevationLevel const type.
-func PossibleElevationLevelValues() []ElevationLevel {
- return []ElevationLevel{Admin, NonAdmin}
-}
-
-// ErrorCategory enumerates the values for error category.
-type ErrorCategory string
-
-const (
- // ServerError ...
- ServerError ErrorCategory = "serverError"
- // UserError ...
- UserError ErrorCategory = "userError"
-)
-
-// PossibleErrorCategoryValues returns an array of possible values for the ErrorCategory const type.
-func PossibleErrorCategoryValues() []ErrorCategory {
- return []ErrorCategory{ServerError, UserError}
-}
-
-// InboundEndpointProtocol enumerates the values for inbound endpoint protocol.
-type InboundEndpointProtocol string
-
-const (
- // TCP ...
- TCP InboundEndpointProtocol = "tcp"
- // UDP ...
- UDP InboundEndpointProtocol = "udp"
-)
-
-// PossibleInboundEndpointProtocolValues returns an array of possible values for the InboundEndpointProtocol const type.
-func PossibleInboundEndpointProtocolValues() []InboundEndpointProtocol {
- return []InboundEndpointProtocol{TCP, UDP}
-}
-
-// JobAction enumerates the values for job action.
-type JobAction string
-
-const (
- // JobActionDisable ...
- JobActionDisable JobAction = "disable"
- // JobActionNone ...
- JobActionNone JobAction = "none"
- // JobActionTerminate ...
- JobActionTerminate JobAction = "terminate"
-)
-
-// PossibleJobActionValues returns an array of possible values for the JobAction const type.
-func PossibleJobActionValues() []JobAction {
- return []JobAction{JobActionDisable, JobActionNone, JobActionTerminate}
-}
-
-// JobPreparationTaskState enumerates the values for job preparation task state.
-type JobPreparationTaskState string
-
-const (
- // JobPreparationTaskStateCompleted ...
- JobPreparationTaskStateCompleted JobPreparationTaskState = "completed"
- // JobPreparationTaskStateRunning ...
- JobPreparationTaskStateRunning JobPreparationTaskState = "running"
-)
-
-// PossibleJobPreparationTaskStateValues returns an array of possible values for the JobPreparationTaskState const type.
-func PossibleJobPreparationTaskStateValues() []JobPreparationTaskState {
- return []JobPreparationTaskState{JobPreparationTaskStateCompleted, JobPreparationTaskStateRunning}
-}
-
-// JobReleaseTaskState enumerates the values for job release task state.
-type JobReleaseTaskState string
-
-const (
- // JobReleaseTaskStateCompleted ...
- JobReleaseTaskStateCompleted JobReleaseTaskState = "completed"
- // JobReleaseTaskStateRunning ...
- JobReleaseTaskStateRunning JobReleaseTaskState = "running"
-)
-
-// PossibleJobReleaseTaskStateValues returns an array of possible values for the JobReleaseTaskState const type.
-func PossibleJobReleaseTaskStateValues() []JobReleaseTaskState {
- return []JobReleaseTaskState{JobReleaseTaskStateCompleted, JobReleaseTaskStateRunning}
-}
-
-// JobScheduleState enumerates the values for job schedule state.
-type JobScheduleState string
-
-const (
- // JobScheduleStateActive ...
- JobScheduleStateActive JobScheduleState = "active"
- // JobScheduleStateCompleted ...
- JobScheduleStateCompleted JobScheduleState = "completed"
- // JobScheduleStateDeleting ...
- JobScheduleStateDeleting JobScheduleState = "deleting"
- // JobScheduleStateDisabled ...
- JobScheduleStateDisabled JobScheduleState = "disabled"
- // JobScheduleStateTerminating ...
- JobScheduleStateTerminating JobScheduleState = "terminating"
-)
-
-// PossibleJobScheduleStateValues returns an array of possible values for the JobScheduleState const type.
-func PossibleJobScheduleStateValues() []JobScheduleState {
- return []JobScheduleState{JobScheduleStateActive, JobScheduleStateCompleted, JobScheduleStateDeleting, JobScheduleStateDisabled, JobScheduleStateTerminating}
-}
-
-// JobState enumerates the values for job state.
-type JobState string
-
-const (
- // JobStateActive ...
- JobStateActive JobState = "active"
- // JobStateCompleted ...
- JobStateCompleted JobState = "completed"
- // JobStateDeleting ...
- JobStateDeleting JobState = "deleting"
- // JobStateDisabled ...
- JobStateDisabled JobState = "disabled"
- // JobStateDisabling ...
- JobStateDisabling JobState = "disabling"
- // JobStateEnabling ...
- JobStateEnabling JobState = "enabling"
- // JobStateTerminating ...
- JobStateTerminating JobState = "terminating"
-)
-
-// PossibleJobStateValues returns an array of possible values for the JobState const type.
-func PossibleJobStateValues() []JobState {
- return []JobState{JobStateActive, JobStateCompleted, JobStateDeleting, JobStateDisabled, JobStateDisabling, JobStateEnabling, JobStateTerminating}
-}
-
-// NetworkSecurityGroupRuleAccess enumerates the values for network security group rule access.
-type NetworkSecurityGroupRuleAccess string
-
-const (
- // Allow ...
- Allow NetworkSecurityGroupRuleAccess = "allow"
- // Deny ...
- Deny NetworkSecurityGroupRuleAccess = "deny"
-)
-
-// PossibleNetworkSecurityGroupRuleAccessValues returns an array of possible values for the NetworkSecurityGroupRuleAccess const type.
-func PossibleNetworkSecurityGroupRuleAccessValues() []NetworkSecurityGroupRuleAccess {
- return []NetworkSecurityGroupRuleAccess{Allow, Deny}
-}
-
-// OnAllTasksComplete enumerates the values for on all tasks complete.
-type OnAllTasksComplete string
-
-const (
- // NoAction ...
- NoAction OnAllTasksComplete = "noAction"
- // TerminateJob ...
- TerminateJob OnAllTasksComplete = "terminateJob"
-)
-
-// PossibleOnAllTasksCompleteValues returns an array of possible values for the OnAllTasksComplete const type.
-func PossibleOnAllTasksCompleteValues() []OnAllTasksComplete {
- return []OnAllTasksComplete{NoAction, TerminateJob}
-}
-
-// OnTaskFailure enumerates the values for on task failure.
-type OnTaskFailure string
-
-const (
- // OnTaskFailureNoAction ...
- OnTaskFailureNoAction OnTaskFailure = "noAction"
- // OnTaskFailurePerformExitOptionsJobAction ...
- OnTaskFailurePerformExitOptionsJobAction OnTaskFailure = "performExitOptionsJobAction"
-)
-
-// PossibleOnTaskFailureValues returns an array of possible values for the OnTaskFailure const type.
-func PossibleOnTaskFailureValues() []OnTaskFailure {
- return []OnTaskFailure{OnTaskFailureNoAction, OnTaskFailurePerformExitOptionsJobAction}
-}
-
-// OSType enumerates the values for os type.
-type OSType string
-
-const (
- // Linux ...
- Linux OSType = "linux"
- // Windows ...
- Windows OSType = "windows"
-)
-
-// PossibleOSTypeValues returns an array of possible values for the OSType const type.
-func PossibleOSTypeValues() []OSType {
- return []OSType{Linux, Windows}
-}
-
-// OutputFileUploadCondition enumerates the values for output file upload condition.
-type OutputFileUploadCondition string
-
-const (
- // OutputFileUploadConditionTaskCompletion ...
- OutputFileUploadConditionTaskCompletion OutputFileUploadCondition = "taskCompletion"
- // OutputFileUploadConditionTaskFailure ...
- OutputFileUploadConditionTaskFailure OutputFileUploadCondition = "taskFailure"
- // OutputFileUploadConditionTaskSuccess ...
- OutputFileUploadConditionTaskSuccess OutputFileUploadCondition = "taskSuccess"
-)
-
-// PossibleOutputFileUploadConditionValues returns an array of possible values for the OutputFileUploadCondition const type.
-func PossibleOutputFileUploadConditionValues() []OutputFileUploadCondition {
- return []OutputFileUploadCondition{OutputFileUploadConditionTaskCompletion, OutputFileUploadConditionTaskFailure, OutputFileUploadConditionTaskSuccess}
-}
-
-// PoolLifetimeOption enumerates the values for pool lifetime option.
-type PoolLifetimeOption string
-
-const (
- // PoolLifetimeOptionJob ...
- PoolLifetimeOptionJob PoolLifetimeOption = "job"
- // PoolLifetimeOptionJobSchedule ...
- PoolLifetimeOptionJobSchedule PoolLifetimeOption = "jobSchedule"
-)
-
-// PossiblePoolLifetimeOptionValues returns an array of possible values for the PoolLifetimeOption const type.
-func PossiblePoolLifetimeOptionValues() []PoolLifetimeOption {
- return []PoolLifetimeOption{PoolLifetimeOptionJob, PoolLifetimeOptionJobSchedule}
-}
-
-// PoolState enumerates the values for pool state.
-type PoolState string
-
-const (
- // PoolStateActive ...
- PoolStateActive PoolState = "active"
- // PoolStateDeleting ...
- PoolStateDeleting PoolState = "deleting"
- // PoolStateUpgrading ...
- PoolStateUpgrading PoolState = "upgrading"
-)
-
-// PossiblePoolStateValues returns an array of possible values for the PoolState const type.
-func PossiblePoolStateValues() []PoolState {
- return []PoolState{PoolStateActive, PoolStateDeleting, PoolStateUpgrading}
-}
-
-// SchedulingState enumerates the values for scheduling state.
-type SchedulingState string
-
-const (
- // Disabled ...
- Disabled SchedulingState = "disabled"
- // Enabled ...
- Enabled SchedulingState = "enabled"
-)
-
-// PossibleSchedulingStateValues returns an array of possible values for the SchedulingState const type.
-func PossibleSchedulingStateValues() []SchedulingState {
- return []SchedulingState{Disabled, Enabled}
-}
-
-// StartTaskState enumerates the values for start task state.
-type StartTaskState string
-
-const (
- // StartTaskStateCompleted ...
- StartTaskStateCompleted StartTaskState = "completed"
- // StartTaskStateRunning ...
- StartTaskStateRunning StartTaskState = "running"
-)
-
-// PossibleStartTaskStateValues returns an array of possible values for the StartTaskState const type.
-func PossibleStartTaskStateValues() []StartTaskState {
- return []StartTaskState{StartTaskStateCompleted, StartTaskStateRunning}
-}
-
-// SubtaskState enumerates the values for subtask state.
-type SubtaskState string
-
-const (
- // SubtaskStateCompleted ...
- SubtaskStateCompleted SubtaskState = "completed"
- // SubtaskStatePreparing ...
- SubtaskStatePreparing SubtaskState = "preparing"
- // SubtaskStateRunning ...
- SubtaskStateRunning SubtaskState = "running"
-)
-
-// PossibleSubtaskStateValues returns an array of possible values for the SubtaskState const type.
-func PossibleSubtaskStateValues() []SubtaskState {
- return []SubtaskState{SubtaskStateCompleted, SubtaskStatePreparing, SubtaskStateRunning}
-}
-
-// TaskAddStatus enumerates the values for task add status.
-type TaskAddStatus string
-
-const (
- // TaskAddStatusClientError ...
- TaskAddStatusClientError TaskAddStatus = "clientError"
- // TaskAddStatusServerError ...
- TaskAddStatusServerError TaskAddStatus = "serverError"
- // TaskAddStatusSuccess ...
- TaskAddStatusSuccess TaskAddStatus = "success"
-)
-
-// PossibleTaskAddStatusValues returns an array of possible values for the TaskAddStatus const type.
-func PossibleTaskAddStatusValues() []TaskAddStatus {
- return []TaskAddStatus{TaskAddStatusClientError, TaskAddStatusServerError, TaskAddStatusSuccess}
-}
-
-// TaskCountValidationStatus enumerates the values for task count validation status.
-type TaskCountValidationStatus string
-
-const (
- // Unvalidated ...
- Unvalidated TaskCountValidationStatus = "unvalidated"
- // Validated ...
- Validated TaskCountValidationStatus = "validated"
-)
-
-// PossibleTaskCountValidationStatusValues returns an array of possible values for the TaskCountValidationStatus const type.
-func PossibleTaskCountValidationStatusValues() []TaskCountValidationStatus {
- return []TaskCountValidationStatus{Unvalidated, Validated}
-}
-
-// TaskExecutionResult enumerates the values for task execution result.
-type TaskExecutionResult string
-
-const (
- // Failure ...
- Failure TaskExecutionResult = "failure"
- // Success ...
- Success TaskExecutionResult = "success"
-)
-
-// PossibleTaskExecutionResultValues returns an array of possible values for the TaskExecutionResult const type.
-func PossibleTaskExecutionResultValues() []TaskExecutionResult {
- return []TaskExecutionResult{Failure, Success}
-}
-
-// TaskState enumerates the values for task state.
-type TaskState string
-
-const (
- // TaskStateActive ...
- TaskStateActive TaskState = "active"
- // TaskStateCompleted ...
- TaskStateCompleted TaskState = "completed"
- // TaskStatePreparing ...
- TaskStatePreparing TaskState = "preparing"
- // TaskStateRunning ...
- TaskStateRunning TaskState = "running"
-)
-
-// PossibleTaskStateValues returns an array of possible values for the TaskState const type.
-func PossibleTaskStateValues() []TaskState {
- return []TaskState{TaskStateActive, TaskStateCompleted, TaskStatePreparing, TaskStateRunning}
-}
-
-// AccountListNodeAgentSkusResult ...
-type AccountListNodeAgentSkusResult struct {
- autorest.Response `json:"-"`
- Value *[]NodeAgentSku `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// AccountListNodeAgentSkusResultIterator provides access to a complete listing of NodeAgentSku values.
-type AccountListNodeAgentSkusResultIterator struct {
- i int
- page AccountListNodeAgentSkusResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *AccountListNodeAgentSkusResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter AccountListNodeAgentSkusResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter AccountListNodeAgentSkusResultIterator) Response() AccountListNodeAgentSkusResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter AccountListNodeAgentSkusResultIterator) Value() NodeAgentSku {
- if !iter.page.NotDone() {
- return NodeAgentSku{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (alnasr AccountListNodeAgentSkusResult) IsEmpty() bool {
- return alnasr.Value == nil || len(*alnasr.Value) == 0
-}
-
-// accountListNodeAgentSkusResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (alnasr AccountListNodeAgentSkusResult) accountListNodeAgentSkusResultPreparer() (*http.Request, error) {
- if alnasr.OdataNextLink == nil || len(to.String(alnasr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(alnasr.OdataNextLink)))
-}
-
-// AccountListNodeAgentSkusResultPage contains a page of NodeAgentSku values.
-type AccountListNodeAgentSkusResultPage struct {
- fn func(AccountListNodeAgentSkusResult) (AccountListNodeAgentSkusResult, error)
- alnasr AccountListNodeAgentSkusResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *AccountListNodeAgentSkusResultPage) Next() error {
- next, err := page.fn(page.alnasr)
- if err != nil {
- return err
- }
- page.alnasr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page AccountListNodeAgentSkusResultPage) NotDone() bool {
- return !page.alnasr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page AccountListNodeAgentSkusResultPage) Response() AccountListNodeAgentSkusResult {
- return page.alnasr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page AccountListNodeAgentSkusResultPage) Values() []NodeAgentSku {
- if page.alnasr.IsEmpty() {
- return nil
- }
- return *page.alnasr.Value
-}
-
-// AffinityInformation ...
-type AffinityInformation struct {
- // AffinityID - You can pass the affinityId of a compute node to indicate that this task needs to run on that compute node. Note that this is just a soft affinity. If the target node is busy or unavailable at the time the task is scheduled, then the task will be scheduled elsewhere.
- AffinityID *string `json:"affinityId,omitempty"`
-}
-
-// ApplicationListResult ...
-type ApplicationListResult struct {
- autorest.Response `json:"-"`
- Value *[]ApplicationSummary `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// ApplicationListResultIterator provides access to a complete listing of ApplicationSummary values.
-type ApplicationListResultIterator struct {
- i int
- page ApplicationListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *ApplicationListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter ApplicationListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter ApplicationListResultIterator) Response() ApplicationListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter ApplicationListResultIterator) Value() ApplicationSummary {
- if !iter.page.NotDone() {
- return ApplicationSummary{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (alr ApplicationListResult) IsEmpty() bool {
- return alr.Value == nil || len(*alr.Value) == 0
-}
-
-// applicationListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (alr ApplicationListResult) applicationListResultPreparer() (*http.Request, error) {
- if alr.OdataNextLink == nil || len(to.String(alr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(alr.OdataNextLink)))
-}
-
-// ApplicationListResultPage contains a page of ApplicationSummary values.
-type ApplicationListResultPage struct {
- fn func(ApplicationListResult) (ApplicationListResult, error)
- alr ApplicationListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *ApplicationListResultPage) Next() error {
- next, err := page.fn(page.alr)
- if err != nil {
- return err
- }
- page.alr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page ApplicationListResultPage) NotDone() bool {
- return !page.alr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page ApplicationListResultPage) Response() ApplicationListResult {
- return page.alr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page ApplicationListResultPage) Values() []ApplicationSummary {
- if page.alr.IsEmpty() {
- return nil
- }
- return *page.alr.Value
-}
-
-// ApplicationPackageReference ...
-type ApplicationPackageReference struct {
- ApplicationID *string `json:"applicationId,omitempty"`
- // Version - If this is omitted on a pool, and no default version is specified for this application, the request fails with the error code InvalidApplicationPackageReferences and HTTP status code 409. If this is omitted on a task, and no default version is specified for this application, the task fails with a pre-processing error.
- Version *string `json:"version,omitempty"`
-}
-
-// ApplicationSummary ...
-type ApplicationSummary struct {
- autorest.Response `json:"-"`
- ID *string `json:"id,omitempty"`
- DisplayName *string `json:"displayName,omitempty"`
- Versions *[]string `json:"versions,omitempty"`
-}
-
-// AuthenticationTokenSettings ...
-type AuthenticationTokenSettings struct {
- // Access - The authentication token grants access to a limited set of Batch service operations. Currently the only supported value for the access property is 'job', which grants access to all operations related to the job which contains the task.
- Access *[]AccessScope `json:"access,omitempty"`
-}
-
-// AutoPoolSpecification ...
-type AutoPoolSpecification struct {
- // AutoPoolIDPrefix - The Batch service assigns each auto pool a unique identifier on creation. To distinguish between pools created for different purposes, you can specify this element to add a prefix to the ID that is assigned. The prefix can be up to 20 characters long.
- AutoPoolIDPrefix *string `json:"autoPoolIdPrefix,omitempty"`
- // PoolLifetimeOption - When the pool lifetime is jobSchedule the pool exists for the lifetime of the job schedule. The Batch Service creates the pool when it creates the first job on the schedule. You may apply this option only to job schedules, not to jobs. When the pool lifetime is job the pool exists for the lifetime of the job to which it is dedicated. The Batch service creates the pool when it creates the job. If the 'job' option is applied to a job schedule, the Batch service creates a new auto pool for every job created on the schedule. Possible values include: 'PoolLifetimeOptionJobSchedule', 'PoolLifetimeOptionJob'
- PoolLifetimeOption PoolLifetimeOption `json:"poolLifetimeOption,omitempty"`
- // KeepAlive - If false, the Batch service deletes the pool once its lifetime (as determined by the poolLifetimeOption setting) expires; that is, when the job or job schedule completes. If true, the Batch service does not delete the pool automatically. It is up to the user to delete auto pools created with this option.
- KeepAlive *bool `json:"keepAlive,omitempty"`
- Pool *PoolSpecification `json:"pool,omitempty"`
-}
-
-// AutoScaleRun ...
-type AutoScaleRun struct {
- autorest.Response `json:"-"`
- Timestamp *date.Time `json:"timestamp,omitempty"`
- // Results - Each variable value is returned in the form $variable=value, and variables are separated by semicolons.
- Results *string `json:"results,omitempty"`
- Error *AutoScaleRunError `json:"error,omitempty"`
-}
-
-// AutoScaleRunError ...
-type AutoScaleRunError struct {
- Code *string `json:"code,omitempty"`
- Message *string `json:"message,omitempty"`
- Values *[]NameValuePair `json:"values,omitempty"`
-}
-
-// AutoUserSpecification ...
-type AutoUserSpecification struct {
- // Scope - Values are:
- // pool - specifies that the task runs as the common auto user account which is created on every node in a pool.
- // task - specifies that the service should create a new user for the task.
- // The default value is task. Possible values include: 'Task', 'Pool'
- Scope AutoUserScope `json:"scope,omitempty"`
- // ElevationLevel - nonAdmin - The auto user is a standard user without elevated access. admin - The auto user is a user with elevated access and operates with full Administrator permissions. The default value is nonAdmin. Possible values include: 'NonAdmin', 'Admin'
- ElevationLevel ElevationLevel `json:"elevationLevel,omitempty"`
-}
-
-// Certificate a certificate that can be installed on compute nodes and can be used to authenticate operations on
-// the machine.
-type Certificate struct {
- autorest.Response `json:"-"`
- Thumbprint *string `json:"thumbprint,omitempty"`
- ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"`
- URL *string `json:"url,omitempty"`
- // State - Possible values include: 'Active', 'Deleting', 'DeleteFailed'
- State CertificateState `json:"state,omitempty"`
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // PreviousState - This property is not set if the certificate is in its initial active state. Possible values include: 'Active', 'Deleting', 'DeleteFailed'
- PreviousState CertificateState `json:"previousState,omitempty"`
- // PreviousStateTransitionTime - This property is not set if the certificate is in its initial Active state.
- PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"`
- PublicData *string `json:"publicData,omitempty"`
- // DeleteCertificateError - This property is set only if the certificate is in the DeleteFailed state.
- DeleteCertificateError *DeleteCertificateError `json:"deleteCertificateError,omitempty"`
-}
-
-// CertificateAddParameter ...
-type CertificateAddParameter struct {
- Thumbprint *string `json:"thumbprint,omitempty"`
- ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"`
- Data *string `json:"data,omitempty"`
- // CertificateFormat - Possible values include: 'Pfx', 'Cer'
- CertificateFormat CertificateFormat `json:"certificateFormat,omitempty"`
- // Password - This is required if the certificate format is pfx. It should be omitted if the certificate format is cer.
- Password *string `json:"password,omitempty"`
-}
-
-// CertificateListResult ...
-type CertificateListResult struct {
- autorest.Response `json:"-"`
- Value *[]Certificate `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CertificateListResultIterator provides access to a complete listing of Certificate values.
-type CertificateListResultIterator struct {
- i int
- page CertificateListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CertificateListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CertificateListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CertificateListResultIterator) Response() CertificateListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CertificateListResultIterator) Value() Certificate {
- if !iter.page.NotDone() {
- return Certificate{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (clr CertificateListResult) IsEmpty() bool {
- return clr.Value == nil || len(*clr.Value) == 0
-}
-
-// certificateListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (clr CertificateListResult) certificateListResultPreparer() (*http.Request, error) {
- if clr.OdataNextLink == nil || len(to.String(clr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(clr.OdataNextLink)))
-}
-
-// CertificateListResultPage contains a page of Certificate values.
-type CertificateListResultPage struct {
- fn func(CertificateListResult) (CertificateListResult, error)
- clr CertificateListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CertificateListResultPage) Next() error {
- next, err := page.fn(page.clr)
- if err != nil {
- return err
- }
- page.clr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CertificateListResultPage) NotDone() bool {
- return !page.clr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CertificateListResultPage) Response() CertificateListResult {
- return page.clr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CertificateListResultPage) Values() []Certificate {
- if page.clr.IsEmpty() {
- return nil
- }
- return *page.clr.Value
-}
-
-// CertificateReference ...
-type CertificateReference struct {
- Thumbprint *string `json:"thumbprint,omitempty"`
- ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"`
- // StoreLocation - The default value is currentUser. This property is applicable only for pools configured with Windows nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows image reference). For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory. Possible values include: 'CurrentUser', 'LocalMachine'
- StoreLocation CertificateStoreLocation `json:"storeLocation,omitempty"`
- // StoreName - This property is applicable only for pools configured with Windows nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows image reference). Common store names include: My, Root, CA, Trust, Disallowed, TrustedPeople, TrustedPublisher, AuthRoot, AddressBook, but any custom store name can also be used. The default value is My.
- StoreName *string `json:"storeName,omitempty"`
- // Visibility - Values are:
- // starttask - The user account under which the start task is run.
- // task - The accounts under which job tasks are run.
- // remoteuser - The accounts under which users remotely access the node.
- // You can specify more than one visibility in this collection. The default is all accounts.
- Visibility *[]CertificateVisibility `json:"visibility,omitempty"`
-}
-
-// CloudJob ...
-type CloudJob struct {
- autorest.Response `json:"-"`
- // ID - The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an account that differ only by case).
- ID *string `json:"id,omitempty"`
- DisplayName *string `json:"displayName,omitempty"`
- UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"`
- URL *string `json:"url,omitempty"`
- // ETag - This is an opaque string. You can use it to detect whether the job has changed between requests. In particular, you can be pass the ETag when updating a job to specify that your changes should take effect only if nobody else has modified the job in the meantime.
- ETag *string `json:"eTag,omitempty"`
- // LastModified - This is the last time at which the job level data, such as the job state or priority, changed. It does not factor in task-level changes such as adding new tasks or tasks changing state.
- LastModified *date.Time `json:"lastModified,omitempty"`
- CreationTime *date.Time `json:"creationTime,omitempty"`
- // State - Possible values include: 'JobStateActive', 'JobStateDisabling', 'JobStateDisabled', 'JobStateEnabling', 'JobStateTerminating', 'JobStateCompleted', 'JobStateDeleting'
- State JobState `json:"state,omitempty"`
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // PreviousState - This property is not set if the job is in its initial Active state. Possible values include: 'JobStateActive', 'JobStateDisabling', 'JobStateDisabled', 'JobStateEnabling', 'JobStateTerminating', 'JobStateCompleted', 'JobStateDeleting'
- PreviousState JobState `json:"previousState,omitempty"`
- // PreviousStateTransitionTime - This property is not set if the job is in its initial Active state.
- PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"`
- // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0.
- Priority *int32 `json:"priority,omitempty"`
- Constraints *JobConstraints `json:"constraints,omitempty"`
- JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"`
- // JobPreparationTask - The Job Preparation task is a special task run on each node before any other task of the job.
- JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"`
- // JobReleaseTask - The Job Release task is a special task run at the end of the job on each node that has run any other task of the job.
- JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"`
- // CommonEnvironmentSettings - Individual tasks can override an environment setting specified here by specifying the same setting name with a different value.
- CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"`
- PoolInfo *PoolInformation `json:"poolInfo,omitempty"`
- // OnAllTasksComplete - noAction - do nothing. The job remains active unless terminated or disabled by some other means. terminateJob - terminate the job. The job's terminateReason is set to 'AllTasksComplete'. The default is noAction. Possible values include: 'NoAction', 'TerminateJob'
- OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"`
- // OnTaskFailure - A task is considered to have failed if has a failureInfo. A failureInfo is set if the task completes with a non-zero exit code after exhausting its retry count, or if there was an error starting the task, for example due to a resource file download error. noAction - do nothing. performExitOptionsJobAction - take the action associated with the task exit condition in the task's exitConditions collection. (This may still result in no action being taken, if that is what the task specifies.) The default is noAction. Possible values include: 'OnTaskFailureNoAction', 'OnTaskFailurePerformExitOptionsJobAction'
- OnTaskFailure OnTaskFailure `json:"onTaskFailure,omitempty"`
- // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
- ExecutionInfo *JobExecutionInformation `json:"executionInfo,omitempty"`
- Stats *JobStatistics `json:"stats,omitempty"`
-}
-
-// CloudJobListPreparationAndReleaseTaskStatusResult ...
-type CloudJobListPreparationAndReleaseTaskStatusResult struct {
- autorest.Response `json:"-"`
- Value *[]JobPreparationAndReleaseTaskExecutionInformation `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CloudJobListPreparationAndReleaseTaskStatusResultIterator provides access to a complete listing of
-// JobPreparationAndReleaseTaskExecutionInformation values.
-type CloudJobListPreparationAndReleaseTaskStatusResultIterator struct {
- i int
- page CloudJobListPreparationAndReleaseTaskStatusResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CloudJobListPreparationAndReleaseTaskStatusResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CloudJobListPreparationAndReleaseTaskStatusResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CloudJobListPreparationAndReleaseTaskStatusResultIterator) Response() CloudJobListPreparationAndReleaseTaskStatusResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CloudJobListPreparationAndReleaseTaskStatusResultIterator) Value() JobPreparationAndReleaseTaskExecutionInformation {
- if !iter.page.NotDone() {
- return JobPreparationAndReleaseTaskExecutionInformation{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult) IsEmpty() bool {
- return cjlpartsr.Value == nil || len(*cjlpartsr.Value) == 0
-}
-
-// cloudJobListPreparationAndReleaseTaskStatusResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult) cloudJobListPreparationAndReleaseTaskStatusResultPreparer() (*http.Request, error) {
- if cjlpartsr.OdataNextLink == nil || len(to.String(cjlpartsr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(cjlpartsr.OdataNextLink)))
-}
-
-// CloudJobListPreparationAndReleaseTaskStatusResultPage contains a page of
-// JobPreparationAndReleaseTaskExecutionInformation values.
-type CloudJobListPreparationAndReleaseTaskStatusResultPage struct {
- fn func(CloudJobListPreparationAndReleaseTaskStatusResult) (CloudJobListPreparationAndReleaseTaskStatusResult, error)
- cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CloudJobListPreparationAndReleaseTaskStatusResultPage) Next() error {
- next, err := page.fn(page.cjlpartsr)
- if err != nil {
- return err
- }
- page.cjlpartsr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) NotDone() bool {
- return !page.cjlpartsr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) Response() CloudJobListPreparationAndReleaseTaskStatusResult {
- return page.cjlpartsr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) Values() []JobPreparationAndReleaseTaskExecutionInformation {
- if page.cjlpartsr.IsEmpty() {
- return nil
- }
- return *page.cjlpartsr.Value
-}
-
-// CloudJobListResult ...
-type CloudJobListResult struct {
- autorest.Response `json:"-"`
- Value *[]CloudJob `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CloudJobListResultIterator provides access to a complete listing of CloudJob values.
-type CloudJobListResultIterator struct {
- i int
- page CloudJobListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CloudJobListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CloudJobListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CloudJobListResultIterator) Response() CloudJobListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CloudJobListResultIterator) Value() CloudJob {
- if !iter.page.NotDone() {
- return CloudJob{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (cjlr CloudJobListResult) IsEmpty() bool {
- return cjlr.Value == nil || len(*cjlr.Value) == 0
-}
-
-// cloudJobListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (cjlr CloudJobListResult) cloudJobListResultPreparer() (*http.Request, error) {
- if cjlr.OdataNextLink == nil || len(to.String(cjlr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(cjlr.OdataNextLink)))
-}
-
-// CloudJobListResultPage contains a page of CloudJob values.
-type CloudJobListResultPage struct {
- fn func(CloudJobListResult) (CloudJobListResult, error)
- cjlr CloudJobListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CloudJobListResultPage) Next() error {
- next, err := page.fn(page.cjlr)
- if err != nil {
- return err
- }
- page.cjlr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CloudJobListResultPage) NotDone() bool {
- return !page.cjlr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CloudJobListResultPage) Response() CloudJobListResult {
- return page.cjlr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CloudJobListResultPage) Values() []CloudJob {
- if page.cjlr.IsEmpty() {
- return nil
- }
- return *page.cjlr.Value
-}
-
-// CloudJobSchedule ...
-type CloudJobSchedule struct {
- autorest.Response `json:"-"`
- ID *string `json:"id,omitempty"`
- DisplayName *string `json:"displayName,omitempty"`
- URL *string `json:"url,omitempty"`
- // ETag - This is an opaque string. You can use it to detect whether the job schedule has changed between requests. In particular, you can be pass the ETag with an Update Job Schedule request to specify that your changes should take effect only if nobody else has modified the schedule in the meantime.
- ETag *string `json:"eTag,omitempty"`
- // LastModified - This is the last time at which the schedule level data, such as the job specification or recurrence information, changed. It does not factor in job-level changes such as new jobs being created or jobs changing state.
- LastModified *date.Time `json:"lastModified,omitempty"`
- CreationTime *date.Time `json:"creationTime,omitempty"`
- // State - Possible values include: 'JobScheduleStateActive', 'JobScheduleStateCompleted', 'JobScheduleStateDisabled', 'JobScheduleStateTerminating', 'JobScheduleStateDeleting'
- State JobScheduleState `json:"state,omitempty"`
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // PreviousState - This property is not present if the job schedule is in its initial active state. Possible values include: 'JobScheduleStateActive', 'JobScheduleStateCompleted', 'JobScheduleStateDisabled', 'JobScheduleStateTerminating', 'JobScheduleStateDeleting'
- PreviousState JobScheduleState `json:"previousState,omitempty"`
- // PreviousStateTransitionTime - This property is not present if the job schedule is in its initial active state.
- PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"`
- Schedule *Schedule `json:"schedule,omitempty"`
- JobSpecification *JobSpecification `json:"jobSpecification,omitempty"`
- ExecutionInfo *JobScheduleExecutionInformation `json:"executionInfo,omitempty"`
- // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
- Stats *JobScheduleStatistics `json:"stats,omitempty"`
-}
-
-// CloudJobScheduleListResult ...
-type CloudJobScheduleListResult struct {
- autorest.Response `json:"-"`
- Value *[]CloudJobSchedule `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CloudJobScheduleListResultIterator provides access to a complete listing of CloudJobSchedule values.
-type CloudJobScheduleListResultIterator struct {
- i int
- page CloudJobScheduleListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CloudJobScheduleListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CloudJobScheduleListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CloudJobScheduleListResultIterator) Response() CloudJobScheduleListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CloudJobScheduleListResultIterator) Value() CloudJobSchedule {
- if !iter.page.NotDone() {
- return CloudJobSchedule{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (cjslr CloudJobScheduleListResult) IsEmpty() bool {
- return cjslr.Value == nil || len(*cjslr.Value) == 0
-}
-
-// cloudJobScheduleListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (cjslr CloudJobScheduleListResult) cloudJobScheduleListResultPreparer() (*http.Request, error) {
- if cjslr.OdataNextLink == nil || len(to.String(cjslr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(cjslr.OdataNextLink)))
-}
-
-// CloudJobScheduleListResultPage contains a page of CloudJobSchedule values.
-type CloudJobScheduleListResultPage struct {
- fn func(CloudJobScheduleListResult) (CloudJobScheduleListResult, error)
- cjslr CloudJobScheduleListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CloudJobScheduleListResultPage) Next() error {
- next, err := page.fn(page.cjslr)
- if err != nil {
- return err
- }
- page.cjslr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CloudJobScheduleListResultPage) NotDone() bool {
- return !page.cjslr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CloudJobScheduleListResultPage) Response() CloudJobScheduleListResult {
- return page.cjslr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CloudJobScheduleListResultPage) Values() []CloudJobSchedule {
- if page.cjslr.IsEmpty() {
- return nil
- }
- return *page.cjslr.Value
-}
-
-// CloudPool ...
-type CloudPool struct {
- autorest.Response `json:"-"`
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an account that differ only by case).
- ID *string `json:"id,omitempty"`
- // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- URL *string `json:"url,omitempty"`
- // ETag - This is an opaque string. You can use it to detect whether the pool has changed between requests. In particular, you can be pass the ETag when updating a pool to specify that your changes should take effect only if nobody else has modified the pool in the meantime.
- ETag *string `json:"eTag,omitempty"`
- // LastModified - This is the last time at which the pool level data, such as the targetDedicatedNodes or enableAutoscale settings, changed. It does not factor in node-level changes such as a compute node changing state.
- LastModified *date.Time `json:"lastModified,omitempty"`
- CreationTime *date.Time `json:"creationTime,omitempty"`
- // State - Values are:
- // active - The pool is available to run tasks subject to the availability of compute nodes.
- // deleting - The user has requested that the pool be deleted, but the delete operation has not yet completed.
- // upgrading - The user has requested that the operating system of the pool's nodes be upgraded, but the upgrade operation has not yet completed (that is, some nodes in the pool have not yet been upgraded). While upgrading, the pool may be able to run tasks (with reduced capacity) but this is not guaranteed. Possible values include: 'PoolStateActive', 'PoolStateDeleting', 'PoolStateUpgrading'
- State PoolState `json:"state,omitempty"`
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // AllocationState - Values are:
- // steady - The pool is not resizing. There are no changes to the number of nodes in the pool in progress. A pool enters this state when it is created and when no operations are being performed on the pool to change the number of dedicated nodes.
- // resizing - The pool is resizing; that is, compute nodes are being added to or removed from the pool.
- // stopping - The pool was resizing, but the user has requested that the resize be stopped, but the stop request has not yet been completed. Possible values include: 'Steady', 'Resizing', 'Stopping'
- AllocationState AllocationState `json:"allocationState,omitempty"`
- AllocationStateTransitionTime *date.Time `json:"allocationStateTransitionTime,omitempty"`
- // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall, A1V2 and A2V2. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series).
- VMSize *string `json:"vmSize,omitempty"`
- // CloudServiceConfiguration - This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. This property cannot be specified if the Batch account was created with its poolAllocationMode property set to 'UserSubscription'.
- CloudServiceConfiguration *CloudServiceConfiguration `json:"cloudServiceConfiguration,omitempty"`
- // VirtualMachineConfiguration - This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified.
- VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"`
- // ResizeTimeout - This is the timeout for the most recent resize operation. (The initial sizing when the pool is created counts as a resize.) The default value is 15 minutes.
- ResizeTimeout *string `json:"resizeTimeout,omitempty"`
- // ResizeErrors - This property is set only if one or more errors occurred during the last pool resize, and only when the pool allocationState is Steady.
- ResizeErrors *[]ResizeError `json:"resizeErrors,omitempty"`
- CurrentDedicatedNodes *int32 `json:"currentDedicatedNodes,omitempty"`
- // CurrentLowPriorityNodes - Low-priority compute nodes which have been preempted are included in this count.
- CurrentLowPriorityNodes *int32 `json:"currentLowPriorityNodes,omitempty"`
- TargetDedicatedNodes *int32 `json:"targetDedicatedNodes,omitempty"`
- TargetLowPriorityNodes *int32 `json:"targetLowPriorityNodes,omitempty"`
- // EnableAutoScale - If false, at least one of targetDedicateNodes and targetLowPriorityNodes must be specified. If true, the autoScaleFormula property is required and the pool automatically resizes according to the formula. The default value is false.
- EnableAutoScale *bool `json:"enableAutoScale,omitempty"`
- // AutoScaleFormula - This property is set only if the pool automatically scales, i.e. enableAutoScale is true.
- AutoScaleFormula *string `json:"autoScaleFormula,omitempty"`
- // AutoScaleEvaluationInterval - This property is set only if the pool automatically scales, i.e. enableAutoScale is true.
- AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"`
- // AutoScaleRun - This property is set only if the pool automatically scales, i.e. enableAutoScale is true.
- AutoScaleRun *AutoScaleRun `json:"autoScaleRun,omitempty"`
- // EnableInterNodeCommunication - This imposes restrictions on which nodes can be assigned to the pool. Specifying this value can reduce the chance of the requested number of nodes to be allocated in the pool.
- EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"`
- NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"`
- StartTask *StartTask `json:"startTask,omitempty"`
- // CertificateReferences - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // ApplicationLicenses - The list of application licenses must be a subset of available Batch service application licenses. If a license is requested which is not supported, pool creation will fail.
- ApplicationLicenses *[]string `json:"applicationLicenses,omitempty"`
- MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"`
- TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"`
- UserAccounts *[]UserAccount `json:"userAccounts,omitempty"`
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
- Stats *PoolStatistics `json:"stats,omitempty"`
-}
-
-// CloudPoolListResult ...
-type CloudPoolListResult struct {
- autorest.Response `json:"-"`
- Value *[]CloudPool `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CloudPoolListResultIterator provides access to a complete listing of CloudPool values.
-type CloudPoolListResultIterator struct {
- i int
- page CloudPoolListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CloudPoolListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CloudPoolListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CloudPoolListResultIterator) Response() CloudPoolListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CloudPoolListResultIterator) Value() CloudPool {
- if !iter.page.NotDone() {
- return CloudPool{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (cplr CloudPoolListResult) IsEmpty() bool {
- return cplr.Value == nil || len(*cplr.Value) == 0
-}
-
-// cloudPoolListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (cplr CloudPoolListResult) cloudPoolListResultPreparer() (*http.Request, error) {
- if cplr.OdataNextLink == nil || len(to.String(cplr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(cplr.OdataNextLink)))
-}
-
-// CloudPoolListResultPage contains a page of CloudPool values.
-type CloudPoolListResultPage struct {
- fn func(CloudPoolListResult) (CloudPoolListResult, error)
- cplr CloudPoolListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CloudPoolListResultPage) Next() error {
- next, err := page.fn(page.cplr)
- if err != nil {
- return err
- }
- page.cplr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CloudPoolListResultPage) NotDone() bool {
- return !page.cplr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CloudPoolListResultPage) Response() CloudPoolListResult {
- return page.cplr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CloudPoolListResultPage) Values() []CloudPool {
- if page.cplr.IsEmpty() {
- return nil
- }
- return *page.cplr.Value
-}
-
-// CloudServiceConfiguration ...
-type CloudServiceConfiguration struct {
- // OsFamily - Possible values are: 2 - OS Family 2, equivalent to Windows Server 2008 R2 SP1. 3 - OS Family 3, equivalent to Windows Server 2012. 4 - OS Family 4, equivalent to Windows Server 2012 R2. 5 - OS Family 5, equivalent to Windows Server 2016. For more information, see Azure Guest OS Releases (https://azure.microsoft.com/documentation/articles/cloud-services-guestos-update-matrix/#releases).
- OsFamily *string `json:"osFamily,omitempty"`
- // TargetOSVersion - The default value is * which specifies the latest operating system version for the specified OS family.
- TargetOSVersion *string `json:"targetOSVersion,omitempty"`
- // CurrentOSVersion - This may differ from targetOSVersion if the pool state is Upgrading. In this case some virtual machines may be on the targetOSVersion and some may be on the currentOSVersion during the upgrade process. Once all virtual machines have upgraded, currentOSVersion is updated to be the same as targetOSVersion.
- CurrentOSVersion *string `json:"currentOSVersion,omitempty"`
-}
-
-// CloudTask ...
-type CloudTask struct {
- autorest.Response `json:"-"`
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters.
- ID *string `json:"id,omitempty"`
- // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- URL *string `json:"url,omitempty"`
- // ETag - This is an opaque string. You can use it to detect whether the task has changed between requests. In particular, you can be pass the ETag when updating a task to specify that your changes should take effect only if nobody else has modified the task in the meantime.
- ETag *string `json:"eTag,omitempty"`
- LastModified *date.Time `json:"lastModified,omitempty"`
- CreationTime *date.Time `json:"creationTime,omitempty"`
- // ExitConditions - How the Batch service should respond when the task completes.
- ExitConditions *ExitConditions `json:"exitConditions,omitempty"`
- // State - Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted'
- State TaskState `json:"state,omitempty"`
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // PreviousState - This property is not set if the task is in its initial Active state. Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted'
- PreviousState TaskState `json:"previousState,omitempty"`
- // PreviousStateTransitionTime - This property is not set if the task is in its initial Active state.
- PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"`
- // CommandLine - For multi-instance tasks, the command line is executed as the primary task, after the primary task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux.
- CommandLine *string `json:"commandLine,omitempty"`
- // ResourceFiles - For multi-instance tasks, the resource files will only be downloaded to the compute node on which the primary task is executed.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- // OutputFiles - For multi-instance tasks, the files will only be uploaded from the compute node on which the primary task is executed.
- OutputFiles *[]OutputFile `json:"outputFiles,omitempty"`
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- AffinityInfo *AffinityInformation `json:"affinityInfo,omitempty"`
- Constraints *TaskConstraints `json:"constraints,omitempty"`
- // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task.
- UserIdentity *UserIdentity `json:"userIdentity,omitempty"`
- ExecutionInfo *TaskExecutionInformation `json:"executionInfo,omitempty"`
- NodeInfo *ComputeNodeInformation `json:"nodeInfo,omitempty"`
- MultiInstanceSettings *MultiInstanceSettings `json:"multiInstanceSettings,omitempty"`
- Stats *TaskStatistics `json:"stats,omitempty"`
- // DependsOn - This task will not be scheduled until all tasks that it depends on have completed successfully. If any of those tasks fail and exhaust their retry counts, this task will never be scheduled.
- DependsOn *TaskDependencies `json:"dependsOn,omitempty"`
- // ApplicationPackageReferences - Application packages are downloaded and deployed to a shared directory, not the task working directory. Therefore, if a referenced package is already on the compute node, and is up to date, then it is not re-downloaded; the existing copy on the compute node is used. If a referenced application package cannot be installed, for example because the package has been deleted or because download failed, the task fails.
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // AuthenticationTokenSettings - If this property is set, the Batch service provides the task with an authentication token which can be used to authenticate Batch service operations without requiring an account access key. The token is provided via the AZ_BATCH_AUTHENTICATION_TOKEN environment variable. The operations that the task can carry out using the token depend on the settings. For example, a task can request job permissions in order to add other tasks to the job, or check the status of the job or of other tasks under the job.
- AuthenticationTokenSettings *AuthenticationTokenSettings `json:"authenticationTokenSettings,omitempty"`
-}
-
-// CloudTaskListResult ...
-type CloudTaskListResult struct {
- autorest.Response `json:"-"`
- Value *[]CloudTask `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CloudTaskListResultIterator provides access to a complete listing of CloudTask values.
-type CloudTaskListResultIterator struct {
- i int
- page CloudTaskListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CloudTaskListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CloudTaskListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CloudTaskListResultIterator) Response() CloudTaskListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CloudTaskListResultIterator) Value() CloudTask {
- if !iter.page.NotDone() {
- return CloudTask{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (ctlr CloudTaskListResult) IsEmpty() bool {
- return ctlr.Value == nil || len(*ctlr.Value) == 0
-}
-
-// cloudTaskListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (ctlr CloudTaskListResult) cloudTaskListResultPreparer() (*http.Request, error) {
- if ctlr.OdataNextLink == nil || len(to.String(ctlr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(ctlr.OdataNextLink)))
-}
-
-// CloudTaskListResultPage contains a page of CloudTask values.
-type CloudTaskListResultPage struct {
- fn func(CloudTaskListResult) (CloudTaskListResult, error)
- ctlr CloudTaskListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CloudTaskListResultPage) Next() error {
- next, err := page.fn(page.ctlr)
- if err != nil {
- return err
- }
- page.ctlr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CloudTaskListResultPage) NotDone() bool {
- return !page.ctlr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CloudTaskListResultPage) Response() CloudTaskListResult {
- return page.ctlr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CloudTaskListResultPage) Values() []CloudTask {
- if page.ctlr.IsEmpty() {
- return nil
- }
- return *page.ctlr.Value
-}
-
-// CloudTaskListSubtasksResult ...
-type CloudTaskListSubtasksResult struct {
- autorest.Response `json:"-"`
- Value *[]SubtaskInformation `json:"value,omitempty"`
-}
-
-// ComputeNode ...
-type ComputeNode struct {
- autorest.Response `json:"-"`
- // ID - Every node that is added to a pool is assigned a unique ID. Whenever a node is removed from a pool, all of its local files are deleted, and the ID is reclaimed and could be reused for new nodes.
- ID *string `json:"id,omitempty"`
- URL *string `json:"url,omitempty"`
- // State - Values are:
- // idle - The node is not currently running a task.
- // rebooting - The node is rebooting.
- // reimaging - The node is reimaging.
- // running - The node is running one or more tasks (other than a start task).
- // unusable - The node cannot be used for task execution due to errors.
- // creating - The Batch service has obtained the underlying virtual machine from Azure Compute, but it has not yet started to join the pool.
- // starting - the Batch service is starting on the underlying virtual machine.
- // waitingforstarttask - The start task has started running on the compute node, but waitForSuccess is set and the start task has not yet completed.
- // starttaskfailed - The start task has failed on the compute node (and exhausted all retries), and waitForSuccess is set. The node is not usable for running tasks.
- // unknown - The Batch service has lost contact with the node, and does not know its true state.
- // leavingpool - The node is leaving the pool, either because the user explicitly removed it or because the pool is resizing or autoscaling down.
- // offline - The node is not currently running a task, and scheduling of new tasks to the node is disabled.
- // preempted - The low-priority node has been preempted. Tasks which were running on the node when it was pre-empted will be rescheduled when another node becomes available. Possible values include: 'Idle', 'Rebooting', 'Reimaging', 'Running', 'Unusable', 'Creating', 'Starting', 'WaitingForStartTask', 'StartTaskFailed', 'Unknown', 'LeavingPool', 'Offline', 'Preempted'
- State ComputeNodeState `json:"state,omitempty"`
- // SchedulingState - Values are:
- // enabled - Tasks can be scheduled on the node.
- // disabled - No new tasks will be scheduled on the node. Tasks already running on the node may still run to completion. All nodes start with scheduling enabled. Possible values include: 'Enabled', 'Disabled'
- SchedulingState SchedulingState `json:"schedulingState,omitempty"`
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // LastBootTime - This property may not be present if the node state is unusable.
- LastBootTime *date.Time `json:"lastBootTime,omitempty"`
- AllocationTime *date.Time `json:"allocationTime,omitempty"`
- // IPAddress - Every node that is added to a pool is assigned a unique IP address. Whenever a node is removed from a pool, all of its local files are deleted, and the IP address is reclaimed and could be reused for new nodes.
- IPAddress *string `json:"ipAddress,omitempty"`
- // AffinityID - Note that this is just a soft affinity. If the target node is busy or unavailable at the time the task is scheduled, then the task will be scheduled elsewhere.
- AffinityID *string `json:"affinityId,omitempty"`
- // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall, A1V2 and A2V2. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series).
- VMSize *string `json:"vmSize,omitempty"`
- TotalTasksRun *int32 `json:"totalTasksRun,omitempty"`
- RunningTasksCount *int32 `json:"runningTasksCount,omitempty"`
- TotalTasksSucceeded *int32 `json:"totalTasksSucceeded,omitempty"`
- // RecentTasks - This property is present only if at least one task has run on this node since it was assigned to the pool.
- RecentTasks *[]TaskInformation `json:"recentTasks,omitempty"`
- StartTask *StartTask `json:"startTask,omitempty"`
- StartTaskInfo *StartTaskInformation `json:"startTaskInfo,omitempty"`
- // CertificateReferences - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- Errors *[]ComputeNodeError `json:"errors,omitempty"`
- IsDedicated *bool `json:"isDedicated,omitempty"`
- EndpointConfiguration *ComputeNodeEndpointConfiguration `json:"endpointConfiguration,omitempty"`
-}
-
-// ComputeNodeEndpointConfiguration ...
-type ComputeNodeEndpointConfiguration struct {
- InboundEndpoints *[]InboundEndpoint `json:"inboundEndpoints,omitempty"`
-}
-
-// ComputeNodeError ...
-type ComputeNodeError struct {
- Code *string `json:"code,omitempty"`
- Message *string `json:"message,omitempty"`
- ErrorDetails *[]NameValuePair `json:"errorDetails,omitempty"`
-}
-
-// ComputeNodeGetRemoteLoginSettingsResult ...
-type ComputeNodeGetRemoteLoginSettingsResult struct {
- autorest.Response `json:"-"`
- RemoteLoginIPAddress *string `json:"remoteLoginIPAddress,omitempty"`
- RemoteLoginPort *int32 `json:"remoteLoginPort,omitempty"`
-}
-
-// ComputeNodeInformation ...
-type ComputeNodeInformation struct {
- AffinityID *string `json:"affinityId,omitempty"`
- NodeURL *string `json:"nodeUrl,omitempty"`
- PoolID *string `json:"poolId,omitempty"`
- NodeID *string `json:"nodeId,omitempty"`
- TaskRootDirectory *string `json:"taskRootDirectory,omitempty"`
- TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"`
-}
-
-// ComputeNodeListResult ...
-type ComputeNodeListResult struct {
- autorest.Response `json:"-"`
- Value *[]ComputeNode `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// ComputeNodeListResultIterator provides access to a complete listing of ComputeNode values.
-type ComputeNodeListResultIterator struct {
- i int
- page ComputeNodeListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *ComputeNodeListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter ComputeNodeListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter ComputeNodeListResultIterator) Response() ComputeNodeListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter ComputeNodeListResultIterator) Value() ComputeNode {
- if !iter.page.NotDone() {
- return ComputeNode{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (cnlr ComputeNodeListResult) IsEmpty() bool {
- return cnlr.Value == nil || len(*cnlr.Value) == 0
-}
-
-// computeNodeListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (cnlr ComputeNodeListResult) computeNodeListResultPreparer() (*http.Request, error) {
- if cnlr.OdataNextLink == nil || len(to.String(cnlr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(cnlr.OdataNextLink)))
-}
-
-// ComputeNodeListResultPage contains a page of ComputeNode values.
-type ComputeNodeListResultPage struct {
- fn func(ComputeNodeListResult) (ComputeNodeListResult, error)
- cnlr ComputeNodeListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *ComputeNodeListResultPage) Next() error {
- next, err := page.fn(page.cnlr)
- if err != nil {
- return err
- }
- page.cnlr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page ComputeNodeListResultPage) NotDone() bool {
- return !page.cnlr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page ComputeNodeListResultPage) Response() ComputeNodeListResult {
- return page.cnlr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page ComputeNodeListResultPage) Values() []ComputeNode {
- if page.cnlr.IsEmpty() {
- return nil
- }
- return *page.cnlr.Value
-}
-
-// ComputeNodeUser ...
-type ComputeNodeUser struct {
- Name *string `json:"name,omitempty"`
- // IsAdmin - The default value is false.
- IsAdmin *bool `json:"isAdmin,omitempty"`
- // ExpiryTime - If omitted, the default is 1 day from the current time. For Linux compute nodes, the expiryTime has a precision up to a day.
- ExpiryTime *date.Time `json:"expiryTime,omitempty"`
- // Password - The password is required for Windows nodes (those created with 'cloudServiceConfiguration', or created with 'virtualMachineConfiguration' using a Windows image reference). For Linux compute nodes, the password can optionally be specified along with the sshPublicKey property.
- Password *string `json:"password,omitempty"`
- // SSHPublicKey - The public key should be compatible with OpenSSH encoding and should be base 64 encoded. This property can be specified only for Linux nodes. If this is specified for a Windows node, then the Batch service rejects the request; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- SSHPublicKey *string `json:"sshPublicKey,omitempty"`
-}
-
-// DeleteCertificateError ...
-type DeleteCertificateError struct {
- Code *string `json:"code,omitempty"`
- Message *string `json:"message,omitempty"`
- // Values - This list includes details such as the active pools and nodes referencing this certificate. However, if a large number of resources reference the certificate, the list contains only about the first hundred.
- Values *[]NameValuePair `json:"values,omitempty"`
-}
-
-// EnvironmentSetting ...
-type EnvironmentSetting struct {
- Name *string `json:"name,omitempty"`
- Value *string `json:"value,omitempty"`
-}
-
-// Error ...
-type Error struct {
- Code *string `json:"code,omitempty"`
- Message *ErrorMessage `json:"message,omitempty"`
- Values *[]ErrorDetail `json:"values,omitempty"`
-}
-
-// ErrorDetail ...
-type ErrorDetail struct {
- Key *string `json:"key,omitempty"`
- Value *string `json:"value,omitempty"`
-}
-
-// ErrorMessage ...
-type ErrorMessage struct {
- Lang *string `json:"lang,omitempty"`
- Value *string `json:"value,omitempty"`
-}
-
-// ExitCodeMapping ...
-type ExitCodeMapping struct {
- Code *int32 `json:"code,omitempty"`
- ExitOptions *ExitOptions `json:"exitOptions,omitempty"`
-}
-
-// ExitCodeRangeMapping ...
-type ExitCodeRangeMapping struct {
- Start *int32 `json:"start,omitempty"`
- End *int32 `json:"end,omitempty"`
- ExitOptions *ExitOptions `json:"exitOptions,omitempty"`
-}
-
-// ExitConditions ...
-type ExitConditions struct {
- ExitCodes *[]ExitCodeMapping `json:"exitCodes,omitempty"`
- ExitCodeRanges *[]ExitCodeRangeMapping `json:"exitCodeRanges,omitempty"`
- PreProcessingError *ExitOptions `json:"preProcessingError,omitempty"`
- // FileUploadError - If the task exited with an exit code that was specified via exitCodes or exitCodeRanges, and then encountered a file upload error, then the action specified by the exit code takes precedence.
- FileUploadError *ExitOptions `json:"fileUploadError,omitempty"`
- // Default - This value is used if the task exits with any nonzero exit code not listed in the exitCodes or exitCodeRanges collection, with a pre-processing error if the preProcessingError property is not present, or with a file upload error if the fileUploadError property is not present. If you want non-default behaviour on exit code 0, you must list it explicitly using the exitCodes or exitCodeRanges collection.
- Default *ExitOptions `json:"default,omitempty"`
-}
-
-// ExitOptions ...
-type ExitOptions struct {
- // JobAction - Values are:
- // none - Take no action.
- // disable - Disable the job. This is equivalent to calling the disable job API, with a disableTasks value of requeue.
- // terminate - Terminate the job. The terminateReason in the job's executionInfo is set to "TaskFailed". The default is none for exit code 0 and terminate for all other exit conditions.
- // If the job's onTaskFailed property is noAction, then specifying this property returns an error and the add task request fails with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). Possible values include: 'JobActionNone', 'JobActionDisable', 'JobActionTerminate'
- JobAction JobAction `json:"jobAction,omitempty"`
- // DependencyAction - Values are:
- // satisfy - Satisfy the task's dependencies.
- // block - Block the task's dependencies.
- // The default is 'satisfy' for exit code 0, and 'block' for all other exit conditions. If the job's usesTaskDependencies property is set to false, then specifying the dependencyAction property returns an erro and the add task request fails with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). Possible values include: 'Satisfy', 'Block'
- DependencyAction DependencyAction `json:"dependencyAction,omitempty"`
-}
-
-// FileProperties ...
-type FileProperties struct {
- // CreationTime - The creation time is not returned for files on Linux compute nodes.
- CreationTime *date.Time `json:"creationTime,omitempty"`
- LastModified *date.Time `json:"lastModified,omitempty"`
- ContentLength *int64 `json:"contentLength,omitempty"`
- ContentType *string `json:"contentType,omitempty"`
- // FileMode - The file mode is returned only for files on Linux compute nodes.
- FileMode *string `json:"fileMode,omitempty"`
-}
-
-// ImageReference ...
-type ImageReference struct {
- // Publisher - For example, Canonical or MicrosoftWindowsServer.
- Publisher *string `json:"publisher,omitempty"`
- // Offer - For example, UbuntuServer or WindowsServer.
- Offer *string `json:"offer,omitempty"`
- // Sku - For example, 14.04.0-LTS or 2012-R2-Datacenter.
- Sku *string `json:"sku,omitempty"`
- // Version - A value of 'latest' can be specified to select the latest version of an image. If omitted, the default is 'latest'.
- Version *string `json:"version,omitempty"`
-}
-
-// InboundEndpoint ...
-type InboundEndpoint struct {
- Name *string `json:"name,omitempty"`
- // Protocol - Possible values include: 'TCP', 'UDP'
- Protocol InboundEndpointProtocol `json:"protocol,omitempty"`
- PublicIPAddress *string `json:"publicIPAddress,omitempty"`
- PublicFQDN *string `json:"publicFQDN,omitempty"`
- FrontendPort *int32 `json:"frontendPort,omitempty"`
- BackendPort *int32 `json:"backendPort,omitempty"`
-}
-
-// InboundNATPool ...
-type InboundNATPool struct {
- // Name - The name must be unique within a Batch pool, can contain letters, numbers, underscores, periods, and hyphens. Names must start with a letter or number, must end with a letter, number, or underscore, and cannot exceed 77 characters. If any invalid values are provided the request fails with HTTP status code 400.
- Name *string `json:"name,omitempty"`
- // Protocol - Possible values include: 'TCP', 'UDP'
- Protocol InboundEndpointProtocol `json:"protocol,omitempty"`
- // BackendPort - This must be unique within a Batch pool. Acceptable values are between 1 and 65535 except for 22, 3389, 29876 and 29877 as these are reserved. If any reserved values are provided the request fails with HTTP status code 400.
- BackendPort *int32 `json:"backendPort,omitempty"`
- // FrontendPortRangeStart - Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved. All ranges within a pool must be distinct and cannot overlap. If any reserved or overlapping values are provided the request fails with HTTP status code 400.
- FrontendPortRangeStart *int32 `json:"frontendPortRangeStart,omitempty"`
- // FrontendPortRangeEnd - Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved by the Batch service. All ranges within a pool must be distinct and cannot overlap. If any reserved or overlapping values are provided the request fails with HTTP status code 400.
- FrontendPortRangeEnd *int32 `json:"frontendPortRangeEnd,omitempty"`
- // NetworkSecurityGroupRules - The maximum number of rules that can be specified across all the endpoints on a Batch pool is 25. If no network security group rules are specified, a default rule will be created to allow inbound access to the specified backendPort. If the maximum number of network security group rules is exceeded the request fails with HTTP status code 400.
- NetworkSecurityGroupRules *[]NetworkSecurityGroupRule `json:"networkSecurityGroupRules,omitempty"`
-}
-
-// JobAddParameter ...
-type JobAddParameter struct {
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an account that differ only by case).
- ID *string `json:"id,omitempty"`
- // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0.
- Priority *int32 `json:"priority,omitempty"`
- // Constraints - The execution constraints for the job.
- Constraints *JobConstraints `json:"constraints,omitempty"`
- // JobManagerTask - If the job does not specify a Job Manager task, the user must explicitly add tasks to the job. If the job does specify a Job Manager task, the Batch service creates the Job Manager task when the job is created, and will try to schedule the Job Manager task before scheduling other tasks in the job. The Job Manager task's typical purpose is to control and/or monitor job execution, for example by deciding what additional tasks to run, determining when the work is complete, etc. (However, a Job Manager task is not restricted to these activities - it is a fully-fledged task in the system and perform whatever actions are required for the job.) For example, a Job Manager task might download a file specified as a parameter, analyze the contents of that file and submit additional tasks based on those contents.
- JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"`
- // JobPreparationTask - If a job has a Job Preparation task, the Batch service will run the Job Preparation task on a compute node before starting any tasks of that job on that compute node.
- JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"`
- // JobReleaseTask - A Job Release task cannot be specified without also specifying a Job Preparation task for the job. The Batch service runs the Job Release task on the compute nodes that have run the Job Preparation task. The primary purpose of the Job Release task is to undo changes to compute nodes made by the Job Preparation task. Example activities include deleting local files, or shutting down services that were started as part of job preparation.
- JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"`
- // CommonEnvironmentSettings - Individual tasks can override an environment setting specified here by specifying the same setting name with a different value.
- CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"`
- PoolInfo *PoolInformation `json:"poolInfo,omitempty"`
- // OnAllTasksComplete - Note that if a job contains no tasks, then all tasks are considered complete. This option is therefore most commonly used with a Job Manager task; if you want to use automatic job termination without a Job Manager, you should initially set onAllTasksComplete to noAction and update the job properties to set onAllTasksComplete to terminateJob once you have finished adding tasks. Permitted values are: noAction - do nothing. The job remains active unless terminated or disabled by some other means. terminateJob - terminate the job. The job's terminateReason is set to 'AllTasksComplete'. The default is noAction. Possible values include: 'NoAction', 'TerminateJob'
- OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"`
- // OnTaskFailure - A task is considered to have failed if has a failureInfo. A failureInfo is set if the task completes with a non-zero exit code after exhausting its retry count, or if there was an error starting the task, for example due to a resource file download error. noAction - do nothing. performExitOptionsJobAction - take the action associated with the task exit condition in the task's exitConditions collection. (This may still result in no action being taken, if that is what the task specifies.) The default is noAction. Possible values include: 'OnTaskFailureNoAction', 'OnTaskFailurePerformExitOptionsJobAction'
- OnTaskFailure OnTaskFailure `json:"onTaskFailure,omitempty"`
- // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
- UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"`
-}
-
-// JobConstraints ...
-type JobConstraints struct {
- // MaxWallClockTime - If the job does not complete within the time limit, the Batch service terminates it and any tasks that are still running. In this case, the termination reason will be MaxWallClockTimeExpiry. If this property is not specified, there is no time limit on how long the job may run.
- MaxWallClockTime *string `json:"maxWallClockTime,omitempty"`
- // MaxTaskRetryCount - Note that this value specifically controls the number of retries. The Batch service will try each task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries a task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry tasks. If the maximum retry count is -1, the Batch service retries tasks without limit. The default value is 0 (no retries).
- MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"`
-}
-
-// JobDisableParameter ...
-type JobDisableParameter struct {
- // DisableTasks - Values are:
- // requeue - Terminate running tasks and requeue them. The tasks will run again when the job is enabled.
- // terminate - Terminate running tasks. The tasks will not run again.
- // wait - Allow currently running tasks to complete. Possible values include: 'DisableJobOptionRequeue', 'DisableJobOptionTerminate', 'DisableJobOptionWait'
- DisableTasks DisableJobOption `json:"disableTasks,omitempty"`
-}
-
-// JobExecutionInformation ...
-type JobExecutionInformation struct {
- // StartTime - This is the time at which the job was created.
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - This property is set only if the job is in the completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
- // PoolID - This element contains the actual pool where the job is assigned. When you get job details from the service, they also contain a poolInfo element, which contains the pool configuration data from when the job was added or updated. That poolInfo element may also contain a poolId element. If it does, the two IDs are the same. If it does not, it means the job ran on an auto pool, and this property contains the ID of that auto pool.
- PoolID *string `json:"poolId,omitempty"`
- // SchedulingError - This property is not set if there was no error starting the job.
- SchedulingError *JobSchedulingError `json:"schedulingError,omitempty"`
- // TerminateReason - This property is set only if the job is in the completed state. If the Batch service terminates the job, it sets the reason as follows: JMComplete - the Job Manager task completed, and killJobOnCompletion was set to true. MaxWallClockTimeExpiry - the job reached its maxWallClockTime constraint. TerminateJobSchedule - the job ran as part of a schedule, and the schedule terminated. AllTasksComplete - the job's onAllTasksComplete attribute is set to terminateJob, and all tasks in the job are complete. TaskFailed - the job's onTaskFailure attribute is set to performExitOptionsJobAction, and a task in the job failed with an exit condition that specified a jobAction of terminateJob. Any other string is a user-defined reason specified in a call to the 'Terminate a job' operation.
- TerminateReason *string `json:"terminateReason,omitempty"`
-}
-
-// JobManagerTask the Job Manager task is automatically started when the job is created. The Batch service tries to
-// schedule the Job Manager task before any other tasks in the job. When shrinking a pool, the Batch service tries
-// to preserve compute nodes where Job Manager tasks are running for as long as possible (that is, nodes running
-// 'normal' tasks are removed before nodes running Job Manager tasks). When a Job Manager task fails and needs to
-// be restarted, the system tries to schedule it at the highest priority. If there are no idle nodes available, the
-// system may terminate one of the running tasks in the pool and return it to the queue in order to make room for
-// the Job Manager task to restart. Note that a Job Manager task in one job does not have priority over tasks in
-// other jobs. Across jobs, only job level priorities are observed. For example, if a Job Manager in a priority 0
-// job needs to be restarted, it will not displace tasks of a priority 1 job.
-type JobManagerTask struct {
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters.
- ID *string `json:"id,omitempty"`
- // DisplayName - It need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux.
- CommandLine *string `json:"commandLine,omitempty"`
- // ResourceFiles - Files listed under this element are located in the task's working directory.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- // OutputFiles - For multi-instance tasks, the files will only be uploaded from the compute node on which the primary task is executed.
- OutputFiles *[]OutputFile `json:"outputFiles,omitempty"`
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- Constraints *TaskConstraints `json:"constraints,omitempty"`
- // KillJobOnCompletion - If true, when the Job Manager task completes, the Batch service marks the job as complete. If any tasks are still running at this time (other than Job Release), those tasks are terminated. If false, the completion of the Job Manager task does not affect the job status. In this case, you should either use the onAllTasksComplete attribute to terminate the job, or have a client or user terminate the job explicitly. An example of this is if the Job Manager creates a set of tasks but then takes no further role in their execution. The default value is true. If you are using the onAllTasksComplete and onTaskFailure attributes to control job lifetime, and using the Job Manager task only to create the tasks for the job (not to monitor progress), then it is important to set killJobOnCompletion to false.
- KillJobOnCompletion *bool `json:"killJobOnCompletion,omitempty"`
- // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task.
- UserIdentity *UserIdentity `json:"userIdentity,omitempty"`
- // RunExclusive - If true, no other tasks will run on the same compute node for as long as the Job Manager is running. If false, other tasks can run simultaneously with the Job Manager on a compute node. The Job Manager task counts normally against the node's concurrent task limit, so this is only relevant if the node allows multiple concurrent tasks. The default value is true.
- RunExclusive *bool `json:"runExclusive,omitempty"`
- // ApplicationPackageReferences - Application packages are downloaded and deployed to a shared directory, not the task working directory. Therefore, if a referenced package is already on the compute node, and is up to date, then it is not re-downloaded; the existing copy on the compute node is used. If a referenced application package cannot be installed, for example because the package has been deleted or because download failed, the task fails.
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // AuthenticationTokenSettings - If this property is set, the Batch service provides the task with an authentication token which can be used to authenticate Batch service operations without requiring an account access key. The token is provided via the AZ_BATCH_AUTHENTICATION_TOKEN environment variable. The operations that the task can carry out using the token depend on the settings. For example, a task can request job permissions in order to add other tasks to the job, or check the status of the job or of other tasks under the job.
- AuthenticationTokenSettings *AuthenticationTokenSettings `json:"authenticationTokenSettings,omitempty"`
- // AllowLowPriorityNode - The default value is false.
- AllowLowPriorityNode *bool `json:"allowLowPriorityNode,omitempty"`
-}
-
-// JobPatchParameter ...
-type JobPatchParameter struct {
- // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. If omitted, the priority of the job is left unchanged.
- Priority *int32 `json:"priority,omitempty"`
- // OnAllTasksComplete - If omitted, the completion behavior is left unchanged. You may not change the value from terminateJob to noAction - that is, once you have engaged automatic job termination, you cannot turn it off again. If you try to do this, the request fails with an 'invalid property value' error response; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). Possible values include: 'NoAction', 'TerminateJob'
- OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"`
- // Constraints - If omitted, the existing execution constraints are left unchanged.
- Constraints *JobConstraints `json:"constraints,omitempty"`
- // PoolInfo - You may change the pool for a job only when the job is disabled. The Patch Job call will fail if you include the poolInfo element and the job is not disabled. If you specify an autoPoolSpecification specification in the poolInfo, only the keepAlive property can be updated, and then only if the auto pool has a poolLifetimeOption of job. If omitted, the job continues to run on its current pool.
- PoolInfo *PoolInformation `json:"poolInfo,omitempty"`
- // Metadata - If omitted, the existing job metadata is left unchanged.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// JobPreparationAndReleaseTaskExecutionInformation ...
-type JobPreparationAndReleaseTaskExecutionInformation struct {
- PoolID *string `json:"poolId,omitempty"`
- NodeID *string `json:"nodeId,omitempty"`
- NodeURL *string `json:"nodeUrl,omitempty"`
- JobPreparationTaskExecutionInfo *JobPreparationTaskExecutionInformation `json:"jobPreparationTaskExecutionInfo,omitempty"`
- // JobReleaseTaskExecutionInfo - This property is set only if the Job Release task has run on the node.
- JobReleaseTaskExecutionInfo *JobReleaseTaskExecutionInformation `json:"jobReleaseTaskExecutionInfo,omitempty"`
-}
-
-// JobPreparationTask you can use Job Preparation to prepare a compute node to run tasks for the job. Activities
-// commonly performed in Job Preparation include: Downloading common resource files used by all the tasks in the
-// job. The Job Preparation task can download these common resource files to the shared location on the compute
-// node. (AZ_BATCH_NODE_ROOT_DIR\shared), or starting a local service on the compute node so that all tasks of that
-// job can communicate with it. If the Job Preparation task fails (that is, exhausts its retry count before exiting
-// with exit code 0), Batch will not run tasks of this job on the compute node. The node remains ineligible to run
-// tasks of this job until it is reimaged. The node remains active and can be used for other jobs. The Job
-// Preparation task can run multiple times on the same compute node. Therefore, you should write the Job
-// Preparation task to handle re-execution. If the compute node is rebooted, the Job Preparation task is run again
-// on the node before scheduling any other task of the job, if rerunOnNodeRebootAfterSuccess is true or if the Job
-// Preparation task did not previously complete. If the compute node is reimaged, the Job Preparation task is run
-// again before scheduling any task of the job.
-type JobPreparationTask struct {
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobpreparation'. No other task in the job can have the same ID as the Job Preparation task. If you try to submit a task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobPreparationTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict).
- ID *string `json:"id,omitempty"`
- // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux.
- CommandLine *string `json:"commandLine,omitempty"`
- // ResourceFiles - Files listed under this element are located in the task's working directory.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- Constraints *TaskConstraints `json:"constraints,omitempty"`
- // WaitForSuccess - If true and the Job Preparation task fails on a compute node, the Batch service retries the Job Preparation task up to its maximum retry count (as specified in the constraints element). If the task has still not completed successfully after all retries, then the Batch service will not schedule tasks of the job to the compute node. The compute node remains active and eligible to run tasks of other jobs. If false, the Batch service will not wait for the Job Preparation task to complete. In this case, other tasks of the job can start executing on the compute node while the Job Preparation task is still running; and even if the Job Preparation task fails, new tasks will continue to be scheduled on the node. The default value is true.
- WaitForSuccess *bool `json:"waitForSuccess,omitempty"`
- // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task on Windows nodes, or a a non-administrative user unique to the pool on Linux nodes.
- UserIdentity *UserIdentity `json:"userIdentity,omitempty"`
- // RerunOnNodeRebootAfterSuccess - The Job Preparation task is always rerun if a compute node is reimaged, or if the Job Preparation task did not complete (e.g. because the reboot occurred while the task was running). Therefore, you should always write a Job Preparation task to be idempotent and to behave correctly if run multiple times. The default value is true.
- RerunOnNodeRebootAfterSuccess *bool `json:"rerunOnNodeRebootAfterSuccess,omitempty"`
-}
-
-// JobPreparationTaskExecutionInformation ...
-type JobPreparationTaskExecutionInformation struct {
- // StartTime - If the task has been restarted or retried, this is the most recent time at which the task started running.
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - This property is set only if the task is in the Completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
- // State - Values are:
- // running - the task is currently running (including retrying).
- // completed - the task has exited with exit code 0, or the task has exhausted its retry limit, or the Batch service was unable to start the task due to task preparation errors (such as resource file download failures). Possible values include: 'JobPreparationTaskStateRunning', 'JobPreparationTaskStateCompleted'
- State JobPreparationTaskState `json:"state,omitempty"`
- TaskRootDirectory *string `json:"taskRootDirectory,omitempty"`
- TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"`
- // ExitCode - This parameter is returned only if the task is in the completed state. The exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. Note that the exit code may also be generated by the compute node operating system, such as when a process is forcibly terminated.
- ExitCode *int32 `json:"exitCode,omitempty"`
- // FailureInfo - This property is set only if the task is in the completed state and encountered a failure.
- FailureInfo *TaskFailureInformation `json:"failureInfo,omitempty"`
- // RetryCount - Task application failures (non-zero exit code) are retried, pre-processing errors (the task could not be run) and file upload errors are not retried. The Batch service will retry the task up to the limit specified by the constraints.
- RetryCount *int32 `json:"retryCount,omitempty"`
- // LastRetryTime - This property is set only if the task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the task has been restarted for reasons other than retry; for example, if the compute node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not.
- LastRetryTime *date.Time `json:"lastRetryTime,omitempty"`
- // Result - If the value is 'failed', then the details of the failure can be found in the failureInfo property. Possible values include: 'Success', 'Failure'
- Result TaskExecutionResult `json:"result,omitempty"`
-}
-
-// JobReleaseTask the Job Release task runs when the job ends, because of one of the following: The user calls the
-// Terminate Job API, or the Delete Job API while the job is still active, the job's maximum wall clock time
-// constraint is reached, and the job is still active, or the job's Job Manager task completed, and the job is
-// configured to terminate when the Job Manager completes. The Job Release task runs on each compute node where
-// tasks of the job have run and the Job Preparation task ran and completed. If you reimage a compute node after it
-// has run the Job Preparation task, and the job ends without any further tasks of the job running on that compute
-// node (and hence the Job Preparation task does not re-run), then the Job Release task does not run on that node.
-// If a compute node reboots while the Job Release task is still running, the Job Release task runs again when the
-// compute node starts up. The job is not marked as complete until all Job Release tasks have completed. The Job
-// Release task runs in the background. It does not occupy a scheduling slot; that is, it does not count towards
-// the maxTasksPerNode limit specified on the pool.
-type JobReleaseTask struct {
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobrelease'. No other task in the job can have the same ID as the Job Release task. If you try to submit a task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobReleaseTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict).
- ID *string `json:"id,omitempty"`
- // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux.
- CommandLine *string `json:"commandLine,omitempty"`
- // ResourceFiles - Files listed under this element are located in the task's working directory.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- MaxWallClockTime *string `json:"maxWallClockTime,omitempty"`
- // RetentionTime - The default is infinite, i.e. the task directory will be retained until the compute node is removed or reimaged.
- RetentionTime *string `json:"retentionTime,omitempty"`
- // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task.
- UserIdentity *UserIdentity `json:"userIdentity,omitempty"`
-}
-
-// JobReleaseTaskExecutionInformation ...
-type JobReleaseTaskExecutionInformation struct {
- // StartTime - If the task has been restarted or retried, this is the most recent time at which the task started running.
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - This property is set only if the task is in the Completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
- // State - Values are:
- // running - the task is currently running (including retrying).
- // completed - the task has exited, or the Batch service was unable to start the task due to task preparation errors (such as resource file download failures). Possible values include: 'JobReleaseTaskStateRunning', 'JobReleaseTaskStateCompleted'
- State JobReleaseTaskState `json:"state,omitempty"`
- TaskRootDirectory *string `json:"taskRootDirectory,omitempty"`
- TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"`
- // ExitCode - This parameter is returned only if the task is in the completed state. The exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. Note that the exit code may also be generated by the compute node operating system, such as when a process is forcibly terminated.
- ExitCode *int32 `json:"exitCode,omitempty"`
- // FailureInfo - This property is set only if the task is in the completed state and encountered a failure.
- FailureInfo *TaskFailureInformation `json:"failureInfo,omitempty"`
- // Result - If the value is 'failed', then the details of the failure can be found in the failureInfo property. Possible values include: 'Success', 'Failure'
- Result TaskExecutionResult `json:"result,omitempty"`
-}
-
-// JobScheduleAddParameter ...
-type JobScheduleAddParameter struct {
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an account that differ only by case).
- ID *string `json:"id,omitempty"`
- // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- Schedule *Schedule `json:"schedule,omitempty"`
- JobSpecification *JobSpecification `json:"jobSpecification,omitempty"`
- // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// JobScheduleExecutionInformation ...
-type JobScheduleExecutionInformation struct {
- // NextRunTime - This property is meaningful only if the schedule is in the active state when the time comes around. For example, if the schedule is disabled, no job will be created at nextRunTime unless the job is enabled before then.
- NextRunTime *date.Time `json:"nextRunTime,omitempty"`
- // RecentJob - This property is present only if the at least one job has run under the schedule.
- RecentJob *RecentJob `json:"recentJob,omitempty"`
- // EndTime - This property is set only if the job schedule is in the completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
-}
-
-// JobSchedulePatchParameter ...
-type JobSchedulePatchParameter struct {
- // Schedule - If you do not specify this element, the existing schedule is left unchanged.
- Schedule *Schedule `json:"schedule,omitempty"`
- // JobSpecification - Updates affect only jobs that are started after the update has taken place. Any currently active job continues with the older specification.
- JobSpecification *JobSpecification `json:"jobSpecification,omitempty"`
- // Metadata - If you do not specify this element, existing metadata is left unchanged.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// JobScheduleStatistics ...
-type JobScheduleStatistics struct {
- URL *string `json:"url,omitempty"`
- StartTime *date.Time `json:"startTime,omitempty"`
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- UserCPUTime *string `json:"userCPUTime,omitempty"`
- KernelCPUTime *string `json:"kernelCPUTime,omitempty"`
- // WallClockTime - The wall clock time is the elapsed time from when the task started running on a compute node to when it finished (or to the last time the statistics were updated, if the task had not finished by then). If a task was retried, this includes the wall clock time of all the task retries.
- WallClockTime *string `json:"wallClockTime,omitempty"`
- ReadIOps *int64 `json:"readIOps,omitempty"`
- WriteIOps *int64 `json:"writeIOps,omitempty"`
- ReadIOGiB *float64 `json:"readIOGiB,omitempty"`
- WriteIOGiB *float64 `json:"writeIOGiB,omitempty"`
- NumSucceededTasks *int64 `json:"numSucceededTasks,omitempty"`
- NumFailedTasks *int64 `json:"numFailedTasks,omitempty"`
- NumTaskRetries *int64 `json:"numTaskRetries,omitempty"`
- // WaitTime - This value is only reported in the account lifetime statistics; it is not included in the job statistics.
- WaitTime *string `json:"waitTime,omitempty"`
-}
-
-// JobScheduleUpdateParameter ...
-type JobScheduleUpdateParameter struct {
- // Schedule - If you do not specify this element, it is equivalent to passing the default schedule: that is, a single job scheduled to run immediately.
- Schedule *Schedule `json:"schedule,omitempty"`
- // JobSpecification - Updates affect only jobs that are started after the update has taken place. Any currently active job continues with the older specification.
- JobSpecification *JobSpecification `json:"jobSpecification,omitempty"`
- // Metadata - If you do not specify this element, it takes the default value of an empty list; in effect, any existing metadata is deleted.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// JobSchedulingError ...
-type JobSchedulingError struct {
- // Category - Possible values include: 'UserError', 'ServerError'
- Category ErrorCategory `json:"category,omitempty"`
- Code *string `json:"code,omitempty"`
- Message *string `json:"message,omitempty"`
- Details *[]NameValuePair `json:"details,omitempty"`
-}
-
-// JobSpecification ...
-type JobSpecification struct {
- // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0. This priority is used as the default for all jobs under the job schedule. You can update a job's priority after it has been created using by using the update job API.
- Priority *int32 `json:"priority,omitempty"`
- // DisplayName - The name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"`
- // OnAllTasksComplete - Note that if a job contains no tasks, then all tasks are considered complete. This option is therefore most commonly used with a Job Manager task; if you want to use automatic job termination without a Job Manager, you should initially set onAllTasksComplete to noAction and update the job properties to set onAllTasksComplete to terminateJob once you have finished adding tasks. The default is noAction. Possible values include: 'NoAction', 'TerminateJob'
- OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"`
- // OnTaskFailure - The default is noAction. Possible values include: 'OnTaskFailureNoAction', 'OnTaskFailurePerformExitOptionsJobAction'
- OnTaskFailure OnTaskFailure `json:"onTaskFailure,omitempty"`
- Constraints *JobConstraints `json:"constraints,omitempty"`
- // JobManagerTask - If the job does not specify a Job Manager task, the user must explicitly add tasks to the job using the Task API. If the job does specify a Job Manager task, the Batch service creates the Job Manager task when the job is created, and will try to schedule the Job Manager task before scheduling other tasks in the job.
- JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"`
- // JobPreparationTask - If a job has a Job Preparation task, the Batch service will run the Job Preparation task on a compute node before starting any tasks of that job on that compute node.
- JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"`
- // JobReleaseTask - The primary purpose of the Job Release task is to undo changes to compute nodes made by the Job Preparation task. Example activities include deleting local files, or shutting down services that were started as part of job preparation. A Job Release task cannot be specified without also specifying a Job Preparation task for the job. The Batch service runs the Job Release task on the compute nodes that have run the Job Preparation task.
- JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"`
- // CommonEnvironmentSettings - Individual tasks can override an environment setting specified here by specifying the same setting name with a different value.
- CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"`
- PoolInfo *PoolInformation `json:"poolInfo,omitempty"`
- // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// JobStatistics ...
-type JobStatistics struct {
- autorest.Response `json:"-"`
- URL *string `json:"url,omitempty"`
- StartTime *date.Time `json:"startTime,omitempty"`
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- UserCPUTime *string `json:"userCPUTime,omitempty"`
- KernelCPUTime *string `json:"kernelCPUTime,omitempty"`
- // WallClockTime - The wall clock time is the elapsed time from when the task started running on a compute node to when it finished (or to the last time the statistics were updated, if the task had not finished by then). If a task was retried, this includes the wall clock time of all the task retries.
- WallClockTime *string `json:"wallClockTime,omitempty"`
- ReadIOps *int64 `json:"readIOps,omitempty"`
- WriteIOps *int64 `json:"writeIOps,omitempty"`
- ReadIOGiB *float64 `json:"readIOGiB,omitempty"`
- WriteIOGiB *float64 `json:"writeIOGiB,omitempty"`
- // NumSucceededTasks - A task completes successfully if it returns exit code 0.
- NumSucceededTasks *int64 `json:"numSucceededTasks,omitempty"`
- // NumFailedTasks - A task fails if it exhausts its maximum retry count without returning exit code 0.
- NumFailedTasks *int64 `json:"numFailedTasks,omitempty"`
- NumTaskRetries *int64 `json:"numTaskRetries,omitempty"`
- // WaitTime - The wait time for a task is defined as the elapsed time between the creation of the task and the start of task execution. (If the task is retried due to failures, the wait time is the time to the most recent task execution.) This value is only reported in the account lifetime statistics; it is not included in the job statistics.
- WaitTime *string `json:"waitTime,omitempty"`
-}
-
-// JobTerminateParameter ...
-type JobTerminateParameter struct {
- TerminateReason *string `json:"terminateReason,omitempty"`
-}
-
-// JobUpdateParameter ...
-type JobUpdateParameter struct {
- // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. If omitted, it is set to the default value 0.
- Priority *int32 `json:"priority,omitempty"`
- // Constraints - If omitted, the constraints are cleared.
- Constraints *JobConstraints `json:"constraints,omitempty"`
- // PoolInfo - You may change the pool for a job only when the job is disabled. The Update Job call will fail if you include the poolInfo element and the job is not disabled. If you specify an autoPoolSpecification specification in the poolInfo, only the keepAlive property can be updated, and then only if the auto pool has a poolLifetimeOption of job.
- PoolInfo *PoolInformation `json:"poolInfo,omitempty"`
- // Metadata - If omitted, it takes the default value of an empty list; in effect, any existing metadata is deleted.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
- // OnAllTasksComplete - If omitted, the completion behavior is set to noAction. If the current value is terminateJob, this is an error because a job's completion behavior may not be changed from terminateJob to noAction. You may not change the value from terminatejob to noaction - that is, once you have engaged automatic job termination, you cannot turn it off again. If you try to do this, the request fails and Batch returns status code 400 (Bad Request) and an 'invalid property value' error response. If you do not specify this element in a PUT request, it is equivalent to passing noaction. This is an error if the current value is terminatejob. Possible values include: 'NoAction', 'TerminateJob'
- OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"`
-}
-
-// LinuxUserConfiguration ...
-type LinuxUserConfiguration struct {
- // UID - The uid and gid properties must be specified together or not at all. If not specified the underlying operating system picks the uid.
- UID *int32 `json:"uid,omitempty"`
- // Gid - The uid and gid properties must be specified together or not at all. If not specified the underlying operating system picks the gid.
- Gid *int32 `json:"gid,omitempty"`
- // SSHPrivateKey - The private key must not be password protected. The private key is used to automatically configure asymmetric-key based authentication for SSH between nodes in a Linux pool when the pool's enableInterNodeCommunication property is true (it is ignored if enableInterNodeCommunication is false). It does this by placing the key pair into the user's .ssh directory. If not specified, password-less SSH is not configured between nodes (no modification of the user's .ssh directory is done).
- SSHPrivateKey *string `json:"sshPrivateKey,omitempty"`
-}
-
-// MetadataItem the Batch service does not assign any meaning to this metadata; it is solely for the use of user
-// code.
-type MetadataItem struct {
- Name *string `json:"name,omitempty"`
- Value *string `json:"value,omitempty"`
-}
-
-// MultiInstanceSettings multi-instance tasks are commonly used to support MPI tasks.
-type MultiInstanceSettings struct {
- NumberOfInstances *int32 `json:"numberOfInstances,omitempty"`
- // CoordinationCommandLine - A typical coordination command line launches a background service and verifies that the service is ready to process inter-node messages.
- CoordinationCommandLine *string `json:"coordinationCommandLine,omitempty"`
- // CommonResourceFiles - The difference between common resource files and task resource files is that common resource files are downloaded for all subtasks including the primary, whereas task resource files are downloaded only for the primary. Also note that these resource files are not downloaded to the task working directory, but instead are downloaded to the task root directory (one directory above the working directory).
- CommonResourceFiles *[]ResourceFile `json:"commonResourceFiles,omitempty"`
-}
-
-// NameValuePair ...
-type NameValuePair struct {
- Name *string `json:"name,omitempty"`
- Value *string `json:"value,omitempty"`
-}
-
-// NetworkConfiguration the network configuration for a pool.
-type NetworkConfiguration struct {
- // SubnetID - The virtual network must be in the same region and subscription as the Azure Batch account. The specified subnet should have enough free IP addresses to accommodate the number of nodes in the pool. If the subnet doesn't have enough free IP addresses, the pool will partially allocate compute nodes, and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to be able to schedule tasks on the compute nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the compute nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the compute nodes to unusable. For pools created via virtualMachineConfiguration the Batch account must have poolAllocationMode userSubscription in order to use a VNet. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication. For pools created with a virtual machine configuration, enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. For pools created with a cloud service configuration, enable ports 10100, 20100, and 30100. Also enable outbound connections to Azure Storage on port 443. For more details see: https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration
- SubnetID *string `json:"subnetId,omitempty"`
- // EndpointConfiguration - Pool endpoint configuration is only supported on pools with the virtualMachineConfiguration property.
- EndpointConfiguration *PoolEndpointConfiguration `json:"endpointConfiguration,omitempty"`
-}
-
-// NetworkSecurityGroupRule ...
-type NetworkSecurityGroupRule struct {
- // Priority - Priorities within a pool must be unique and are evaluated in order of priority. The lower the number the higher the priority. For example, rules could be specified with order numbers of 150, 250, and 350. The rule with the order number of 150 takes precedence over the rule that has an order of 250. Allowed priorities are 150 to 3500. If any reserved or duplicate values are provided the request fails with HTTP status code 400.
- Priority *int32 `json:"priority,omitempty"`
- // Access - Possible values include: 'Allow', 'Deny'
- Access NetworkSecurityGroupRuleAccess `json:"access,omitempty"`
- // SourceAddressPrefix - Valid values are a single IP address (i.e. 10.10.10.10), IP subnet (i.e. 192.168.1.0/24), default tag, or * (for all addresses). If any other values are provided the request fails with HTTP status code 400.
- SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"`
-}
-
-// NodeAgentSku the Batch node agent is a program that runs on each node in the pool, and provides the
-// command-and-control interface between the node and the Batch service. There are different implementations of the
-// node agent, known as SKUs, for different operating systems.
-type NodeAgentSku struct {
- ID *string `json:"id,omitempty"`
- // VerifiedImageReferences - This collection is not exhaustive (the node agent may be compatible with other images).
- VerifiedImageReferences *[]ImageReference `json:"verifiedImageReferences,omitempty"`
- // OsType - Possible values include: 'Linux', 'Windows'
- OsType OSType `json:"osType,omitempty"`
-}
-
-// NodeDisableSchedulingParameter ...
-type NodeDisableSchedulingParameter struct {
- // NodeDisableSchedulingOption - Values are:
- // requeue - Terminate running task processes and requeue the tasks. The tasks may run again on other compute nodes, or when task scheduling is re-enabled on this node. Enter offline state as soon as tasks have been terminated.
- // terminate - Terminate running tasks. The tasks will not run again. Enter offline state as soon as tasks have been terminated.
- // taskcompletion - Allow currently running tasks to complete. Schedule no new tasks while waiting. Enter offline state when all tasks have completed.
- // The default value is requeue. Possible values include: 'DisableComputeNodeSchedulingOptionRequeue', 'DisableComputeNodeSchedulingOptionTerminate', 'DisableComputeNodeSchedulingOptionTaskCompletion'
- NodeDisableSchedulingOption DisableComputeNodeSchedulingOption `json:"nodeDisableSchedulingOption,omitempty"`
-}
-
-// NodeFile ...
-type NodeFile struct {
- Name *string `json:"name,omitempty"`
- URL *string `json:"url,omitempty"`
- IsDirectory *bool `json:"isDirectory,omitempty"`
- Properties *FileProperties `json:"properties,omitempty"`
-}
-
-// NodeFileListResult ...
-type NodeFileListResult struct {
- autorest.Response `json:"-"`
- Value *[]NodeFile `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// NodeFileListResultIterator provides access to a complete listing of NodeFile values.
-type NodeFileListResultIterator struct {
- i int
- page NodeFileListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *NodeFileListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter NodeFileListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter NodeFileListResultIterator) Response() NodeFileListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter NodeFileListResultIterator) Value() NodeFile {
- if !iter.page.NotDone() {
- return NodeFile{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (nflr NodeFileListResult) IsEmpty() bool {
- return nflr.Value == nil || len(*nflr.Value) == 0
-}
-
-// nodeFileListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (nflr NodeFileListResult) nodeFileListResultPreparer() (*http.Request, error) {
- if nflr.OdataNextLink == nil || len(to.String(nflr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(nflr.OdataNextLink)))
-}
-
-// NodeFileListResultPage contains a page of NodeFile values.
-type NodeFileListResultPage struct {
- fn func(NodeFileListResult) (NodeFileListResult, error)
- nflr NodeFileListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *NodeFileListResultPage) Next() error {
- next, err := page.fn(page.nflr)
- if err != nil {
- return err
- }
- page.nflr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page NodeFileListResultPage) NotDone() bool {
- return !page.nflr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page NodeFileListResultPage) Response() NodeFileListResult {
- return page.nflr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page NodeFileListResultPage) Values() []NodeFile {
- if page.nflr.IsEmpty() {
- return nil
- }
- return *page.nflr.Value
-}
-
-// NodeRebootParameter ...
-type NodeRebootParameter struct {
- // NodeRebootOption - Values are:
- // requeue - Terminate running task processes and requeue the tasks. The tasks will run again when a node is available. Restart the node as soon as tasks have been terminated.
- // terminate - Terminate running tasks. The tasks will not run again. Restart the node as soon as tasks have been terminated.
- // taskcompletion - Allow currently running tasks to complete. Schedule no new tasks while waiting. Restart the node when all tasks have completed.
- // retaineddata - Allow currently running tasks to complete, then wait for all task data retention periods to expire. Schedule no new tasks while waiting. Restart the node when all task retention periods have expired.
- // The default value is requeue. Possible values include: 'ComputeNodeRebootOptionRequeue', 'ComputeNodeRebootOptionTerminate', 'ComputeNodeRebootOptionTaskCompletion', 'ComputeNodeRebootOptionRetainedData'
- NodeRebootOption ComputeNodeRebootOption `json:"nodeRebootOption,omitempty"`
-}
-
-// NodeReimageParameter ...
-type NodeReimageParameter struct {
- // NodeReimageOption - Values are:
- // requeue - Terminate running task processes and requeue the tasks. The tasks will run again when a node is available. Reimage the node as soon as tasks have been terminated.
- // terminate - Terminate running tasks. The tasks will not run again. Reimage the node as soon as tasks have been terminated.
- // taskcompletion - Allow currently running tasks to complete. Schedule no new tasks while waiting. Reimage the node when all tasks have completed.
- // retaineddata - Allow currently running tasks to complete, then wait for all task data retention periods to expire. Schedule no new tasks while waiting. Reimage the node when all task retention periods have expired.
- // The default value is requeue. Possible values include: 'ComputeNodeReimageOptionRequeue', 'ComputeNodeReimageOptionTerminate', 'ComputeNodeReimageOptionTaskCompletion', 'ComputeNodeReimageOptionRetainedData'
- NodeReimageOption ComputeNodeReimageOption `json:"nodeReimageOption,omitempty"`
-}
-
-// NodeRemoveParameter ...
-type NodeRemoveParameter struct {
- NodeList *[]string `json:"nodeList,omitempty"`
- // ResizeTimeout - The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- ResizeTimeout *string `json:"resizeTimeout,omitempty"`
- // NodeDeallocationOption - The default value is requeue. Possible values include: 'Requeue', 'Terminate', 'TaskCompletion', 'RetainedData'
- NodeDeallocationOption ComputeNodeDeallocationOption `json:"nodeDeallocationOption,omitempty"`
-}
-
-// NodeUpdateUserParameter ...
-type NodeUpdateUserParameter struct {
- // Password - The password is required for Windows nodes (those created with 'cloudServiceConfiguration', or created with 'virtualMachineConfiguration' using a Windows image reference). For Linux compute nodes, the password can optionally be specified along with the sshPublicKey property. If omitted, any existing password is removed.
- Password *string `json:"password,omitempty"`
- // ExpiryTime - If omitted, the default is 1 day from the current time. For Linux compute nodes, the expiryTime has a precision up to a day.
- ExpiryTime *date.Time `json:"expiryTime,omitempty"`
- // SSHPublicKey - The public key should be compatible with OpenSSH encoding and should be base 64 encoded. This property can be specified only for Linux nodes. If this is specified for a Windows node, then the Batch service rejects the request; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). If omitted, any existing SSH public key is removed.
- SSHPublicKey *string `json:"sshPublicKey,omitempty"`
-}
-
-// OSDisk ...
-type OSDisk struct {
- // ImageUris - All the VHDs must be identical and must reside in an Azure Storage account within the same subscription and same region as the Batch account. For best performance, it is recommended that each VHD resides in a separate Azure Storage account. Each VHD can serve upto 20 Windows compute nodes or 40 Linux compute nodes. You must supply enough VHD URIs to satisfy the 'targetDedicated' property of the pool. If you do not supply enough VHD URIs, the pool will partially allocate compute nodes, and a resize error will occur.
- ImageUris *[]string `json:"imageUris,omitempty"`
- // Caching - Values are:
- // none - The caching mode for the disk is not enabled.
- // readOnly - The caching mode for the disk is read only.
- // readWrite - The caching mode for the disk is read and write.
- // The default value for caching is none. For information about the caching options see: https://blogs.msdn.microsoft.com/windowsazurestorage/2012/06/27/exploring-windows-azure-drives-disks-and-images/. Possible values include: 'None', 'ReadOnly', 'ReadWrite'
- Caching CachingType `json:"caching,omitempty"`
-}
-
-// OutputFile ...
-type OutputFile struct {
- // FilePattern - Both relative and absolute paths are supported. Relative paths are relative to the task working directory. The following wildcards are supported: * matches 0 or more characters (for example pattern abc* would match abc or abcdef), ** matches any directory, ? matches any single character, [abc] matches one character in the brackets, and [a-c] matches one character in the range. Brackets can include a negation to match any character not specified (for example [!abc] matches any character but a, b, or c). If a file name starts with "." it is ignored by default but may be matched by specifying it explicitly (for example *.gif will not match .a.gif, but .*.gif will). A simple example: **\*.txt matches any file that does not start in '.' and ends with .txt in the task working directory or any subdirectory. If the filename contains a wildcard character it can be escaped using brackets (for example abc[*] would match a file named abc*). Note that both \ and / are treated as directory separators on Windows, but only / is on Linux. Environment variables (%var% on Windows or $var on Linux) are expanded prior to the pattern being applied.
- FilePattern *string `json:"filePattern,omitempty"`
- Destination *OutputFileDestination `json:"destination,omitempty"`
- UploadOptions *OutputFileUploadOptions `json:"uploadOptions,omitempty"`
-}
-
-// OutputFileBlobContainerDestination ...
-type OutputFileBlobContainerDestination struct {
- // Path - If filePattern refers to a specific file (i.e. contains no wildcards), then path is the name of the blob to which to upload that file. If filePattern contains one or more wildcards (and therefore may match multiple files), then path is the name of the blob virtual directory (which is prepended to each blob name) to which to upload the file(s). If omitted, file(s) are uploaded to the root of the container with a blob name matching their file name.
- Path *string `json:"path,omitempty"`
- // ContainerURL - The URL must include a Shared Access Signature (SAS) granting write permissions to the container.
- ContainerURL *string `json:"containerUrl,omitempty"`
-}
-
-// OutputFileDestination ...
-type OutputFileDestination struct {
- Container *OutputFileBlobContainerDestination `json:"container,omitempty"`
-}
-
-// OutputFileUploadOptions ...
-type OutputFileUploadOptions struct {
- // UploadCondition - The default is taskCompletion. Possible values include: 'OutputFileUploadConditionTaskSuccess', 'OutputFileUploadConditionTaskFailure', 'OutputFileUploadConditionTaskCompletion'
- UploadCondition OutputFileUploadCondition `json:"uploadCondition,omitempty"`
-}
-
-// PoolAddParameter ...
-type PoolAddParameter struct {
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two pool IDs within an account that differ only by case).
- ID *string `json:"id,omitempty"`
- // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall, A1V2 and A2V2. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series).
- VMSize *string `json:"vmSize,omitempty"`
- // CloudServiceConfiguration - This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. This property cannot be specified if the Batch account was created with its poolAllocationMode property set to 'UserSubscription'.
- CloudServiceConfiguration *CloudServiceConfiguration `json:"cloudServiceConfiguration,omitempty"`
- // VirtualMachineConfiguration - This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified.
- VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"`
- // ResizeTimeout - This timeout applies only to manual scaling; it has no effect when enableAutoScale is set to true. The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- ResizeTimeout *string `json:"resizeTimeout,omitempty"`
- // TargetDedicatedNodes - This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both.
- TargetDedicatedNodes *int32 `json:"targetDedicatedNodes,omitempty"`
- // TargetLowPriorityNodes - This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both.
- TargetLowPriorityNodes *int32 `json:"targetLowPriorityNodes,omitempty"`
- // EnableAutoScale - If false, at least one of targetDedicateNodes and targetLowPriorityNodes must be specified. If true, the autoScaleFormula property is required and the pool automatically resizes according to the formula. The default value is false.
- EnableAutoScale *bool `json:"enableAutoScale,omitempty"`
- // AutoScaleFormula - This property must not be specified if enableAutoScale is set to false. It is required if enableAutoScale is set to true. The formula is checked for validity before the pool is created. If the formula is not valid, the Batch service rejects the request with detailed error information. For more information about specifying this formula, see 'Automatically scale compute nodes in an Azure Batch pool' (https://azure.microsoft.com/documentation/articles/batch-automatic-scaling/).
- AutoScaleFormula *string `json:"autoScaleFormula,omitempty"`
- // AutoScaleEvaluationInterval - The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"`
- // EnableInterNodeCommunication - Enabling inter-node communication limits the maximum size of the pool due to deployment restrictions on the nodes of the pool. This may result in the pool not reaching its desired size. The default value is false.
- EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"`
- NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"`
- // StartTask - The task runs when the node is added to the pool or when the node is restarted.
- StartTask *StartTask `json:"startTask,omitempty"`
- // CertificateReferences - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // ApplicationLicenses - The list of application licenses must be a subset of available Batch service application licenses. If a license is requested which is not supported, pool creation will fail.
- ApplicationLicenses *[]string `json:"applicationLicenses,omitempty"`
- // MaxTasksPerNode - The default value is 1. The maximum value of this setting depends on the size of the compute nodes in the pool (the vmSize setting).
- MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"`
- TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"`
- UserAccounts *[]UserAccount `json:"userAccounts,omitempty"`
- // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// PoolEnableAutoScaleParameter ...
-type PoolEnableAutoScaleParameter struct {
- // AutoScaleFormula - The formula is checked for validity before it is applied to the pool. If the formula is not valid, the Batch service rejects the request with detailed error information. For more information about specifying this formula, see Automatically scale compute nodes in an Azure Batch pool (https://azure.microsoft.com/en-us/documentation/articles/batch-automatic-scaling).
- AutoScaleFormula *string `json:"autoScaleFormula,omitempty"`
- // AutoScaleEvaluationInterval - The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service rejects the request with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). If you specify a new interval, then the existing autoscale evaluation schedule will be stopped and a new autoscale evaluation schedule will be started, with its starting time being the time when this request was issued.
- AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"`
-}
-
-// PoolEndpointConfiguration ...
-type PoolEndpointConfiguration struct {
- // InboundNATPools - The maximum number of inbound NAT pools per Batch pool is 5. If the maximum number of inbound NAT pools is exceeded the request fails with HTTP status code 400.
- InboundNATPools *[]InboundNATPool `json:"inboundNATPools,omitempty"`
-}
-
-// PoolEvaluateAutoScaleParameter ...
-type PoolEvaluateAutoScaleParameter struct {
- // AutoScaleFormula - The formula is validated and its results calculated, but it is not applied to the pool. To apply the formula to the pool, 'Enable automatic scaling on a pool'. For more information about specifying this formula, see Automatically scale compute nodes in an Azure Batch pool (https://azure.microsoft.com/en-us/documentation/articles/batch-automatic-scaling).
- AutoScaleFormula *string `json:"autoScaleFormula,omitempty"`
-}
-
-// PoolInformation ...
-type PoolInformation struct {
- // PoolID - You must ensure that the pool referenced by this property exists. If the pool does not exist at the time the Batch service tries to schedule a job, no tasks for the job will run until you create a pool with that id. Note that the Batch service will not reject the job request; it will simply not run tasks until the pool exists. You must specify either the pool ID or the auto pool specification, but not both.
- PoolID *string `json:"poolId,omitempty"`
- // AutoPoolSpecification - If auto pool creation fails, the Batch service moves the job to a completed state, and the pool creation error is set in the job's scheduling error property. The Batch service manages the lifetime (both creation and, unless keepAlive is specified, deletion) of the auto pool. Any user actions that affect the lifetime of the auto pool while the job is active will result in unexpected behavior. You must specify either the pool ID or the auto pool specification, but not both.
- AutoPoolSpecification *AutoPoolSpecification `json:"autoPoolSpecification,omitempty"`
-}
-
-// PoolListUsageMetricsResult ...
-type PoolListUsageMetricsResult struct {
- autorest.Response `json:"-"`
- Value *[]PoolUsageMetrics `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// PoolListUsageMetricsResultIterator provides access to a complete listing of PoolUsageMetrics values.
-type PoolListUsageMetricsResultIterator struct {
- i int
- page PoolListUsageMetricsResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *PoolListUsageMetricsResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter PoolListUsageMetricsResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter PoolListUsageMetricsResultIterator) Response() PoolListUsageMetricsResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter PoolListUsageMetricsResultIterator) Value() PoolUsageMetrics {
- if !iter.page.NotDone() {
- return PoolUsageMetrics{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (plumr PoolListUsageMetricsResult) IsEmpty() bool {
- return plumr.Value == nil || len(*plumr.Value) == 0
-}
-
-// poolListUsageMetricsResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (plumr PoolListUsageMetricsResult) poolListUsageMetricsResultPreparer() (*http.Request, error) {
- if plumr.OdataNextLink == nil || len(to.String(plumr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(plumr.OdataNextLink)))
-}
-
-// PoolListUsageMetricsResultPage contains a page of PoolUsageMetrics values.
-type PoolListUsageMetricsResultPage struct {
- fn func(PoolListUsageMetricsResult) (PoolListUsageMetricsResult, error)
- plumr PoolListUsageMetricsResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *PoolListUsageMetricsResultPage) Next() error {
- next, err := page.fn(page.plumr)
- if err != nil {
- return err
- }
- page.plumr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page PoolListUsageMetricsResultPage) NotDone() bool {
- return !page.plumr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page PoolListUsageMetricsResultPage) Response() PoolListUsageMetricsResult {
- return page.plumr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page PoolListUsageMetricsResultPage) Values() []PoolUsageMetrics {
- if page.plumr.IsEmpty() {
- return nil
- }
- return *page.plumr.Value
-}
-
-// PoolPatchParameter ...
-type PoolPatchParameter struct {
- // StartTask - If this element is present, it overwrites any existing start task. If omitted, any existing start task is left unchanged.
- StartTask *StartTask `json:"startTask,omitempty"`
- // CertificateReferences - If this element is present, it replaces any existing certificate references configured on the pool. If omitted, any existing certificate references are left unchanged. For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- // ApplicationPackageReferences - Changes to application package references affect all new compute nodes joining the pool, but do not affect compute nodes that are already in the pool until they are rebooted or reimaged. If this element is present, it replaces any existing application package references. If you specify an empty collection, then all application package references are removed from the pool. If omitted, any existing application package references are left unchanged.
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // Metadata - If this element is present, it replaces any existing metadata configured on the pool. If you specify an empty collection, any metadata is removed from the pool. If omitted, any existing metadata is left unchanged.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// PoolResizeParameter ...
-type PoolResizeParameter struct {
- TargetDedicatedNodes *int32 `json:"targetDedicatedNodes,omitempty"`
- TargetLowPriorityNodes *int32 `json:"targetLowPriorityNodes,omitempty"`
- // ResizeTimeout - The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- ResizeTimeout *string `json:"resizeTimeout,omitempty"`
- // NodeDeallocationOption - The default value is requeue. Possible values include: 'Requeue', 'Terminate', 'TaskCompletion', 'RetainedData'
- NodeDeallocationOption ComputeNodeDeallocationOption `json:"nodeDeallocationOption,omitempty"`
-}
-
-// PoolSpecification ...
-type PoolSpecification struct {
- // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall, A1V2 and A2V2. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series).
- VMSize *string `json:"vmSize,omitempty"`
- // CloudServiceConfiguration - This property must be specified if the pool needs to be created with Azure PaaS VMs. This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. If neither is specified then the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). This property cannot be specified if the Batch account was created with its poolAllocationMode property set to 'UserSubscription'.
- CloudServiceConfiguration *CloudServiceConfiguration `json:"cloudServiceConfiguration,omitempty"`
- // VirtualMachineConfiguration - This property must be specified if the pool needs to be created with Azure IaaS VMs. This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified. If neither is specified then the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"`
- // MaxTasksPerNode - The default value is 1. The maximum value of this setting depends on the size of the compute nodes in the pool (the vmSize setting).
- MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"`
- TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"`
- // ResizeTimeout - This timeout applies only to manual scaling; it has no effect when enableAutoScale is set to true. The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service rejects the request with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- ResizeTimeout *string `json:"resizeTimeout,omitempty"`
- // TargetDedicatedNodes - This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both.
- TargetDedicatedNodes *int32 `json:"targetDedicatedNodes,omitempty"`
- // TargetLowPriorityNodes - This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both.
- TargetLowPriorityNodes *int32 `json:"targetLowPriorityNodes,omitempty"`
- // EnableAutoScale - If false, at least one of targetDedicateNodes and targetLowPriorityNodes must be specified. If true, the autoScaleFormula element is required. The pool automatically resizes according to the formula. The default value is false.
- EnableAutoScale *bool `json:"enableAutoScale,omitempty"`
- // AutoScaleFormula - This property must not be specified if enableAutoScale is set to false. It is required if enableAutoScale is set to true. The formula is checked for validity before the pool is created. If the formula is not valid, the Batch service rejects the request with detailed error information.
- AutoScaleFormula *string `json:"autoScaleFormula,omitempty"`
- // AutoScaleEvaluationInterval - The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service rejects the request with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"`
- // EnableInterNodeCommunication - Enabling inter-node communication limits the maximum size of the pool due to deployment restrictions on the nodes of the pool. This may result in the pool not reaching its desired size. The default value is false.
- EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"`
- NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"`
- StartTask *StartTask `json:"startTask,omitempty"`
- // CertificateReferences - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // ApplicationLicenses - The list of application licenses must be a subset of available Batch service application licenses. If a license is requested which is not supported, pool creation will fail.
- ApplicationLicenses *[]string `json:"applicationLicenses,omitempty"`
- UserAccounts *[]UserAccount `json:"userAccounts,omitempty"`
- // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// PoolStatistics ...
-type PoolStatistics struct {
- autorest.Response `json:"-"`
- URL *string `json:"url,omitempty"`
- StartTime *date.Time `json:"startTime,omitempty"`
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- UsageStats *UsageStatistics `json:"usageStats,omitempty"`
- ResourceStats *ResourceStatistics `json:"resourceStats,omitempty"`
-}
-
-// PoolUpdatePropertiesParameter ...
-type PoolUpdatePropertiesParameter struct {
- // StartTask - If this element is present, it overwrites any existing start task. If omitted, any existing start task is removed from the pool.
- StartTask *StartTask `json:"startTask,omitempty"`
- // CertificateReferences - This list replaces any existing certificate references configured on the pool. If you specify an empty collection, any existing certificate references are removed from the pool. For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- // ApplicationPackageReferences - The list replaces any existing application package references on the pool. Changes to application package references affect all new compute nodes joining the pool, but do not affect compute nodes that are already in the pool until they are rebooted or reimaged. If omitted, or if you specify an empty collection, any existing application packages references are removed from the pool.
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // Metadata - This list replaces any existing metadata configured on the pool. If omitted, or if you specify an empty collection, any existing metadata is removed from the pool.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// PoolUpgradeOSParameter ...
-type PoolUpgradeOSParameter struct {
- TargetOSVersion *string `json:"targetOSVersion,omitempty"`
-}
-
-// PoolUsageMetrics ...
-type PoolUsageMetrics struct {
- PoolID *string `json:"poolId,omitempty"`
- StartTime *date.Time `json:"startTime,omitempty"`
- EndTime *date.Time `json:"endTime,omitempty"`
- // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall, STANDARD_A1_V2 and STANDARD_A2_V2. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series).
- VMSize *string `json:"vmSize,omitempty"`
- TotalCoreHours *float64 `json:"totalCoreHours,omitempty"`
- DataIngressGiB *float64 `json:"dataIngressGiB,omitempty"`
- DataEgressGiB *float64 `json:"dataEgressGiB,omitempty"`
-}
-
-// ReadCloser ...
-type ReadCloser struct {
- autorest.Response `json:"-"`
- Value *io.ReadCloser `json:"value,omitempty"`
-}
-
-// RecentJob ...
-type RecentJob struct {
- ID *string `json:"id,omitempty"`
- URL *string `json:"url,omitempty"`
-}
-
-// ResizeError ...
-type ResizeError struct {
- Code *string `json:"code,omitempty"`
- Message *string `json:"message,omitempty"`
- Values *[]NameValuePair `json:"values,omitempty"`
-}
-
-// ResourceFile ...
-type ResourceFile struct {
- // BlobSource - This URL must be readable using anonymous access; that is, the Batch service does not present any credentials when downloading the blob. There are two ways to get such a URL for a blob in Azure storage: include a Shared Access Signature (SAS) granting read permissions on the blob, or set the ACL for the blob or its container to allow public access.
- BlobSource *string `json:"blobSource,omitempty"`
- FilePath *string `json:"filePath,omitempty"`
- // FileMode - This property applies only to files being downloaded to Linux compute nodes. It will be ignored if it is specified for a resourceFile which will be downloaded to a Windows node. If this property is not specified for a Linux node, then a default value of 0770 is applied to the file.
- FileMode *string `json:"fileMode,omitempty"`
-}
-
-// ResourceStatistics ...
-type ResourceStatistics struct {
- StartTime *date.Time `json:"startTime,omitempty"`
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- AvgCPUPercentage *float64 `json:"avgCPUPercentage,omitempty"`
- AvgMemoryGiB *float64 `json:"avgMemoryGiB,omitempty"`
- PeakMemoryGiB *float64 `json:"peakMemoryGiB,omitempty"`
- AvgDiskGiB *float64 `json:"avgDiskGiB,omitempty"`
- PeakDiskGiB *float64 `json:"peakDiskGiB,omitempty"`
- DiskReadIOps *int64 `json:"diskReadIOps,omitempty"`
- DiskWriteIOps *int64 `json:"diskWriteIOps,omitempty"`
- DiskReadGiB *float64 `json:"diskReadGiB,omitempty"`
- DiskWriteGiB *float64 `json:"diskWriteGiB,omitempty"`
- NetworkReadGiB *float64 `json:"networkReadGiB,omitempty"`
- NetworkWriteGiB *float64 `json:"networkWriteGiB,omitempty"`
-}
-
-// Schedule ...
-type Schedule struct {
- // DoNotRunUntil - If you do not specify a doNotRunUntil time, the schedule becomes ready to create jobs immediately.
- DoNotRunUntil *date.Time `json:"doNotRunUntil,omitempty"`
- // DoNotRunAfter - If you do not specify a doNotRunAfter time, and you are creating a recurring job schedule, the job schedule will remain active until you explicitly terminate it.
- DoNotRunAfter *date.Time `json:"doNotRunAfter,omitempty"`
- // StartWindow - If a job is not created within the startWindow interval, then the 'opportunity' is lost; no job will be created until the next recurrence of the schedule. If the schedule is recurring, and the startWindow is longer than the recurrence interval, then this is equivalent to an infinite startWindow, because the job that is 'due' in one recurrenceInterval is not carried forward into the next recurrence interval. The default is infinite. The minimum value is 1 minute. If you specify a lower value, the Batch service rejects the schedule with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- StartWindow *string `json:"startWindow,omitempty"`
- // RecurrenceInterval - Because a job schedule can have at most one active job under it at any given time, if it is time to create a new job under a job schedule, but the previous job is still running, the Batch service will not create the new job until the previous job finishes. If the previous job does not finish within the startWindow period of the new recurrenceInterval, then no new job will be scheduled for that interval. For recurring jobs, you should normally specify a jobManagerTask in the jobSpecification. If you do not use jobManagerTask, you will need an external process to monitor when jobs are created, add tasks to the jobs and terminate the jobs ready for the next recurrence. The default is that the schedule does not recur: one job is created, within the startWindow after the doNotRunUntil time, and the schedule is complete as soon as that job finishes. The minimum value is 1 minute. If you specify a lower value, the Batch service rejects the schedule with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- RecurrenceInterval *string `json:"recurrenceInterval,omitempty"`
-}
-
-// StartTask ...
-type StartTask struct {
- // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux.
- CommandLine *string `json:"commandLine,omitempty"`
- // ResourceFiles - Files listed under this element are located in the task's working directory.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task.
- UserIdentity *UserIdentity `json:"userIdentity,omitempty"`
- // MaxTaskRetryCount - The Batch service retries a task if its exit code is nonzero. Note that this value specifically controls the number of retries. The Batch service will try the task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the task. If the maximum retry count is -1, the Batch service retries the task without limit.
- MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"`
- // WaitForSuccess - If true and the start task fails on a compute node, the Batch service retries the start task up to its maximum retry count (maxTaskRetryCount). If the task has still not completed successfully after all retries, then the Batch service marks the compute node unusable, and will not schedule tasks to it. This condition can be detected via the node state and failure info details. If false, the Batch service will not wait for the start task to complete. In this case, other tasks can start executing on the compute node while the start task is still running; and even if the start task fails, new tasks will continue to be scheduled on the node. The default is false.
- WaitForSuccess *bool `json:"waitForSuccess,omitempty"`
-}
-
-// StartTaskInformation ...
-type StartTaskInformation struct {
- // State - Values are:
- // running - The start task is currently running.
- // completed - The start task has exited with exit code 0, or the start task has failed and the retry limit has reached, or the start task process did not run due to task preparation errors (such as resource file download failures). Possible values include: 'StartTaskStateRunning', 'StartTaskStateCompleted'
- State StartTaskState `json:"state,omitempty"`
- // StartTime - This value is reset every time the task is restarted or retried (that is, this is the most recent time at which the start task started running).
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - This is the end time of the most recent run of the start task, if that run has completed (even if that run failed and a retry is pending). This element is not present if the start task is currently running.
- EndTime *date.Time `json:"endTime,omitempty"`
- // ExitCode - This property is set only if the start task is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the start task (due to timeout, or user termination via the API) you may see an operating system-defined exit code.
- ExitCode *int32 `json:"exitCode,omitempty"`
- // FailureInfo - This property is set only if the task is in the completed state and encountered a failure.
- FailureInfo *TaskFailureInformation `json:"failureInfo,omitempty"`
- // RetryCount - Task application failures (non-zero exit code) are retried, pre-processing errors (the task could not be run) and file upload errors are not retried. The Batch service will retry the task up to the limit specified by the constraints.
- RetryCount *int32 `json:"retryCount,omitempty"`
- // LastRetryTime - This element is present only if the task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the task has been restarted for reasons other than retry; for example, if the compute node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not.
- LastRetryTime *date.Time `json:"lastRetryTime,omitempty"`
- // Result - If the value is 'failed', then the details of the failure can be found in the failureInfo property. Possible values include: 'Success', 'Failure'
- Result TaskExecutionResult `json:"result,omitempty"`
-}
-
-// SubtaskInformation ...
-type SubtaskInformation struct {
- ID *int32 `json:"id,omitempty"`
- NodeInfo *ComputeNodeInformation `json:"nodeInfo,omitempty"`
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - This property is set only if the subtask is in the Completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
- // ExitCode - This property is set only if the subtask is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the subtask (due to timeout, or user termination via the API) you may see an operating system-defined exit code.
- ExitCode *int32 `json:"exitCode,omitempty"`
- // FailureInfo - This property is set only if the task is in the completed state and encountered a failure.
- FailureInfo *TaskFailureInformation `json:"failureInfo,omitempty"`
- // State - Possible values include: 'SubtaskStatePreparing', 'SubtaskStateRunning', 'SubtaskStateCompleted'
- State SubtaskState `json:"state,omitempty"`
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // PreviousState - This property is not set if the subtask is in its initial running state. Possible values include: 'SubtaskStatePreparing', 'SubtaskStateRunning', 'SubtaskStateCompleted'
- PreviousState SubtaskState `json:"previousState,omitempty"`
- // PreviousStateTransitionTime - This property is not set if the subtask is in its initial running state.
- PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"`
- // Result - If the value is 'failed', then the details of the failure can be found in the failureInfo property. Possible values include: 'Success', 'Failure'
- Result TaskExecutionResult `json:"result,omitempty"`
-}
-
-// TaskAddCollectionParameter ...
-type TaskAddCollectionParameter struct {
- // Value - The total serialized size of this collection must be less than 4MB. If it is greater than 4MB (for example if each task has 100's of resource files or environment variables), the request will fail with code 'RequestBodyTooLarge' and should be retried again with fewer tasks.
- Value *[]TaskAddParameter `json:"value,omitempty"`
-}
-
-// TaskAddCollectionResult ...
-type TaskAddCollectionResult struct {
- autorest.Response `json:"-"`
- Value *[]TaskAddResult `json:"value,omitempty"`
-}
-
-// TaskAddParameter ...
-type TaskAddParameter struct {
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within a job that differ only by case).
- ID *string `json:"id,omitempty"`
- // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- // CommandLine - For multi-instance tasks, the command line is executed as the primary task, after the primary task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux.
- CommandLine *string `json:"commandLine,omitempty"`
- // ExitConditions - How the Batch service should respond when the task completes.
- ExitConditions *ExitConditions `json:"exitConditions,omitempty"`
- // ResourceFiles - For multi-instance tasks, the resource files will only be downloaded to the compute node on which the primary task is executed.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- // OutputFiles - For multi-instance tasks, the files will only be uploaded from the compute node on which the primary task is executed.
- OutputFiles *[]OutputFile `json:"outputFiles,omitempty"`
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- AffinityInfo *AffinityInformation `json:"affinityInfo,omitempty"`
- // Constraints - If you do not specify constraints, the maxTaskRetryCount is the maxTaskRetryCount specified for the job, and the maxWallClockTime and retentionTime are infinite.
- Constraints *TaskConstraints `json:"constraints,omitempty"`
- // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task.
- UserIdentity *UserIdentity `json:"userIdentity,omitempty"`
- MultiInstanceSettings *MultiInstanceSettings `json:"multiInstanceSettings,omitempty"`
- // DependsOn - This task will not be scheduled until all tasks that it depends on have completed successfully. If any of those tasks fail and exhaust their retry counts, this task will never be scheduled. If the job does not have usesTaskDependencies set to true, and this element is present, the request fails with error code TaskDependenciesNotSpecifiedOnJob.
- DependsOn *TaskDependencies `json:"dependsOn,omitempty"`
- // ApplicationPackageReferences - Application packages are downloaded and deployed to a shared directory, not the task working directory. Therefore, if a referenced package is already on the compute node, and is up to date, then it is not re-downloaded; the existing copy on the compute node is used. If a referenced application package cannot be installed, for example because the package has been deleted or because download failed, the task fails.
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // AuthenticationTokenSettings - If this property is set, the Batch service provides the task with an authentication token which can be used to authenticate Batch service operations without requiring an account access key. The token is provided via the AZ_BATCH_AUTHENTICATION_TOKEN environment variable. The operations that the task can carry out using the token depend on the settings. For example, a task can request job permissions in order to add other tasks to the job, or check the status of the job or of other tasks under the job.
- AuthenticationTokenSettings *AuthenticationTokenSettings `json:"authenticationTokenSettings,omitempty"`
-}
-
-// TaskAddResult ...
-type TaskAddResult struct {
- // Status - Values are:
- // success - Task was added successfully.
- // clienterror - Task failed to add due to a client error and should not be retried without modifying the request as appropriate.
- // servererror - Task failed to add due to a server error and can be retried without modification. Possible values include: 'TaskAddStatusSuccess', 'TaskAddStatusClientError', 'TaskAddStatusServerError'
- Status TaskAddStatus `json:"status,omitempty"`
- TaskID *string `json:"taskId,omitempty"`
- // ETag - You can use this to detect whether the task has changed between requests. In particular, you can be pass the ETag with an Update Task request to specify that your changes should take effect only if nobody else has modified the job in the meantime.
- ETag *string `json:"eTag,omitempty"`
- LastModified *date.Time `json:"lastModified,omitempty"`
- Location *string `json:"location,omitempty"`
- Error *Error `json:"error,omitempty"`
-}
-
-// TaskConstraints ...
-type TaskConstraints struct {
- // MaxWallClockTime - If this is not specified, there is no time limit on how long the task may run.
- MaxWallClockTime *string `json:"maxWallClockTime,omitempty"`
- // RetentionTime - The default is infinite, i.e. the task directory will be retained until the compute node is removed or reimaged.
- RetentionTime *string `json:"retentionTime,omitempty"`
- // MaxTaskRetryCount - Note that this value specifically controls the number of retries. The Batch service will try the task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the task. If the maximum retry count is -1, the Batch service retries the task without limit.
- MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"`
-}
-
-// TaskCounts ...
-type TaskCounts struct {
- autorest.Response `json:"-"`
- Active *int32 `json:"active,omitempty"`
- Running *int32 `json:"running,omitempty"`
- Completed *int32 `json:"completed,omitempty"`
- Succeeded *int32 `json:"succeeded,omitempty"`
- Failed *int32 `json:"failed,omitempty"`
- // ValidationStatus - If the validationStatus is unvalidated, then the Batch service has not been able to check state counts against the task states as reported in the List Tasks API. The validationStatus may be unvalidated if the job contains more than 200,000 tasks. Possible values include: 'Validated', 'Unvalidated'
- ValidationStatus TaskCountValidationStatus `json:"validationStatus,omitempty"`
-}
-
-// TaskDependencies ...
-type TaskDependencies struct {
- // TaskIds - The taskIds collection is limited to 64000 characters total (i.e. the combined length of all task IDs). If the taskIds collection exceeds the maximum length, the Add Task request fails with error code TaskDependencyListTooLong. In this case consider using task ID ranges instead.
- TaskIds *[]string `json:"taskIds,omitempty"`
- TaskIDRanges *[]TaskIDRange `json:"taskIdRanges,omitempty"`
-}
-
-// TaskExecutionInformation ...
-type TaskExecutionInformation struct {
- // StartTime - 'Running' corresponds to the running state, so if the task specifies resource files or application packages, then the start time reflects the time at which the task started downloading or deploying these. If the task has been restarted or retried, this is the most recent time at which the task started running. This property is present only for tasks that are in the running or completed state.
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - This property is set only if the task is in the Completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
- // ExitCode - This property is set only if the task is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the task (due to timeout, or user termination via the API) you may see an operating system-defined exit code.
- ExitCode *int32 `json:"exitCode,omitempty"`
- // FailureInfo - This property is set only if the task is in the completed state and encountered a failure.
- FailureInfo *TaskFailureInformation `json:"failureInfo,omitempty"`
- // RetryCount - Task application failures (non-zero exit code) are retried, pre-processing errors (the task could not be run) and file upload errors are not retried. The Batch service will retry the task up to the limit specified by the constraints.
- RetryCount *int32 `json:"retryCount,omitempty"`
- // LastRetryTime - This element is present only if the task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the task has been restarted for reasons other than retry; for example, if the compute node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not.
- LastRetryTime *date.Time `json:"lastRetryTime,omitempty"`
- // RequeueCount - When the user removes nodes from a pool (by resizing/shrinking the pool) or when the job is being disabled, the user can specify that running tasks on the nodes be requeued for execution. This count tracks how many times the task has been requeued for these reasons.
- RequeueCount *int32 `json:"requeueCount,omitempty"`
- // LastRequeueTime - This property is set only if the requeueCount is nonzero.
- LastRequeueTime *date.Time `json:"lastRequeueTime,omitempty"`
- // Result - If the value is 'failed', then the details of the failure can be found in the failureInfo property. Possible values include: 'Success', 'Failure'
- Result TaskExecutionResult `json:"result,omitempty"`
-}
-
-// TaskFailureInformation ...
-type TaskFailureInformation struct {
- // Category - Possible values include: 'UserError', 'ServerError'
- Category ErrorCategory `json:"category,omitempty"`
- Code *string `json:"code,omitempty"`
- Message *string `json:"message,omitempty"`
- Details *[]NameValuePair `json:"details,omitempty"`
-}
-
-// TaskIDRange the start and end of the range are inclusive. For example, if a range has start 9 and end 12, then
-// it represents tasks '9', '10', '11' and '12'.
-type TaskIDRange struct {
- Start *int32 `json:"start,omitempty"`
- End *int32 `json:"end,omitempty"`
-}
-
-// TaskInformation ...
-type TaskInformation struct {
- TaskURL *string `json:"taskUrl,omitempty"`
- JobID *string `json:"jobId,omitempty"`
- TaskID *string `json:"taskId,omitempty"`
- SubtaskID *int32 `json:"subtaskId,omitempty"`
- // TaskState - Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted'
- TaskState TaskState `json:"taskState,omitempty"`
- ExecutionInfo *TaskExecutionInformation `json:"executionInfo,omitempty"`
-}
-
-// TaskSchedulingPolicy ...
-type TaskSchedulingPolicy struct {
- // NodeFillType - Possible values include: 'Spread', 'Pack'
- NodeFillType ComputeNodeFillType `json:"nodeFillType,omitempty"`
-}
-
-// TaskStatistics ...
-type TaskStatistics struct {
- URL *string `json:"url,omitempty"`
- StartTime *date.Time `json:"startTime,omitempty"`
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- UserCPUTime *string `json:"userCPUTime,omitempty"`
- KernelCPUTime *string `json:"kernelCPUTime,omitempty"`
- // WallClockTime - The wall clock time is the elapsed time from when the task started running on a compute node to when it finished (or to the last time the statistics were updated, if the task had not finished by then). If the task was retried, this includes the wall clock time of all the task retries.
- WallClockTime *string `json:"wallClockTime,omitempty"`
- ReadIOps *int64 `json:"readIOps,omitempty"`
- WriteIOps *int64 `json:"writeIOps,omitempty"`
- ReadIOGiB *float64 `json:"readIOGiB,omitempty"`
- WriteIOGiB *float64 `json:"writeIOGiB,omitempty"`
- WaitTime *string `json:"waitTime,omitempty"`
-}
-
-// TaskUpdateParameter ...
-type TaskUpdateParameter struct {
- // Constraints - If omitted, the task is given the default constraints. For multi-instance tasks, updating the retention time applies only to the primary task and not subtasks.
- Constraints *TaskConstraints `json:"constraints,omitempty"`
-}
-
-// UsageStatistics ...
-type UsageStatistics struct {
- StartTime *date.Time `json:"startTime,omitempty"`
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- DedicatedCoreTime *string `json:"dedicatedCoreTime,omitempty"`
-}
-
-// UserAccount ...
-type UserAccount struct {
- Name *string `json:"name,omitempty"`
- Password *string `json:"password,omitempty"`
- // ElevationLevel - nonAdmin - The auto user is a standard user without elevated access. admin - The auto user is a user with elevated access and operates with full Administrator permissions. The default value is nonAdmin. Possible values include: 'NonAdmin', 'Admin'
- ElevationLevel ElevationLevel `json:"elevationLevel,omitempty"`
- // LinuxUserConfiguration - This property is ignored if specified on a Windows pool. If not specified, the user is created with the default options.
- LinuxUserConfiguration *LinuxUserConfiguration `json:"linuxUserConfiguration,omitempty"`
-}
-
-// UserIdentity specify either the userName or autoUser property, but not both.
-type UserIdentity struct {
- // UserName - The userName and autoUser properties are mutually exclusive; you must specify one but not both.
- UserName *string `json:"username,omitempty"`
- // AutoUser - The userName and autoUser properties are mutually exclusive; you must specify one but not both.
- AutoUser *AutoUserSpecification `json:"autoUser,omitempty"`
-}
-
-// VirtualMachineConfiguration ...
-type VirtualMachineConfiguration struct {
- // ImageReference - This property and osDisk are mutually exclusive and one of the properties must be specified.
- ImageReference *ImageReference `json:"imageReference,omitempty"`
- // OsDisk - This property can be specified only if the Batch account was created with its poolAllocationMode property set to 'UserSubscription'. This property and imageReference are mutually exclusive and one of the properties must be specified.
- OsDisk *OSDisk `json:"osDisk,omitempty"`
- // NodeAgentSKUID - The Batch node agent is a program that runs on each node in the pool, and provides the command-and-control interface between the node and the Batch service. There are different implementations of the node agent, known as SKUs, for different operating systems. You must specify a node agent SKU which matches the selected image reference. To get the list of supported node agent SKUs along with their list of verified image references, see the 'List supported node agent SKUs' operation.
- NodeAgentSKUID *string `json:"nodeAgentSKUId,omitempty"`
- // WindowsConfiguration - This property must not be specified if the imageReference or osDisk property specifies a Linux OS image.
- WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"`
-}
-
-// WindowsConfiguration ...
-type WindowsConfiguration struct {
- // EnableAutomaticUpdates - If omitted, the default value is true.
- EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"`
-}
diff --git a/services/batch/2017-06-01.5.1/batch/pool.go b/services/batch/2017-06-01.5.1/batch/pool.go
deleted file mode 100644
index e24802b02cab..000000000000
--- a/services/batch/2017-06-01.5.1/batch/pool.go
+++ /dev/null
@@ -1,1884 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// PoolClient is the a client for issuing REST requests to the Azure Batch service.
-type PoolClient struct {
- BaseClient
-}
-
-// NewPoolClient creates an instance of the PoolClient client.
-func NewPoolClient() PoolClient {
- return NewPoolClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewPoolClientWithBaseURI creates an instance of the PoolClient client.
-func NewPoolClientWithBaseURI(baseURI string) PoolClient {
- return PoolClient{NewWithBaseURI(baseURI)}
-}
-
-// Add when naming pools, avoid including sensitive information such as user names or secret project names. This
-// information may appear in telemetry logs accessible to Microsoft Support engineers.
-//
-// pool is the pool to be added. timeout is the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a
-// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are
-// calling the REST API directly.
-func (client PoolClient) Add(ctx context.Context, pool PoolAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: pool,
- Constraints: []validation.Constraint{{Target: "pool.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "pool.VMSize", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "pool.CloudServiceConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "pool.VirtualMachineConfiguration.ImageReference.Publisher", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "pool.VirtualMachineConfiguration.ImageReference.Offer", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "pool.VirtualMachineConfiguration.ImageReference.Sku", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "pool.VirtualMachineConfiguration.OsDisk", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "pool.VirtualMachineConfiguration.OsDisk.ImageUris", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "pool.NetworkConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "pool.NetworkConfiguration.EndpointConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "pool.NetworkConfiguration.EndpointConfiguration.InboundNATPools", Name: validation.Null, Rule: true, Chain: nil}}},
- }},
- {Target: "pool.StartTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "Add", err.Error())
- }
-
- req, err := client.AddPreparer(ctx, pool, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPreparer prepares the Add request.
-func (client PoolClient) AddPreparer(ctx context.Context, pool PoolAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/pools"),
- autorest.WithJSON(pool),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSender sends the Add request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) AddSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddResponder handles the response to the Add request. The method always
-// closes the http.Response Body.
-func (client PoolClient) AddResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Delete when you request that a pool be deleted, the following actions occur: the pool state is set to deleting; any
-// ongoing resize operation on the pool are stopped; the Batch service starts resizing the pool to zero nodes; any
-// tasks running on existing nodes are terminated and requeued (as if a resize pool operation had been requested with
-// the default requeue option); finally, the pool is removed from the system. Because running tasks are requeued, the
-// user can rerun these tasks by updating their job to target a different pool. The tasks can then run on the new pool.
-// If you want to override the requeue behavior, then you should call resize pool explicitly to shrink the pool to zero
-// size before deleting the pool. If you call an Update, Patch or Delete API on a pool in the deleting state, it will
-// fail with HTTP status code 409 with error code PoolBeingDeleted.
-//
-// poolID is the ID of the pool to delete. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. Client libraries typically set this to the current system clock time; set it
-// explicitly if you are calling the REST API directly. ifMatch is an ETag value associated with the version of the
-// resource known to the client. The operation will be performed only if the resource's current ETag on the service
-// exactly matches the value specified by the client. ifNoneMatch is an ETag value associated with the version of
-// the resource known to the client. The operation will be performed only if the resource's current ETag on the
-// service does not match the value specified by the client. ifModifiedSince is a timestamp indicating the last
-// modified time of the resource known to the client. The operation will be performed only if the resource on the
-// service has been modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last
-// modified time of the resource known to the client. The operation will be performed only if the resource on the
-// service has not been modified since the specified time.
-func (client PoolClient) Delete(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeletePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client PoolClient) DeletePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client PoolClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// DisableAutoScale sends the disable auto scale request.
-//
-// poolID is the ID of the pool on which to disable automatic scaling. timeout is the maximum time that the server
-// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated
-// request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client PoolClient) DisableAutoScale(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DisableAutoScalePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DisableAutoScaleSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", resp, "Failure sending request")
- return
- }
-
- result, err = client.DisableAutoScaleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DisableAutoScalePreparer prepares the DisableAutoScale request.
-func (client PoolClient) DisableAutoScalePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/disableautoscale", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DisableAutoScaleSender sends the DisableAutoScale request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) DisableAutoScaleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DisableAutoScaleResponder handles the response to the DisableAutoScale request. The method always
-// closes the http.Response Body.
-func (client PoolClient) DisableAutoScaleResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// EnableAutoScale you cannot enable automatic scaling on a pool if a resize operation is in progress on the pool. If
-// automatic scaling of the pool is currently disabled, you must specify a valid autoscale formula as part of the
-// request. If automatic scaling of the pool is already enabled, you may specify a new autoscale formula and/or a new
-// evaluation interval. You cannot call this API for the same pool more than once every 30 seconds.
-//
-// poolID is the ID of the pool on which to enable automatic scaling. poolEnableAutoScaleParameter is the
-// parameters for the request. timeout is the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a
-// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are
-// calling the REST API directly. ifMatch is an ETag value associated with the version of the resource known to the
-// client. The operation will be performed only if the resource's current ETag on the service exactly matches the
-// value specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to
-// the client. The operation will be performed only if the resource's current ETag on the service does not match
-// the value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the
-// resource known to the client. The operation will be performed only if the resource on the service has been
-// modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the
-// resource known to the client. The operation will be performed only if the resource on the service has not been
-// modified since the specified time.
-func (client PoolClient) EnableAutoScale(ctx context.Context, poolID string, poolEnableAutoScaleParameter PoolEnableAutoScaleParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.EnableAutoScalePreparer(ctx, poolID, poolEnableAutoScaleParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.EnableAutoScaleSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", resp, "Failure sending request")
- return
- }
-
- result, err = client.EnableAutoScaleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", resp, "Failure responding to request")
- }
-
- return
-}
-
-// EnableAutoScalePreparer prepares the EnableAutoScale request.
-func (client PoolClient) EnableAutoScalePreparer(ctx context.Context, poolID string, poolEnableAutoScaleParameter PoolEnableAutoScaleParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/enableautoscale", pathParameters),
- autorest.WithJSON(poolEnableAutoScaleParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// EnableAutoScaleSender sends the EnableAutoScale request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) EnableAutoScaleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// EnableAutoScaleResponder handles the response to the EnableAutoScale request. The method always
-// closes the http.Response Body.
-func (client PoolClient) EnableAutoScaleResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// EvaluateAutoScale this API is primarily for validating an autoscale formula, as it simply returns the result without
-// applying the formula to the pool. The pool must have auto scaling enabled in order to evaluate a formula.
-//
-// poolID is the ID of the pool on which to evaluate the automatic scaling formula. poolEvaluateAutoScaleParameter
-// is the parameters for the request. timeout is the maximum time that the server can spend processing the request,
-// in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of
-// a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are
-// calling the REST API directly.
-func (client PoolClient) EvaluateAutoScale(ctx context.Context, poolID string, poolEvaluateAutoScaleParameter PoolEvaluateAutoScaleParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result AutoScaleRun, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: poolEvaluateAutoScaleParameter,
- Constraints: []validation.Constraint{{Target: "poolEvaluateAutoScaleParameter.AutoScaleFormula", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "EvaluateAutoScale", err.Error())
- }
-
- req, err := client.EvaluateAutoScalePreparer(ctx, poolID, poolEvaluateAutoScaleParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.EvaluateAutoScaleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", resp, "Failure sending request")
- return
- }
-
- result, err = client.EvaluateAutoScaleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", resp, "Failure responding to request")
- }
-
- return
-}
-
-// EvaluateAutoScalePreparer prepares the EvaluateAutoScale request.
-func (client PoolClient) EvaluateAutoScalePreparer(ctx context.Context, poolID string, poolEvaluateAutoScaleParameter PoolEvaluateAutoScaleParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/evaluateautoscale", pathParameters),
- autorest.WithJSON(poolEvaluateAutoScaleParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// EvaluateAutoScaleSender sends the EvaluateAutoScale request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) EvaluateAutoScaleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// EvaluateAutoScaleResponder handles the response to the EvaluateAutoScale request. The method always
-// closes the http.Response Body.
-func (client PoolClient) EvaluateAutoScaleResponder(resp *http.Response) (result AutoScaleRun, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Exists gets basic properties of a pool.
-//
-// poolID is the ID of the pool to get. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. Client libraries typically set this to the current system clock time; set it
-// explicitly if you are calling the REST API directly. ifMatch is an ETag value associated with the version of the
-// resource known to the client. The operation will be performed only if the resource's current ETag on the service
-// exactly matches the value specified by the client. ifNoneMatch is an ETag value associated with the version of
-// the resource known to the client. The operation will be performed only if the resource's current ETag on the
-// service does not match the value specified by the client. ifModifiedSince is a timestamp indicating the last
-// modified time of the resource known to the client. The operation will be performed only if the resource on the
-// service has been modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last
-// modified time of the resource known to the client. The operation will be performed only if the resource on the
-// service has not been modified since the specified time.
-func (client PoolClient) Exists(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.ExistsPreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ExistsSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", resp, "Failure sending request")
- return
- }
-
- result, err = client.ExistsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ExistsPreparer prepares the Exists request.
-func (client PoolClient) ExistsPreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsHead(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ExistsSender sends the Exists request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) ExistsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ExistsResponder handles the response to the Exists request. The method always
-// closes the http.Response Body.
-func (client PoolClient) ExistsResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get gets information about the specified pool.
-//
-// poolID is the ID of the pool to get. selectParameter is an OData $select clause. expand is an OData $expand
-// clause. timeout is the maximum time that the server can spend processing the request, in seconds. The default is
-// 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration
-// such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server
-// should return the client-request-id in the response. ocpDate is the time the request was issued. Client
-// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API
-// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The
-// operation will be performed only if the resource's current ETag on the service exactly matches the value
-// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the
-// client. The operation will be performed only if the resource's current ETag on the service does not match the
-// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource
-// known to the client. The operation will be performed only if the resource on the service has been modified since
-// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to
-// the client. The operation will be performed only if the resource on the service has not been modified since the
-// specified time.
-func (client PoolClient) Get(ctx context.Context, poolID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudPool, err error) {
- req, err := client.GetPreparer(ctx, poolID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client PoolClient) GetPreparer(ctx context.Context, poolID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client PoolClient) GetResponder(resp *http.Response) (result CloudPool, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetAllLifetimeStatistics statistics are aggregated across all pools that have ever existed in the account, from
-// account creation to the last update time of the statistics.
-//
-// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30
-// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such
-// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should
-// return the client-request-id in the response. ocpDate is the time the request was issued. Client libraries
-// typically set this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client PoolClient) GetAllLifetimeStatistics(ctx context.Context, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolStatistics, err error) {
- req, err := client.GetAllLifetimeStatisticsPreparer(ctx, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllLifetimeStatistics", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetAllLifetimeStatisticsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllLifetimeStatistics", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetAllLifetimeStatisticsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllLifetimeStatistics", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetAllLifetimeStatisticsPreparer prepares the GetAllLifetimeStatistics request.
-func (client PoolClient) GetAllLifetimeStatisticsPreparer(ctx context.Context, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/lifetimepoolstats"),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetAllLifetimeStatisticsSender sends the GetAllLifetimeStatistics request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) GetAllLifetimeStatisticsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetAllLifetimeStatisticsResponder handles the response to the GetAllLifetimeStatistics request. The method always
-// closes the http.Response Body.
-func (client PoolClient) GetAllLifetimeStatisticsResponder(resp *http.Response) (result PoolStatistics, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List sends the list request.
-//
-// filter is an OData $filter clause. selectParameter is an OData $select clause. expand is an OData $expand
-// clause. maxResults is the maximum number of items to return in the response. A maximum of 1000 pools can be
-// returned. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client
-// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API
-// directly.
-func (client PoolClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudPoolListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "List", err.Error())
- }
-
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.cplr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", resp, "Failure sending request")
- return
- }
-
- result.cplr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client PoolClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/pools"),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client PoolClient) ListResponder(resp *http.Response) (result CloudPoolListResult, 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 PoolClient) listNextResults(lastResults CloudPoolListResult) (result CloudPoolListResult, err error) {
- req, err := lastResults.cloudPoolListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.PoolClient", "listNextResults", 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.PoolClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client PoolClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudPoolListResultIterator, err error) {
- result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// ListUsageMetrics if you do not specify a $filter clause including a poolId, the response includes all pools that
-// existed in the account in the time range of the returned aggregation intervals. If you do not specify a $filter
-// clause including a startTime or endTime these filters default to the start and end times of the last aggregation
-// interval currently available; that is, only the last aggregation interval is returned.
-//
-// startTime is the earliest time from which to include metrics. This must be at least two and a half hours before
-// the current time. If not specified this defaults to the start time of the last aggregation interval currently
-// available. endTime is the latest time from which to include metrics. This must be at least two hours before the
-// current time. If not specified this defaults to the end time of the last aggregation interval currently
-// available. filter is an OData $filter clause. If this is not specified the response includes all pools that
-// existed in the account in the time range of the returned aggregation intervals. maxResults is the maximum number
-// of items to return in the response. A maximum of 1000 results will be returned. timeout is the maximum time that
-// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client PoolClient) ListUsageMetrics(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolListUsageMetricsResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "ListUsageMetrics", err.Error())
- }
-
- result.fn = client.listUsageMetricsNextResults
- req, err := client.ListUsageMetricsPreparer(ctx, startTime, endTime, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListUsageMetrics", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListUsageMetricsSender(req)
- if err != nil {
- result.plumr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListUsageMetrics", resp, "Failure sending request")
- return
- }
-
- result.plumr, err = client.ListUsageMetricsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListUsageMetrics", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListUsageMetricsPreparer prepares the ListUsageMetrics request.
-func (client PoolClient) ListUsageMetricsPreparer(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if startTime != nil {
- queryParameters["starttime"] = autorest.Encode("query", *startTime)
- }
- if endTime != nil {
- queryParameters["endtime"] = autorest.Encode("query", *endTime)
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/poolusagemetrics"),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListUsageMetricsSender sends the ListUsageMetrics request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) ListUsageMetricsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListUsageMetricsResponder handles the response to the ListUsageMetrics request. The method always
-// closes the http.Response Body.
-func (client PoolClient) ListUsageMetricsResponder(resp *http.Response) (result PoolListUsageMetricsResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listUsageMetricsNextResults retrieves the next set of results, if any.
-func (client PoolClient) listUsageMetricsNextResults(lastResults PoolListUsageMetricsResult) (result PoolListUsageMetricsResult, err error) {
- req, err := lastResults.poolListUsageMetricsResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.PoolClient", "listUsageMetricsNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListUsageMetricsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.PoolClient", "listUsageMetricsNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListUsageMetricsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "listUsageMetricsNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListUsageMetricsComplete enumerates all values, automatically crossing page boundaries as required.
-func (client PoolClient) ListUsageMetricsComplete(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolListUsageMetricsResultIterator, err error) {
- result.page, err = client.ListUsageMetrics(ctx, startTime, endTime, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// Patch this only replaces the pool properties specified in the request. For example, if the pool has a start task
-// associated with it, and a request does not specify a start task element, then the pool keeps the existing start
-// task.
-//
-// poolID is the ID of the pool to update. poolPatchParameter is the parameters for the request. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client PoolClient) Patch(ctx context.Context, poolID string, poolPatchParameter PoolPatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.PatchPreparer(ctx, poolID, poolPatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.PatchSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", resp, "Failure sending request")
- return
- }
-
- result, err = client.PatchResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", resp, "Failure responding to request")
- }
-
- return
-}
-
-// PatchPreparer prepares the Patch request.
-func (client PoolClient) PatchPreparer(ctx context.Context, poolID string, poolPatchParameter PoolPatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPatch(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}", pathParameters),
- autorest.WithJSON(poolPatchParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// PatchSender sends the Patch request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) PatchSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// PatchResponder handles the response to the Patch request. The method always
-// closes the http.Response Body.
-func (client PoolClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// RemoveNodes this operation can only run when the allocation state of the pool is steady. When this operation runs,
-// the allocation state changes from steady to resizing.
-//
-// poolID is the ID of the pool from which you want to remove nodes. nodeRemoveParameter is the parameters for the
-// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client
-// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API
-// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The
-// operation will be performed only if the resource's current ETag on the service exactly matches the value
-// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the
-// client. The operation will be performed only if the resource's current ETag on the service does not match the
-// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource
-// known to the client. The operation will be performed only if the resource on the service has been modified since
-// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to
-// the client. The operation will be performed only if the resource on the service has not been modified since the
-// specified time.
-func (client PoolClient) RemoveNodes(ctx context.Context, poolID string, nodeRemoveParameter NodeRemoveParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: nodeRemoveParameter,
- Constraints: []validation.Constraint{{Target: "nodeRemoveParameter.NodeList", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "nodeRemoveParameter.NodeList", Name: validation.MaxItems, Rule: 100, Chain: nil}}}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "RemoveNodes", err.Error())
- }
-
- req, err := client.RemoveNodesPreparer(ctx, poolID, nodeRemoveParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.RemoveNodesSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", resp, "Failure sending request")
- return
- }
-
- result, err = client.RemoveNodesResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", resp, "Failure responding to request")
- }
-
- return
-}
-
-// RemoveNodesPreparer prepares the RemoveNodes request.
-func (client PoolClient) RemoveNodesPreparer(ctx context.Context, poolID string, nodeRemoveParameter NodeRemoveParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/removenodes", pathParameters),
- autorest.WithJSON(nodeRemoveParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// RemoveNodesSender sends the RemoveNodes request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) RemoveNodesSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// RemoveNodesResponder handles the response to the RemoveNodes request. The method always
-// closes the http.Response Body.
-func (client PoolClient) RemoveNodesResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Resize you can only resize a pool when its allocation state is steady. If the pool is already resizing, the request
-// fails with status code 409. When you resize a pool, the pool's allocation state changes from steady to resizing. You
-// cannot resize pools which are configured for automatic scaling. If you try to do this, the Batch service returns an
-// error 409. If you resize a pool downwards, the Batch service chooses which nodes to remove. To remove specific
-// nodes, use the pool remove nodes API instead.
-//
-// poolID is the ID of the pool to resize. poolResizeParameter is the parameters for the request. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client PoolClient) Resize(ctx context.Context, poolID string, poolResizeParameter PoolResizeParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.ResizePreparer(ctx, poolID, poolResizeParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ResizeSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", resp, "Failure sending request")
- return
- }
-
- result, err = client.ResizeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ResizePreparer prepares the Resize request.
-func (client PoolClient) ResizePreparer(ctx context.Context, poolID string, poolResizeParameter PoolResizeParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/resize", pathParameters),
- autorest.WithJSON(poolResizeParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ResizeSender sends the Resize request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) ResizeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ResizeResponder handles the response to the Resize request. The method always
-// closes the http.Response Body.
-func (client PoolClient) ResizeResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// StopResize this does not restore the pool to its previous state before the resize operation: it only stops any
-// further changes being made, and the pool maintains its current state. After stopping, the pool stabilizes at the
-// number of nodes it was at when the stop operation was done. During the stop operation, the pool allocation state
-// changes first to stopping and then to steady. A resize operation need not be an explicit resize pool request; this
-// API can also be used to halt the initial sizing of the pool when it is created.
-//
-// poolID is the ID of the pool whose resizing you want to stop. timeout is the maximum time that the server can
-// spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated
-// request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client PoolClient) StopResize(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.StopResizePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.StopResizeSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", resp, "Failure sending request")
- return
- }
-
- result, err = client.StopResizeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", resp, "Failure responding to request")
- }
-
- return
-}
-
-// StopResizePreparer prepares the StopResize request.
-func (client PoolClient) StopResizePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/stopresize", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// StopResizeSender sends the StopResize request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) StopResizeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// StopResizeResponder handles the response to the StopResize request. The method always
-// closes the http.Response Body.
-func (client PoolClient) StopResizeResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// UpdateProperties this fully replaces all the updateable properties of the pool. For example, if the pool has a start
-// task associated with it and if start task is not specified with this request, then the Batch service will remove the
-// existing start task.
-//
-// poolID is the ID of the pool to update. poolUpdatePropertiesParameter is the parameters for the request. timeout
-// is the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client PoolClient) UpdateProperties(ctx context.Context, poolID string, poolUpdatePropertiesParameter PoolUpdatePropertiesParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: poolUpdatePropertiesParameter,
- Constraints: []validation.Constraint{{Target: "poolUpdatePropertiesParameter.StartTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "poolUpdatePropertiesParameter.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "poolUpdatePropertiesParameter.CertificateReferences", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "poolUpdatePropertiesParameter.ApplicationPackageReferences", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "poolUpdatePropertiesParameter.Metadata", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "UpdateProperties", err.Error())
- }
-
- req, err := client.UpdatePropertiesPreparer(ctx, poolID, poolUpdatePropertiesParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdatePropertiesSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdatePropertiesResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePropertiesPreparer prepares the UpdateProperties request.
-func (client PoolClient) UpdatePropertiesPreparer(ctx context.Context, poolID string, poolUpdatePropertiesParameter PoolUpdatePropertiesParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/updateproperties", pathParameters),
- autorest.WithJSON(poolUpdatePropertiesParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdatePropertiesSender sends the UpdateProperties request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) UpdatePropertiesSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdatePropertiesResponder handles the response to the UpdateProperties request. The method always
-// closes the http.Response Body.
-func (client PoolClient) UpdatePropertiesResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// UpgradeOS during an upgrade, the Batch service upgrades each compute node in the pool. When a compute node is chosen
-// for upgrade, any tasks running on that node are removed from the node and returned to the queue to be rerun later
-// (or on a different compute node). The node will be unavailable until the upgrade is complete. This operation results
-// in temporarily reduced pool capacity as nodes are taken out of service to be upgraded. Although the Batch service
-// tries to avoid upgrading all compute nodes at the same time, it does not guarantee to do this (particularly on small
-// pools); therefore, the pool may be temporarily unavailable to run tasks. When this operation runs, the pool state
-// changes to upgrading. When all compute nodes have finished upgrading, the pool state returns to active. While the
-// upgrade is in progress, the pool's currentOSVersion reflects the OS version that nodes are upgrading from, and
-// targetOSVersion reflects the OS version that nodes are upgrading to. Once the upgrade is complete, currentOSVersion
-// is updated to reflect the OS version now running on all nodes. This operation can only be invoked on pools created
-// with the cloudServiceConfiguration property.
-//
-// poolID is the ID of the pool to upgrade. poolUpgradeOSParameter is the parameters for the request. timeout is
-// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client PoolClient) UpgradeOS(ctx context.Context, poolID string, poolUpgradeOSParameter PoolUpgradeOSParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: poolUpgradeOSParameter,
- Constraints: []validation.Constraint{{Target: "poolUpgradeOSParameter.TargetOSVersion", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "UpgradeOS", err.Error())
- }
-
- req, err := client.UpgradeOSPreparer(ctx, poolID, poolUpgradeOSParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpgradeOSSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpgradeOSResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpgradeOSPreparer prepares the UpgradeOS request.
-func (client PoolClient) UpgradeOSPreparer(ctx context.Context, poolID string, poolUpgradeOSParameter PoolUpgradeOSParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/upgradeos", pathParameters),
- autorest.WithJSON(poolUpgradeOSParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpgradeOSSender sends the UpgradeOS request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) UpgradeOSSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpgradeOSResponder handles the response to the UpgradeOS request. The method always
-// closes the http.Response Body.
-func (client PoolClient) UpgradeOSResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff --git a/services/batch/2017-06-01.5.1/batch/task.go b/services/batch/2017-06-01.5.1/batch/task.go
deleted file mode 100644
index dd8c9edb081e..000000000000
--- a/services/batch/2017-06-01.5.1/batch/task.go
+++ /dev/null
@@ -1,1070 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// TaskClient is the a client for issuing REST requests to the Azure Batch service.
-type TaskClient struct {
- BaseClient
-}
-
-// NewTaskClient creates an instance of the TaskClient client.
-func NewTaskClient() TaskClient {
- return NewTaskClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewTaskClientWithBaseURI creates an instance of the TaskClient client.
-func NewTaskClientWithBaseURI(baseURI string) TaskClient {
- return TaskClient{NewWithBaseURI(baseURI)}
-}
-
-// Add sends the add request.
-//
-// jobID is the ID of the job to which the task is to be added. task is the task to be added. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client TaskClient) Add(ctx context.Context, jobID string, task TaskAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: task,
- Constraints: []validation.Constraint{{Target: "task.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "task.CommandLine", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "task.AffinityInfo", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "task.AffinityInfo.AffinityID", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "task.MultiInstanceSettings", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "task.MultiInstanceSettings.NumberOfInstances", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil {
- return result, validation.NewError("batch.TaskClient", "Add", err.Error())
- }
-
- req, err := client.AddPreparer(ctx, jobID, task, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPreparer prepares the Add request.
-func (client TaskClient) AddPreparer(ctx context.Context, jobID string, task TaskAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks", pathParameters),
- autorest.WithJSON(task),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSender sends the Add request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) AddSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddResponder handles the response to the Add request. The method always
-// closes the http.Response Body.
-func (client TaskClient) AddResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// AddCollection note that each task must have a unique ID. The Batch service may not return the results for each task
-// in the same order the tasks were submitted in this request. If the server times out or the connection is closed
-// during the request, the request may have been partially or fully processed, or not at all. In such cases, the user
-// should re-issue the request. Note that it is up to the user to correctly handle failures when re-issuing a request.
-// For example, you should use the same task IDs during a retry so that if the prior operation succeeded, the retry
-// will not create extra tasks unexpectedly. If the response contains any tasks which failed to add, a client can retry
-// the request. In a retry, it is most efficient to resubmit only tasks that failed to add, and to omit tasks that were
-// successfully added on the first attempt.
-//
-// jobID is the ID of the job to which the task collection is to be added. taskCollection is the tasks to be added.
-// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30
-// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such
-// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should
-// return the client-request-id in the response. ocpDate is the time the request was issued. Client libraries
-// typically set this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client TaskClient) AddCollection(ctx context.Context, jobID string, taskCollection TaskAddCollectionParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result TaskAddCollectionResult, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: taskCollection,
- Constraints: []validation.Constraint{{Target: "taskCollection.Value", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "taskCollection.Value", Name: validation.MaxItems, Rule: 100, Chain: nil}}}}}}); err != nil {
- return result, validation.NewError("batch.TaskClient", "AddCollection", err.Error())
- }
-
- req, err := client.AddCollectionPreparer(ctx, jobID, taskCollection, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "AddCollection", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddCollectionSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "AddCollection", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddCollectionResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "AddCollection", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddCollectionPreparer prepares the AddCollection request.
-func (client TaskClient) AddCollectionPreparer(ctx context.Context, jobID string, taskCollection TaskAddCollectionParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/addtaskcollection", pathParameters),
- autorest.WithJSON(taskCollection),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddCollectionSender sends the AddCollection request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) AddCollectionSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddCollectionResponder handles the response to the AddCollection request. The method always
-// closes the http.Response Body.
-func (client TaskClient) AddCollectionResponder(resp *http.Response) (result TaskAddCollectionResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Delete when a task is deleted, all of the files in its directory on the compute node where it ran are also deleted
-// (regardless of the retention time). For multi-instance tasks, the delete task operation applies synchronously to the
-// primary task; subtasks and their files are then deleted asynchronously in the background.
-//
-// jobID is the ID of the job from which to delete the task. taskID is the ID of the task to delete. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client TaskClient) Delete(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeletePreparer(ctx, jobID, taskID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client TaskClient) DeletePreparer(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client TaskClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get for multi-instance tasks, information such as affinityId, executionInfo and nodeInfo refer to the primary task.
-// Use the list subtasks API to retrieve information about subtasks.
-//
-// jobID is the ID of the job that contains the task. taskID is the ID of the task to get information about.
-// selectParameter is an OData $select clause. expand is an OData $expand clause. timeout is the maximum time that
-// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client TaskClient) Get(ctx context.Context, jobID string, taskID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudTask, err error) {
- req, err := client.GetPreparer(ctx, jobID, taskID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client TaskClient) GetPreparer(ctx context.Context, jobID string, taskID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client TaskClient) GetResponder(resp *http.Response) (result CloudTask, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List for multi-instance tasks, information such as affinityId, executionInfo and nodeInfo refer to the primary task.
-// Use the list subtasks API to retrieve information about subtasks.
-//
-// jobID is the ID of the job. filter is an OData $filter clause. selectParameter is an OData $select clause.
-// expand is an OData $expand clause. maxResults is the maximum number of items to return in the response. A
-// maximum of 1000 tasks can be returned. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. Client libraries typically set this to the current system clock time; set it
-// explicitly if you are calling the REST API directly.
-func (client TaskClient) List(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.TaskClient", "List", err.Error())
- }
-
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, jobID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.ctlr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", resp, "Failure sending request")
- return
- }
-
- result.ctlr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client TaskClient) ListPreparer(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client TaskClient) ListResponder(resp *http.Response) (result CloudTaskListResult, 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 TaskClient) listNextResults(lastResults CloudTaskListResult) (result CloudTaskListResult, err error) {
- req, err := lastResults.cloudTaskListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.TaskClient", "listNextResults", 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.TaskClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client TaskClient) ListComplete(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListResultIterator, err error) {
- result.page, err = client.List(ctx, jobID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// ListSubtasks if the task is not a multi-instance task then this returns an empty collection.
-//
-// jobID is the ID of the job. taskID is the ID of the task. selectParameter is an OData $select clause. timeout is
-// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client TaskClient) ListSubtasks(ctx context.Context, jobID string, taskID string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListSubtasksResult, err error) {
- req, err := client.ListSubtasksPreparer(ctx, jobID, taskID, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSubtasksSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListSubtasksResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListSubtasksPreparer prepares the ListSubtasks request.
-func (client TaskClient) ListSubtasksPreparer(ctx context.Context, jobID string, taskID string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/subtasksinfo", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSubtasksSender sends the ListSubtasks request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) ListSubtasksSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListSubtasksResponder handles the response to the ListSubtasks request. The method always
-// closes the http.Response Body.
-func (client TaskClient) ListSubtasksResponder(resp *http.Response) (result CloudTaskListSubtasksResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Reactivate reactivation makes a task eligible to be retried again up to its maximum retry count. The task's state is
-// changed to active. As the task is no longer in the completed state, any previous exit code or failure information is
-// no longer available after reactivation. Each time a task is reactivated, its retry count is reset to 0. Reactivation
-// will fail for tasks that are not completed or that previously completed successfully (with an exit code of 0).
-// Additionally, it will fail if the job has completed (or is terminating or deleting).
-//
-// jobID is the ID of the job containing the task. taskID is the ID of the task to reactivate. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client TaskClient) Reactivate(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.ReactivatePreparer(ctx, jobID, taskID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Reactivate", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ReactivateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Reactivate", resp, "Failure sending request")
- return
- }
-
- result, err = client.ReactivateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Reactivate", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ReactivatePreparer prepares the Reactivate request.
-func (client TaskClient) ReactivatePreparer(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/reactivate", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ReactivateSender sends the Reactivate request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) ReactivateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ReactivateResponder handles the response to the Reactivate request. The method always
-// closes the http.Response Body.
-func (client TaskClient) ReactivateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Terminate when the task has been terminated, it moves to the completed state. For multi-instance tasks, the
-// terminate task operation applies synchronously to the primary task; subtasks are then terminated asynchronously in
-// the background.
-//
-// jobID is the ID of the job containing the task. taskID is the ID of the task to terminate. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client TaskClient) Terminate(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.TerminatePreparer(ctx, jobID, taskID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.TerminateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", resp, "Failure sending request")
- return
- }
-
- result, err = client.TerminateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", resp, "Failure responding to request")
- }
-
- return
-}
-
-// TerminatePreparer prepares the Terminate request.
-func (client TaskClient) TerminatePreparer(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/terminate", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// TerminateSender sends the Terminate request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) TerminateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// TerminateResponder handles the response to the Terminate request. The method always
-// closes the http.Response Body.
-func (client TaskClient) TerminateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Update updates the properties of the specified task.
-//
-// jobID is the ID of the job containing the task. taskID is the ID of the task to update. taskUpdateParameter is
-// the parameters for the request. timeout is the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a
-// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are
-// calling the REST API directly. ifMatch is an ETag value associated with the version of the resource known to the
-// client. The operation will be performed only if the resource's current ETag on the service exactly matches the
-// value specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to
-// the client. The operation will be performed only if the resource's current ETag on the service does not match
-// the value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the
-// resource known to the client. The operation will be performed only if the resource on the service has been
-// modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the
-// resource known to the client. The operation will be performed only if the resource on the service has not been
-// modified since the specified time.
-func (client TaskClient) Update(ctx context.Context, jobID string, taskID string, taskUpdateParameter TaskUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.UpdatePreparer(ctx, jobID, taskID, taskUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePreparer prepares the Update request.
-func (client TaskClient) UpdatePreparer(ctx context.Context, jobID string, taskID string, taskUpdateParameter TaskUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2017-06-01.5.1"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters),
- autorest.WithJSON(taskUpdateParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSender sends the Update request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) UpdateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateResponder handles the response to the Update request. The method always
-// closes the http.Response Body.
-func (client TaskClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff --git a/services/batch/2017-06-01.5.1/batch/version.go b/services/batch/2017-06-01.5.1/batch/version.go
deleted file mode 100644
index fb1f35fb5b21..000000000000
--- a/services/batch/2017-06-01.5.1/batch/version.go
+++ /dev/null
@@ -1,30 +0,0 @@
-package batch
-
-import "github.com/Azure/azure-sdk-for-go/version"
-
-// 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.
-
-// UserAgent returns the UserAgent string to use when sending http.Requests.
-func UserAgent() string {
- return "Azure-SDK-For-Go/" + version.Number + " batch/2017-06-01.5.1"
-}
-
-// Version returns the semantic version (see http://semver.org) of the client.
-func Version() string {
- return version.Number
-}
diff --git a/services/batch/2017-09-01.6.0/batch/account.go b/services/batch/2017-09-01.6.0/batch/account.go
deleted file mode 100644
index 1e4fba835806..000000000000
--- a/services/batch/2017-09-01.6.0/batch/account.go
+++ /dev/null
@@ -1,175 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// AccountClient is the a client for issuing REST requests to the Azure Batch service.
-type AccountClient struct {
- BaseClient
-}
-
-// NewAccountClient creates an instance of the AccountClient client.
-func NewAccountClient() AccountClient {
- return NewAccountClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewAccountClientWithBaseURI creates an instance of the AccountClient client.
-func NewAccountClientWithBaseURI(baseURI string) AccountClient {
- return AccountClient{NewWithBaseURI(baseURI)}
-}
-
-// ListNodeAgentSkus sends the list node agent skus request.
-//
-// filter is an OData $filter clause. For more information on constructing this filter, see
-// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-node-agent-skus. maxResults
-// is the maximum number of items to return in the response. A maximum of 1000 results will be returned. timeout is
-// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client AccountClient) ListNodeAgentSkus(ctx context.Context, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result AccountListNodeAgentSkusResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.AccountClient", "ListNodeAgentSkus", err.Error())
- }
-
- result.fn = client.listNodeAgentSkusNextResults
- req, err := client.ListNodeAgentSkusPreparer(ctx, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListNodeAgentSkus", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListNodeAgentSkusSender(req)
- if err != nil {
- result.alnasr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListNodeAgentSkus", resp, "Failure sending request")
- return
- }
-
- result.alnasr, err = client.ListNodeAgentSkusResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListNodeAgentSkus", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListNodeAgentSkusPreparer prepares the ListNodeAgentSkus request.
-func (client AccountClient) ListNodeAgentSkusPreparer(ctx context.Context, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/nodeagentskus"),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListNodeAgentSkusSender sends the ListNodeAgentSkus request. The method will close the
-// http.Response Body if it receives an error.
-func (client AccountClient) ListNodeAgentSkusSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListNodeAgentSkusResponder handles the response to the ListNodeAgentSkus request. The method always
-// closes the http.Response Body.
-func (client AccountClient) ListNodeAgentSkusResponder(resp *http.Response) (result AccountListNodeAgentSkusResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listNodeAgentSkusNextResults retrieves the next set of results, if any.
-func (client AccountClient) listNodeAgentSkusNextResults(lastResults AccountListNodeAgentSkusResult) (result AccountListNodeAgentSkusResult, err error) {
- req, err := lastResults.accountListNodeAgentSkusResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.AccountClient", "listNodeAgentSkusNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListNodeAgentSkusSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.AccountClient", "listNodeAgentSkusNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListNodeAgentSkusResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.AccountClient", "listNodeAgentSkusNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListNodeAgentSkusComplete enumerates all values, automatically crossing page boundaries as required.
-func (client AccountClient) ListNodeAgentSkusComplete(ctx context.Context, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result AccountListNodeAgentSkusResultIterator, err error) {
- result.page, err = client.ListNodeAgentSkus(ctx, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
diff --git a/services/batch/2017-09-01.6.0/batch/application.go b/services/batch/2017-09-01.6.0/batch/application.go
deleted file mode 100644
index de66c6d66086..000000000000
--- a/services/batch/2017-09-01.6.0/batch/application.go
+++ /dev/null
@@ -1,264 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// ApplicationClient is the a client for issuing REST requests to the Azure Batch service.
-type ApplicationClient struct {
- BaseClient
-}
-
-// NewApplicationClient creates an instance of the ApplicationClient client.
-func NewApplicationClient() ApplicationClient {
- return NewApplicationClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewApplicationClientWithBaseURI creates an instance of the ApplicationClient client.
-func NewApplicationClientWithBaseURI(baseURI string) ApplicationClient {
- return ApplicationClient{NewWithBaseURI(baseURI)}
-}
-
-// Get this operation returns only applications and versions that are available for use on compute nodes; that is, that
-// can be used in an application package reference. For administrator information about applications and versions that
-// are not yet available to compute nodes, use the Azure portal or the Azure Resource Manager API.
-//
-// applicationID is the ID of the application. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. Client libraries typically set this to the current system clock time; set it
-// explicitly if you are calling the REST API directly.
-func (client ApplicationClient) Get(ctx context.Context, applicationID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationSummary, err error) {
- req, err := client.GetPreparer(ctx, applicationID, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client ApplicationClient) GetPreparer(ctx context.Context, applicationID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "applicationId": autorest.Encode("path", applicationID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/applications/{applicationId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client ApplicationClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client ApplicationClient) GetResponder(resp *http.Response) (result ApplicationSummary, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List this operation returns only applications and versions that are available for use on compute nodes; that is,
-// that can be used in an application package reference. For administrator information about applications and versions
-// that are not yet available to compute nodes, use the Azure portal or the Azure Resource Manager API.
-//
-// maxResults is the maximum number of items to return in the response. A maximum of 1000 applications can be
-// returned. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client
-// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API
-// directly.
-func (client ApplicationClient) List(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.ApplicationClient", "List", err.Error())
- }
-
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.alr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "List", resp, "Failure sending request")
- return
- }
-
- result.alr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client ApplicationClient) ListPreparer(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/applications"),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client ApplicationClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client ApplicationClient) ListResponder(resp *http.Response) (result ApplicationListResult, 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 ApplicationClient) listNextResults(lastResults ApplicationListResult) (result ApplicationListResult, err error) {
- req, err := lastResults.applicationListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.ApplicationClient", "listNextResults", 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.ApplicationClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ApplicationClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client ApplicationClient) ListComplete(ctx context.Context, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ApplicationListResultIterator, err error) {
- result.page, err = client.List(ctx, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
diff --git a/services/batch/2017-09-01.6.0/batch/certificate.go b/services/batch/2017-09-01.6.0/batch/certificate.go
deleted file mode 100644
index 28e2724ee7e6..000000000000
--- a/services/batch/2017-09-01.6.0/batch/certificate.go
+++ /dev/null
@@ -1,557 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// CertificateClient is the a client for issuing REST requests to the Azure Batch service.
-type CertificateClient struct {
- BaseClient
-}
-
-// NewCertificateClient creates an instance of the CertificateClient client.
-func NewCertificateClient() CertificateClient {
- return NewCertificateClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewCertificateClientWithBaseURI creates an instance of the CertificateClient client.
-func NewCertificateClientWithBaseURI(baseURI string) CertificateClient {
- return CertificateClient{NewWithBaseURI(baseURI)}
-}
-
-// Add sends the add request.
-//
-// certificate is the certificate to be added. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. Client libraries typically set this to the current system clock time; set it
-// explicitly if you are calling the REST API directly.
-func (client CertificateClient) Add(ctx context.Context, certificate CertificateAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: certificate,
- Constraints: []validation.Constraint{{Target: "certificate.Thumbprint", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "certificate.ThumbprintAlgorithm", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "certificate.Data", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.CertificateClient", "Add", err.Error())
- }
-
- req, err := client.AddPreparer(ctx, certificate, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Add", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPreparer prepares the Add request.
-func (client CertificateClient) AddPreparer(ctx context.Context, certificate CertificateAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/certificates"),
- autorest.WithJSON(certificate),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSender sends the Add request. The method will close the
-// http.Response Body if it receives an error.
-func (client CertificateClient) AddSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddResponder handles the response to the Add request. The method always
-// closes the http.Response Body.
-func (client CertificateClient) AddResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// CancelDeletion if you try to delete a certificate that is being used by a pool or compute node, the status of the
-// certificate changes to deleteFailed. If you decide that you want to continue using the certificate, you can use this
-// operation to set the status of the certificate back to active. If you intend to delete the certificate, you do not
-// need to run this operation after the deletion failed. You must make sure that the certificate is not being used by
-// any resources, and then you can try again to delete the certificate.
-//
-// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is
-// the thumbprint of the certificate being deleted. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client CertificateClient) CancelDeletion(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.CancelDeletionPreparer(ctx, thumbprintAlgorithm, thumbprint, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.CancelDeletionSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", resp, "Failure sending request")
- return
- }
-
- result, err = client.CancelDeletionResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "CancelDeletion", resp, "Failure responding to request")
- }
-
- return
-}
-
-// CancelDeletionPreparer prepares the CancelDeletion request.
-func (client CertificateClient) CancelDeletionPreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "thumbprint": autorest.Encode("path", thumbprint),
- "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})/canceldelete", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CancelDeletionSender sends the CancelDeletion request. The method will close the
-// http.Response Body if it receives an error.
-func (client CertificateClient) CancelDeletionSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// CancelDeletionResponder handles the response to the CancelDeletion request. The method always
-// closes the http.Response Body.
-func (client CertificateClient) CancelDeletionResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Delete you cannot delete a certificate if a resource (pool or compute node) is using it. Before you can delete a
-// certificate, you must therefore make sure that the certificate is not associated with any existing pools, the
-// certificate is not installed on any compute nodes (even if you remove a certificate from a pool, it is not removed
-// from existing compute nodes in that pool until they restart), and no running tasks depend on the certificate. If you
-// try to delete a certificate that is in use, the deletion fails. The certificate status changes to deleteFailed. You
-// can use Cancel Delete Certificate to set the status back to active if you decide that you want to continue using the
-// certificate.
-//
-// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is
-// the thumbprint of the certificate to be deleted. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client CertificateClient) Delete(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeletePreparer(ctx, thumbprintAlgorithm, thumbprint, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client CertificateClient) DeletePreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "thumbprint": autorest.Encode("path", thumbprint),
- "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client CertificateClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client CertificateClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get gets information about the specified certificate.
-//
-// thumbprintAlgorithm is the algorithm used to derive the thumbprint parameter. This must be sha1. thumbprint is
-// the thumbprint of the certificate to get. selectParameter is an OData $select clause. timeout is the maximum
-// time that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is
-// the caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client CertificateClient) Get(ctx context.Context, thumbprintAlgorithm string, thumbprint string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result Certificate, err error) {
- req, err := client.GetPreparer(ctx, thumbprintAlgorithm, thumbprint, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client CertificateClient) GetPreparer(ctx context.Context, thumbprintAlgorithm string, thumbprint string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "thumbprint": autorest.Encode("path", thumbprint),
- "thumbprintAlgorithm": autorest.Encode("path", thumbprintAlgorithm),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client CertificateClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client CertificateClient) GetResponder(resp *http.Response) (result Certificate, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List sends the list request.
-//
-// filter is an OData $filter clause. For more information on constructing this filter, see
-// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-certificates. selectParameter
-// is an OData $select clause. maxResults is the maximum number of items to return in the response. A maximum of
-// 1000 certificates can be returned. timeout is the maximum time that the server can spend processing the request,
-// in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of
-// a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are
-// calling the REST API directly.
-func (client CertificateClient) List(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CertificateListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.CertificateClient", "List", err.Error())
- }
-
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.clr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "List", resp, "Failure sending request")
- return
- }
-
- result.clr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client CertificateClient) ListPreparer(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/certificates"),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client CertificateClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client CertificateClient) ListResponder(resp *http.Response) (result CertificateListResult, 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 CertificateClient) listNextResults(lastResults CertificateListResult) (result CertificateListResult, err error) {
- req, err := lastResults.certificateListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.CertificateClient", "listNextResults", 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.CertificateClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.CertificateClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client CertificateClient) ListComplete(ctx context.Context, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CertificateListResultIterator, err error) {
- result.page, err = client.List(ctx, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
diff --git a/services/batch/2017-09-01.6.0/batch/client.go b/services/batch/2017-09-01.6.0/batch/client.go
deleted file mode 100644
index 87ffc1ecd65a..000000000000
--- a/services/batch/2017-09-01.6.0/batch/client.go
+++ /dev/null
@@ -1,49 +0,0 @@
-// Package batch implements the Azure ARM Batch service API version 2017-09-01.6.0.
-//
-// A client for issuing REST requests to the Azure Batch service.
-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"
-)
-
-const (
- // DefaultBaseURI is the default URI used for the service Batch
- DefaultBaseURI = "https://batch.core.windows.net"
-)
-
-// BaseClient is the base client for Batch.
-type BaseClient struct {
- autorest.Client
- BaseURI string
-}
-
-// New creates an instance of the BaseClient client.
-func New() BaseClient {
- return NewWithBaseURI(DefaultBaseURI)
-}
-
-// NewWithBaseURI creates an instance of the BaseClient client.
-func NewWithBaseURI(baseURI string) BaseClient {
- return BaseClient{
- Client: autorest.NewClientWithUserAgent(UserAgent()),
- BaseURI: baseURI,
- }
-}
diff --git a/services/batch/2017-09-01.6.0/batch/computenode.go b/services/batch/2017-09-01.6.0/batch/computenode.go
deleted file mode 100644
index f28823c047f1..000000000000
--- a/services/batch/2017-09-01.6.0/batch/computenode.go
+++ /dev/null
@@ -1,1124 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// ComputeNodeClient is the a client for issuing REST requests to the Azure Batch service.
-type ComputeNodeClient struct {
- BaseClient
-}
-
-// NewComputeNodeClient creates an instance of the ComputeNodeClient client.
-func NewComputeNodeClient() ComputeNodeClient {
- return NewComputeNodeClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewComputeNodeClientWithBaseURI creates an instance of the ComputeNodeClient client.
-func NewComputeNodeClientWithBaseURI(baseURI string) ComputeNodeClient {
- return ComputeNodeClient{NewWithBaseURI(baseURI)}
-}
-
-// AddUser you can add a user account to a node only when it is in the idle or running state.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the machine on which you want
-// to create a user account. userParameter is the user account to be created. timeout is the maximum time that the
-// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client ComputeNodeClient) AddUser(ctx context.Context, poolID string, nodeID string, userParameter ComputeNodeUser, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: userParameter,
- Constraints: []validation.Constraint{{Target: "userParameter.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.ComputeNodeClient", "AddUser", err.Error())
- }
-
- req, err := client.AddUserPreparer(ctx, poolID, nodeID, userParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddUserSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddUserResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "AddUser", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddUserPreparer prepares the AddUser request.
-func (client ComputeNodeClient) AddUserPreparer(ctx context.Context, poolID string, nodeID string, userParameter ComputeNodeUser, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users", pathParameters),
- autorest.WithJSON(userParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddUserSender sends the AddUser request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) AddUserSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddUserResponder handles the response to the AddUser request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) AddUserResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// DeleteUser you can delete a user account to a node only when it is in the idle or running state.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the machine on which you want
-// to delete a user account. userName is the name of the user account to delete. timeout is the maximum time that
-// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client ComputeNodeClient) DeleteUser(ctx context.Context, poolID string, nodeID string, userName string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeleteUserPreparer(ctx, poolID, nodeID, userName, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteUserSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteUserResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DeleteUser", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteUserPreparer prepares the DeleteUser request.
-func (client ComputeNodeClient) DeleteUserPreparer(ctx context.Context, poolID string, nodeID string, userName string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- "userName": autorest.Encode("path", userName),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users/{userName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteUserSender sends the DeleteUser request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) DeleteUserSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteUserResponder handles the response to the DeleteUser request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) DeleteUserResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// DisableScheduling you can disable task scheduling on a node only if its current scheduling state is enabled.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node on which you
-// want to disable task scheduling. nodeDisableSchedulingParameter is the parameters for the request. timeout is
-// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client ComputeNodeClient) DisableScheduling(ctx context.Context, poolID string, nodeID string, nodeDisableSchedulingParameter *NodeDisableSchedulingParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DisableSchedulingPreparer(ctx, poolID, nodeID, nodeDisableSchedulingParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DisableSchedulingSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", resp, "Failure sending request")
- return
- }
-
- result, err = client.DisableSchedulingResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "DisableScheduling", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DisableSchedulingPreparer prepares the DisableScheduling request.
-func (client ComputeNodeClient) DisableSchedulingPreparer(ctx context.Context, poolID string, nodeID string, nodeDisableSchedulingParameter *NodeDisableSchedulingParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/disablescheduling", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if nodeDisableSchedulingParameter != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(nodeDisableSchedulingParameter))
- }
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DisableSchedulingSender sends the DisableScheduling request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) DisableSchedulingSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DisableSchedulingResponder handles the response to the DisableScheduling request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) DisableSchedulingResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// EnableScheduling you can enable task scheduling on a node only if its current scheduling state is disabled
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node on which you
-// want to enable task scheduling. timeout is the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a
-// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are
-// calling the REST API directly.
-func (client ComputeNodeClient) EnableScheduling(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.EnableSchedulingPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.EnableSchedulingSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", resp, "Failure sending request")
- return
- }
-
- result, err = client.EnableSchedulingResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "EnableScheduling", resp, "Failure responding to request")
- }
-
- return
-}
-
-// EnableSchedulingPreparer prepares the EnableScheduling request.
-func (client ComputeNodeClient) EnableSchedulingPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/enablescheduling", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// EnableSchedulingSender sends the EnableScheduling request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) EnableSchedulingSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// EnableSchedulingResponder handles the response to the EnableScheduling request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) EnableSchedulingResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get sends the get request.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that you want
-// to get information about. selectParameter is an OData $select clause. timeout is the maximum time that the
-// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client ComputeNodeClient) Get(ctx context.Context, poolID string, nodeID string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNode, err error) {
- req, err := client.GetPreparer(ctx, poolID, nodeID, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client ComputeNodeClient) GetPreparer(ctx context.Context, poolID string, nodeID string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) GetResponder(resp *http.Response) (result ComputeNode, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetRemoteDesktop before you can access a node by using the RDP file, you must create a user account on the node.
-// This API can only be invoked on pools created with a cloud service configuration. For pools created with a virtual
-// machine configuration, see the GetRemoteLoginSettings API.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node for which you
-// want to get the Remote Desktop Protocol file. timeout is the maximum time that the server can spend processing
-// the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in
-// the form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. Client libraries typically set this to the current system clock time; set it
-// explicitly if you are calling the REST API directly.
-func (client ComputeNodeClient) GetRemoteDesktop(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ReadCloser, err error) {
- req, err := client.GetRemoteDesktopPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetRemoteDesktopSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetRemoteDesktopResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteDesktop", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetRemoteDesktopPreparer prepares the GetRemoteDesktop request.
-func (client ComputeNodeClient) GetRemoteDesktopPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/rdp", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetRemoteDesktopSender sends the GetRemoteDesktop request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) GetRemoteDesktopSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetRemoteDesktopResponder handles the response to the GetRemoteDesktop request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) GetRemoteDesktopResponder(resp *http.Response) (result ReadCloser, err error) {
- result.Value = &resp.Body
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK))
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetRemoteLoginSettings before you can remotely login to a node using the remote login settings, you must create a
-// user account on the node. This API can be invoked only on pools created with the virtual machine configuration
-// property. For pools created with a cloud service configuration, see the GetRemoteDesktop API.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node for which to
-// obtain the remote login settings. timeout is the maximum time that the server can spend processing the request,
-// in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of
-// a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are
-// calling the REST API directly.
-func (client ComputeNodeClient) GetRemoteLoginSettings(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeGetRemoteLoginSettingsResult, err error) {
- req, err := client.GetRemoteLoginSettingsPreparer(ctx, poolID, nodeID, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteLoginSettings", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetRemoteLoginSettingsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteLoginSettings", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetRemoteLoginSettingsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "GetRemoteLoginSettings", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetRemoteLoginSettingsPreparer prepares the GetRemoteLoginSettings request.
-func (client ComputeNodeClient) GetRemoteLoginSettingsPreparer(ctx context.Context, poolID string, nodeID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/remoteloginsettings", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetRemoteLoginSettingsSender sends the GetRemoteLoginSettings request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) GetRemoteLoginSettingsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetRemoteLoginSettingsResponder handles the response to the GetRemoteLoginSettings request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) GetRemoteLoginSettingsResponder(resp *http.Response) (result ComputeNodeGetRemoteLoginSettingsResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List sends the list request.
-//
-// poolID is the ID of the pool from which you want to list nodes. filter is an OData $filter clause. For more
-// information on constructing this filter, see
-// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-nodes-in-a-pool.
-// selectParameter is an OData $select clause. maxResults is the maximum number of items to return in the response.
-// A maximum of 1000 nodes can be returned. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. Client libraries typically set this to the current system clock time; set it
-// explicitly if you are calling the REST API directly.
-func (client ComputeNodeClient) List(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.ComputeNodeClient", "List", err.Error())
- }
-
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, poolID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.cnlr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", resp, "Failure sending request")
- return
- }
-
- result.cnlr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client ComputeNodeClient) ListPreparer(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) ListResponder(resp *http.Response) (result ComputeNodeListResult, 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 ComputeNodeClient) listNextResults(lastResults ComputeNodeListResult) (result ComputeNodeListResult, err error) {
- req, err := lastResults.computeNodeListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "listNextResults", 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.ComputeNodeClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client ComputeNodeClient) ListComplete(ctx context.Context, poolID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result ComputeNodeListResultIterator, err error) {
- result.page, err = client.List(ctx, poolID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// Reboot you can restart a node only if it is in an idle or running state.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that you want
-// to restart. nodeRebootParameter is the parameters for the request. timeout is the maximum time that the server
-// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated
-// request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client ComputeNodeClient) Reboot(ctx context.Context, poolID string, nodeID string, nodeRebootParameter *NodeRebootParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.RebootPreparer(ctx, poolID, nodeID, nodeRebootParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.RebootSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", resp, "Failure sending request")
- return
- }
-
- result, err = client.RebootResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reboot", resp, "Failure responding to request")
- }
-
- return
-}
-
-// RebootPreparer prepares the Reboot request.
-func (client ComputeNodeClient) RebootPreparer(ctx context.Context, poolID string, nodeID string, nodeRebootParameter *NodeRebootParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/reboot", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if nodeRebootParameter != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(nodeRebootParameter))
- }
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// RebootSender sends the Reboot request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) RebootSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// RebootResponder handles the response to the Reboot request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) RebootResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Reimage you can reinstall the operating system on a node only if it is in an idle or running state. This API can be
-// invoked only on pools created with the cloud service configuration property.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that you want
-// to restart. nodeReimageParameter is the parameters for the request. timeout is the maximum time that the server
-// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated
-// request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client ComputeNodeClient) Reimage(ctx context.Context, poolID string, nodeID string, nodeReimageParameter *NodeReimageParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.ReimagePreparer(ctx, poolID, nodeID, nodeReimageParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ReimageSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", resp, "Failure sending request")
- return
- }
-
- result, err = client.ReimageResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "Reimage", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ReimagePreparer prepares the Reimage request.
-func (client ComputeNodeClient) ReimagePreparer(ctx context.Context, poolID string, nodeID string, nodeReimageParameter *NodeReimageParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/reimage", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if nodeReimageParameter != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(nodeReimageParameter))
- }
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ReimageSender sends the Reimage request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) ReimageSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ReimageResponder handles the response to the Reimage request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// UpdateUser this operation replaces of all the updateable properties of the account. For example, if the expiryTime
-// element is not specified, the current value is replaced with the default value, not left unmodified. You can update
-// a user account on a node only when it is in the idle or running state.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the machine on which you want
-// to update a user account. userName is the name of the user account to update. nodeUpdateUserParameter is the
-// parameters for the request. timeout is the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a
-// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are
-// calling the REST API directly.
-func (client ComputeNodeClient) UpdateUser(ctx context.Context, poolID string, nodeID string, userName string, nodeUpdateUserParameter NodeUpdateUserParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.UpdateUserPreparer(ctx, poolID, nodeID, userName, nodeUpdateUserParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateUserSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateUserResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.ComputeNodeClient", "UpdateUser", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdateUserPreparer prepares the UpdateUser request.
-func (client ComputeNodeClient) UpdateUserPreparer(ctx context.Context, poolID string, nodeID string, userName string, nodeUpdateUserParameter NodeUpdateUserParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- "userName": autorest.Encode("path", userName),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/users/{userName}", pathParameters),
- autorest.WithJSON(nodeUpdateUserParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateUserSender sends the UpdateUser request. The method will close the
-// http.Response Body if it receives an error.
-func (client ComputeNodeClient) UpdateUserSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateUserResponder handles the response to the UpdateUser request. The method always
-// closes the http.Response Body.
-func (client ComputeNodeClient) UpdateUserResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff --git a/services/batch/2017-09-01.6.0/batch/file.go b/services/batch/2017-09-01.6.0/batch/file.go
deleted file mode 100644
index d05993078297..000000000000
--- a/services/batch/2017-09-01.6.0/batch/file.go
+++ /dev/null
@@ -1,946 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// FileClient is the a client for issuing REST requests to the Azure Batch service.
-type FileClient struct {
- BaseClient
-}
-
-// NewFileClient creates an instance of the FileClient client.
-func NewFileClient() FileClient {
- return NewFileClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewFileClientWithBaseURI creates an instance of the FileClient client.
-func NewFileClientWithBaseURI(baseURI string) FileClient {
- return FileClient{NewWithBaseURI(baseURI)}
-}
-
-// DeleteFromComputeNode sends the delete from compute node request.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node from which you
-// want to delete the file. filePath is the path to the file or directory that you want to delete. recursive is
-// whether to delete children of a directory. If the filePath parameter represents a directory instead of a file,
-// you can set recursive to true to delete the directory and all of the files and subdirectories in it. If
-// recursive is false then the directory must be empty or deletion will fail. timeout is the maximum time that the
-// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client FileClient) DeleteFromComputeNode(ctx context.Context, poolID string, nodeID string, filePath string, recursive *bool, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeleteFromComputeNodePreparer(ctx, poolID, nodeID, filePath, recursive, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteFromComputeNodeSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteFromComputeNodeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromComputeNode", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteFromComputeNodePreparer prepares the DeleteFromComputeNode request.
-func (client FileClient) DeleteFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, filePath string, recursive *bool, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "filePath": autorest.Encode("path", filePath),
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if recursive != nil {
- queryParameters["recursive"] = autorest.Encode("query", *recursive)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{filePath}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteFromComputeNodeSender sends the DeleteFromComputeNode request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) DeleteFromComputeNodeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteFromComputeNodeResponder handles the response to the DeleteFromComputeNode request. The method always
-// closes the http.Response Body.
-func (client FileClient) DeleteFromComputeNodeResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// DeleteFromTask sends the delete from task request.
-//
-// jobID is the ID of the job that contains the task. taskID is the ID of the task whose file you want to delete.
-// filePath is the path to the task file or directory that you want to delete. recursive is whether to delete
-// children of a directory. If the filePath parameter represents a directory instead of a file, you can set
-// recursive to true to delete the directory and all of the files and subdirectories in it. If recursive is false
-// then the directory must be empty or deletion will fail. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client FileClient) DeleteFromTask(ctx context.Context, jobID string, taskID string, filePath string, recursive *bool, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeleteFromTaskPreparer(ctx, jobID, taskID, filePath, recursive, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteFromTaskSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteFromTaskResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "DeleteFromTask", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteFromTaskPreparer prepares the DeleteFromTask request.
-func (client FileClient) DeleteFromTaskPreparer(ctx context.Context, jobID string, taskID string, filePath string, recursive *bool, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "filePath": autorest.Encode("path", filePath),
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if recursive != nil {
- queryParameters["recursive"] = autorest.Encode("query", *recursive)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{filePath}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteFromTaskSender sends the DeleteFromTask request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) DeleteFromTaskSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteFromTaskResponder handles the response to the DeleteFromTask request. The method always
-// closes the http.Response Body.
-func (client FileClient) DeleteFromTaskResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// GetFromComputeNode returns the content of the specified compute node file.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that contains
-// the file. filePath is the path to the compute node file that you want to get the content of. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ocpRange is
-// the byte range to be retrieved. The default is to retrieve the entire file. The format is
-// bytes=startRange-endRange. ifModifiedSince is a timestamp indicating the last modified time of the resource
-// known to the client. The operation will be performed only if the resource on the service has been modified since
-// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to
-// the client. The operation will be performed only if the resource on the service has not been modified since the
-// specified time.
-func (client FileClient) GetFromComputeNode(ctx context.Context, poolID string, nodeID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result ReadCloser, err error) {
- req, err := client.GetFromComputeNodePreparer(ctx, poolID, nodeID, filePath, timeout, clientRequestID, returnClientRequestID, ocpDate, ocpRange, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetFromComputeNodeSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetFromComputeNodeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromComputeNode", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetFromComputeNodePreparer prepares the GetFromComputeNode request.
-func (client FileClient) GetFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "filePath": autorest.Encode("path", filePath),
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{filePath}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ocpRange) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-range", autorest.String(ocpRange)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetFromComputeNodeSender sends the GetFromComputeNode request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) GetFromComputeNodeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetFromComputeNodeResponder handles the response to the GetFromComputeNode request. The method always
-// closes the http.Response Body.
-func (client FileClient) GetFromComputeNodeResponder(resp *http.Response) (result ReadCloser, err error) {
- result.Value = &resp.Body
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK))
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetFromTask returns the content of the specified task file.
-//
-// jobID is the ID of the job that contains the task. taskID is the ID of the task whose file you want to retrieve.
-// filePath is the path to the task file that you want to get the content of. timeout is the maximum time that the
-// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ocpRange is
-// the byte range to be retrieved. The default is to retrieve the entire file. The format is
-// bytes=startRange-endRange. ifModifiedSince is a timestamp indicating the last modified time of the resource
-// known to the client. The operation will be performed only if the resource on the service has been modified since
-// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to
-// the client. The operation will be performed only if the resource on the service has not been modified since the
-// specified time.
-func (client FileClient) GetFromTask(ctx context.Context, jobID string, taskID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result ReadCloser, err error) {
- req, err := client.GetFromTaskPreparer(ctx, jobID, taskID, filePath, timeout, clientRequestID, returnClientRequestID, ocpDate, ocpRange, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetFromTaskSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetFromTaskResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetFromTask", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetFromTaskPreparer prepares the GetFromTask request.
-func (client FileClient) GetFromTaskPreparer(ctx context.Context, jobID string, taskID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ocpRange string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "filePath": autorest.Encode("path", filePath),
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{filePath}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ocpRange) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-range", autorest.String(ocpRange)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetFromTaskSender sends the GetFromTask request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) GetFromTaskSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetFromTaskResponder handles the response to the GetFromTask request. The method always
-// closes the http.Response Body.
-func (client FileClient) GetFromTaskResponder(resp *http.Response) (result ReadCloser, err error) {
- result.Value = &resp.Body
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK))
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetPropertiesFromComputeNode gets the properties of the specified compute node file.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node that contains
-// the file. filePath is the path to the compute node file that you want to get the properties of. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client FileClient) GetPropertiesFromComputeNode(ctx context.Context, poolID string, nodeID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.GetPropertiesFromComputeNodePreparer(ctx, poolID, nodeID, filePath, timeout, clientRequestID, returnClientRequestID, ocpDate, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromComputeNode", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetPropertiesFromComputeNodeSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromComputeNode", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetPropertiesFromComputeNodeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromComputeNode", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPropertiesFromComputeNodePreparer prepares the GetPropertiesFromComputeNode request.
-func (client FileClient) GetPropertiesFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "filePath": autorest.Encode("path", filePath),
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsHead(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files/{filePath}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetPropertiesFromComputeNodeSender sends the GetPropertiesFromComputeNode request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) GetPropertiesFromComputeNodeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetPropertiesFromComputeNodeResponder handles the response to the GetPropertiesFromComputeNode request. The method always
-// closes the http.Response Body.
-func (client FileClient) GetPropertiesFromComputeNodeResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// GetPropertiesFromTask gets the properties of the specified task file.
-//
-// jobID is the ID of the job that contains the task. taskID is the ID of the task whose file you want to get the
-// properties of. filePath is the path to the task file that you want to get the properties of. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client FileClient) GetPropertiesFromTask(ctx context.Context, jobID string, taskID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.GetPropertiesFromTaskPreparer(ctx, jobID, taskID, filePath, timeout, clientRequestID, returnClientRequestID, ocpDate, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromTask", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetPropertiesFromTaskSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromTask", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetPropertiesFromTaskResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "GetPropertiesFromTask", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPropertiesFromTaskPreparer prepares the GetPropertiesFromTask request.
-func (client FileClient) GetPropertiesFromTaskPreparer(ctx context.Context, jobID string, taskID string, filePath string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "filePath": autorest.Encode("path", filePath),
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsHead(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files/{filePath}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetPropertiesFromTaskSender sends the GetPropertiesFromTask request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) GetPropertiesFromTaskSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetPropertiesFromTaskResponder handles the response to the GetPropertiesFromTask request. The method always
-// closes the http.Response Body.
-func (client FileClient) GetPropertiesFromTaskResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// ListFromComputeNode sends the list from compute node request.
-//
-// poolID is the ID of the pool that contains the compute node. nodeID is the ID of the compute node whose files
-// you want to list. filter is an OData $filter clause. For more information on constructing this filter, see
-// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-compute-node-files. recursive
-// is whether to list children of a directory. maxResults is the maximum number of items to return in the response.
-// A maximum of 1000 files can be returned. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. Client libraries typically set this to the current system clock time; set it
-// explicitly if you are calling the REST API directly.
-func (client FileClient) ListFromComputeNode(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.FileClient", "ListFromComputeNode", err.Error())
- }
-
- result.fn = client.listFromComputeNodeNextResults
- req, err := client.ListFromComputeNodePreparer(ctx, poolID, nodeID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListFromComputeNodeSender(req)
- if err != nil {
- result.nflr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", resp, "Failure sending request")
- return
- }
-
- result.nflr, err = client.ListFromComputeNodeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromComputeNode", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListFromComputeNodePreparer prepares the ListFromComputeNode request.
-func (client FileClient) ListFromComputeNodePreparer(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nodeId": autorest.Encode("path", nodeID),
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if recursive != nil {
- queryParameters["recursive"] = autorest.Encode("query", *recursive)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/nodes/{nodeId}/files", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListFromComputeNodeSender sends the ListFromComputeNode request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) ListFromComputeNodeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListFromComputeNodeResponder handles the response to the ListFromComputeNode request. The method always
-// closes the http.Response Body.
-func (client FileClient) ListFromComputeNodeResponder(resp *http.Response) (result NodeFileListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listFromComputeNodeNextResults retrieves the next set of results, if any.
-func (client FileClient) listFromComputeNodeNextResults(lastResults NodeFileListResult) (result NodeFileListResult, err error) {
- req, err := lastResults.nodeFileListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListFromComputeNodeSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListFromComputeNodeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "listFromComputeNodeNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListFromComputeNodeComplete enumerates all values, automatically crossing page boundaries as required.
-func (client FileClient) ListFromComputeNodeComplete(ctx context.Context, poolID string, nodeID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultIterator, err error) {
- result.page, err = client.ListFromComputeNode(ctx, poolID, nodeID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// ListFromTask sends the list from task request.
-//
-// jobID is the ID of the job that contains the task. taskID is the ID of the task whose files you want to list.
-// filter is an OData $filter clause. For more information on constructing this filter, see
-// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-task-files. recursive is
-// whether to list children of the task directory. This parameter can be used in combination with the filter
-// parameter to list specific type of files. maxResults is the maximum number of items to return in the response. A
-// maximum of 1000 files can be returned. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. Client libraries typically set this to the current system clock time; set it
-// explicitly if you are calling the REST API directly.
-func (client FileClient) ListFromTask(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.FileClient", "ListFromTask", err.Error())
- }
-
- result.fn = client.listFromTaskNextResults
- req, err := client.ListFromTaskPreparer(ctx, jobID, taskID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListFromTaskSender(req)
- if err != nil {
- result.nflr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", resp, "Failure sending request")
- return
- }
-
- result.nflr, err = client.ListFromTaskResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "ListFromTask", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListFromTaskPreparer prepares the ListFromTask request.
-func (client FileClient) ListFromTaskPreparer(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if recursive != nil {
- queryParameters["recursive"] = autorest.Encode("query", *recursive)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/files", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListFromTaskSender sends the ListFromTask request. The method will close the
-// http.Response Body if it receives an error.
-func (client FileClient) ListFromTaskSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListFromTaskResponder handles the response to the ListFromTask request. The method always
-// closes the http.Response Body.
-func (client FileClient) ListFromTaskResponder(resp *http.Response) (result NodeFileListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listFromTaskNextResults retrieves the next set of results, if any.
-func (client FileClient) listFromTaskNextResults(lastResults NodeFileListResult) (result NodeFileListResult, err error) {
- req, err := lastResults.nodeFileListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListFromTaskSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListFromTaskResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.FileClient", "listFromTaskNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListFromTaskComplete enumerates all values, automatically crossing page boundaries as required.
-func (client FileClient) ListFromTaskComplete(ctx context.Context, jobID string, taskID string, filter string, recursive *bool, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result NodeFileListResultIterator, err error) {
- result.page, err = client.ListFromTask(ctx, jobID, taskID, filter, recursive, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
diff --git a/services/batch/2017-09-01.6.0/batch/job.go b/services/batch/2017-09-01.6.0/batch/job.go
deleted file mode 100644
index a1ce513e8337..000000000000
--- a/services/batch/2017-09-01.6.0/batch/job.go
+++ /dev/null
@@ -1,1660 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// JobClient is the a client for issuing REST requests to the Azure Batch service.
-type JobClient struct {
- BaseClient
-}
-
-// NewJobClient creates an instance of the JobClient client.
-func NewJobClient() JobClient {
- return NewJobClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewJobClientWithBaseURI creates an instance of the JobClient client.
-func NewJobClientWithBaseURI(baseURI string) JobClient {
- return JobClient{NewWithBaseURI(baseURI)}
-}
-
-// Add the Batch service supports two ways to control the work done as part of a job. In the first approach, the user
-// specifies a Job Manager task. The Batch service launches this task when it is ready to start the job. The Job
-// Manager task controls all other tasks that run under this job, by using the Task APIs. In the second approach, the
-// user directly controls the execution of tasks under an active job, by using the Task APIs. Also note: when naming
-// jobs, avoid including sensitive information such as user names or secret project names. This information may appear
-// in telemetry logs accessible to Microsoft Support engineers.
-//
-// job is the job to be added. timeout is the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a
-// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are
-// calling the REST API directly.
-func (client JobClient) Add(ctx context.Context, job JobAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: job,
- Constraints: []validation.Constraint{{Target: "job.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.JobManagerTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.JobManagerTask.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.JobManagerTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.JobManagerTask.ContainerSettings", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.JobManagerTask.ContainerSettings.ImageName", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.JobManagerTask.ContainerSettings.Registry", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.JobManagerTask.ContainerSettings.Registry.UserName", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.JobManagerTask.ContainerSettings.Registry.Password", Name: validation.Null, Rule: true, Chain: nil},
- }},
- }},
- }},
- {Target: "job.JobPreparationTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.JobPreparationTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.JobPreparationTask.ContainerSettings", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.JobPreparationTask.ContainerSettings.ImageName", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.JobPreparationTask.ContainerSettings.Registry", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.JobPreparationTask.ContainerSettings.Registry.UserName", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.JobPreparationTask.ContainerSettings.Registry.Password", Name: validation.Null, Rule: true, Chain: nil},
- }},
- }},
- }},
- {Target: "job.JobReleaseTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.JobReleaseTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.JobReleaseTask.ContainerSettings", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.JobReleaseTask.ContainerSettings.ImageName", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.JobReleaseTask.ContainerSettings.Registry", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.JobReleaseTask.ContainerSettings.Registry.UserName", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.JobReleaseTask.ContainerSettings.Registry.Password", Name: validation.Null, Rule: true, Chain: nil},
- }},
- }},
- }},
- {Target: "job.PoolInfo", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.VMSize", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ContainerConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ContainerConfiguration.Type", Name: validation.Null, Rule: true, Chain: nil}}},
- }},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration.EndpointConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration.EndpointConfiguration.InboundNATPools", Name: validation.Null, Rule: true, Chain: nil}}},
- }},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.StartTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings.ImageName", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings.Registry", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "job.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings.Registry.UserName", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "job.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings.Registry.Password", Name: validation.Null, Rule: true, Chain: nil},
- }},
- }},
- }},
- }},
- }},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobClient", "Add", err.Error())
- }
-
- req, err := client.AddPreparer(ctx, job, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Add", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPreparer prepares the Add request.
-func (client JobClient) AddPreparer(ctx context.Context, job JobAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/jobs"),
- autorest.WithJSON(job),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSender sends the Add request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) AddSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddResponder handles the response to the Add request. The method always
-// closes the http.Response Body.
-func (client JobClient) AddResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Delete deleting a job also deletes all tasks that are part of that job, and all job statistics. This also overrides
-// the retention period for task data; that is, if the job contains tasks which are still retained on compute nodes,
-// the Batch services deletes those tasks' working directories and all their contents. When a Delete Job request is
-// received, the Batch service sets the job to the deleting state. All update operations on a job that is in deleting
-// state will fail with status code 409 (Conflict), with additional information indicating that the job is being
-// deleted.
-//
-// jobID is the ID of the job to delete. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. Client libraries typically set this to the current system clock time; set it
-// explicitly if you are calling the REST API directly. ifMatch is an ETag value associated with the version of the
-// resource known to the client. The operation will be performed only if the resource's current ETag on the service
-// exactly matches the value specified by the client. ifNoneMatch is an ETag value associated with the version of
-// the resource known to the client. The operation will be performed only if the resource's current ETag on the
-// service does not match the value specified by the client. ifModifiedSince is a timestamp indicating the last
-// modified time of the resource known to the client. The operation will be performed only if the resource on the
-// service has been modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last
-// modified time of the resource known to the client. The operation will be performed only if the resource on the
-// service has not been modified since the specified time.
-func (client JobClient) Delete(ctx context.Context, jobID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeletePreparer(ctx, jobID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client JobClient) DeletePreparer(ctx context.Context, jobID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client JobClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Disable the Batch Service immediately moves the job to the disabling state. Batch then uses the disableTasks
-// parameter to determine what to do with the currently running tasks of the job. The job remains in the disabling
-// state until the disable operation is completed and all tasks have been dealt with according to the disableTasks
-// option; the job then moves to the disabled state. No new tasks are started under the job until it moves back to
-// active state. If you try to disable a job that is in any state other than active, disabling, or disabled, the
-// request fails with status code 409.
-//
-// jobID is the ID of the job to disable. jobDisableParameter is the parameters for the request. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client JobClient) Disable(ctx context.Context, jobID string, jobDisableParameter JobDisableParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DisablePreparer(ctx, jobID, jobDisableParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DisableSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", resp, "Failure sending request")
- return
- }
-
- result, err = client.DisableResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Disable", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DisablePreparer prepares the Disable request.
-func (client JobClient) DisablePreparer(ctx context.Context, jobID string, jobDisableParameter JobDisableParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/disable", pathParameters),
- autorest.WithJSON(jobDisableParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DisableSender sends the Disable request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) DisableSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DisableResponder handles the response to the Disable request. The method always
-// closes the http.Response Body.
-func (client JobClient) DisableResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Enable when you call this API, the Batch service sets a disabled job to the enabling state. After the this operation
-// is completed, the job moves to the active state, and scheduling of new tasks under the job resumes. The Batch
-// service does not allow a task to remain in the active state for more than 7 days. Therefore, if you enable a job
-// containing active tasks which were added more than 7 days ago, those tasks will not run.
-//
-// jobID is the ID of the job to enable. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. Client libraries typically set this to the current system clock time; set it
-// explicitly if you are calling the REST API directly. ifMatch is an ETag value associated with the version of the
-// resource known to the client. The operation will be performed only if the resource's current ETag on the service
-// exactly matches the value specified by the client. ifNoneMatch is an ETag value associated with the version of
-// the resource known to the client. The operation will be performed only if the resource's current ETag on the
-// service does not match the value specified by the client. ifModifiedSince is a timestamp indicating the last
-// modified time of the resource known to the client. The operation will be performed only if the resource on the
-// service has been modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last
-// modified time of the resource known to the client. The operation will be performed only if the resource on the
-// service has not been modified since the specified time.
-func (client JobClient) Enable(ctx context.Context, jobID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.EnablePreparer(ctx, jobID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.EnableSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", resp, "Failure sending request")
- return
- }
-
- result, err = client.EnableResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Enable", resp, "Failure responding to request")
- }
-
- return
-}
-
-// EnablePreparer prepares the Enable request.
-func (client JobClient) EnablePreparer(ctx context.Context, jobID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/enable", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// EnableSender sends the Enable request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) EnableSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// EnableResponder handles the response to the Enable request. The method always
-// closes the http.Response Body.
-func (client JobClient) EnableResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get sends the get request.
-//
-// jobID is the ID of the job. selectParameter is an OData $select clause. expand is an OData $expand clause.
-// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30
-// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such
-// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should
-// return the client-request-id in the response. ocpDate is the time the request was issued. Client libraries
-// typically set this to the current system clock time; set it explicitly if you are calling the REST API directly.
-// ifMatch is an ETag value associated with the version of the resource known to the client. The operation will be
-// performed only if the resource's current ETag on the service exactly matches the value specified by the client.
-// ifNoneMatch is an ETag value associated with the version of the resource known to the client. The operation will
-// be performed only if the resource's current ETag on the service does not match the value specified by the
-// client. ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client.
-// The operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client JobClient) Get(ctx context.Context, jobID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudJob, err error) {
- req, err := client.GetPreparer(ctx, jobID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client JobClient) GetPreparer(ctx context.Context, jobID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client JobClient) GetResponder(resp *http.Response) (result CloudJob, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetAllLifetimeStatistics statistics are aggregated across all jobs that have ever existed in the account, from
-// account creation to the last update time of the statistics.
-//
-// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30
-// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such
-// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should
-// return the client-request-id in the response. ocpDate is the time the request was issued. Client libraries
-// typically set this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client JobClient) GetAllLifetimeStatistics(ctx context.Context, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result JobStatistics, err error) {
- req, err := client.GetAllLifetimeStatisticsPreparer(ctx, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllLifetimeStatistics", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetAllLifetimeStatisticsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllLifetimeStatistics", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetAllLifetimeStatisticsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "GetAllLifetimeStatistics", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetAllLifetimeStatisticsPreparer prepares the GetAllLifetimeStatistics request.
-func (client JobClient) GetAllLifetimeStatisticsPreparer(ctx context.Context, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/lifetimejobstats"),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetAllLifetimeStatisticsSender sends the GetAllLifetimeStatistics request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) GetAllLifetimeStatisticsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetAllLifetimeStatisticsResponder handles the response to the GetAllLifetimeStatistics request. The method always
-// closes the http.Response Body.
-func (client JobClient) GetAllLifetimeStatisticsResponder(resp *http.Response) (result JobStatistics, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetTaskCounts task counts provide a count of the tasks by active, running or completed task state, and a count of
-// tasks which succeeded or failed. Tasks in the preparing state are counted as running. If the validationStatus is
-// unvalidated, then the Batch service has not been able to check state counts against the task states as reported in
-// the List Tasks API. The validationStatus may be unvalidated if the job contains more than 200,000 tasks.
-//
-// jobID is the ID of the job. timeout is the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a
-// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are
-// calling the REST API directly.
-func (client JobClient) GetTaskCounts(ctx context.Context, jobID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result TaskCounts, err error) {
- req, err := client.GetTaskCountsPreparer(ctx, jobID, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "GetTaskCounts", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetTaskCountsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobClient", "GetTaskCounts", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetTaskCountsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "GetTaskCounts", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetTaskCountsPreparer prepares the GetTaskCounts request.
-func (client JobClient) GetTaskCountsPreparer(ctx context.Context, jobID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/taskcounts", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetTaskCountsSender sends the GetTaskCounts request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) GetTaskCountsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetTaskCountsResponder handles the response to the GetTaskCounts request. The method always
-// closes the http.Response Body.
-func (client JobClient) GetTaskCountsResponder(resp *http.Response) (result TaskCounts, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List sends the list request.
-//
-// filter is an OData $filter clause. For more information on constructing this filter, see
-// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-jobs. selectParameter is an
-// OData $select clause. expand is an OData $expand clause. maxResults is the maximum number of items to return in
-// the response. A maximum of 1000 jobs can be returned. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client JobClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobClient", "List", err.Error())
- }
-
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.cjlr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobClient", "List", resp, "Failure sending request")
- return
- }
-
- result.cjlr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client JobClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/jobs"),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client JobClient) ListResponder(resp *http.Response) (result CloudJobListResult, 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 JobClient) listNextResults(lastResults CloudJobListResult) (result CloudJobListResult, err error) {
- req, err := lastResults.cloudJobListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.JobClient", "listNextResults", 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.JobClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client JobClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultIterator, err error) {
- result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// ListFromJobSchedule sends the list from job schedule request.
-//
-// jobScheduleID is the ID of the job schedule from which you want to get a list of jobs. filter is an OData
-// $filter clause. For more information on constructing this filter, see
-// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-jobs-in-a-job-schedule.
-// selectParameter is an OData $select clause. expand is an OData $expand clause. maxResults is the maximum number
-// of items to return in the response. A maximum of 1000 jobs can be returned. timeout is the maximum time that the
-// server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client JobClient) ListFromJobSchedule(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobClient", "ListFromJobSchedule", err.Error())
- }
-
- result.fn = client.listFromJobScheduleNextResults
- req, err := client.ListFromJobSchedulePreparer(ctx, jobScheduleID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListFromJobScheduleSender(req)
- if err != nil {
- result.cjlr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", resp, "Failure sending request")
- return
- }
-
- result.cjlr, err = client.ListFromJobScheduleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListFromJobSchedule", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListFromJobSchedulePreparer prepares the ListFromJobSchedule request.
-func (client JobClient) ListFromJobSchedulePreparer(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}/jobs", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListFromJobScheduleSender sends the ListFromJobSchedule request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) ListFromJobScheduleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListFromJobScheduleResponder handles the response to the ListFromJobSchedule request. The method always
-// closes the http.Response Body.
-func (client JobClient) ListFromJobScheduleResponder(resp *http.Response) (result CloudJobListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listFromJobScheduleNextResults retrieves the next set of results, if any.
-func (client JobClient) listFromJobScheduleNextResults(lastResults CloudJobListResult) (result CloudJobListResult, err error) {
- req, err := lastResults.cloudJobListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListFromJobScheduleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListFromJobScheduleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "listFromJobScheduleNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListFromJobScheduleComplete enumerates all values, automatically crossing page boundaries as required.
-func (client JobClient) ListFromJobScheduleComplete(ctx context.Context, jobScheduleID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListResultIterator, err error) {
- result.page, err = client.ListFromJobSchedule(ctx, jobScheduleID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// ListPreparationAndReleaseTaskStatus this API returns the Job Preparation and Job Release task status on all compute
-// nodes that have run the Job Preparation or Job Release task. This includes nodes which have since been removed from
-// the pool. If this API is invoked on a job which has no Job Preparation or Job Release task, the Batch service
-// returns HTTP status code 409 (Conflict) with an error code of JobPreparationTaskNotSpecified.
-//
-// jobID is the ID of the job. filter is an OData $filter clause. For more information on constructing this filter,
-// see
-// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-job-preparation-and-release-status.
-// selectParameter is an OData $select clause. maxResults is the maximum number of items to return in the response.
-// A maximum of 1000 tasks can be returned. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. Client libraries typically set this to the current system clock time; set it
-// explicitly if you are calling the REST API directly.
-func (client JobClient) ListPreparationAndReleaseTaskStatus(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListPreparationAndReleaseTaskStatusResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobClient", "ListPreparationAndReleaseTaskStatus", err.Error())
- }
-
- result.fn = client.listPreparationAndReleaseTaskStatusNextResults
- req, err := client.ListPreparationAndReleaseTaskStatusPreparer(ctx, jobID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListPreparationAndReleaseTaskStatusSender(req)
- if err != nil {
- result.cjlpartsr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", resp, "Failure sending request")
- return
- }
-
- result.cjlpartsr, err = client.ListPreparationAndReleaseTaskStatusResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "ListPreparationAndReleaseTaskStatus", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparationAndReleaseTaskStatusPreparer prepares the ListPreparationAndReleaseTaskStatus request.
-func (client JobClient) ListPreparationAndReleaseTaskStatusPreparer(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/jobpreparationandreleasetaskstatus", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListPreparationAndReleaseTaskStatusSender sends the ListPreparationAndReleaseTaskStatus request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) ListPreparationAndReleaseTaskStatusSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListPreparationAndReleaseTaskStatusResponder handles the response to the ListPreparationAndReleaseTaskStatus request. The method always
-// closes the http.Response Body.
-func (client JobClient) ListPreparationAndReleaseTaskStatusResponder(resp *http.Response) (result CloudJobListPreparationAndReleaseTaskStatusResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listPreparationAndReleaseTaskStatusNextResults retrieves the next set of results, if any.
-func (client JobClient) listPreparationAndReleaseTaskStatusNextResults(lastResults CloudJobListPreparationAndReleaseTaskStatusResult) (result CloudJobListPreparationAndReleaseTaskStatusResult, err error) {
- req, err := lastResults.cloudJobListPreparationAndReleaseTaskStatusResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListPreparationAndReleaseTaskStatusSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListPreparationAndReleaseTaskStatusResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "listPreparationAndReleaseTaskStatusNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListPreparationAndReleaseTaskStatusComplete enumerates all values, automatically crossing page boundaries as required.
-func (client JobClient) ListPreparationAndReleaseTaskStatusComplete(ctx context.Context, jobID string, filter string, selectParameter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobListPreparationAndReleaseTaskStatusResultIterator, err error) {
- result.page, err = client.ListPreparationAndReleaseTaskStatus(ctx, jobID, filter, selectParameter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// Patch this replaces only the job properties specified in the request. For example, if the job has constraints, and a
-// request does not specify the constraints element, then the job keeps the existing constraints.
-//
-// jobID is the ID of the job whose properties you want to update. jobPatchParameter is the parameters for the
-// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client
-// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API
-// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The
-// operation will be performed only if the resource's current ETag on the service exactly matches the value
-// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the
-// client. The operation will be performed only if the resource's current ETag on the service does not match the
-// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource
-// known to the client. The operation will be performed only if the resource on the service has been modified since
-// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to
-// the client. The operation will be performed only if the resource on the service has not been modified since the
-// specified time.
-func (client JobClient) Patch(ctx context.Context, jobID string, jobPatchParameter JobPatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.PatchPreparer(ctx, jobID, jobPatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.PatchSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", resp, "Failure sending request")
- return
- }
-
- result, err = client.PatchResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Patch", resp, "Failure responding to request")
- }
-
- return
-}
-
-// PatchPreparer prepares the Patch request.
-func (client JobClient) PatchPreparer(ctx context.Context, jobID string, jobPatchParameter JobPatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPatch(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}", pathParameters),
- autorest.WithJSON(jobPatchParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// PatchSender sends the Patch request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) PatchSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// PatchResponder handles the response to the Patch request. The method always
-// closes the http.Response Body.
-func (client JobClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Terminate when a Terminate Job request is received, the Batch service sets the job to the terminating state. The
-// Batch service then terminates any active or running tasks associated with the job, and runs any required Job Release
-// tasks. The job then moves into the completed state.
-//
-// jobID is the ID of the job to terminate. jobTerminateParameter is the parameters for the request. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client JobClient) Terminate(ctx context.Context, jobID string, jobTerminateParameter *JobTerminateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.TerminatePreparer(ctx, jobID, jobTerminateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.TerminateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", resp, "Failure sending request")
- return
- }
-
- result, err = client.TerminateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Terminate", resp, "Failure responding to request")
- }
-
- return
-}
-
-// TerminatePreparer prepares the Terminate request.
-func (client JobClient) TerminatePreparer(ctx context.Context, jobID string, jobTerminateParameter *JobTerminateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/terminate", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if jobTerminateParameter != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(jobTerminateParameter))
- }
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// TerminateSender sends the Terminate request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) TerminateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// TerminateResponder handles the response to the Terminate request. The method always
-// closes the http.Response Body.
-func (client JobClient) TerminateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Update this fully replaces all the updateable properties of the job. For example, if the job has constraints
-// associated with it and if constraints is not specified with this request, then the Batch service will remove the
-// existing constraints.
-//
-// jobID is the ID of the job whose properties you want to update. jobUpdateParameter is the parameters for the
-// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client
-// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API
-// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The
-// operation will be performed only if the resource's current ETag on the service exactly matches the value
-// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the
-// client. The operation will be performed only if the resource's current ETag on the service does not match the
-// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource
-// known to the client. The operation will be performed only if the resource on the service has been modified since
-// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to
-// the client. The operation will be performed only if the resource on the service has not been modified since the
-// specified time.
-func (client JobClient) Update(ctx context.Context, jobID string, jobUpdateParameter JobUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: jobUpdateParameter,
- Constraints: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VMSize", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ContainerConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ContainerConfiguration.Type", Name: validation.Null, Rule: true, Chain: nil}}},
- }},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration.EndpointConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration.EndpointConfiguration.InboundNATPools", Name: validation.Null, Rule: true, Chain: nil}}},
- }},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.StartTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings.ImageName", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings.Registry", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings.Registry.UserName", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobUpdateParameter.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings.Registry.Password", Name: validation.Null, Rule: true, Chain: nil},
- }},
- }},
- }},
- }},
- }},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobClient", "Update", err.Error())
- }
-
- req, err := client.UpdatePreparer(ctx, jobID, jobUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobClient", "Update", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePreparer prepares the Update request.
-func (client JobClient) UpdatePreparer(ctx context.Context, jobID string, jobUpdateParameter JobUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}", pathParameters),
- autorest.WithJSON(jobUpdateParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSender sends the Update request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobClient) UpdateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateResponder handles the response to the Update request. The method always
-// closes the http.Response Body.
-func (client JobClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff --git a/services/batch/2017-09-01.6.0/batch/jobschedule.go b/services/batch/2017-09-01.6.0/batch/jobschedule.go
deleted file mode 100644
index f6e83fb3368f..000000000000
--- a/services/batch/2017-09-01.6.0/batch/jobschedule.go
+++ /dev/null
@@ -1,1324 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// JobScheduleClient is the a client for issuing REST requests to the Azure Batch service.
-type JobScheduleClient struct {
- BaseClient
-}
-
-// NewJobScheduleClient creates an instance of the JobScheduleClient client.
-func NewJobScheduleClient() JobScheduleClient {
- return NewJobScheduleClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewJobScheduleClientWithBaseURI creates an instance of the JobScheduleClient client.
-func NewJobScheduleClientWithBaseURI(baseURI string) JobScheduleClient {
- return JobScheduleClient{NewWithBaseURI(baseURI)}
-}
-
-// Add sends the add request.
-//
-// cloudJobSchedule is the job schedule to be added. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client JobScheduleClient) Add(ctx context.Context, cloudJobSchedule JobScheduleAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: cloudJobSchedule,
- Constraints: []validation.Constraint{{Target: "cloudJobSchedule.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.Schedule", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobManagerTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobManagerTask.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification.JobManagerTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification.JobManagerTask.ContainerSettings", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobManagerTask.ContainerSettings.ImageName", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification.JobManagerTask.ContainerSettings.Registry", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobManagerTask.ContainerSettings.Registry.UserName", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification.JobManagerTask.ContainerSettings.Registry.Password", Name: validation.Null, Rule: true, Chain: nil},
- }},
- }},
- }},
- {Target: "cloudJobSchedule.JobSpecification.JobPreparationTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobPreparationTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification.JobPreparationTask.ContainerSettings", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobPreparationTask.ContainerSettings.ImageName", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification.JobPreparationTask.ContainerSettings.Registry", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobPreparationTask.ContainerSettings.Registry.UserName", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification.JobPreparationTask.ContainerSettings.Registry.Password", Name: validation.Null, Rule: true, Chain: nil},
- }},
- }},
- }},
- {Target: "cloudJobSchedule.JobSpecification.JobReleaseTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobReleaseTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification.JobReleaseTask.ContainerSettings", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobReleaseTask.ContainerSettings.ImageName", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification.JobReleaseTask.ContainerSettings.Registry", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.JobReleaseTask.ContainerSettings.Registry.UserName", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification.JobReleaseTask.ContainerSettings.Registry.Password", Name: validation.Null, Rule: true, Chain: nil},
- }},
- }},
- }},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VMSize", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ContainerConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ContainerConfiguration.Type", Name: validation.Null, Rule: true, Chain: nil}}},
- }},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration.EndpointConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration.EndpointConfiguration.InboundNATPools", Name: validation.Null, Rule: true, Chain: nil}}},
- }},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings.ImageName", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings.Registry", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings.Registry.UserName", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "cloudJobSchedule.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings.Registry.Password", Name: validation.Null, Rule: true, Chain: nil},
- }},
- }},
- }},
- }},
- }},
- }},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobScheduleClient", "Add", err.Error())
- }
-
- req, err := client.AddPreparer(ctx, cloudJobSchedule, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Add", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPreparer prepares the Add request.
-func (client JobScheduleClient) AddPreparer(ctx context.Context, cloudJobSchedule JobScheduleAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/jobschedules"),
- autorest.WithJSON(cloudJobSchedule),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSender sends the Add request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) AddSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddResponder handles the response to the Add request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) AddResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Delete when you delete a job schedule, this also deletes all jobs and tasks under that schedule. When tasks are
-// deleted, all the files in their working directories on the compute nodes are also deleted (the retention period is
-// ignored). The job schedule statistics are no longer accessible once the job schedule is deleted, though they are
-// still counted towards account lifetime statistics.
-//
-// jobScheduleID is the ID of the job schedule to delete. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client JobScheduleClient) Delete(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeletePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client JobScheduleClient) DeletePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Disable no new jobs will be created until the job schedule is enabled again.
-//
-// jobScheduleID is the ID of the job schedule to disable. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client JobScheduleClient) Disable(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DisablePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DisableSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", resp, "Failure sending request")
- return
- }
-
- result, err = client.DisableResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Disable", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DisablePreparer prepares the Disable request.
-func (client JobScheduleClient) DisablePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}/disable", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DisableSender sends the Disable request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) DisableSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DisableResponder handles the response to the Disable request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) DisableResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Enable sends the enable request.
-//
-// jobScheduleID is the ID of the job schedule to enable. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client JobScheduleClient) Enable(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.EnablePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.EnableSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", resp, "Failure sending request")
- return
- }
-
- result, err = client.EnableResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Enable", resp, "Failure responding to request")
- }
-
- return
-}
-
-// EnablePreparer prepares the Enable request.
-func (client JobScheduleClient) EnablePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}/enable", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// EnableSender sends the Enable request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) EnableSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// EnableResponder handles the response to the Enable request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) EnableResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Exists sends the exists request.
-//
-// jobScheduleID is the ID of the job schedule which you want to check. timeout is the maximum time that the server
-// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated
-// request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client JobScheduleClient) Exists(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.ExistsPreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ExistsSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", resp, "Failure sending request")
- return
- }
-
- result, err = client.ExistsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Exists", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ExistsPreparer prepares the Exists request.
-func (client JobScheduleClient) ExistsPreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsHead(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ExistsSender sends the Exists request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) ExistsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ExistsResponder handles the response to the Exists request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) ExistsResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get gets information about the specified job schedule.
-//
-// jobScheduleID is the ID of the job schedule to get. selectParameter is an OData $select clause. expand is an
-// OData $expand clause. timeout is the maximum time that the server can spend processing the request, in seconds.
-// The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with
-// no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether
-// the server should return the client-request-id in the response. ocpDate is the time the request was issued.
-// Client libraries typically set this to the current system clock time; set it explicitly if you are calling the
-// REST API directly. ifMatch is an ETag value associated with the version of the resource known to the client. The
-// operation will be performed only if the resource's current ETag on the service exactly matches the value
-// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the
-// client. The operation will be performed only if the resource's current ETag on the service does not match the
-// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource
-// known to the client. The operation will be performed only if the resource on the service has been modified since
-// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to
-// the client. The operation will be performed only if the resource on the service has not been modified since the
-// specified time.
-func (client JobScheduleClient) Get(ctx context.Context, jobScheduleID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudJobSchedule, err error) {
- req, err := client.GetPreparer(ctx, jobScheduleID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client JobScheduleClient) GetPreparer(ctx context.Context, jobScheduleID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) GetResponder(resp *http.Response) (result CloudJobSchedule, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List sends the list request.
-//
-// filter is an OData $filter clause. For more information on constructing this filter, see
-// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-job-schedules.
-// selectParameter is an OData $select clause. expand is an OData $expand clause. maxResults is the maximum number
-// of items to return in the response. A maximum of 1000 job schedules can be returned. timeout is the maximum time
-// that the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client JobScheduleClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobScheduleListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobScheduleClient", "List", err.Error())
- }
-
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.cjslr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", resp, "Failure sending request")
- return
- }
-
- result.cjslr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client JobScheduleClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/jobschedules"),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) ListResponder(resp *http.Response) (result CloudJobScheduleListResult, 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 JobScheduleClient) listNextResults(lastResults CloudJobScheduleListResult) (result CloudJobScheduleListResult, err error) {
- req, err := lastResults.cloudJobScheduleListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.JobScheduleClient", "listNextResults", 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.JobScheduleClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client JobScheduleClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudJobScheduleListResultIterator, err error) {
- result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// Patch this replaces only the job schedule properties specified in the request. For example, if the schedule property
-// is not specified with this request, then the Batch service will keep the existing schedule. Changes to a job
-// schedule only impact jobs created by the schedule after the update has taken place; currently running jobs are
-// unaffected.
-//
-// jobScheduleID is the ID of the job schedule to update. jobSchedulePatchParameter is the parameters for the
-// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client
-// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API
-// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The
-// operation will be performed only if the resource's current ETag on the service exactly matches the value
-// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the
-// client. The operation will be performed only if the resource's current ETag on the service does not match the
-// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource
-// known to the client. The operation will be performed only if the resource on the service has been modified since
-// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to
-// the client. The operation will be performed only if the resource on the service has not been modified since the
-// specified time.
-func (client JobScheduleClient) Patch(ctx context.Context, jobScheduleID string, jobSchedulePatchParameter JobSchedulePatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.PatchPreparer(ctx, jobScheduleID, jobSchedulePatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.PatchSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", resp, "Failure sending request")
- return
- }
-
- result, err = client.PatchResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Patch", resp, "Failure responding to request")
- }
-
- return
-}
-
-// PatchPreparer prepares the Patch request.
-func (client JobScheduleClient) PatchPreparer(ctx context.Context, jobScheduleID string, jobSchedulePatchParameter JobSchedulePatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPatch(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters),
- autorest.WithJSON(jobSchedulePatchParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// PatchSender sends the Patch request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) PatchSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// PatchResponder handles the response to the Patch request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Terminate sends the terminate request.
-//
-// jobScheduleID is the ID of the job schedule to terminates. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client JobScheduleClient) Terminate(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.TerminatePreparer(ctx, jobScheduleID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.TerminateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", resp, "Failure sending request")
- return
- }
-
- result, err = client.TerminateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Terminate", resp, "Failure responding to request")
- }
-
- return
-}
-
-// TerminatePreparer prepares the Terminate request.
-func (client JobScheduleClient) TerminatePreparer(ctx context.Context, jobScheduleID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}/terminate", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// TerminateSender sends the Terminate request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) TerminateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// TerminateResponder handles the response to the Terminate request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) TerminateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Update this fully replaces all the updateable properties of the job schedule. For example, if the schedule property
-// is not specified with this request, then the Batch service will remove the existing schedule. Changes to a job
-// schedule only impact jobs created by the schedule after the update has taken place; currently running jobs are
-// unaffected.
-//
-// jobScheduleID is the ID of the job schedule to update. jobScheduleUpdateParameter is the parameters for the
-// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client
-// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API
-// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The
-// operation will be performed only if the resource's current ETag on the service exactly matches the value
-// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the
-// client. The operation will be performed only if the resource's current ETag on the service does not match the
-// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource
-// known to the client. The operation will be performed only if the resource on the service has been modified since
-// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to
-// the client. The operation will be performed only if the resource on the service has not been modified since the
-// specified time.
-func (client JobScheduleClient) Update(ctx context.Context, jobScheduleID string, jobScheduleUpdateParameter JobScheduleUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: jobScheduleUpdateParameter,
- Constraints: []validation.Constraint{{Target: "jobScheduleUpdateParameter.Schedule", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask.ContainerSettings", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask.ContainerSettings.ImageName", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask.ContainerSettings.Registry", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask.ContainerSettings.Registry.UserName", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification.JobManagerTask.ContainerSettings.Registry.Password", Name: validation.Null, Rule: true, Chain: nil},
- }},
- }},
- }},
- {Target: "jobScheduleUpdateParameter.JobSpecification.JobPreparationTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobPreparationTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification.JobPreparationTask.ContainerSettings", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobPreparationTask.ContainerSettings.ImageName", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification.JobPreparationTask.ContainerSettings.Registry", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobPreparationTask.ContainerSettings.Registry.UserName", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification.JobPreparationTask.ContainerSettings.Registry.Password", Name: validation.Null, Rule: true, Chain: nil},
- }},
- }},
- }},
- {Target: "jobScheduleUpdateParameter.JobSpecification.JobReleaseTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobReleaseTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification.JobReleaseTask.ContainerSettings", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobReleaseTask.ContainerSettings.ImageName", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification.JobReleaseTask.ContainerSettings.Registry", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.JobReleaseTask.ContainerSettings.Registry.UserName", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification.JobReleaseTask.ContainerSettings.Registry.Password", Name: validation.Null, Rule: true, Chain: nil},
- }},
- }},
- }},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VMSize", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ContainerConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.VirtualMachineConfiguration.ContainerConfiguration.Type", Name: validation.Null, Rule: true, Chain: nil}}},
- }},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration.EndpointConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.NetworkConfiguration.EndpointConfiguration.InboundNATPools", Name: validation.Null, Rule: true, Chain: nil}}},
- }},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings.ImageName", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings.Registry", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings.Registry.UserName", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "jobScheduleUpdateParameter.JobSpecification.PoolInfo.AutoPoolSpecification.Pool.StartTask.ContainerSettings.Registry.Password", Name: validation.Null, Rule: true, Chain: nil},
- }},
- }},
- }},
- }},
- }},
- }},
- }}}}}); err != nil {
- return result, validation.NewError("batch.JobScheduleClient", "Update", err.Error())
- }
-
- req, err := client.UpdatePreparer(ctx, jobScheduleID, jobScheduleUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.JobScheduleClient", "Update", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePreparer prepares the Update request.
-func (client JobScheduleClient) UpdatePreparer(ctx context.Context, jobScheduleID string, jobScheduleUpdateParameter JobScheduleUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobScheduleId": autorest.Encode("path", jobScheduleID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobschedules/{jobScheduleId}", pathParameters),
- autorest.WithJSON(jobScheduleUpdateParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSender sends the Update request. The method will close the
-// http.Response Body if it receives an error.
-func (client JobScheduleClient) UpdateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateResponder handles the response to the Update request. The method always
-// closes the http.Response Body.
-func (client JobScheduleClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff --git a/services/batch/2017-09-01.6.0/batch/models.go b/services/batch/2017-09-01.6.0/batch/models.go
deleted file mode 100644
index d75557cf0e08..000000000000
--- a/services/batch/2017-09-01.6.0/batch/models.go
+++ /dev/null
@@ -1,3418 +0,0 @@
-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/date"
- "github.com/Azure/go-autorest/autorest/to"
- "io"
- "net/http"
-)
-
-// AccessScope enumerates the values for access scope.
-type AccessScope string
-
-const (
- // Job Grants access to perform all operations on the job containing the task.
- Job AccessScope = "job"
-)
-
-// PossibleAccessScopeValues returns an array of possible values for the AccessScope const type.
-func PossibleAccessScopeValues() []AccessScope {
- return []AccessScope{Job}
-}
-
-// AllocationState enumerates the values for allocation state.
-type AllocationState string
-
-const (
- // Resizing The pool is resizing; that is, compute nodes are being added to or removed from the pool.
- Resizing AllocationState = "resizing"
- // Steady The pool is not resizing. There are no changes to the number of nodes in the pool in progress. A
- // pool enters this state when it is created and when no operations are being performed on the pool to
- // change the number of nodes.
- Steady AllocationState = "steady"
- // Stopping The pool was resizing, but the user has requested that the resize be stopped, but the stop
- // request has not yet been completed.
- Stopping AllocationState = "stopping"
-)
-
-// PossibleAllocationStateValues returns an array of possible values for the AllocationState const type.
-func PossibleAllocationStateValues() []AllocationState {
- return []AllocationState{Resizing, Steady, Stopping}
-}
-
-// AutoUserScope enumerates the values for auto user scope.
-type AutoUserScope string
-
-const (
- // Pool Specifies that the task runs as the common auto user account which is created on every node in a
- // pool.
- Pool AutoUserScope = "pool"
- // Task Specifies that the service should create a new user for the task.
- Task AutoUserScope = "task"
-)
-
-// PossibleAutoUserScopeValues returns an array of possible values for the AutoUserScope const type.
-func PossibleAutoUserScopeValues() []AutoUserScope {
- return []AutoUserScope{Pool, Task}
-}
-
-// CachingType enumerates the values for caching type.
-type CachingType string
-
-const (
- // None The caching mode for the disk is not enabled.
- None CachingType = "none"
- // ReadOnly The caching mode for the disk is read only.
- ReadOnly CachingType = "readonly"
- // ReadWrite The caching mode for the disk is read and write.
- ReadWrite CachingType = "readwrite"
-)
-
-// PossibleCachingTypeValues returns an array of possible values for the CachingType const type.
-func PossibleCachingTypeValues() []CachingType {
- return []CachingType{None, ReadOnly, ReadWrite}
-}
-
-// CertificateFormat enumerates the values for certificate format.
-type CertificateFormat string
-
-const (
- // Cer The certificate is a base64-encoded X.509 certificate.
- Cer CertificateFormat = "cer"
- // Pfx The certificate is a PFX (PKCS#12) formatted certificate or certificate chain.
- Pfx CertificateFormat = "pfx"
-)
-
-// PossibleCertificateFormatValues returns an array of possible values for the CertificateFormat const type.
-func PossibleCertificateFormatValues() []CertificateFormat {
- return []CertificateFormat{Cer, Pfx}
-}
-
-// CertificateState enumerates the values for certificate state.
-type CertificateState string
-
-const (
- // Active The certificate is available for use in pools.
- Active CertificateState = "active"
- // DeleteFailed The user requested that the certificate be deleted, but there are pools that still have
- // references to the certificate, or it is still installed on one or more compute nodes. (The latter can
- // occur if the certificate has been removed from the pool, but the node has not yet restarted. Nodes
- // refresh their certificates only when they restart.) You may use the cancel certificate delete operation
- // to cancel the delete, or the delete certificate operation to retry the delete.
- DeleteFailed CertificateState = "deletefailed"
- // Deleting The user has requested that the certificate be deleted, but the delete operation has not yet
- // completed. You may not reference the certificate when creating or updating pools.
- Deleting CertificateState = "deleting"
-)
-
-// PossibleCertificateStateValues returns an array of possible values for the CertificateState const type.
-func PossibleCertificateStateValues() []CertificateState {
- return []CertificateState{Active, DeleteFailed, Deleting}
-}
-
-// CertificateStoreLocation enumerates the values for certificate store location.
-type CertificateStoreLocation string
-
-const (
- // CurrentUser Certificates should be installed to the CurrentUser certificate store.
- CurrentUser CertificateStoreLocation = "currentuser"
- // LocalMachine Certificates should be installed to the LocalMachine certificate store.
- LocalMachine CertificateStoreLocation = "localmachine"
-)
-
-// PossibleCertificateStoreLocationValues returns an array of possible values for the CertificateStoreLocation const type.
-func PossibleCertificateStoreLocationValues() []CertificateStoreLocation {
- return []CertificateStoreLocation{CurrentUser, LocalMachine}
-}
-
-// CertificateVisibility enumerates the values for certificate visibility.
-type CertificateVisibility string
-
-const (
- // CertificateVisibilityRemoteUser The certificate should be visibile to the user accounts under which
- // users remotely access the node.
- CertificateVisibilityRemoteUser CertificateVisibility = "remoteuser"
- // CertificateVisibilityStartTask The certificate should be visible to the user account under which the
- // start task is run.
- CertificateVisibilityStartTask CertificateVisibility = "starttask"
- // CertificateVisibilityTask The certificate should be visibile to the user accounts under which job tasks
- // are run.
- CertificateVisibilityTask CertificateVisibility = "task"
-)
-
-// PossibleCertificateVisibilityValues returns an array of possible values for the CertificateVisibility const type.
-func PossibleCertificateVisibilityValues() []CertificateVisibility {
- return []CertificateVisibility{CertificateVisibilityRemoteUser, CertificateVisibilityStartTask, CertificateVisibilityTask}
-}
-
-// ComputeNodeDeallocationOption enumerates the values for compute node deallocation option.
-type ComputeNodeDeallocationOption string
-
-const (
- // Requeue Terminate running task processes and requeue the tasks. The tasks will run again when a node is
- // available. Remove nodes as soon as tasks have been terminated.
- Requeue ComputeNodeDeallocationOption = "requeue"
- // RetainedData Allow currently running tasks to complete, then wait for all task data retention periods to
- // expire. Schedule no new tasks while waiting. Remove nodes when all task retention periods have expired.
- RetainedData ComputeNodeDeallocationOption = "retaineddata"
- // TaskCompletion Allow currently running tasks to complete. Schedule no new tasks while waiting. Remove
- // nodes when all tasks have completed.
- TaskCompletion ComputeNodeDeallocationOption = "taskcompletion"
- // Terminate Terminate running tasks. The tasks will be completed with failureInfo indicating that they
- // were terminated, and will not run again. Remove nodes as soon as tasks have been terminated.
- Terminate ComputeNodeDeallocationOption = "terminate"
-)
-
-// PossibleComputeNodeDeallocationOptionValues returns an array of possible values for the ComputeNodeDeallocationOption const type.
-func PossibleComputeNodeDeallocationOptionValues() []ComputeNodeDeallocationOption {
- return []ComputeNodeDeallocationOption{Requeue, RetainedData, TaskCompletion, Terminate}
-}
-
-// ComputeNodeFillType enumerates the values for compute node fill type.
-type ComputeNodeFillType string
-
-const (
- // Pack As many tasks as possible (maxTasksPerNode) should be assigned to each node in the pool before any
- // tasks are assigned to the next node in the pool.
- Pack ComputeNodeFillType = "pack"
- // Spread Tasks should be assigned evenly across all nodes in the pool.
- Spread ComputeNodeFillType = "spread"
-)
-
-// PossibleComputeNodeFillTypeValues returns an array of possible values for the ComputeNodeFillType const type.
-func PossibleComputeNodeFillTypeValues() []ComputeNodeFillType {
- return []ComputeNodeFillType{Pack, Spread}
-}
-
-// ComputeNodeRebootOption enumerates the values for compute node reboot option.
-type ComputeNodeRebootOption string
-
-const (
- // ComputeNodeRebootOptionRequeue Terminate running task processes and requeue the tasks. The tasks will
- // run again when a node is available. Restart the node as soon as tasks have been terminated.
- ComputeNodeRebootOptionRequeue ComputeNodeRebootOption = "requeue"
- // ComputeNodeRebootOptionRetainedData Allow currently running tasks to complete, then wait for all task
- // data retention periods to expire. Schedule no new tasks while waiting. Restart the node when all task
- // retention periods have expired.
- ComputeNodeRebootOptionRetainedData ComputeNodeRebootOption = "retaineddata"
- // ComputeNodeRebootOptionTaskCompletion Allow currently running tasks to complete. Schedule no new tasks
- // while waiting. Restart the node when all tasks have completed.
- ComputeNodeRebootOptionTaskCompletion ComputeNodeRebootOption = "taskcompletion"
- // ComputeNodeRebootOptionTerminate Terminate running tasks. The tasks will be completed with failureInfo
- // indicating that they were terminated, and will not run again. Restart the node as soon as tasks have
- // been terminated.
- ComputeNodeRebootOptionTerminate ComputeNodeRebootOption = "terminate"
-)
-
-// PossibleComputeNodeRebootOptionValues returns an array of possible values for the ComputeNodeRebootOption const type.
-func PossibleComputeNodeRebootOptionValues() []ComputeNodeRebootOption {
- return []ComputeNodeRebootOption{ComputeNodeRebootOptionRequeue, ComputeNodeRebootOptionRetainedData, ComputeNodeRebootOptionTaskCompletion, ComputeNodeRebootOptionTerminate}
-}
-
-// ComputeNodeReimageOption enumerates the values for compute node reimage option.
-type ComputeNodeReimageOption string
-
-const (
- // ComputeNodeReimageOptionRequeue Terminate running task processes and requeue the tasks. The tasks will
- // run again when a node is available. Reimage the node as soon as tasks have been terminated.
- ComputeNodeReimageOptionRequeue ComputeNodeReimageOption = "requeue"
- // ComputeNodeReimageOptionRetainedData Allow currently running tasks to complete, then wait for all task
- // data retention periods to expire. Schedule no new tasks while waiting. Reimage the node when all task
- // retention periods have expired.
- ComputeNodeReimageOptionRetainedData ComputeNodeReimageOption = "retaineddata"
- // ComputeNodeReimageOptionTaskCompletion Allow currently running tasks to complete. Schedule no new tasks
- // while waiting. Reimage the node when all tasks have completed.
- ComputeNodeReimageOptionTaskCompletion ComputeNodeReimageOption = "taskcompletion"
- // ComputeNodeReimageOptionTerminate Terminate running tasks. The tasks will be completed with failureInfo
- // indicating that they were terminated, and will not run again. Reimage the node as soon as tasks have
- // been terminated.
- ComputeNodeReimageOptionTerminate ComputeNodeReimageOption = "terminate"
-)
-
-// PossibleComputeNodeReimageOptionValues returns an array of possible values for the ComputeNodeReimageOption const type.
-func PossibleComputeNodeReimageOptionValues() []ComputeNodeReimageOption {
- return []ComputeNodeReimageOption{ComputeNodeReimageOptionRequeue, ComputeNodeReimageOptionRetainedData, ComputeNodeReimageOptionTaskCompletion, ComputeNodeReimageOptionTerminate}
-}
-
-// ComputeNodeState enumerates the values for compute node state.
-type ComputeNodeState string
-
-const (
- // Creating The Batch service has obtained the underlying virtual machine from Azure Compute, but it has
- // not yet started to join the pool.
- Creating ComputeNodeState = "creating"
- // Idle The node is not currently running a task.
- Idle ComputeNodeState = "idle"
- // LeavingPool The node is leaving the pool, either because the user explicitly removed it or because the
- // pool is resizing or autoscaling down.
- LeavingPool ComputeNodeState = "leavingpool"
- // Offline The node is not currently running a task, and scheduling of new tasks to the node is disabled.
- Offline ComputeNodeState = "offline"
- // Preempted The low-priority node has been preempted. Tasks which were running on the node when it was
- // pre-empted will be rescheduled when another node becomes available.
- Preempted ComputeNodeState = "preempted"
- // Rebooting The node is rebooting.
- Rebooting ComputeNodeState = "rebooting"
- // Reimaging The node is reimaging.
- Reimaging ComputeNodeState = "reimaging"
- // Running The node is running one or more tasks (other than a start task).
- Running ComputeNodeState = "running"
- // Starting The Batch service is starting on the underlying virtual machine.
- Starting ComputeNodeState = "starting"
- // StartTaskFailed The start task has failed on the compute node (and exhausted all retries), and
- // waitForSuccess is set. The node is not usable for running tasks.
- StartTaskFailed ComputeNodeState = "starttaskfailed"
- // Unknown The Batch service has lost contact with the node, and does not know its true state.
- Unknown ComputeNodeState = "unknown"
- // Unusable The node cannot be used for task execution due to errors.
- Unusable ComputeNodeState = "unusable"
- // WaitingForStartTask The start task has started running on the compute node, but waitForSuccess is set
- // and the start task has not yet completed.
- WaitingForStartTask ComputeNodeState = "waitingforstarttask"
-)
-
-// PossibleComputeNodeStateValues returns an array of possible values for the ComputeNodeState const type.
-func PossibleComputeNodeStateValues() []ComputeNodeState {
- return []ComputeNodeState{Creating, Idle, LeavingPool, Offline, Preempted, Rebooting, Reimaging, Running, Starting, StartTaskFailed, Unknown, Unusable, WaitingForStartTask}
-}
-
-// DependencyAction enumerates the values for dependency action.
-type DependencyAction string
-
-const (
- // Block Block the task's dependencies.
- Block DependencyAction = "block"
- // Satisfy Satisfy the task's dependencies.
- Satisfy DependencyAction = "satisfy"
-)
-
-// PossibleDependencyActionValues returns an array of possible values for the DependencyAction const type.
-func PossibleDependencyActionValues() []DependencyAction {
- return []DependencyAction{Block, Satisfy}
-}
-
-// DisableComputeNodeSchedulingOption enumerates the values for disable compute node scheduling option.
-type DisableComputeNodeSchedulingOption string
-
-const (
- // DisableComputeNodeSchedulingOptionRequeue Terminate running task processes and requeue the tasks. The
- // tasks may run again on other compute nodes, or when task scheduling is re-enabled on this node. Enter
- // offline state as soon as tasks have been terminated.
- DisableComputeNodeSchedulingOptionRequeue DisableComputeNodeSchedulingOption = "requeue"
- // DisableComputeNodeSchedulingOptionTaskCompletion Allow currently running tasks to complete. Schedule no
- // new tasks while waiting. Enter offline state when all tasks have completed.
- DisableComputeNodeSchedulingOptionTaskCompletion DisableComputeNodeSchedulingOption = "taskcompletion"
- // DisableComputeNodeSchedulingOptionTerminate Terminate running tasks. The tasks will be completed with
- // failureInfo indicating that they were terminated, and will not run again. Enter offline state as soon as
- // tasks have been terminated.
- DisableComputeNodeSchedulingOptionTerminate DisableComputeNodeSchedulingOption = "terminate"
-)
-
-// PossibleDisableComputeNodeSchedulingOptionValues returns an array of possible values for the DisableComputeNodeSchedulingOption const type.
-func PossibleDisableComputeNodeSchedulingOptionValues() []DisableComputeNodeSchedulingOption {
- return []DisableComputeNodeSchedulingOption{DisableComputeNodeSchedulingOptionRequeue, DisableComputeNodeSchedulingOptionTaskCompletion, DisableComputeNodeSchedulingOptionTerminate}
-}
-
-// DisableJobOption enumerates the values for disable job option.
-type DisableJobOption string
-
-const (
- // DisableJobOptionRequeue Terminate running tasks and requeue them. The tasks will run again when the job
- // is enabled.
- DisableJobOptionRequeue DisableJobOption = "requeue"
- // DisableJobOptionTerminate Terminate running tasks. The tasks will be completed with failureInfo
- // indicating that they were terminated, and will not run again.
- DisableJobOptionTerminate DisableJobOption = "terminate"
- // DisableJobOptionWait Allow currently running tasks to complete.
- DisableJobOptionWait DisableJobOption = "wait"
-)
-
-// PossibleDisableJobOptionValues returns an array of possible values for the DisableJobOption const type.
-func PossibleDisableJobOptionValues() []DisableJobOption {
- return []DisableJobOption{DisableJobOptionRequeue, DisableJobOptionTerminate, DisableJobOptionWait}
-}
-
-// ElevationLevel enumerates the values for elevation level.
-type ElevationLevel string
-
-const (
- // Admin The user is a user with elevated access and operates with full Administrator permissions.
- Admin ElevationLevel = "admin"
- // NonAdmin The user is a standard user without elevated access.
- NonAdmin ElevationLevel = "nonadmin"
-)
-
-// PossibleElevationLevelValues returns an array of possible values for the ElevationLevel const type.
-func PossibleElevationLevelValues() []ElevationLevel {
- return []ElevationLevel{Admin, NonAdmin}
-}
-
-// ErrorCategory enumerates the values for error category.
-type ErrorCategory string
-
-const (
- // ServerError The error is due to an internal server issue.
- ServerError ErrorCategory = "servererror"
- // UserError The error is due to a user issue, such as misconfiguration.
- UserError ErrorCategory = "usererror"
-)
-
-// PossibleErrorCategoryValues returns an array of possible values for the ErrorCategory const type.
-func PossibleErrorCategoryValues() []ErrorCategory {
- return []ErrorCategory{ServerError, UserError}
-}
-
-// InboundEndpointProtocol enumerates the values for inbound endpoint protocol.
-type InboundEndpointProtocol string
-
-const (
- // TCP Use TCP for the endpoint.
- TCP InboundEndpointProtocol = "tcp"
- // UDP Use UDP for the endpoint.
- UDP InboundEndpointProtocol = "udp"
-)
-
-// PossibleInboundEndpointProtocolValues returns an array of possible values for the InboundEndpointProtocol const type.
-func PossibleInboundEndpointProtocolValues() []InboundEndpointProtocol {
- return []InboundEndpointProtocol{TCP, UDP}
-}
-
-// JobAction enumerates the values for job action.
-type JobAction string
-
-const (
- // JobActionDisable Disable the job. This is equivalent to calling the disable job API, with a disableTasks
- // value of requeue.
- JobActionDisable JobAction = "disable"
- // JobActionNone Take no action.
- JobActionNone JobAction = "none"
- // JobActionTerminate Terminate the job. The terminateReason in the job's executionInfo is set to
- // "TaskFailed".
- JobActionTerminate JobAction = "terminate"
-)
-
-// PossibleJobActionValues returns an array of possible values for the JobAction const type.
-func PossibleJobActionValues() []JobAction {
- return []JobAction{JobActionDisable, JobActionNone, JobActionTerminate}
-}
-
-// JobPreparationTaskState enumerates the values for job preparation task state.
-type JobPreparationTaskState string
-
-const (
- // JobPreparationTaskStateCompleted The task has exited with exit code 0, or the task has exhausted its
- // retry limit, or the Batch service was unable to start the task due to task preparation errors (such as
- // resource file download failures).
- JobPreparationTaskStateCompleted JobPreparationTaskState = "completed"
- // JobPreparationTaskStateRunning The task is currently running (including retrying).
- JobPreparationTaskStateRunning JobPreparationTaskState = "running"
-)
-
-// PossibleJobPreparationTaskStateValues returns an array of possible values for the JobPreparationTaskState const type.
-func PossibleJobPreparationTaskStateValues() []JobPreparationTaskState {
- return []JobPreparationTaskState{JobPreparationTaskStateCompleted, JobPreparationTaskStateRunning}
-}
-
-// JobReleaseTaskState enumerates the values for job release task state.
-type JobReleaseTaskState string
-
-const (
- // JobReleaseTaskStateCompleted The task has exited with exit code 0, or the task has exhausted its retry
- // limit, or the Batch service was unable to start the task due to task preparation errors (such as
- // resource file download failures).
- JobReleaseTaskStateCompleted JobReleaseTaskState = "completed"
- // JobReleaseTaskStateRunning The task is currently running (including retrying).
- JobReleaseTaskStateRunning JobReleaseTaskState = "running"
-)
-
-// PossibleJobReleaseTaskStateValues returns an array of possible values for the JobReleaseTaskState const type.
-func PossibleJobReleaseTaskStateValues() []JobReleaseTaskState {
- return []JobReleaseTaskState{JobReleaseTaskStateCompleted, JobReleaseTaskStateRunning}
-}
-
-// JobScheduleState enumerates the values for job schedule state.
-type JobScheduleState string
-
-const (
- // JobScheduleStateActive The job schedule is active and will create jobs as per its schedule.
- JobScheduleStateActive JobScheduleState = "active"
- // JobScheduleStateCompleted The schedule has terminated, either by reaching its end time or by the user
- // terminating it explicitly.
- JobScheduleStateCompleted JobScheduleState = "completed"
- // JobScheduleStateDeleting The user has requested that the schedule be deleted, but the delete operation
- // is still in progress. The scheduler will not initiate any new jobs for this schedule, and will delete
- // any existing jobs and tasks under the schedule, including any active job. The schedule will be deleted
- // when all jobs and tasks under the schedule have been deleted.
- JobScheduleStateDeleting JobScheduleState = "deleting"
- // JobScheduleStateDisabled The user has disabled the schedule. The scheduler will not initiate any new
- // jobs will on this schedule, but any existing active job will continue to run.
- JobScheduleStateDisabled JobScheduleState = "disabled"
- // JobScheduleStateTerminating The schedule has no more work to do, or has been explicitly terminated by
- // the user, but the termination operation is still in progress. The scheduler will not initiate any new
- // jobs for this schedule, nor is any existing job active.
- JobScheduleStateTerminating JobScheduleState = "terminating"
-)
-
-// PossibleJobScheduleStateValues returns an array of possible values for the JobScheduleState const type.
-func PossibleJobScheduleStateValues() []JobScheduleState {
- return []JobScheduleState{JobScheduleStateActive, JobScheduleStateCompleted, JobScheduleStateDeleting, JobScheduleStateDisabled, JobScheduleStateTerminating}
-}
-
-// JobState enumerates the values for job state.
-type JobState string
-
-const (
- // JobStateActive The job is available to have tasks scheduled.
- JobStateActive JobState = "active"
- // JobStateCompleted All tasks have terminated, and the system will not accept any more tasks or any
- // further changes to the job.
- JobStateCompleted JobState = "completed"
- // JobStateDeleting A user has requested that the job be deleted, but the delete operation is still in
- // progress (for example, because the system is still terminating running tasks).
- JobStateDeleting JobState = "deleting"
- // JobStateDisabled A user has disabled the job. No tasks are running, and no new tasks will be scheduled.
- JobStateDisabled JobState = "disabled"
- // JobStateDisabling A user has requested that the job be disabled, but the disable operation is still in
- // progress (for example, waiting for tasks to terminate).
- JobStateDisabling JobState = "disabling"
- // JobStateEnabling A user has requested that the job be enabled, but the enable operation is still in
- // progress.
- JobStateEnabling JobState = "enabling"
- // JobStateTerminating The job is about to complete, either because a Job Manager task has completed or
- // because the user has terminated the job, but the terminate operation is still in progress (for example,
- // because Job Release tasks are running).
- JobStateTerminating JobState = "terminating"
-)
-
-// PossibleJobStateValues returns an array of possible values for the JobState const type.
-func PossibleJobStateValues() []JobState {
- return []JobState{JobStateActive, JobStateCompleted, JobStateDeleting, JobStateDisabled, JobStateDisabling, JobStateEnabling, JobStateTerminating}
-}
-
-// NetworkSecurityGroupRuleAccess enumerates the values for network security group rule access.
-type NetworkSecurityGroupRuleAccess string
-
-const (
- // Allow Allow access.
- Allow NetworkSecurityGroupRuleAccess = "allow"
- // Deny Deny access.
- Deny NetworkSecurityGroupRuleAccess = "deny"
-)
-
-// PossibleNetworkSecurityGroupRuleAccessValues returns an array of possible values for the NetworkSecurityGroupRuleAccess const type.
-func PossibleNetworkSecurityGroupRuleAccessValues() []NetworkSecurityGroupRuleAccess {
- return []NetworkSecurityGroupRuleAccess{Allow, Deny}
-}
-
-// OnAllTasksComplete enumerates the values for on all tasks complete.
-type OnAllTasksComplete string
-
-const (
- // NoAction Do nothing. The job remains active unless terminated or disabled by some other means.
- NoAction OnAllTasksComplete = "noaction"
- // TerminateJob Terminate the job. The job's terminateReason is set to 'AllTasksComplete'.
- TerminateJob OnAllTasksComplete = "terminatejob"
-)
-
-// PossibleOnAllTasksCompleteValues returns an array of possible values for the OnAllTasksComplete const type.
-func PossibleOnAllTasksCompleteValues() []OnAllTasksComplete {
- return []OnAllTasksComplete{NoAction, TerminateJob}
-}
-
-// OnTaskFailure enumerates the values for on task failure.
-type OnTaskFailure string
-
-const (
- // OnTaskFailureNoAction Do nothing. The job remains active unless terminated or disabled by some other
- // means.
- OnTaskFailureNoAction OnTaskFailure = "noaction"
- // OnTaskFailurePerformExitOptionsJobAction Take the action associated with the task exit condition in the
- // task's exitConditions collection. (This may still result in no action being taken, if that is what the
- // task specifies.)
- OnTaskFailurePerformExitOptionsJobAction OnTaskFailure = "performexitoptionsjobaction"
-)
-
-// PossibleOnTaskFailureValues returns an array of possible values for the OnTaskFailure const type.
-func PossibleOnTaskFailureValues() []OnTaskFailure {
- return []OnTaskFailure{OnTaskFailureNoAction, OnTaskFailurePerformExitOptionsJobAction}
-}
-
-// OSType enumerates the values for os type.
-type OSType string
-
-const (
- // Linux The Linux operating system.
- Linux OSType = "linux"
- // Windows The Windows operating system.
- Windows OSType = "windows"
-)
-
-// PossibleOSTypeValues returns an array of possible values for the OSType const type.
-func PossibleOSTypeValues() []OSType {
- return []OSType{Linux, Windows}
-}
-
-// OutputFileUploadCondition enumerates the values for output file upload condition.
-type OutputFileUploadCondition string
-
-const (
- // OutputFileUploadConditionTaskCompletion Upload the file(s) after the task process exits, no matter what
- // the exit code was.
- OutputFileUploadConditionTaskCompletion OutputFileUploadCondition = "taskcompletion"
- // OutputFileUploadConditionTaskFailure Upload the file(s) only after the task process exits with a nonzero
- // exit code.
- OutputFileUploadConditionTaskFailure OutputFileUploadCondition = "taskfailure"
- // OutputFileUploadConditionTaskSuccess Upload the file(s) only after the task process exits with an exit
- // code of 0.
- OutputFileUploadConditionTaskSuccess OutputFileUploadCondition = "tasksuccess"
-)
-
-// PossibleOutputFileUploadConditionValues returns an array of possible values for the OutputFileUploadCondition const type.
-func PossibleOutputFileUploadConditionValues() []OutputFileUploadCondition {
- return []OutputFileUploadCondition{OutputFileUploadConditionTaskCompletion, OutputFileUploadConditionTaskFailure, OutputFileUploadConditionTaskSuccess}
-}
-
-// PoolLifetimeOption enumerates the values for pool lifetime option.
-type PoolLifetimeOption string
-
-const (
- // PoolLifetimeOptionJob The pool exists for the lifetime of the job to which it is dedicated. The Batch
- // service creates the pool when it creates the job. If the 'job' option is applied to a job schedule, the
- // Batch service creates a new auto pool for every job created on the schedule.
- PoolLifetimeOptionJob PoolLifetimeOption = "job"
- // PoolLifetimeOptionJobSchedule The pool exists for the lifetime of the job schedule. The Batch Service
- // creates the pool when it creates the first job on the schedule. You may apply this option only to job
- // schedules, not to jobs.
- PoolLifetimeOptionJobSchedule PoolLifetimeOption = "jobschedule"
-)
-
-// PossiblePoolLifetimeOptionValues returns an array of possible values for the PoolLifetimeOption const type.
-func PossiblePoolLifetimeOptionValues() []PoolLifetimeOption {
- return []PoolLifetimeOption{PoolLifetimeOptionJob, PoolLifetimeOptionJobSchedule}
-}
-
-// PoolState enumerates the values for pool state.
-type PoolState string
-
-const (
- // PoolStateActive The pool is available to run tasks subject to the availability of compute nodes.
- PoolStateActive PoolState = "active"
- // PoolStateDeleting The user has requested that the pool be deleted, but the delete operation has not yet
- // completed.
- PoolStateDeleting PoolState = "deleting"
- // PoolStateUpgrading The user has requested that the operating system of the pool's nodes be upgraded, but
- // the upgrade operation has not yet completed (that is, some nodes in the pool have not yet been
- // upgraded). While upgrading, the pool may be able to run tasks (with reduced capacity) but this is not
- // guaranteed.
- PoolStateUpgrading PoolState = "upgrading"
-)
-
-// PossiblePoolStateValues returns an array of possible values for the PoolState const type.
-func PossiblePoolStateValues() []PoolState {
- return []PoolState{PoolStateActive, PoolStateDeleting, PoolStateUpgrading}
-}
-
-// SchedulingState enumerates the values for scheduling state.
-type SchedulingState string
-
-const (
- // Disabled No new tasks will be scheduled on the node. Tasks already running on the node may still run to
- // completion. All nodes start with scheduling enabled.
- Disabled SchedulingState = "disabled"
- // Enabled Tasks can be scheduled on the node.
- Enabled SchedulingState = "enabled"
-)
-
-// PossibleSchedulingStateValues returns an array of possible values for the SchedulingState const type.
-func PossibleSchedulingStateValues() []SchedulingState {
- return []SchedulingState{Disabled, Enabled}
-}
-
-// StartTaskState enumerates the values for start task state.
-type StartTaskState string
-
-const (
- // StartTaskStateCompleted The start task has exited with exit code 0, or the start task has failed and the
- // retry limit has reached, or the start task process did not run due to task preparation errors (such as
- // resource file download failures).
- StartTaskStateCompleted StartTaskState = "completed"
- // StartTaskStateRunning The start task is currently running.
- StartTaskStateRunning StartTaskState = "running"
-)
-
-// PossibleStartTaskStateValues returns an array of possible values for the StartTaskState const type.
-func PossibleStartTaskStateValues() []StartTaskState {
- return []StartTaskState{StartTaskStateCompleted, StartTaskStateRunning}
-}
-
-// StorageAccountType enumerates the values for storage account type.
-type StorageAccountType string
-
-const (
- // PremiumLRS The data disk should use premium locally redundant storage.
- PremiumLRS StorageAccountType = "premium_lrs"
- // StandardLRS The data disk should use standard locally redundant storage.
- StandardLRS StorageAccountType = "standard_lrs"
-)
-
-// PossibleStorageAccountTypeValues returns an array of possible values for the StorageAccountType const type.
-func PossibleStorageAccountTypeValues() []StorageAccountType {
- return []StorageAccountType{PremiumLRS, StandardLRS}
-}
-
-// SubtaskState enumerates the values for subtask state.
-type SubtaskState string
-
-const (
- // SubtaskStateCompleted The task is no longer eligible to run, usually because the task has finished
- // successfully, or the task has finished unsuccessfully and has exhausted its retry limit. A task is also
- // marked as completed if an error occurred launching the task, or when the task has been terminated.
- SubtaskStateCompleted SubtaskState = "completed"
- // SubtaskStatePreparing The task has been assigned to a compute node, but is waiting for a required Job
- // Preparation task to complete on the node. If the Job Preparation task succeeds, the task will move to
- // running. If the Job Preparation task fails, the task will return to active and will be eligible to be
- // assigned to a different node.
- SubtaskStatePreparing SubtaskState = "preparing"
- // SubtaskStateRunning The task is running on a compute node. This includes task-level preparation such as
- // downloading resource files or deploying application packages specified on the task - it does not
- // necessarily mean that the task command line has started executing.
- SubtaskStateRunning SubtaskState = "running"
-)
-
-// PossibleSubtaskStateValues returns an array of possible values for the SubtaskState const type.
-func PossibleSubtaskStateValues() []SubtaskState {
- return []SubtaskState{SubtaskStateCompleted, SubtaskStatePreparing, SubtaskStateRunning}
-}
-
-// TaskAddStatus enumerates the values for task add status.
-type TaskAddStatus string
-
-const (
- // TaskAddStatusClientError The task failed to add due to a client error and should not be retried without
- // modifying the request as appropriate.
- TaskAddStatusClientError TaskAddStatus = "clienterror"
- // TaskAddStatusServerError Task failed to add due to a server error and can be retried without
- // modification.
- TaskAddStatusServerError TaskAddStatus = "servererror"
- // TaskAddStatusSuccess The task was added successfully.
- TaskAddStatusSuccess TaskAddStatus = "success"
-)
-
-// PossibleTaskAddStatusValues returns an array of possible values for the TaskAddStatus const type.
-func PossibleTaskAddStatusValues() []TaskAddStatus {
- return []TaskAddStatus{TaskAddStatusClientError, TaskAddStatusServerError, TaskAddStatusSuccess}
-}
-
-// TaskCountValidationStatus enumerates the values for task count validation status.
-type TaskCountValidationStatus string
-
-const (
- // Unvalidated The Batch service has not been able to check state counts against the task states as
- // reported in the List Tasks API. The validationStatus may be unvalidated if the job contains more than
- // 200,000 tasks.
- Unvalidated TaskCountValidationStatus = "unvalidated"
- // Validated The Batch service has validated the state counts against the task states as reported in the
- // List Tasks API.
- Validated TaskCountValidationStatus = "validated"
-)
-
-// PossibleTaskCountValidationStatusValues returns an array of possible values for the TaskCountValidationStatus const type.
-func PossibleTaskCountValidationStatusValues() []TaskCountValidationStatus {
- return []TaskCountValidationStatus{Unvalidated, Validated}
-}
-
-// TaskExecutionResult enumerates the values for task execution result.
-type TaskExecutionResult string
-
-const (
- // Failure There was an error during processing of the task. The failure may have occurred before the task
- // process was launched, while the task process was executing, or after the task process exited.
- Failure TaskExecutionResult = "failure"
- // Success The task ran successfully.
- Success TaskExecutionResult = "success"
-)
-
-// PossibleTaskExecutionResultValues returns an array of possible values for the TaskExecutionResult const type.
-func PossibleTaskExecutionResultValues() []TaskExecutionResult {
- return []TaskExecutionResult{Failure, Success}
-}
-
-// TaskState enumerates the values for task state.
-type TaskState string
-
-const (
- // TaskStateActive The task is queued and able to run, but is not currently assigned to a compute node. A
- // task enters this state when it is created, when it is enabled after being disabled, or when it is
- // awaiting a retry after a failed run.
- TaskStateActive TaskState = "active"
- // TaskStateCompleted The task is no longer eligible to run, usually because the task has finished
- // successfully, or the task has finished unsuccessfully and has exhausted its retry limit. A task is also
- // marked as completed if an error occurred launching the task, or when the task has been terminated.
- TaskStateCompleted TaskState = "completed"
- // TaskStatePreparing The task has been assigned to a compute node, but is waiting for a required Job
- // Preparation task to complete on the node. If the Job Preparation task succeeds, the task will move to
- // running. If the Job Preparation task fails, the task will return to active and will be eligible to be
- // assigned to a different node.
- TaskStatePreparing TaskState = "preparing"
- // TaskStateRunning The task is running on a compute node. This includes task-level preparation such as
- // downloading resource files or deploying application packages specified on the task - it does not
- // necessarily mean that the task command line has started executing.
- TaskStateRunning TaskState = "running"
-)
-
-// PossibleTaskStateValues returns an array of possible values for the TaskState const type.
-func PossibleTaskStateValues() []TaskState {
- return []TaskState{TaskStateActive, TaskStateCompleted, TaskStatePreparing, TaskStateRunning}
-}
-
-// AccountListNodeAgentSkusResult ...
-type AccountListNodeAgentSkusResult struct {
- autorest.Response `json:"-"`
- Value *[]NodeAgentSku `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// AccountListNodeAgentSkusResultIterator provides access to a complete listing of NodeAgentSku values.
-type AccountListNodeAgentSkusResultIterator struct {
- i int
- page AccountListNodeAgentSkusResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *AccountListNodeAgentSkusResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter AccountListNodeAgentSkusResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter AccountListNodeAgentSkusResultIterator) Response() AccountListNodeAgentSkusResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter AccountListNodeAgentSkusResultIterator) Value() NodeAgentSku {
- if !iter.page.NotDone() {
- return NodeAgentSku{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (alnasr AccountListNodeAgentSkusResult) IsEmpty() bool {
- return alnasr.Value == nil || len(*alnasr.Value) == 0
-}
-
-// accountListNodeAgentSkusResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (alnasr AccountListNodeAgentSkusResult) accountListNodeAgentSkusResultPreparer() (*http.Request, error) {
- if alnasr.OdataNextLink == nil || len(to.String(alnasr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(alnasr.OdataNextLink)))
-}
-
-// AccountListNodeAgentSkusResultPage contains a page of NodeAgentSku values.
-type AccountListNodeAgentSkusResultPage struct {
- fn func(AccountListNodeAgentSkusResult) (AccountListNodeAgentSkusResult, error)
- alnasr AccountListNodeAgentSkusResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *AccountListNodeAgentSkusResultPage) Next() error {
- next, err := page.fn(page.alnasr)
- if err != nil {
- return err
- }
- page.alnasr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page AccountListNodeAgentSkusResultPage) NotDone() bool {
- return !page.alnasr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page AccountListNodeAgentSkusResultPage) Response() AccountListNodeAgentSkusResult {
- return page.alnasr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page AccountListNodeAgentSkusResultPage) Values() []NodeAgentSku {
- if page.alnasr.IsEmpty() {
- return nil
- }
- return *page.alnasr.Value
-}
-
-// AffinityInformation ...
-type AffinityInformation struct {
- // AffinityID - You can pass the affinityId of a compute node to indicate that this task needs to run on that compute node. Note that this is just a soft affinity. If the target node is busy or unavailable at the time the task is scheduled, then the task will be scheduled elsewhere.
- AffinityID *string `json:"affinityId,omitempty"`
-}
-
-// ApplicationListResult ...
-type ApplicationListResult struct {
- autorest.Response `json:"-"`
- Value *[]ApplicationSummary `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// ApplicationListResultIterator provides access to a complete listing of ApplicationSummary values.
-type ApplicationListResultIterator struct {
- i int
- page ApplicationListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *ApplicationListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter ApplicationListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter ApplicationListResultIterator) Response() ApplicationListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter ApplicationListResultIterator) Value() ApplicationSummary {
- if !iter.page.NotDone() {
- return ApplicationSummary{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (alr ApplicationListResult) IsEmpty() bool {
- return alr.Value == nil || len(*alr.Value) == 0
-}
-
-// applicationListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (alr ApplicationListResult) applicationListResultPreparer() (*http.Request, error) {
- if alr.OdataNextLink == nil || len(to.String(alr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(alr.OdataNextLink)))
-}
-
-// ApplicationListResultPage contains a page of ApplicationSummary values.
-type ApplicationListResultPage struct {
- fn func(ApplicationListResult) (ApplicationListResult, error)
- alr ApplicationListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *ApplicationListResultPage) Next() error {
- next, err := page.fn(page.alr)
- if err != nil {
- return err
- }
- page.alr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page ApplicationListResultPage) NotDone() bool {
- return !page.alr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page ApplicationListResultPage) Response() ApplicationListResult {
- return page.alr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page ApplicationListResultPage) Values() []ApplicationSummary {
- if page.alr.IsEmpty() {
- return nil
- }
- return *page.alr.Value
-}
-
-// ApplicationPackageReference ...
-type ApplicationPackageReference struct {
- ApplicationID *string `json:"applicationId,omitempty"`
- // Version - If this is omitted on a pool, and no default version is specified for this application, the request fails with the error code InvalidApplicationPackageReferences and HTTP status code 409. If this is omitted on a task, and no default version is specified for this application, the task fails with a pre-processing error.
- Version *string `json:"version,omitempty"`
-}
-
-// ApplicationSummary ...
-type ApplicationSummary struct {
- autorest.Response `json:"-"`
- ID *string `json:"id,omitempty"`
- DisplayName *string `json:"displayName,omitempty"`
- Versions *[]string `json:"versions,omitempty"`
-}
-
-// AuthenticationTokenSettings ...
-type AuthenticationTokenSettings struct {
- // Access - The authentication token grants access to a limited set of Batch service operations. Currently the only supported value for the access property is 'job', which grants access to all operations related to the job which contains the task.
- Access *[]AccessScope `json:"access,omitempty"`
-}
-
-// AutoPoolSpecification ...
-type AutoPoolSpecification struct {
- // AutoPoolIDPrefix - The Batch service assigns each auto pool a unique identifier on creation. To distinguish between pools created for different purposes, you can specify this element to add a prefix to the ID that is assigned. The prefix can be up to 20 characters long.
- AutoPoolIDPrefix *string `json:"autoPoolIdPrefix,omitempty"`
- // PoolLifetimeOption - Possible values include: 'PoolLifetimeOptionJobSchedule', 'PoolLifetimeOptionJob'
- PoolLifetimeOption PoolLifetimeOption `json:"poolLifetimeOption,omitempty"`
- // KeepAlive - If false, the Batch service deletes the pool once its lifetime (as determined by the poolLifetimeOption setting) expires; that is, when the job or job schedule completes. If true, the Batch service does not delete the pool automatically. It is up to the user to delete auto pools created with this option.
- KeepAlive *bool `json:"keepAlive,omitempty"`
- Pool *PoolSpecification `json:"pool,omitempty"`
-}
-
-// AutoScaleRun ...
-type AutoScaleRun struct {
- autorest.Response `json:"-"`
- Timestamp *date.Time `json:"timestamp,omitempty"`
- // Results - Each variable value is returned in the form $variable=value, and variables are separated by semicolons.
- Results *string `json:"results,omitempty"`
- Error *AutoScaleRunError `json:"error,omitempty"`
-}
-
-// AutoScaleRunError ...
-type AutoScaleRunError struct {
- Code *string `json:"code,omitempty"`
- Message *string `json:"message,omitempty"`
- Values *[]NameValuePair `json:"values,omitempty"`
-}
-
-// AutoUserSpecification ...
-type AutoUserSpecification struct {
- // Scope - The default value is task. Possible values include: 'Task', 'Pool'
- Scope AutoUserScope `json:"scope,omitempty"`
- // ElevationLevel - nonAdmin - The auto user is a standard user without elevated access. admin - The auto user is a user with elevated access and operates with full Administrator permissions. The default value is nonAdmin. Possible values include: 'NonAdmin', 'Admin'
- ElevationLevel ElevationLevel `json:"elevationLevel,omitempty"`
-}
-
-// Certificate a certificate that can be installed on compute nodes and can be used to authenticate operations on
-// the machine.
-type Certificate struct {
- autorest.Response `json:"-"`
- Thumbprint *string `json:"thumbprint,omitempty"`
- ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"`
- URL *string `json:"url,omitempty"`
- // State - Possible values include: 'Active', 'Deleting', 'DeleteFailed'
- State CertificateState `json:"state,omitempty"`
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // PreviousState - This property is not set if the certificate is in its initial active state. Possible values include: 'Active', 'Deleting', 'DeleteFailed'
- PreviousState CertificateState `json:"previousState,omitempty"`
- // PreviousStateTransitionTime - This property is not set if the certificate is in its initial Active state.
- PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"`
- PublicData *string `json:"publicData,omitempty"`
- // DeleteCertificateError - This property is set only if the certificate is in the DeleteFailed state.
- DeleteCertificateError *DeleteCertificateError `json:"deleteCertificateError,omitempty"`
-}
-
-// CertificateAddParameter ...
-type CertificateAddParameter struct {
- Thumbprint *string `json:"thumbprint,omitempty"`
- ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"`
- Data *string `json:"data,omitempty"`
- // CertificateFormat - Possible values include: 'Pfx', 'Cer'
- CertificateFormat CertificateFormat `json:"certificateFormat,omitempty"`
- // Password - This is required if the certificate format is pfx. It should be omitted if the certificate format is cer.
- Password *string `json:"password,omitempty"`
-}
-
-// CertificateListResult ...
-type CertificateListResult struct {
- autorest.Response `json:"-"`
- Value *[]Certificate `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CertificateListResultIterator provides access to a complete listing of Certificate values.
-type CertificateListResultIterator struct {
- i int
- page CertificateListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CertificateListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CertificateListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CertificateListResultIterator) Response() CertificateListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CertificateListResultIterator) Value() Certificate {
- if !iter.page.NotDone() {
- return Certificate{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (clr CertificateListResult) IsEmpty() bool {
- return clr.Value == nil || len(*clr.Value) == 0
-}
-
-// certificateListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (clr CertificateListResult) certificateListResultPreparer() (*http.Request, error) {
- if clr.OdataNextLink == nil || len(to.String(clr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(clr.OdataNextLink)))
-}
-
-// CertificateListResultPage contains a page of Certificate values.
-type CertificateListResultPage struct {
- fn func(CertificateListResult) (CertificateListResult, error)
- clr CertificateListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CertificateListResultPage) Next() error {
- next, err := page.fn(page.clr)
- if err != nil {
- return err
- }
- page.clr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CertificateListResultPage) NotDone() bool {
- return !page.clr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CertificateListResultPage) Response() CertificateListResult {
- return page.clr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CertificateListResultPage) Values() []Certificate {
- if page.clr.IsEmpty() {
- return nil
- }
- return *page.clr.Value
-}
-
-// CertificateReference ...
-type CertificateReference struct {
- Thumbprint *string `json:"thumbprint,omitempty"`
- ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"`
- // StoreLocation - The default value is currentuser. This property is applicable only for pools configured with Windows nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows image reference). For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory. Possible values include: 'CurrentUser', 'LocalMachine'
- StoreLocation CertificateStoreLocation `json:"storeLocation,omitempty"`
- // StoreName - This property is applicable only for pools configured with Windows nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows image reference). Common store names include: My, Root, CA, Trust, Disallowed, TrustedPeople, TrustedPublisher, AuthRoot, AddressBook, but any custom store name can also be used. The default value is My.
- StoreName *string `json:"storeName,omitempty"`
- // Visibility - You can specify more than one visibility in this collection. The default is all accounts.
- Visibility *[]CertificateVisibility `json:"visibility,omitempty"`
-}
-
-// CloudJob ...
-type CloudJob struct {
- autorest.Response `json:"-"`
- // ID - The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an account that differ only by case).
- ID *string `json:"id,omitempty"`
- DisplayName *string `json:"displayName,omitempty"`
- UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"`
- URL *string `json:"url,omitempty"`
- // ETag - This is an opaque string. You can use it to detect whether the job has changed between requests. In particular, you can be pass the ETag when updating a job to specify that your changes should take effect only if nobody else has modified the job in the meantime.
- ETag *string `json:"eTag,omitempty"`
- // LastModified - This is the last time at which the job level data, such as the job state or priority, changed. It does not factor in task-level changes such as adding new tasks or tasks changing state.
- LastModified *date.Time `json:"lastModified,omitempty"`
- CreationTime *date.Time `json:"creationTime,omitempty"`
- // State - Possible values include: 'JobStateActive', 'JobStateDisabling', 'JobStateDisabled', 'JobStateEnabling', 'JobStateTerminating', 'JobStateCompleted', 'JobStateDeleting'
- State JobState `json:"state,omitempty"`
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // PreviousState - This property is not set if the job is in its initial Active state. Possible values include: 'JobStateActive', 'JobStateDisabling', 'JobStateDisabled', 'JobStateEnabling', 'JobStateTerminating', 'JobStateCompleted', 'JobStateDeleting'
- PreviousState JobState `json:"previousState,omitempty"`
- // PreviousStateTransitionTime - This property is not set if the job is in its initial Active state.
- PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"`
- // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0.
- Priority *int32 `json:"priority,omitempty"`
- Constraints *JobConstraints `json:"constraints,omitempty"`
- JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"`
- // JobPreparationTask - The Job Preparation task is a special task run on each node before any other task of the job.
- JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"`
- // JobReleaseTask - The Job Release task is a special task run at the end of the job on each node that has run any other task of the job.
- JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"`
- // CommonEnvironmentSettings - Individual tasks can override an environment setting specified here by specifying the same setting name with a different value.
- CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"`
- PoolInfo *PoolInformation `json:"poolInfo,omitempty"`
- // OnAllTasksComplete - The default is noaction. Possible values include: 'NoAction', 'TerminateJob'
- OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"`
- // OnTaskFailure - A task is considered to have failed if has a failureInfo. A failureInfo is set if the task completes with a non-zero exit code after exhausting its retry count, or if there was an error starting the task, for example due to a resource file download error. The default is noaction. Possible values include: 'OnTaskFailureNoAction', 'OnTaskFailurePerformExitOptionsJobAction'
- OnTaskFailure OnTaskFailure `json:"onTaskFailure,omitempty"`
- // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
- ExecutionInfo *JobExecutionInformation `json:"executionInfo,omitempty"`
- Stats *JobStatistics `json:"stats,omitempty"`
-}
-
-// CloudJobListPreparationAndReleaseTaskStatusResult ...
-type CloudJobListPreparationAndReleaseTaskStatusResult struct {
- autorest.Response `json:"-"`
- Value *[]JobPreparationAndReleaseTaskExecutionInformation `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CloudJobListPreparationAndReleaseTaskStatusResultIterator provides access to a complete listing of
-// JobPreparationAndReleaseTaskExecutionInformation values.
-type CloudJobListPreparationAndReleaseTaskStatusResultIterator struct {
- i int
- page CloudJobListPreparationAndReleaseTaskStatusResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CloudJobListPreparationAndReleaseTaskStatusResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CloudJobListPreparationAndReleaseTaskStatusResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CloudJobListPreparationAndReleaseTaskStatusResultIterator) Response() CloudJobListPreparationAndReleaseTaskStatusResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CloudJobListPreparationAndReleaseTaskStatusResultIterator) Value() JobPreparationAndReleaseTaskExecutionInformation {
- if !iter.page.NotDone() {
- return JobPreparationAndReleaseTaskExecutionInformation{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult) IsEmpty() bool {
- return cjlpartsr.Value == nil || len(*cjlpartsr.Value) == 0
-}
-
-// cloudJobListPreparationAndReleaseTaskStatusResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult) cloudJobListPreparationAndReleaseTaskStatusResultPreparer() (*http.Request, error) {
- if cjlpartsr.OdataNextLink == nil || len(to.String(cjlpartsr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(cjlpartsr.OdataNextLink)))
-}
-
-// CloudJobListPreparationAndReleaseTaskStatusResultPage contains a page of
-// JobPreparationAndReleaseTaskExecutionInformation values.
-type CloudJobListPreparationAndReleaseTaskStatusResultPage struct {
- fn func(CloudJobListPreparationAndReleaseTaskStatusResult) (CloudJobListPreparationAndReleaseTaskStatusResult, error)
- cjlpartsr CloudJobListPreparationAndReleaseTaskStatusResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CloudJobListPreparationAndReleaseTaskStatusResultPage) Next() error {
- next, err := page.fn(page.cjlpartsr)
- if err != nil {
- return err
- }
- page.cjlpartsr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) NotDone() bool {
- return !page.cjlpartsr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) Response() CloudJobListPreparationAndReleaseTaskStatusResult {
- return page.cjlpartsr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CloudJobListPreparationAndReleaseTaskStatusResultPage) Values() []JobPreparationAndReleaseTaskExecutionInformation {
- if page.cjlpartsr.IsEmpty() {
- return nil
- }
- return *page.cjlpartsr.Value
-}
-
-// CloudJobListResult ...
-type CloudJobListResult struct {
- autorest.Response `json:"-"`
- Value *[]CloudJob `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CloudJobListResultIterator provides access to a complete listing of CloudJob values.
-type CloudJobListResultIterator struct {
- i int
- page CloudJobListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CloudJobListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CloudJobListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CloudJobListResultIterator) Response() CloudJobListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CloudJobListResultIterator) Value() CloudJob {
- if !iter.page.NotDone() {
- return CloudJob{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (cjlr CloudJobListResult) IsEmpty() bool {
- return cjlr.Value == nil || len(*cjlr.Value) == 0
-}
-
-// cloudJobListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (cjlr CloudJobListResult) cloudJobListResultPreparer() (*http.Request, error) {
- if cjlr.OdataNextLink == nil || len(to.String(cjlr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(cjlr.OdataNextLink)))
-}
-
-// CloudJobListResultPage contains a page of CloudJob values.
-type CloudJobListResultPage struct {
- fn func(CloudJobListResult) (CloudJobListResult, error)
- cjlr CloudJobListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CloudJobListResultPage) Next() error {
- next, err := page.fn(page.cjlr)
- if err != nil {
- return err
- }
- page.cjlr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CloudJobListResultPage) NotDone() bool {
- return !page.cjlr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CloudJobListResultPage) Response() CloudJobListResult {
- return page.cjlr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CloudJobListResultPage) Values() []CloudJob {
- if page.cjlr.IsEmpty() {
- return nil
- }
- return *page.cjlr.Value
-}
-
-// CloudJobSchedule ...
-type CloudJobSchedule struct {
- autorest.Response `json:"-"`
- ID *string `json:"id,omitempty"`
- DisplayName *string `json:"displayName,omitempty"`
- URL *string `json:"url,omitempty"`
- // ETag - This is an opaque string. You can use it to detect whether the job schedule has changed between requests. In particular, you can be pass the ETag with an Update Job Schedule request to specify that your changes should take effect only if nobody else has modified the schedule in the meantime.
- ETag *string `json:"eTag,omitempty"`
- // LastModified - This is the last time at which the schedule level data, such as the job specification or recurrence information, changed. It does not factor in job-level changes such as new jobs being created or jobs changing state.
- LastModified *date.Time `json:"lastModified,omitempty"`
- CreationTime *date.Time `json:"creationTime,omitempty"`
- // State - Possible values include: 'JobScheduleStateActive', 'JobScheduleStateCompleted', 'JobScheduleStateDisabled', 'JobScheduleStateTerminating', 'JobScheduleStateDeleting'
- State JobScheduleState `json:"state,omitempty"`
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // PreviousState - This property is not present if the job schedule is in its initial active state. Possible values include: 'JobScheduleStateActive', 'JobScheduleStateCompleted', 'JobScheduleStateDisabled', 'JobScheduleStateTerminating', 'JobScheduleStateDeleting'
- PreviousState JobScheduleState `json:"previousState,omitempty"`
- // PreviousStateTransitionTime - This property is not present if the job schedule is in its initial active state.
- PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"`
- Schedule *Schedule `json:"schedule,omitempty"`
- JobSpecification *JobSpecification `json:"jobSpecification,omitempty"`
- ExecutionInfo *JobScheduleExecutionInformation `json:"executionInfo,omitempty"`
- // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
- Stats *JobScheduleStatistics `json:"stats,omitempty"`
-}
-
-// CloudJobScheduleListResult ...
-type CloudJobScheduleListResult struct {
- autorest.Response `json:"-"`
- Value *[]CloudJobSchedule `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CloudJobScheduleListResultIterator provides access to a complete listing of CloudJobSchedule values.
-type CloudJobScheduleListResultIterator struct {
- i int
- page CloudJobScheduleListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CloudJobScheduleListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CloudJobScheduleListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CloudJobScheduleListResultIterator) Response() CloudJobScheduleListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CloudJobScheduleListResultIterator) Value() CloudJobSchedule {
- if !iter.page.NotDone() {
- return CloudJobSchedule{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (cjslr CloudJobScheduleListResult) IsEmpty() bool {
- return cjslr.Value == nil || len(*cjslr.Value) == 0
-}
-
-// cloudJobScheduleListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (cjslr CloudJobScheduleListResult) cloudJobScheduleListResultPreparer() (*http.Request, error) {
- if cjslr.OdataNextLink == nil || len(to.String(cjslr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(cjslr.OdataNextLink)))
-}
-
-// CloudJobScheduleListResultPage contains a page of CloudJobSchedule values.
-type CloudJobScheduleListResultPage struct {
- fn func(CloudJobScheduleListResult) (CloudJobScheduleListResult, error)
- cjslr CloudJobScheduleListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CloudJobScheduleListResultPage) Next() error {
- next, err := page.fn(page.cjslr)
- if err != nil {
- return err
- }
- page.cjslr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CloudJobScheduleListResultPage) NotDone() bool {
- return !page.cjslr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CloudJobScheduleListResultPage) Response() CloudJobScheduleListResult {
- return page.cjslr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CloudJobScheduleListResultPage) Values() []CloudJobSchedule {
- if page.cjslr.IsEmpty() {
- return nil
- }
- return *page.cjslr.Value
-}
-
-// CloudPool ...
-type CloudPool struct {
- autorest.Response `json:"-"`
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an account that differ only by case).
- ID *string `json:"id,omitempty"`
- // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- URL *string `json:"url,omitempty"`
- // ETag - This is an opaque string. You can use it to detect whether the pool has changed between requests. In particular, you can be pass the ETag when updating a pool to specify that your changes should take effect only if nobody else has modified the pool in the meantime.
- ETag *string `json:"eTag,omitempty"`
- // LastModified - This is the last time at which the pool level data, such as the targetDedicatedNodes or enableAutoscale settings, changed. It does not factor in node-level changes such as a compute node changing state.
- LastModified *date.Time `json:"lastModified,omitempty"`
- CreationTime *date.Time `json:"creationTime,omitempty"`
- // State - Possible values include: 'PoolStateActive', 'PoolStateDeleting', 'PoolStateUpgrading'
- State PoolState `json:"state,omitempty"`
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // AllocationState - Possible values include: 'Steady', 'Resizing', 'Stopping'
- AllocationState AllocationState `json:"allocationState,omitempty"`
- AllocationStateTransitionTime *date.Time `json:"allocationStateTransitionTime,omitempty"`
- // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall, A1V2 and A2V2. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series).
- VMSize *string `json:"vmSize,omitempty"`
- // CloudServiceConfiguration - This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. This property cannot be specified if the Batch account was created with its poolAllocationMode property set to 'UserSubscription'.
- CloudServiceConfiguration *CloudServiceConfiguration `json:"cloudServiceConfiguration,omitempty"`
- // VirtualMachineConfiguration - This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified.
- VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"`
- // ResizeTimeout - This is the timeout for the most recent resize operation. (The initial sizing when the pool is created counts as a resize.) The default value is 15 minutes.
- ResizeTimeout *string `json:"resizeTimeout,omitempty"`
- // ResizeErrors - This property is set only if one or more errors occurred during the last pool resize, and only when the pool allocationState is Steady.
- ResizeErrors *[]ResizeError `json:"resizeErrors,omitempty"`
- CurrentDedicatedNodes *int32 `json:"currentDedicatedNodes,omitempty"`
- // CurrentLowPriorityNodes - Low-priority compute nodes which have been preempted are included in this count.
- CurrentLowPriorityNodes *int32 `json:"currentLowPriorityNodes,omitempty"`
- TargetDedicatedNodes *int32 `json:"targetDedicatedNodes,omitempty"`
- TargetLowPriorityNodes *int32 `json:"targetLowPriorityNodes,omitempty"`
- // EnableAutoScale - If false, at least one of targetDedicateNodes and targetLowPriorityNodes must be specified. If true, the autoScaleFormula property is required and the pool automatically resizes according to the formula. The default value is false.
- EnableAutoScale *bool `json:"enableAutoScale,omitempty"`
- // AutoScaleFormula - This property is set only if the pool automatically scales, i.e. enableAutoScale is true.
- AutoScaleFormula *string `json:"autoScaleFormula,omitempty"`
- // AutoScaleEvaluationInterval - This property is set only if the pool automatically scales, i.e. enableAutoScale is true.
- AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"`
- // AutoScaleRun - This property is set only if the pool automatically scales, i.e. enableAutoScale is true.
- AutoScaleRun *AutoScaleRun `json:"autoScaleRun,omitempty"`
- // EnableInterNodeCommunication - This imposes restrictions on which nodes can be assigned to the pool. Specifying this value can reduce the chance of the requested number of nodes to be allocated in the pool.
- EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"`
- NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"`
- StartTask *StartTask `json:"startTask,omitempty"`
- // CertificateReferences - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // ApplicationLicenses - The list of application licenses must be a subset of available Batch service application licenses. If a license is requested which is not supported, pool creation will fail.
- ApplicationLicenses *[]string `json:"applicationLicenses,omitempty"`
- MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"`
- TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"`
- UserAccounts *[]UserAccount `json:"userAccounts,omitempty"`
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
- Stats *PoolStatistics `json:"stats,omitempty"`
-}
-
-// CloudPoolListResult ...
-type CloudPoolListResult struct {
- autorest.Response `json:"-"`
- Value *[]CloudPool `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CloudPoolListResultIterator provides access to a complete listing of CloudPool values.
-type CloudPoolListResultIterator struct {
- i int
- page CloudPoolListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CloudPoolListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CloudPoolListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CloudPoolListResultIterator) Response() CloudPoolListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CloudPoolListResultIterator) Value() CloudPool {
- if !iter.page.NotDone() {
- return CloudPool{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (cplr CloudPoolListResult) IsEmpty() bool {
- return cplr.Value == nil || len(*cplr.Value) == 0
-}
-
-// cloudPoolListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (cplr CloudPoolListResult) cloudPoolListResultPreparer() (*http.Request, error) {
- if cplr.OdataNextLink == nil || len(to.String(cplr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(cplr.OdataNextLink)))
-}
-
-// CloudPoolListResultPage contains a page of CloudPool values.
-type CloudPoolListResultPage struct {
- fn func(CloudPoolListResult) (CloudPoolListResult, error)
- cplr CloudPoolListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CloudPoolListResultPage) Next() error {
- next, err := page.fn(page.cplr)
- if err != nil {
- return err
- }
- page.cplr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CloudPoolListResultPage) NotDone() bool {
- return !page.cplr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CloudPoolListResultPage) Response() CloudPoolListResult {
- return page.cplr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CloudPoolListResultPage) Values() []CloudPool {
- if page.cplr.IsEmpty() {
- return nil
- }
- return *page.cplr.Value
-}
-
-// CloudServiceConfiguration ...
-type CloudServiceConfiguration struct {
- // OsFamily - Possible values are: 2 - OS Family 2, equivalent to Windows Server 2008 R2 SP1. 3 - OS Family 3, equivalent to Windows Server 2012. 4 - OS Family 4, equivalent to Windows Server 2012 R2. 5 - OS Family 5, equivalent to Windows Server 2016. For more information, see Azure Guest OS Releases (https://azure.microsoft.com/documentation/articles/cloud-services-guestos-update-matrix/#releases).
- OsFamily *string `json:"osFamily,omitempty"`
- // TargetOSVersion - The default value is * which specifies the latest operating system version for the specified OS family.
- TargetOSVersion *string `json:"targetOSVersion,omitempty"`
- // CurrentOSVersion - This may differ from targetOSVersion if the pool state is Upgrading. In this case some virtual machines may be on the targetOSVersion and some may be on the currentOSVersion during the upgrade process. Once all virtual machines have upgraded, currentOSVersion is updated to be the same as targetOSVersion.
- CurrentOSVersion *string `json:"currentOSVersion,omitempty"`
-}
-
-// CloudTask ...
-type CloudTask struct {
- autorest.Response `json:"-"`
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters.
- ID *string `json:"id,omitempty"`
- // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- URL *string `json:"url,omitempty"`
- // ETag - This is an opaque string. You can use it to detect whether the task has changed between requests. In particular, you can be pass the ETag when updating a task to specify that your changes should take effect only if nobody else has modified the task in the meantime.
- ETag *string `json:"eTag,omitempty"`
- LastModified *date.Time `json:"lastModified,omitempty"`
- CreationTime *date.Time `json:"creationTime,omitempty"`
- // ExitConditions - How the Batch service should respond when the task completes.
- ExitConditions *ExitConditions `json:"exitConditions,omitempty"`
- // State - Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted'
- State TaskState `json:"state,omitempty"`
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // PreviousState - This property is not set if the task is in its initial Active state. Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted'
- PreviousState TaskState `json:"previousState,omitempty"`
- // PreviousStateTransitionTime - This property is not set if the task is in its initial Active state.
- PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"`
- // CommandLine - For multi-instance tasks, the command line is executed as the primary task, after the primary task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux.
- CommandLine *string `json:"commandLine,omitempty"`
- // ContainerSettings - If the pool that will run this task has containerConfiguration set, this must be set as well. If the pool that will run this task doesn't have containerConfiguration set, this must not be set. When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all task environment variables are mapped into the container, and the task command line is executed in the container.
- ContainerSettings *TaskContainerSettings `json:"containerSettings,omitempty"`
- // ResourceFiles - For multi-instance tasks, the resource files will only be downloaded to the compute node on which the primary task is executed.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- // OutputFiles - For multi-instance tasks, the files will only be uploaded from the compute node on which the primary task is executed.
- OutputFiles *[]OutputFile `json:"outputFiles,omitempty"`
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- AffinityInfo *AffinityInformation `json:"affinityInfo,omitempty"`
- Constraints *TaskConstraints `json:"constraints,omitempty"`
- // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task.
- UserIdentity *UserIdentity `json:"userIdentity,omitempty"`
- ExecutionInfo *TaskExecutionInformation `json:"executionInfo,omitempty"`
- NodeInfo *ComputeNodeInformation `json:"nodeInfo,omitempty"`
- MultiInstanceSettings *MultiInstanceSettings `json:"multiInstanceSettings,omitempty"`
- Stats *TaskStatistics `json:"stats,omitempty"`
- // DependsOn - This task will not be scheduled until all tasks that it depends on have completed successfully. If any of those tasks fail and exhaust their retry counts, this task will never be scheduled.
- DependsOn *TaskDependencies `json:"dependsOn,omitempty"`
- // ApplicationPackageReferences - Application packages are downloaded and deployed to a shared directory, not the task working directory. Therefore, if a referenced package is already on the compute node, and is up to date, then it is not re-downloaded; the existing copy on the compute node is used. If a referenced application package cannot be installed, for example because the package has been deleted or because download failed, the task fails.
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // AuthenticationTokenSettings - If this property is set, the Batch service provides the task with an authentication token which can be used to authenticate Batch service operations without requiring an account access key. The token is provided via the AZ_BATCH_AUTHENTICATION_TOKEN environment variable. The operations that the task can carry out using the token depend on the settings. For example, a task can request job permissions in order to add other tasks to the job, or check the status of the job or of other tasks under the job.
- AuthenticationTokenSettings *AuthenticationTokenSettings `json:"authenticationTokenSettings,omitempty"`
-}
-
-// CloudTaskListResult ...
-type CloudTaskListResult struct {
- autorest.Response `json:"-"`
- Value *[]CloudTask `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// CloudTaskListResultIterator provides access to a complete listing of CloudTask values.
-type CloudTaskListResultIterator struct {
- i int
- page CloudTaskListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *CloudTaskListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter CloudTaskListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter CloudTaskListResultIterator) Response() CloudTaskListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter CloudTaskListResultIterator) Value() CloudTask {
- if !iter.page.NotDone() {
- return CloudTask{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (ctlr CloudTaskListResult) IsEmpty() bool {
- return ctlr.Value == nil || len(*ctlr.Value) == 0
-}
-
-// cloudTaskListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (ctlr CloudTaskListResult) cloudTaskListResultPreparer() (*http.Request, error) {
- if ctlr.OdataNextLink == nil || len(to.String(ctlr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(ctlr.OdataNextLink)))
-}
-
-// CloudTaskListResultPage contains a page of CloudTask values.
-type CloudTaskListResultPage struct {
- fn func(CloudTaskListResult) (CloudTaskListResult, error)
- ctlr CloudTaskListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *CloudTaskListResultPage) Next() error {
- next, err := page.fn(page.ctlr)
- if err != nil {
- return err
- }
- page.ctlr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page CloudTaskListResultPage) NotDone() bool {
- return !page.ctlr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page CloudTaskListResultPage) Response() CloudTaskListResult {
- return page.ctlr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page CloudTaskListResultPage) Values() []CloudTask {
- if page.ctlr.IsEmpty() {
- return nil
- }
- return *page.ctlr.Value
-}
-
-// CloudTaskListSubtasksResult ...
-type CloudTaskListSubtasksResult struct {
- autorest.Response `json:"-"`
- Value *[]SubtaskInformation `json:"value,omitempty"`
-}
-
-// ComputeNode ...
-type ComputeNode struct {
- autorest.Response `json:"-"`
- // ID - Every node that is added to a pool is assigned a unique ID. Whenever a node is removed from a pool, all of its local files are deleted, and the ID is reclaimed and could be reused for new nodes.
- ID *string `json:"id,omitempty"`
- URL *string `json:"url,omitempty"`
- // State - The low-priority node has been preempted. Tasks which were running on the node when it was pre-empted will be rescheduled when another node becomes available. Possible values include: 'Idle', 'Rebooting', 'Reimaging', 'Running', 'Unusable', 'Creating', 'Starting', 'WaitingForStartTask', 'StartTaskFailed', 'Unknown', 'LeavingPool', 'Offline', 'Preempted'
- State ComputeNodeState `json:"state,omitempty"`
- // SchedulingState - Possible values include: 'Enabled', 'Disabled'
- SchedulingState SchedulingState `json:"schedulingState,omitempty"`
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // LastBootTime - This property may not be present if the node state is unusable.
- LastBootTime *date.Time `json:"lastBootTime,omitempty"`
- AllocationTime *date.Time `json:"allocationTime,omitempty"`
- // IPAddress - Every node that is added to a pool is assigned a unique IP address. Whenever a node is removed from a pool, all of its local files are deleted, and the IP address is reclaimed and could be reused for new nodes.
- IPAddress *string `json:"ipAddress,omitempty"`
- // AffinityID - Note that this is just a soft affinity. If the target node is busy or unavailable at the time the task is scheduled, then the task will be scheduled elsewhere.
- AffinityID *string `json:"affinityId,omitempty"`
- // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall, A1V2 and A2V2. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series).
- VMSize *string `json:"vmSize,omitempty"`
- TotalTasksRun *int32 `json:"totalTasksRun,omitempty"`
- RunningTasksCount *int32 `json:"runningTasksCount,omitempty"`
- TotalTasksSucceeded *int32 `json:"totalTasksSucceeded,omitempty"`
- // RecentTasks - This property is present only if at least one task has run on this node since it was assigned to the pool.
- RecentTasks *[]TaskInformation `json:"recentTasks,omitempty"`
- StartTask *StartTask `json:"startTask,omitempty"`
- StartTaskInfo *StartTaskInformation `json:"startTaskInfo,omitempty"`
- // CertificateReferences - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- Errors *[]ComputeNodeError `json:"errors,omitempty"`
- IsDedicated *bool `json:"isDedicated,omitempty"`
- EndpointConfiguration *ComputeNodeEndpointConfiguration `json:"endpointConfiguration,omitempty"`
-}
-
-// ComputeNodeEndpointConfiguration ...
-type ComputeNodeEndpointConfiguration struct {
- InboundEndpoints *[]InboundEndpoint `json:"inboundEndpoints,omitempty"`
-}
-
-// ComputeNodeError ...
-type ComputeNodeError struct {
- Code *string `json:"code,omitempty"`
- Message *string `json:"message,omitempty"`
- ErrorDetails *[]NameValuePair `json:"errorDetails,omitempty"`
-}
-
-// ComputeNodeGetRemoteLoginSettingsResult ...
-type ComputeNodeGetRemoteLoginSettingsResult struct {
- autorest.Response `json:"-"`
- RemoteLoginIPAddress *string `json:"remoteLoginIPAddress,omitempty"`
- RemoteLoginPort *int32 `json:"remoteLoginPort,omitempty"`
-}
-
-// ComputeNodeInformation ...
-type ComputeNodeInformation struct {
- AffinityID *string `json:"affinityId,omitempty"`
- NodeURL *string `json:"nodeUrl,omitempty"`
- PoolID *string `json:"poolId,omitempty"`
- NodeID *string `json:"nodeId,omitempty"`
- TaskRootDirectory *string `json:"taskRootDirectory,omitempty"`
- TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"`
-}
-
-// ComputeNodeListResult ...
-type ComputeNodeListResult struct {
- autorest.Response `json:"-"`
- Value *[]ComputeNode `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// ComputeNodeListResultIterator provides access to a complete listing of ComputeNode values.
-type ComputeNodeListResultIterator struct {
- i int
- page ComputeNodeListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *ComputeNodeListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter ComputeNodeListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter ComputeNodeListResultIterator) Response() ComputeNodeListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter ComputeNodeListResultIterator) Value() ComputeNode {
- if !iter.page.NotDone() {
- return ComputeNode{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (cnlr ComputeNodeListResult) IsEmpty() bool {
- return cnlr.Value == nil || len(*cnlr.Value) == 0
-}
-
-// computeNodeListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (cnlr ComputeNodeListResult) computeNodeListResultPreparer() (*http.Request, error) {
- if cnlr.OdataNextLink == nil || len(to.String(cnlr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(cnlr.OdataNextLink)))
-}
-
-// ComputeNodeListResultPage contains a page of ComputeNode values.
-type ComputeNodeListResultPage struct {
- fn func(ComputeNodeListResult) (ComputeNodeListResult, error)
- cnlr ComputeNodeListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *ComputeNodeListResultPage) Next() error {
- next, err := page.fn(page.cnlr)
- if err != nil {
- return err
- }
- page.cnlr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page ComputeNodeListResultPage) NotDone() bool {
- return !page.cnlr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page ComputeNodeListResultPage) Response() ComputeNodeListResult {
- return page.cnlr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page ComputeNodeListResultPage) Values() []ComputeNode {
- if page.cnlr.IsEmpty() {
- return nil
- }
- return *page.cnlr.Value
-}
-
-// ComputeNodeUser ...
-type ComputeNodeUser struct {
- Name *string `json:"name,omitempty"`
- // IsAdmin - The default value is false.
- IsAdmin *bool `json:"isAdmin,omitempty"`
- // ExpiryTime - If omitted, the default is 1 day from the current time. For Linux compute nodes, the expiryTime has a precision up to a day.
- ExpiryTime *date.Time `json:"expiryTime,omitempty"`
- // Password - The password is required for Windows nodes (those created with 'cloudServiceConfiguration', or created with 'virtualMachineConfiguration' using a Windows image reference). For Linux compute nodes, the password can optionally be specified along with the sshPublicKey property.
- Password *string `json:"password,omitempty"`
- // SSHPublicKey - The public key should be compatible with OpenSSH encoding and should be base 64 encoded. This property can be specified only for Linux nodes. If this is specified for a Windows node, then the Batch service rejects the request; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- SSHPublicKey *string `json:"sshPublicKey,omitempty"`
-}
-
-// ContainerConfiguration ...
-type ContainerConfiguration struct {
- Type *string `json:"type,omitempty"`
- // ContainerImageNames - This is the full image reference, as would be specified to "docker pull". An image will be sourced from the default Docker registry unless the image is fully qualified with an alternative registry.
- ContainerImageNames *[]string `json:"containerImageNames,omitempty"`
- // ContainerRegistries - If any images must be downloaded from a private registry which requires credentials, then those credentials must be provided here.
- ContainerRegistries *[]ContainerRegistry `json:"containerRegistries,omitempty"`
-}
-
-// ContainerRegistry ...
-type ContainerRegistry struct {
- // RegistryServer - If omitted, the default is "docker.io".
- RegistryServer *string `json:"registryServer,omitempty"`
- UserName *string `json:"username,omitempty"`
- Password *string `json:"password,omitempty"`
-}
-
-// DataDisk ...
-type DataDisk struct {
- // Lun - The lun is used to uniquely identify each data disk. If attaching multiple disks, each should have a distinct lun.
- Lun *int32 `json:"lun,omitempty"`
- // Caching - The default value for caching is none. For information about the caching options see: https://blogs.msdn.microsoft.com/windowsazurestorage/2012/06/27/exploring-windows-azure-drives-disks-and-images/. Possible values include: 'None', 'ReadOnly', 'ReadWrite'
- Caching CachingType `json:"caching,omitempty"`
- DiskSizeGB *int32 `json:"diskSizeGB,omitempty"`
- // StorageAccountType - If omitted, the default is "standard_lrs". Possible values include: 'StandardLRS', 'PremiumLRS'
- StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"`
-}
-
-// DeleteCertificateError ...
-type DeleteCertificateError struct {
- Code *string `json:"code,omitempty"`
- Message *string `json:"message,omitempty"`
- // Values - This list includes details such as the active pools and nodes referencing this certificate. However, if a large number of resources reference the certificate, the list contains only about the first hundred.
- Values *[]NameValuePair `json:"values,omitempty"`
-}
-
-// EnvironmentSetting ...
-type EnvironmentSetting struct {
- Name *string `json:"name,omitempty"`
- Value *string `json:"value,omitempty"`
-}
-
-// Error ...
-type Error struct {
- Code *string `json:"code,omitempty"`
- Message *ErrorMessage `json:"message,omitempty"`
- Values *[]ErrorDetail `json:"values,omitempty"`
-}
-
-// ErrorDetail ...
-type ErrorDetail struct {
- Key *string `json:"key,omitempty"`
- Value *string `json:"value,omitempty"`
-}
-
-// ErrorMessage ...
-type ErrorMessage struct {
- Lang *string `json:"lang,omitempty"`
- Value *string `json:"value,omitempty"`
-}
-
-// ExitCodeMapping ...
-type ExitCodeMapping struct {
- Code *int32 `json:"code,omitempty"`
- ExitOptions *ExitOptions `json:"exitOptions,omitempty"`
-}
-
-// ExitCodeRangeMapping ...
-type ExitCodeRangeMapping struct {
- Start *int32 `json:"start,omitempty"`
- End *int32 `json:"end,omitempty"`
- ExitOptions *ExitOptions `json:"exitOptions,omitempty"`
-}
-
-// ExitConditions ...
-type ExitConditions struct {
- ExitCodes *[]ExitCodeMapping `json:"exitCodes,omitempty"`
- ExitCodeRanges *[]ExitCodeRangeMapping `json:"exitCodeRanges,omitempty"`
- PreProcessingError *ExitOptions `json:"preProcessingError,omitempty"`
- // FileUploadError - If the task exited with an exit code that was specified via exitCodes or exitCodeRanges, and then encountered a file upload error, then the action specified by the exit code takes precedence.
- FileUploadError *ExitOptions `json:"fileUploadError,omitempty"`
- // Default - This value is used if the task exits with any nonzero exit code not listed in the exitCodes or exitCodeRanges collection, with a pre-processing error if the preProcessingError property is not present, or with a file upload error if the fileUploadError property is not present. If you want non-default behaviour on exit code 0, you must list it explicitly using the exitCodes or exitCodeRanges collection.
- Default *ExitOptions `json:"default,omitempty"`
-}
-
-// ExitOptions ...
-type ExitOptions struct {
- // JobAction - The default is none for exit code 0 and terminate for all other exit conditions. If the job's onTaskFailed property is noaction, then specifying this property returns an error and the add task request fails with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). Possible values include: 'JobActionNone', 'JobActionDisable', 'JobActionTerminate'
- JobAction JobAction `json:"jobAction,omitempty"`
- // DependencyAction - The default is 'satisfy' for exit code 0, and 'block' for all other exit conditions. If the job's usesTaskDependencies property is set to false, then specifying the dependencyAction property returns an error and the add task request fails with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). Possible values include: 'Satisfy', 'Block'
- DependencyAction DependencyAction `json:"dependencyAction,omitempty"`
-}
-
-// FileProperties ...
-type FileProperties struct {
- // CreationTime - The creation time is not returned for files on Linux compute nodes.
- CreationTime *date.Time `json:"creationTime,omitempty"`
- LastModified *date.Time `json:"lastModified,omitempty"`
- ContentLength *int64 `json:"contentLength,omitempty"`
- ContentType *string `json:"contentType,omitempty"`
- // FileMode - The file mode is returned only for files on Linux compute nodes.
- FileMode *string `json:"fileMode,omitempty"`
-}
-
-// ImageReference ...
-type ImageReference struct {
- // Publisher - For example, Canonical or MicrosoftWindowsServer.
- Publisher *string `json:"publisher,omitempty"`
- // Offer - For example, UbuntuServer or WindowsServer.
- Offer *string `json:"offer,omitempty"`
- // Sku - For example, 14.04.0-LTS or 2012-R2-Datacenter.
- Sku *string `json:"sku,omitempty"`
- // Version - A value of 'latest' can be specified to select the latest version of an image. If omitted, the default is 'latest'.
- Version *string `json:"version,omitempty"`
- // VirtualMachineImageID - This property is mutually exclusive with other ImageReference properties. The virtual machine image must be in the same region and subscription as the Azure Batch account. For information about the firewall settings for the Batch node agent to communicate with the Batch service see https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration.
- VirtualMachineImageID *string `json:"virtualMachineImageId,omitempty"`
-}
-
-// InboundEndpoint ...
-type InboundEndpoint struct {
- Name *string `json:"name,omitempty"`
- // Protocol - Possible values include: 'TCP', 'UDP'
- Protocol InboundEndpointProtocol `json:"protocol,omitempty"`
- PublicIPAddress *string `json:"publicIPAddress,omitempty"`
- PublicFQDN *string `json:"publicFQDN,omitempty"`
- FrontendPort *int32 `json:"frontendPort,omitempty"`
- BackendPort *int32 `json:"backendPort,omitempty"`
-}
-
-// InboundNATPool ...
-type InboundNATPool struct {
- // Name - The name must be unique within a Batch pool, can contain letters, numbers, underscores, periods, and hyphens. Names must start with a letter or number, must end with a letter, number, or underscore, and cannot exceed 77 characters. If any invalid values are provided the request fails with HTTP status code 400.
- Name *string `json:"name,omitempty"`
- // Protocol - Possible values include: 'TCP', 'UDP'
- Protocol InboundEndpointProtocol `json:"protocol,omitempty"`
- // BackendPort - This must be unique within a Batch pool. Acceptable values are between 1 and 65535 except for 22, 3389, 29876 and 29877 as these are reserved. If any reserved values are provided the request fails with HTTP status code 400.
- BackendPort *int32 `json:"backendPort,omitempty"`
- // FrontendPortRangeStart - Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved. All ranges within a pool must be distinct and cannot overlap. Each range must contain at least 40 ports. If any reserved or overlapping values are provided the request fails with HTTP status code 400.
- FrontendPortRangeStart *int32 `json:"frontendPortRangeStart,omitempty"`
- // FrontendPortRangeEnd - Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved by the Batch service. All ranges within a pool must be distinct and cannot overlap. Each range must contain at least 40 ports. If any reserved or overlapping values are provided the request fails with HTTP status code 400.
- FrontendPortRangeEnd *int32 `json:"frontendPortRangeEnd,omitempty"`
- // NetworkSecurityGroupRules - The maximum number of rules that can be specified across all the endpoints on a Batch pool is 25. If no network security group rules are specified, a default rule will be created to allow inbound access to the specified backendPort. If the maximum number of network security group rules is exceeded the request fails with HTTP status code 400.
- NetworkSecurityGroupRules *[]NetworkSecurityGroupRule `json:"networkSecurityGroupRules,omitempty"`
-}
-
-// JobAddParameter ...
-type JobAddParameter struct {
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an account that differ only by case).
- ID *string `json:"id,omitempty"`
- // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0.
- Priority *int32 `json:"priority,omitempty"`
- // Constraints - The execution constraints for the job.
- Constraints *JobConstraints `json:"constraints,omitempty"`
- // JobManagerTask - If the job does not specify a Job Manager task, the user must explicitly add tasks to the job. If the job does specify a Job Manager task, the Batch service creates the Job Manager task when the job is created, and will try to schedule the Job Manager task before scheduling other tasks in the job. The Job Manager task's typical purpose is to control and/or monitor job execution, for example by deciding what additional tasks to run, determining when the work is complete, etc. (However, a Job Manager task is not restricted to these activities - it is a fully-fledged task in the system and perform whatever actions are required for the job.) For example, a Job Manager task might download a file specified as a parameter, analyze the contents of that file and submit additional tasks based on those contents.
- JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"`
- // JobPreparationTask - If a job has a Job Preparation task, the Batch service will run the Job Preparation task on a compute node before starting any tasks of that job on that compute node.
- JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"`
- // JobReleaseTask - A Job Release task cannot be specified without also specifying a Job Preparation task for the job. The Batch service runs the Job Release task on the compute nodes that have run the Job Preparation task. The primary purpose of the Job Release task is to undo changes to compute nodes made by the Job Preparation task. Example activities include deleting local files, or shutting down services that were started as part of job preparation.
- JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"`
- // CommonEnvironmentSettings - Individual tasks can override an environment setting specified here by specifying the same setting name with a different value.
- CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"`
- PoolInfo *PoolInformation `json:"poolInfo,omitempty"`
- // OnAllTasksComplete - Note that if a job contains no tasks, then all tasks are considered complete. This option is therefore most commonly used with a Job Manager task; if you want to use automatic job termination without a Job Manager, you should initially set onAllTasksComplete to noaction and update the job properties to set onAllTasksComplete to terminatejob once you have finished adding tasks. The default is noaction. Possible values include: 'NoAction', 'TerminateJob'
- OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"`
- // OnTaskFailure - A task is considered to have failed if has a failureInfo. A failureInfo is set if the task completes with a non-zero exit code after exhausting its retry count, or if there was an error starting the task, for example due to a resource file download error. The default is noaction. Possible values include: 'OnTaskFailureNoAction', 'OnTaskFailurePerformExitOptionsJobAction'
- OnTaskFailure OnTaskFailure `json:"onTaskFailure,omitempty"`
- // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
- UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"`
-}
-
-// JobConstraints ...
-type JobConstraints struct {
- // MaxWallClockTime - If the job does not complete within the time limit, the Batch service terminates it and any tasks that are still running. In this case, the termination reason will be MaxWallClockTimeExpiry. If this property is not specified, there is no time limit on how long the job may run.
- MaxWallClockTime *string `json:"maxWallClockTime,omitempty"`
- // MaxTaskRetryCount - Note that this value specifically controls the number of retries. The Batch service will try each task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries a task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry tasks. If the maximum retry count is -1, the Batch service retries tasks without limit. The default value is 0 (no retries).
- MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"`
-}
-
-// JobDisableParameter ...
-type JobDisableParameter struct {
- // DisableTasks - Possible values include: 'DisableJobOptionRequeue', 'DisableJobOptionTerminate', 'DisableJobOptionWait'
- DisableTasks DisableJobOption `json:"disableTasks,omitempty"`
-}
-
-// JobExecutionInformation ...
-type JobExecutionInformation struct {
- // StartTime - This is the time at which the job was created.
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - This property is set only if the job is in the completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
- // PoolID - This element contains the actual pool where the job is assigned. When you get job details from the service, they also contain a poolInfo element, which contains the pool configuration data from when the job was added or updated. That poolInfo element may also contain a poolId element. If it does, the two IDs are the same. If it does not, it means the job ran on an auto pool, and this property contains the ID of that auto pool.
- PoolID *string `json:"poolId,omitempty"`
- // SchedulingError - This property is not set if there was no error starting the job.
- SchedulingError *JobSchedulingError `json:"schedulingError,omitempty"`
- // TerminateReason - This property is set only if the job is in the completed state. If the Batch service terminates the job, it sets the reason as follows: JMComplete - the Job Manager task completed, and killJobOnCompletion was set to true. MaxWallClockTimeExpiry - the job reached its maxWallClockTime constraint. TerminateJobSchedule - the job ran as part of a schedule, and the schedule terminated. AllTasksComplete - the job's onAllTasksComplete attribute is set to terminatejob, and all tasks in the job are complete. TaskFailed - the job's onTaskFailure attribute is set to performExitOptionsJobAction, and a task in the job failed with an exit condition that specified a jobAction of terminatejob. Any other string is a user-defined reason specified in a call to the 'Terminate a job' operation.
- TerminateReason *string `json:"terminateReason,omitempty"`
-}
-
-// JobManagerTask the Job Manager task is automatically started when the job is created. The Batch service tries to
-// schedule the Job Manager task before any other tasks in the job. When shrinking a pool, the Batch service tries
-// to preserve compute nodes where Job Manager tasks are running for as long as possible (that is, nodes running
-// 'normal' tasks are removed before nodes running Job Manager tasks). When a Job Manager task fails and needs to
-// be restarted, the system tries to schedule it at the highest priority. If there are no idle nodes available, the
-// system may terminate one of the running tasks in the pool and return it to the queue in order to make room for
-// the Job Manager task to restart. Note that a Job Manager task in one job does not have priority over tasks in
-// other jobs. Across jobs, only job level priorities are observed. For example, if a Job Manager in a priority 0
-// job needs to be restarted, it will not displace tasks of a priority 1 job.
-type JobManagerTask struct {
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters.
- ID *string `json:"id,omitempty"`
- // DisplayName - It need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux.
- CommandLine *string `json:"commandLine,omitempty"`
- // ContainerSettings - If the pool that will run this task has containerConfiguration set, this must be set as well. If the pool that will run this task doesn't have containerConfiguration set, this must not be set. When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all task environment variables are mapped into the container, and the task command line is executed in the container.
- ContainerSettings *TaskContainerSettings `json:"containerSettings,omitempty"`
- // ResourceFiles - Files listed under this element are located in the task's working directory.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- // OutputFiles - For multi-instance tasks, the files will only be uploaded from the compute node on which the primary task is executed.
- OutputFiles *[]OutputFile `json:"outputFiles,omitempty"`
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- Constraints *TaskConstraints `json:"constraints,omitempty"`
- // KillJobOnCompletion - If true, when the Job Manager task completes, the Batch service marks the job as complete. If any tasks are still running at this time (other than Job Release), those tasks are terminated. If false, the completion of the Job Manager task does not affect the job status. In this case, you should either use the onAllTasksComplete attribute to terminate the job, or have a client or user terminate the job explicitly. An example of this is if the Job Manager creates a set of tasks but then takes no further role in their execution. The default value is true. If you are using the onAllTasksComplete and onTaskFailure attributes to control job lifetime, and using the Job Manager task only to create the tasks for the job (not to monitor progress), then it is important to set killJobOnCompletion to false.
- KillJobOnCompletion *bool `json:"killJobOnCompletion,omitempty"`
- // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task.
- UserIdentity *UserIdentity `json:"userIdentity,omitempty"`
- // RunExclusive - If true, no other tasks will run on the same compute node for as long as the Job Manager is running. If false, other tasks can run simultaneously with the Job Manager on a compute node. The Job Manager task counts normally against the node's concurrent task limit, so this is only relevant if the node allows multiple concurrent tasks. The default value is true.
- RunExclusive *bool `json:"runExclusive,omitempty"`
- // ApplicationPackageReferences - Application packages are downloaded and deployed to a shared directory, not the task working directory. Therefore, if a referenced package is already on the compute node, and is up to date, then it is not re-downloaded; the existing copy on the compute node is used. If a referenced application package cannot be installed, for example because the package has been deleted or because download failed, the task fails.
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // AuthenticationTokenSettings - If this property is set, the Batch service provides the task with an authentication token which can be used to authenticate Batch service operations without requiring an account access key. The token is provided via the AZ_BATCH_AUTHENTICATION_TOKEN environment variable. The operations that the task can carry out using the token depend on the settings. For example, a task can request job permissions in order to add other tasks to the job, or check the status of the job or of other tasks under the job.
- AuthenticationTokenSettings *AuthenticationTokenSettings `json:"authenticationTokenSettings,omitempty"`
- // AllowLowPriorityNode - The default value is false.
- AllowLowPriorityNode *bool `json:"allowLowPriorityNode,omitempty"`
-}
-
-// JobPatchParameter ...
-type JobPatchParameter struct {
- // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. If omitted, the priority of the job is left unchanged.
- Priority *int32 `json:"priority,omitempty"`
- // OnAllTasksComplete - If omitted, the completion behavior is left unchanged. You may not change the value from terminatejob to noaction - that is, once you have engaged automatic job termination, you cannot turn it off again. If you try to do this, the request fails with an 'invalid property value' error response; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). Possible values include: 'NoAction', 'TerminateJob'
- OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"`
- // Constraints - If omitted, the existing execution constraints are left unchanged.
- Constraints *JobConstraints `json:"constraints,omitempty"`
- // PoolInfo - You may change the pool for a job only when the job is disabled. The Patch Job call will fail if you include the poolInfo element and the job is not disabled. If you specify an autoPoolSpecification specification in the poolInfo, only the keepAlive property can be updated, and then only if the auto pool has a poolLifetimeOption of job. If omitted, the job continues to run on its current pool.
- PoolInfo *PoolInformation `json:"poolInfo,omitempty"`
- // Metadata - If omitted, the existing job metadata is left unchanged.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// JobPreparationAndReleaseTaskExecutionInformation ...
-type JobPreparationAndReleaseTaskExecutionInformation struct {
- PoolID *string `json:"poolId,omitempty"`
- NodeID *string `json:"nodeId,omitempty"`
- NodeURL *string `json:"nodeUrl,omitempty"`
- JobPreparationTaskExecutionInfo *JobPreparationTaskExecutionInformation `json:"jobPreparationTaskExecutionInfo,omitempty"`
- // JobReleaseTaskExecutionInfo - This property is set only if the Job Release task has run on the node.
- JobReleaseTaskExecutionInfo *JobReleaseTaskExecutionInformation `json:"jobReleaseTaskExecutionInfo,omitempty"`
-}
-
-// JobPreparationTask you can use Job Preparation to prepare a compute node to run tasks for the job. Activities
-// commonly performed in Job Preparation include: Downloading common resource files used by all the tasks in the
-// job. The Job Preparation task can download these common resource files to the shared location on the compute
-// node. (AZ_BATCH_NODE_ROOT_DIR\shared), or starting a local service on the compute node so that all tasks of that
-// job can communicate with it. If the Job Preparation task fails (that is, exhausts its retry count before exiting
-// with exit code 0), Batch will not run tasks of this job on the compute node. The node remains ineligible to run
-// tasks of this job until it is reimaged. The node remains active and can be used for other jobs. The Job
-// Preparation task can run multiple times on the same compute node. Therefore, you should write the Job
-// Preparation task to handle re-execution. If the compute node is rebooted, the Job Preparation task is run again
-// on the node before scheduling any other task of the job, if rerunOnNodeRebootAfterSuccess is true or if the Job
-// Preparation task did not previously complete. If the compute node is reimaged, the Job Preparation task is run
-// again before scheduling any task of the job.
-type JobPreparationTask struct {
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobpreparation'. No other task in the job can have the same ID as the Job Preparation task. If you try to submit a task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobPreparationTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict).
- ID *string `json:"id,omitempty"`
- // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux.
- CommandLine *string `json:"commandLine,omitempty"`
- // ContainerSettings - When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all task environment variables are mapped into the container, and the task command line is executed in the container.
- ContainerSettings *TaskContainerSettings `json:"containerSettings,omitempty"`
- // ResourceFiles - Files listed under this element are located in the task's working directory.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- Constraints *TaskConstraints `json:"constraints,omitempty"`
- // WaitForSuccess - If true and the Job Preparation task fails on a compute node, the Batch service retries the Job Preparation task up to its maximum retry count (as specified in the constraints element). If the task has still not completed successfully after all retries, then the Batch service will not schedule tasks of the job to the compute node. The compute node remains active and eligible to run tasks of other jobs. If false, the Batch service will not wait for the Job Preparation task to complete. In this case, other tasks of the job can start executing on the compute node while the Job Preparation task is still running; and even if the Job Preparation task fails, new tasks will continue to be scheduled on the node. The default value is true.
- WaitForSuccess *bool `json:"waitForSuccess,omitempty"`
- // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task on Windows nodes, or a a non-administrative user unique to the pool on Linux nodes.
- UserIdentity *UserIdentity `json:"userIdentity,omitempty"`
- // RerunOnNodeRebootAfterSuccess - The Job Preparation task is always rerun if a compute node is reimaged, or if the Job Preparation task did not complete (e.g. because the reboot occurred while the task was running). Therefore, you should always write a Job Preparation task to be idempotent and to behave correctly if run multiple times. The default value is true.
- RerunOnNodeRebootAfterSuccess *bool `json:"rerunOnNodeRebootAfterSuccess,omitempty"`
-}
-
-// JobPreparationTaskExecutionInformation ...
-type JobPreparationTaskExecutionInformation struct {
- // StartTime - If the task has been restarted or retried, this is the most recent time at which the task started running.
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - This property is set only if the task is in the Completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
- // State - Possible values include: 'JobPreparationTaskStateRunning', 'JobPreparationTaskStateCompleted'
- State JobPreparationTaskState `json:"state,omitempty"`
- TaskRootDirectory *string `json:"taskRootDirectory,omitempty"`
- TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"`
- // ExitCode - This parameter is returned only if the task is in the completed state. The exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. Note that the exit code may also be generated by the compute node operating system, such as when a process is forcibly terminated.
- ExitCode *int32 `json:"exitCode,omitempty"`
- // ContainerInfo - This property is set only if the task runs in a container context.
- ContainerInfo *TaskContainerExecutionInformation `json:"containerInfo,omitempty"`
- // FailureInfo - This property is set only if the task is in the completed state and encountered a failure.
- FailureInfo *TaskFailureInformation `json:"failureInfo,omitempty"`
- // RetryCount - Task application failures (non-zero exit code) are retried, pre-processing errors (the task could not be run) and file upload errors are not retried. The Batch service will retry the task up to the limit specified by the constraints.
- RetryCount *int32 `json:"retryCount,omitempty"`
- // LastRetryTime - This property is set only if the task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the task has been restarted for reasons other than retry; for example, if the compute node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not.
- LastRetryTime *date.Time `json:"lastRetryTime,omitempty"`
- // Result - If the value is 'failed', then the details of the failure can be found in the failureInfo property. Possible values include: 'Success', 'Failure'
- Result TaskExecutionResult `json:"result,omitempty"`
-}
-
-// JobReleaseTask the Job Release task runs when the job ends, because of one of the following: The user calls the
-// Terminate Job API, or the Delete Job API while the job is still active, the job's maximum wall clock time
-// constraint is reached, and the job is still active, or the job's Job Manager task completed, and the job is
-// configured to terminate when the Job Manager completes. The Job Release task runs on each compute node where
-// tasks of the job have run and the Job Preparation task ran and completed. If you reimage a compute node after it
-// has run the Job Preparation task, and the job ends without any further tasks of the job running on that compute
-// node (and hence the Job Preparation task does not re-run), then the Job Release task does not run on that node.
-// If a compute node reboots while the Job Release task is still running, the Job Release task runs again when the
-// compute node starts up. The job is not marked as complete until all Job Release tasks have completed. The Job
-// Release task runs in the background. It does not occupy a scheduling slot; that is, it does not count towards
-// the maxTasksPerNode limit specified on the pool.
-type JobReleaseTask struct {
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobrelease'. No other task in the job can have the same ID as the Job Release task. If you try to submit a task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobReleaseTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict).
- ID *string `json:"id,omitempty"`
- // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux.
- CommandLine *string `json:"commandLine,omitempty"`
- // ContainerSettings - When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all task environment variables are mapped into the container, and the task command line is executed in the container.
- ContainerSettings *TaskContainerSettings `json:"containerSettings,omitempty"`
- // ResourceFiles - Files listed under this element are located in the task's working directory.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- MaxWallClockTime *string `json:"maxWallClockTime,omitempty"`
- // RetentionTime - The default is infinite, i.e. the task directory will be retained until the compute node is removed or reimaged.
- RetentionTime *string `json:"retentionTime,omitempty"`
- // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task.
- UserIdentity *UserIdentity `json:"userIdentity,omitempty"`
-}
-
-// JobReleaseTaskExecutionInformation ...
-type JobReleaseTaskExecutionInformation struct {
- // StartTime - If the task has been restarted or retried, this is the most recent time at which the task started running.
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - This property is set only if the task is in the Completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
- // State - Possible values include: 'JobReleaseTaskStateRunning', 'JobReleaseTaskStateCompleted'
- State JobReleaseTaskState `json:"state,omitempty"`
- TaskRootDirectory *string `json:"taskRootDirectory,omitempty"`
- TaskRootDirectoryURL *string `json:"taskRootDirectoryUrl,omitempty"`
- // ExitCode - This parameter is returned only if the task is in the completed state. The exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. Note that the exit code may also be generated by the compute node operating system, such as when a process is forcibly terminated.
- ExitCode *int32 `json:"exitCode,omitempty"`
- // ContainerInfo - This property is set only if the task runs in a container context.
- ContainerInfo *TaskContainerExecutionInformation `json:"containerInfo,omitempty"`
- // FailureInfo - This property is set only if the task is in the completed state and encountered a failure.
- FailureInfo *TaskFailureInformation `json:"failureInfo,omitempty"`
- // Result - If the value is 'failed', then the details of the failure can be found in the failureInfo property. Possible values include: 'Success', 'Failure'
- Result TaskExecutionResult `json:"result,omitempty"`
-}
-
-// JobScheduleAddParameter ...
-type JobScheduleAddParameter struct {
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an account that differ only by case).
- ID *string `json:"id,omitempty"`
- // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- Schedule *Schedule `json:"schedule,omitempty"`
- JobSpecification *JobSpecification `json:"jobSpecification,omitempty"`
- // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// JobScheduleExecutionInformation ...
-type JobScheduleExecutionInformation struct {
- // NextRunTime - This property is meaningful only if the schedule is in the active state when the time comes around. For example, if the schedule is disabled, no job will be created at nextRunTime unless the job is enabled before then.
- NextRunTime *date.Time `json:"nextRunTime,omitempty"`
- // RecentJob - This property is present only if the at least one job has run under the schedule.
- RecentJob *RecentJob `json:"recentJob,omitempty"`
- // EndTime - This property is set only if the job schedule is in the completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
-}
-
-// JobSchedulePatchParameter ...
-type JobSchedulePatchParameter struct {
- // Schedule - If you do not specify this element, the existing schedule is left unchanged.
- Schedule *Schedule `json:"schedule,omitempty"`
- // JobSpecification - Updates affect only jobs that are started after the update has taken place. Any currently active job continues with the older specification.
- JobSpecification *JobSpecification `json:"jobSpecification,omitempty"`
- // Metadata - If you do not specify this element, existing metadata is left unchanged.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// JobScheduleStatistics ...
-type JobScheduleStatistics struct {
- URL *string `json:"url,omitempty"`
- StartTime *date.Time `json:"startTime,omitempty"`
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- UserCPUTime *string `json:"userCPUTime,omitempty"`
- KernelCPUTime *string `json:"kernelCPUTime,omitempty"`
- // WallClockTime - The wall clock time is the elapsed time from when the task started running on a compute node to when it finished (or to the last time the statistics were updated, if the task had not finished by then). If a task was retried, this includes the wall clock time of all the task retries.
- WallClockTime *string `json:"wallClockTime,omitempty"`
- ReadIOps *int64 `json:"readIOps,omitempty"`
- WriteIOps *int64 `json:"writeIOps,omitempty"`
- ReadIOGiB *float64 `json:"readIOGiB,omitempty"`
- WriteIOGiB *float64 `json:"writeIOGiB,omitempty"`
- NumSucceededTasks *int64 `json:"numSucceededTasks,omitempty"`
- NumFailedTasks *int64 `json:"numFailedTasks,omitempty"`
- NumTaskRetries *int64 `json:"numTaskRetries,omitempty"`
- // WaitTime - This value is only reported in the account lifetime statistics; it is not included in the job statistics.
- WaitTime *string `json:"waitTime,omitempty"`
-}
-
-// JobScheduleUpdateParameter ...
-type JobScheduleUpdateParameter struct {
- // Schedule - If you do not specify this element, it is equivalent to passing the default schedule: that is, a single job scheduled to run immediately.
- Schedule *Schedule `json:"schedule,omitempty"`
- // JobSpecification - Updates affect only jobs that are started after the update has taken place. Any currently active job continues with the older specification.
- JobSpecification *JobSpecification `json:"jobSpecification,omitempty"`
- // Metadata - If you do not specify this element, it takes the default value of an empty list; in effect, any existing metadata is deleted.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// JobSchedulingError ...
-type JobSchedulingError struct {
- // Category - Possible values include: 'UserError', 'ServerError'
- Category ErrorCategory `json:"category,omitempty"`
- Code *string `json:"code,omitempty"`
- Message *string `json:"message,omitempty"`
- Details *[]NameValuePair `json:"details,omitempty"`
-}
-
-// JobSpecification ...
-type JobSpecification struct {
- // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0. This priority is used as the default for all jobs under the job schedule. You can update a job's priority after it has been created using by using the update job API.
- Priority *int32 `json:"priority,omitempty"`
- // DisplayName - The name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- UsesTaskDependencies *bool `json:"usesTaskDependencies,omitempty"`
- // OnAllTasksComplete - Note that if a job contains no tasks, then all tasks are considered complete. This option is therefore most commonly used with a Job Manager task; if you want to use automatic job termination without a Job Manager, you should initially set onAllTasksComplete to noaction and update the job properties to set onAllTasksComplete to terminatejob once you have finished adding tasks. The default is noaction. Possible values include: 'NoAction', 'TerminateJob'
- OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"`
- // OnTaskFailure - The default is noaction. Possible values include: 'OnTaskFailureNoAction', 'OnTaskFailurePerformExitOptionsJobAction'
- OnTaskFailure OnTaskFailure `json:"onTaskFailure,omitempty"`
- Constraints *JobConstraints `json:"constraints,omitempty"`
- // JobManagerTask - If the job does not specify a Job Manager task, the user must explicitly add tasks to the job using the Task API. If the job does specify a Job Manager task, the Batch service creates the Job Manager task when the job is created, and will try to schedule the Job Manager task before scheduling other tasks in the job.
- JobManagerTask *JobManagerTask `json:"jobManagerTask,omitempty"`
- // JobPreparationTask - If a job has a Job Preparation task, the Batch service will run the Job Preparation task on a compute node before starting any tasks of that job on that compute node.
- JobPreparationTask *JobPreparationTask `json:"jobPreparationTask,omitempty"`
- // JobReleaseTask - The primary purpose of the Job Release task is to undo changes to compute nodes made by the Job Preparation task. Example activities include deleting local files, or shutting down services that were started as part of job preparation. A Job Release task cannot be specified without also specifying a Job Preparation task for the job. The Batch service runs the Job Release task on the compute nodes that have run the Job Preparation task.
- JobReleaseTask *JobReleaseTask `json:"jobReleaseTask,omitempty"`
- // CommonEnvironmentSettings - Individual tasks can override an environment setting specified here by specifying the same setting name with a different value.
- CommonEnvironmentSettings *[]EnvironmentSetting `json:"commonEnvironmentSettings,omitempty"`
- PoolInfo *PoolInformation `json:"poolInfo,omitempty"`
- // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// JobStatistics ...
-type JobStatistics struct {
- autorest.Response `json:"-"`
- URL *string `json:"url,omitempty"`
- StartTime *date.Time `json:"startTime,omitempty"`
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- UserCPUTime *string `json:"userCPUTime,omitempty"`
- KernelCPUTime *string `json:"kernelCPUTime,omitempty"`
- // WallClockTime - The wall clock time is the elapsed time from when the task started running on a compute node to when it finished (or to the last time the statistics were updated, if the task had not finished by then). If a task was retried, this includes the wall clock time of all the task retries.
- WallClockTime *string `json:"wallClockTime,omitempty"`
- ReadIOps *int64 `json:"readIOps,omitempty"`
- WriteIOps *int64 `json:"writeIOps,omitempty"`
- ReadIOGiB *float64 `json:"readIOGiB,omitempty"`
- WriteIOGiB *float64 `json:"writeIOGiB,omitempty"`
- // NumSucceededTasks - A task completes successfully if it returns exit code 0.
- NumSucceededTasks *int64 `json:"numSucceededTasks,omitempty"`
- // NumFailedTasks - A task fails if it exhausts its maximum retry count without returning exit code 0.
- NumFailedTasks *int64 `json:"numFailedTasks,omitempty"`
- NumTaskRetries *int64 `json:"numTaskRetries,omitempty"`
- // WaitTime - The wait time for a task is defined as the elapsed time between the creation of the task and the start of task execution. (If the task is retried due to failures, the wait time is the time to the most recent task execution.) This value is only reported in the account lifetime statistics; it is not included in the job statistics.
- WaitTime *string `json:"waitTime,omitempty"`
-}
-
-// JobTerminateParameter ...
-type JobTerminateParameter struct {
- TerminateReason *string `json:"terminateReason,omitempty"`
-}
-
-// JobUpdateParameter ...
-type JobUpdateParameter struct {
- // Priority - Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. If omitted, it is set to the default value 0.
- Priority *int32 `json:"priority,omitempty"`
- // Constraints - If omitted, the constraints are cleared.
- Constraints *JobConstraints `json:"constraints,omitempty"`
- // PoolInfo - You may change the pool for a job only when the job is disabled. The Update Job call will fail if you include the poolInfo element and the job is not disabled. If you specify an autoPoolSpecification specification in the poolInfo, only the keepAlive property can be updated, and then only if the auto pool has a poolLifetimeOption of job.
- PoolInfo *PoolInformation `json:"poolInfo,omitempty"`
- // Metadata - If omitted, it takes the default value of an empty list; in effect, any existing metadata is deleted.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
- // OnAllTasksComplete - If omitted, the completion behavior is set to noaction. If the current value is terminatejob, this is an error because a job's completion behavior may not be changed from terminatejob to noaction. You may not change the value from terminatejob to noaction - that is, once you have engaged automatic job termination, you cannot turn it off again. If you try to do this, the request fails and Batch returns status code 400 (Bad Request) and an 'invalid property value' error response. If you do not specify this element in a PUT request, it is equivalent to passing noaction. This is an error if the current value is terminatejob. Possible values include: 'NoAction', 'TerminateJob'
- OnAllTasksComplete OnAllTasksComplete `json:"onAllTasksComplete,omitempty"`
-}
-
-// LinuxUserConfiguration ...
-type LinuxUserConfiguration struct {
- // UID - The uid and gid properties must be specified together or not at all. If not specified the underlying operating system picks the uid.
- UID *int32 `json:"uid,omitempty"`
- // Gid - The uid and gid properties must be specified together or not at all. If not specified the underlying operating system picks the gid.
- Gid *int32 `json:"gid,omitempty"`
- // SSHPrivateKey - The private key must not be password protected. The private key is used to automatically configure asymmetric-key based authentication for SSH between nodes in a Linux pool when the pool's enableInterNodeCommunication property is true (it is ignored if enableInterNodeCommunication is false). It does this by placing the key pair into the user's .ssh directory. If not specified, password-less SSH is not configured between nodes (no modification of the user's .ssh directory is done).
- SSHPrivateKey *string `json:"sshPrivateKey,omitempty"`
-}
-
-// MetadataItem the Batch service does not assign any meaning to this metadata; it is solely for the use of user
-// code.
-type MetadataItem struct {
- Name *string `json:"name,omitempty"`
- Value *string `json:"value,omitempty"`
-}
-
-// MultiInstanceSettings multi-instance tasks are commonly used to support MPI tasks.
-type MultiInstanceSettings struct {
- // NumberOfInstances - If omitted, the default is 1.
- NumberOfInstances *int32 `json:"numberOfInstances,omitempty"`
- // CoordinationCommandLine - A typical coordination command line launches a background service and verifies that the service is ready to process inter-node messages.
- CoordinationCommandLine *string `json:"coordinationCommandLine,omitempty"`
- // CommonResourceFiles - The difference between common resource files and task resource files is that common resource files are downloaded for all subtasks including the primary, whereas task resource files are downloaded only for the primary. Also note that these resource files are not downloaded to the task working directory, but instead are downloaded to the task root directory (one directory above the working directory).
- CommonResourceFiles *[]ResourceFile `json:"commonResourceFiles,omitempty"`
-}
-
-// NameValuePair ...
-type NameValuePair struct {
- Name *string `json:"name,omitempty"`
- Value *string `json:"value,omitempty"`
-}
-
-// NetworkConfiguration the network configuration for a pool.
-type NetworkConfiguration struct {
- // SubnetID - The virtual network must be in the same region and subscription as the Azure Batch account. The specified subnet should have enough free IP addresses to accommodate the number of nodes in the pool. If the subnet doesn't have enough free IP addresses, the pool will partially allocate compute nodes, and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to be able to schedule tasks on the compute nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the compute nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the compute nodes to unusable. For pools created with virtualMachineConfiguration only ARM virtual networks ('Microsoft.Network/virtualNetworks') are supported, but for pools created with cloudServiceConfiguration both ARM and classic virtual networks are supported. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication. For pools created with a virtual machine configuration, enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. For pools created with a cloud service configuration, enable ports 10100, 20100, and 30100. Also enable outbound connections to Azure Storage on port 443. For more details see: https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration
- SubnetID *string `json:"subnetId,omitempty"`
- // EndpointConfiguration - Pool endpoint configuration is only supported on pools with the virtualMachineConfiguration property.
- EndpointConfiguration *PoolEndpointConfiguration `json:"endpointConfiguration,omitempty"`
-}
-
-// NetworkSecurityGroupRule ...
-type NetworkSecurityGroupRule struct {
- // Priority - Priorities within a pool must be unique and are evaluated in order of priority. The lower the number the higher the priority. For example, rules could be specified with order numbers of 150, 250, and 350. The rule with the order number of 150 takes precedence over the rule that has an order of 250. Allowed priorities are 150 to 3500. If any reserved or duplicate values are provided the request fails with HTTP status code 400.
- Priority *int32 `json:"priority,omitempty"`
- // Access - Possible values include: 'Allow', 'Deny'
- Access NetworkSecurityGroupRuleAccess `json:"access,omitempty"`
- // SourceAddressPrefix - Valid values are a single IP address (i.e. 10.10.10.10), IP subnet (i.e. 192.168.1.0/24), default tag, or * (for all addresses). If any other values are provided the request fails with HTTP status code 400.
- SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"`
-}
-
-// NodeAgentSku the Batch node agent is a program that runs on each node in the pool, and provides the
-// command-and-control interface between the node and the Batch service. There are different implementations of the
-// node agent, known as SKUs, for different operating systems.
-type NodeAgentSku struct {
- ID *string `json:"id,omitempty"`
- // VerifiedImageReferences - This collection is not exhaustive (the node agent may be compatible with other images).
- VerifiedImageReferences *[]ImageReference `json:"verifiedImageReferences,omitempty"`
- // OsType - Possible values include: 'Linux', 'Windows'
- OsType OSType `json:"osType,omitempty"`
-}
-
-// NodeDisableSchedulingParameter ...
-type NodeDisableSchedulingParameter struct {
- // NodeDisableSchedulingOption - The default value is requeue. Possible values include: 'DisableComputeNodeSchedulingOptionRequeue', 'DisableComputeNodeSchedulingOptionTerminate', 'DisableComputeNodeSchedulingOptionTaskCompletion'
- NodeDisableSchedulingOption DisableComputeNodeSchedulingOption `json:"nodeDisableSchedulingOption,omitempty"`
-}
-
-// NodeFile ...
-type NodeFile struct {
- Name *string `json:"name,omitempty"`
- URL *string `json:"url,omitempty"`
- IsDirectory *bool `json:"isDirectory,omitempty"`
- Properties *FileProperties `json:"properties,omitempty"`
-}
-
-// NodeFileListResult ...
-type NodeFileListResult struct {
- autorest.Response `json:"-"`
- Value *[]NodeFile `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// NodeFileListResultIterator provides access to a complete listing of NodeFile values.
-type NodeFileListResultIterator struct {
- i int
- page NodeFileListResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *NodeFileListResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter NodeFileListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter NodeFileListResultIterator) Response() NodeFileListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter NodeFileListResultIterator) Value() NodeFile {
- if !iter.page.NotDone() {
- return NodeFile{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (nflr NodeFileListResult) IsEmpty() bool {
- return nflr.Value == nil || len(*nflr.Value) == 0
-}
-
-// nodeFileListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (nflr NodeFileListResult) nodeFileListResultPreparer() (*http.Request, error) {
- if nflr.OdataNextLink == nil || len(to.String(nflr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(nflr.OdataNextLink)))
-}
-
-// NodeFileListResultPage contains a page of NodeFile values.
-type NodeFileListResultPage struct {
- fn func(NodeFileListResult) (NodeFileListResult, error)
- nflr NodeFileListResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *NodeFileListResultPage) Next() error {
- next, err := page.fn(page.nflr)
- if err != nil {
- return err
- }
- page.nflr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page NodeFileListResultPage) NotDone() bool {
- return !page.nflr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page NodeFileListResultPage) Response() NodeFileListResult {
- return page.nflr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page NodeFileListResultPage) Values() []NodeFile {
- if page.nflr.IsEmpty() {
- return nil
- }
- return *page.nflr.Value
-}
-
-// NodeRebootParameter ...
-type NodeRebootParameter struct {
- // NodeRebootOption - The default value is requeue. Possible values include: 'ComputeNodeRebootOptionRequeue', 'ComputeNodeRebootOptionTerminate', 'ComputeNodeRebootOptionTaskCompletion', 'ComputeNodeRebootOptionRetainedData'
- NodeRebootOption ComputeNodeRebootOption `json:"nodeRebootOption,omitempty"`
-}
-
-// NodeReimageParameter ...
-type NodeReimageParameter struct {
- // NodeReimageOption - The default value is requeue. Possible values include: 'ComputeNodeReimageOptionRequeue', 'ComputeNodeReimageOptionTerminate', 'ComputeNodeReimageOptionTaskCompletion', 'ComputeNodeReimageOptionRetainedData'
- NodeReimageOption ComputeNodeReimageOption `json:"nodeReimageOption,omitempty"`
-}
-
-// NodeRemoveParameter ...
-type NodeRemoveParameter struct {
- NodeList *[]string `json:"nodeList,omitempty"`
- // ResizeTimeout - The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- ResizeTimeout *string `json:"resizeTimeout,omitempty"`
- // NodeDeallocationOption - The default value is requeue. Possible values include: 'Requeue', 'Terminate', 'TaskCompletion', 'RetainedData'
- NodeDeallocationOption ComputeNodeDeallocationOption `json:"nodeDeallocationOption,omitempty"`
-}
-
-// NodeUpdateUserParameter ...
-type NodeUpdateUserParameter struct {
- // Password - The password is required for Windows nodes (those created with 'cloudServiceConfiguration', or created with 'virtualMachineConfiguration' using a Windows image reference). For Linux compute nodes, the password can optionally be specified along with the sshPublicKey property. If omitted, any existing password is removed.
- Password *string `json:"password,omitempty"`
- // ExpiryTime - If omitted, the default is 1 day from the current time. For Linux compute nodes, the expiryTime has a precision up to a day.
- ExpiryTime *date.Time `json:"expiryTime,omitempty"`
- // SSHPublicKey - The public key should be compatible with OpenSSH encoding and should be base 64 encoded. This property can be specified only for Linux nodes. If this is specified for a Windows node, then the Batch service rejects the request; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). If omitted, any existing SSH public key is removed.
- SSHPublicKey *string `json:"sshPublicKey,omitempty"`
-}
-
-// OSDisk ...
-type OSDisk struct {
- // Caching - The default value for caching is none. For information about the caching options see: https://blogs.msdn.microsoft.com/windowsazurestorage/2012/06/27/exploring-windows-azure-drives-disks-and-images/. Possible values include: 'None', 'ReadOnly', 'ReadWrite'
- Caching CachingType `json:"caching,omitempty"`
-}
-
-// OutputFile ...
-type OutputFile struct {
- // FilePattern - Both relative and absolute paths are supported. Relative paths are relative to the task working directory. The following wildcards are supported: * matches 0 or more characters (for example pattern abc* would match abc or abcdef), ** matches any directory, ? matches any single character, [abc] matches one character in the brackets, and [a-c] matches one character in the range. Brackets can include a negation to match any character not specified (for example [!abc] matches any character but a, b, or c). If a file name starts with "." it is ignored by default but may be matched by specifying it explicitly (for example *.gif will not match .a.gif, but .*.gif will). A simple example: **\*.txt matches any file that does not start in '.' and ends with .txt in the task working directory or any subdirectory. If the filename contains a wildcard character it can be escaped using brackets (for example abc[*] would match a file named abc*). Note that both \ and / are treated as directory separators on Windows, but only / is on Linux. Environment variables (%var% on Windows or $var on Linux) are expanded prior to the pattern being applied.
- FilePattern *string `json:"filePattern,omitempty"`
- Destination *OutputFileDestination `json:"destination,omitempty"`
- UploadOptions *OutputFileUploadOptions `json:"uploadOptions,omitempty"`
-}
-
-// OutputFileBlobContainerDestination ...
-type OutputFileBlobContainerDestination struct {
- // Path - If filePattern refers to a specific file (i.e. contains no wildcards), then path is the name of the blob to which to upload that file. If filePattern contains one or more wildcards (and therefore may match multiple files), then path is the name of the blob virtual directory (which is prepended to each blob name) to which to upload the file(s). If omitted, file(s) are uploaded to the root of the container with a blob name matching their file name.
- Path *string `json:"path,omitempty"`
- // ContainerURL - The URL must include a Shared Access Signature (SAS) granting write permissions to the container.
- ContainerURL *string `json:"containerUrl,omitempty"`
-}
-
-// OutputFileDestination ...
-type OutputFileDestination struct {
- Container *OutputFileBlobContainerDestination `json:"container,omitempty"`
-}
-
-// OutputFileUploadOptions ...
-type OutputFileUploadOptions struct {
- // UploadCondition - The default is taskcompletion. Possible values include: 'OutputFileUploadConditionTaskSuccess', 'OutputFileUploadConditionTaskFailure', 'OutputFileUploadConditionTaskCompletion'
- UploadCondition OutputFileUploadCondition `json:"uploadCondition,omitempty"`
-}
-
-// PoolAddParameter ...
-type PoolAddParameter struct {
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two pool IDs within an account that differ only by case).
- ID *string `json:"id,omitempty"`
- // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall, A1V2 and A2V2. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series).
- VMSize *string `json:"vmSize,omitempty"`
- // CloudServiceConfiguration - This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. This property cannot be specified if the Batch account was created with its poolAllocationMode property set to 'UserSubscription'.
- CloudServiceConfiguration *CloudServiceConfiguration `json:"cloudServiceConfiguration,omitempty"`
- // VirtualMachineConfiguration - This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified.
- VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"`
- // ResizeTimeout - This timeout applies only to manual scaling; it has no effect when enableAutoScale is set to true. The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- ResizeTimeout *string `json:"resizeTimeout,omitempty"`
- // TargetDedicatedNodes - This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both.
- TargetDedicatedNodes *int32 `json:"targetDedicatedNodes,omitempty"`
- // TargetLowPriorityNodes - This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both.
- TargetLowPriorityNodes *int32 `json:"targetLowPriorityNodes,omitempty"`
- // EnableAutoScale - If false, at least one of targetDedicateNodes and targetLowPriorityNodes must be specified. If true, the autoScaleFormula property is required and the pool automatically resizes according to the formula. The default value is false.
- EnableAutoScale *bool `json:"enableAutoScale,omitempty"`
- // AutoScaleFormula - This property must not be specified if enableAutoScale is set to false. It is required if enableAutoScale is set to true. The formula is checked for validity before the pool is created. If the formula is not valid, the Batch service rejects the request with detailed error information. For more information about specifying this formula, see 'Automatically scale compute nodes in an Azure Batch pool' (https://azure.microsoft.com/documentation/articles/batch-automatic-scaling/).
- AutoScaleFormula *string `json:"autoScaleFormula,omitempty"`
- // AutoScaleEvaluationInterval - The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"`
- // EnableInterNodeCommunication - Enabling inter-node communication limits the maximum size of the pool due to deployment restrictions on the nodes of the pool. This may result in the pool not reaching its desired size. The default value is false.
- EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"`
- NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"`
- // StartTask - The task runs when the node is added to the pool or when the node is restarted.
- StartTask *StartTask `json:"startTask,omitempty"`
- // CertificateReferences - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // ApplicationLicenses - The list of application licenses must be a subset of available Batch service application licenses. If a license is requested which is not supported, pool creation will fail.
- ApplicationLicenses *[]string `json:"applicationLicenses,omitempty"`
- // MaxTasksPerNode - The default value is 1. The maximum value of this setting depends on the size of the compute nodes in the pool (the vmSize setting).
- MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"`
- TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"`
- UserAccounts *[]UserAccount `json:"userAccounts,omitempty"`
- // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// PoolEnableAutoScaleParameter ...
-type PoolEnableAutoScaleParameter struct {
- // AutoScaleFormula - The formula is checked for validity before it is applied to the pool. If the formula is not valid, the Batch service rejects the request with detailed error information. For more information about specifying this formula, see Automatically scale compute nodes in an Azure Batch pool (https://azure.microsoft.com/en-us/documentation/articles/batch-automatic-scaling).
- AutoScaleFormula *string `json:"autoScaleFormula,omitempty"`
- // AutoScaleEvaluationInterval - The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service rejects the request with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). If you specify a new interval, then the existing autoscale evaluation schedule will be stopped and a new autoscale evaluation schedule will be started, with its starting time being the time when this request was issued.
- AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"`
-}
-
-// PoolEndpointConfiguration ...
-type PoolEndpointConfiguration struct {
- // InboundNATPools - The maximum number of inbound NAT pools per Batch pool is 5. If the maximum number of inbound NAT pools is exceeded the request fails with HTTP status code 400.
- InboundNATPools *[]InboundNATPool `json:"inboundNATPools,omitempty"`
-}
-
-// PoolEvaluateAutoScaleParameter ...
-type PoolEvaluateAutoScaleParameter struct {
- // AutoScaleFormula - The formula is validated and its results calculated, but it is not applied to the pool. To apply the formula to the pool, 'Enable automatic scaling on a pool'. For more information about specifying this formula, see Automatically scale compute nodes in an Azure Batch pool (https://azure.microsoft.com/en-us/documentation/articles/batch-automatic-scaling).
- AutoScaleFormula *string `json:"autoScaleFormula,omitempty"`
-}
-
-// PoolInformation ...
-type PoolInformation struct {
- // PoolID - You must ensure that the pool referenced by this property exists. If the pool does not exist at the time the Batch service tries to schedule a job, no tasks for the job will run until you create a pool with that id. Note that the Batch service will not reject the job request; it will simply not run tasks until the pool exists. You must specify either the pool ID or the auto pool specification, but not both.
- PoolID *string `json:"poolId,omitempty"`
- // AutoPoolSpecification - If auto pool creation fails, the Batch service moves the job to a completed state, and the pool creation error is set in the job's scheduling error property. The Batch service manages the lifetime (both creation and, unless keepAlive is specified, deletion) of the auto pool. Any user actions that affect the lifetime of the auto pool while the job is active will result in unexpected behavior. You must specify either the pool ID or the auto pool specification, but not both.
- AutoPoolSpecification *AutoPoolSpecification `json:"autoPoolSpecification,omitempty"`
-}
-
-// PoolListUsageMetricsResult ...
-type PoolListUsageMetricsResult struct {
- autorest.Response `json:"-"`
- Value *[]PoolUsageMetrics `json:"value,omitempty"`
- OdataNextLink *string `json:"odata.nextLink,omitempty"`
-}
-
-// PoolListUsageMetricsResultIterator provides access to a complete listing of PoolUsageMetrics values.
-type PoolListUsageMetricsResultIterator struct {
- i int
- page PoolListUsageMetricsResultPage
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *PoolListUsageMetricsResultIterator) Next() error {
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err := iter.page.Next()
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter PoolListUsageMetricsResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter PoolListUsageMetricsResultIterator) Response() PoolListUsageMetricsResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter PoolListUsageMetricsResultIterator) Value() PoolUsageMetrics {
- if !iter.page.NotDone() {
- return PoolUsageMetrics{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (plumr PoolListUsageMetricsResult) IsEmpty() bool {
- return plumr.Value == nil || len(*plumr.Value) == 0
-}
-
-// poolListUsageMetricsResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (plumr PoolListUsageMetricsResult) poolListUsageMetricsResultPreparer() (*http.Request, error) {
- if plumr.OdataNextLink == nil || len(to.String(plumr.OdataNextLink)) < 1 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(plumr.OdataNextLink)))
-}
-
-// PoolListUsageMetricsResultPage contains a page of PoolUsageMetrics values.
-type PoolListUsageMetricsResultPage struct {
- fn func(PoolListUsageMetricsResult) (PoolListUsageMetricsResult, error)
- plumr PoolListUsageMetricsResult
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *PoolListUsageMetricsResultPage) Next() error {
- next, err := page.fn(page.plumr)
- if err != nil {
- return err
- }
- page.plumr = next
- return nil
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page PoolListUsageMetricsResultPage) NotDone() bool {
- return !page.plumr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page PoolListUsageMetricsResultPage) Response() PoolListUsageMetricsResult {
- return page.plumr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page PoolListUsageMetricsResultPage) Values() []PoolUsageMetrics {
- if page.plumr.IsEmpty() {
- return nil
- }
- return *page.plumr.Value
-}
-
-// PoolPatchParameter ...
-type PoolPatchParameter struct {
- // StartTask - If this element is present, it overwrites any existing start task. If omitted, any existing start task is left unchanged.
- StartTask *StartTask `json:"startTask,omitempty"`
- // CertificateReferences - If this element is present, it replaces any existing certificate references configured on the pool. If omitted, any existing certificate references are left unchanged. For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- // ApplicationPackageReferences - Changes to application package references affect all new compute nodes joining the pool, but do not affect compute nodes that are already in the pool until they are rebooted or reimaged. If this element is present, it replaces any existing application package references. If you specify an empty collection, then all application package references are removed from the pool. If omitted, any existing application package references are left unchanged.
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // Metadata - If this element is present, it replaces any existing metadata configured on the pool. If you specify an empty collection, any metadata is removed from the pool. If omitted, any existing metadata is left unchanged.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// PoolResizeParameter ...
-type PoolResizeParameter struct {
- TargetDedicatedNodes *int32 `json:"targetDedicatedNodes,omitempty"`
- TargetLowPriorityNodes *int32 `json:"targetLowPriorityNodes,omitempty"`
- // ResizeTimeout - The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- ResizeTimeout *string `json:"resizeTimeout,omitempty"`
- // NodeDeallocationOption - The default value is requeue. Possible values include: 'Requeue', 'Terminate', 'TaskCompletion', 'RetainedData'
- NodeDeallocationOption ComputeNodeDeallocationOption `json:"nodeDeallocationOption,omitempty"`
-}
-
-// PoolSpecification ...
-type PoolSpecification struct {
- // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall, A1V2 and A2V2. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series).
- VMSize *string `json:"vmSize,omitempty"`
- // CloudServiceConfiguration - This property must be specified if the pool needs to be created with Azure PaaS VMs. This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. If neither is specified then the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). This property cannot be specified if the Batch account was created with its poolAllocationMode property set to 'UserSubscription'.
- CloudServiceConfiguration *CloudServiceConfiguration `json:"cloudServiceConfiguration,omitempty"`
- // VirtualMachineConfiguration - This property must be specified if the pool needs to be created with Azure IaaS VMs. This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified. If neither is specified then the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"`
- // MaxTasksPerNode - The default value is 1. The maximum value of this setting depends on the size of the compute nodes in the pool (the vmSize setting).
- MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"`
- TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"`
- // ResizeTimeout - This timeout applies only to manual scaling; it has no effect when enableAutoScale is set to true. The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service rejects the request with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- ResizeTimeout *string `json:"resizeTimeout,omitempty"`
- // TargetDedicatedNodes - This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both.
- TargetDedicatedNodes *int32 `json:"targetDedicatedNodes,omitempty"`
- // TargetLowPriorityNodes - This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both.
- TargetLowPriorityNodes *int32 `json:"targetLowPriorityNodes,omitempty"`
- // EnableAutoScale - If false, at least one of targetDedicateNodes and targetLowPriorityNodes must be specified. If true, the autoScaleFormula element is required. The pool automatically resizes according to the formula. The default value is false.
- EnableAutoScale *bool `json:"enableAutoScale,omitempty"`
- // AutoScaleFormula - This property must not be specified if enableAutoScale is set to false. It is required if enableAutoScale is set to true. The formula is checked for validity before the pool is created. If the formula is not valid, the Batch service rejects the request with detailed error information.
- AutoScaleFormula *string `json:"autoScaleFormula,omitempty"`
- // AutoScaleEvaluationInterval - The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service rejects the request with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- AutoScaleEvaluationInterval *string `json:"autoScaleEvaluationInterval,omitempty"`
- // EnableInterNodeCommunication - Enabling inter-node communication limits the maximum size of the pool due to deployment restrictions on the nodes of the pool. This may result in the pool not reaching its desired size. The default value is false.
- EnableInterNodeCommunication *bool `json:"enableInterNodeCommunication,omitempty"`
- NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"`
- StartTask *StartTask `json:"startTask,omitempty"`
- // CertificateReferences - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // ApplicationLicenses - The list of application licenses must be a subset of available Batch service application licenses. If a license is requested which is not supported, pool creation will fail.
- ApplicationLicenses *[]string `json:"applicationLicenses,omitempty"`
- UserAccounts *[]UserAccount `json:"userAccounts,omitempty"`
- // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// PoolStatistics ...
-type PoolStatistics struct {
- autorest.Response `json:"-"`
- URL *string `json:"url,omitempty"`
- StartTime *date.Time `json:"startTime,omitempty"`
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- UsageStats *UsageStatistics `json:"usageStats,omitempty"`
- ResourceStats *ResourceStatistics `json:"resourceStats,omitempty"`
-}
-
-// PoolUpdatePropertiesParameter ...
-type PoolUpdatePropertiesParameter struct {
- // StartTask - If this element is present, it overwrites any existing start task. If omitted, any existing start task is removed from the pool.
- StartTask *StartTask `json:"startTask,omitempty"`
- // CertificateReferences - This list replaces any existing certificate references configured on the pool. If you specify an empty collection, any existing certificate references are removed from the pool. For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory.
- CertificateReferences *[]CertificateReference `json:"certificateReferences,omitempty"`
- // ApplicationPackageReferences - The list replaces any existing application package references on the pool. Changes to application package references affect all new compute nodes joining the pool, but do not affect compute nodes that are already in the pool until they are rebooted or reimaged. If omitted, or if you specify an empty collection, any existing application packages references are removed from the pool.
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // Metadata - This list replaces any existing metadata configured on the pool. If omitted, or if you specify an empty collection, any existing metadata is removed from the pool.
- Metadata *[]MetadataItem `json:"metadata,omitempty"`
-}
-
-// PoolUpgradeOSParameter ...
-type PoolUpgradeOSParameter struct {
- TargetOSVersion *string `json:"targetOSVersion,omitempty"`
-}
-
-// PoolUsageMetrics ...
-type PoolUsageMetrics struct {
- PoolID *string `json:"poolId,omitempty"`
- StartTime *date.Time `json:"startTime,omitempty"`
- EndTime *date.Time `json:"endTime,omitempty"`
- // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall, STANDARD_A1_V2 and STANDARD_A2_V2. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series).
- VMSize *string `json:"vmSize,omitempty"`
- TotalCoreHours *float64 `json:"totalCoreHours,omitempty"`
- DataIngressGiB *float64 `json:"dataIngressGiB,omitempty"`
- DataEgressGiB *float64 `json:"dataEgressGiB,omitempty"`
-}
-
-// ReadCloser ...
-type ReadCloser struct {
- autorest.Response `json:"-"`
- Value *io.ReadCloser `json:"value,omitempty"`
-}
-
-// RecentJob ...
-type RecentJob struct {
- ID *string `json:"id,omitempty"`
- URL *string `json:"url,omitempty"`
-}
-
-// ResizeError ...
-type ResizeError struct {
- Code *string `json:"code,omitempty"`
- Message *string `json:"message,omitempty"`
- Values *[]NameValuePair `json:"values,omitempty"`
-}
-
-// ResourceFile ...
-type ResourceFile struct {
- // BlobSource - This URL must be readable using anonymous access; that is, the Batch service does not present any credentials when downloading the blob. There are two ways to get such a URL for a blob in Azure storage: include a Shared Access Signature (SAS) granting read permissions on the blob, or set the ACL for the blob or its container to allow public access.
- BlobSource *string `json:"blobSource,omitempty"`
- FilePath *string `json:"filePath,omitempty"`
- // FileMode - This property applies only to files being downloaded to Linux compute nodes. It will be ignored if it is specified for a resourceFile which will be downloaded to a Windows node. If this property is not specified for a Linux node, then a default value of 0770 is applied to the file.
- FileMode *string `json:"fileMode,omitempty"`
-}
-
-// ResourceStatistics ...
-type ResourceStatistics struct {
- StartTime *date.Time `json:"startTime,omitempty"`
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- AvgCPUPercentage *float64 `json:"avgCPUPercentage,omitempty"`
- AvgMemoryGiB *float64 `json:"avgMemoryGiB,omitempty"`
- PeakMemoryGiB *float64 `json:"peakMemoryGiB,omitempty"`
- AvgDiskGiB *float64 `json:"avgDiskGiB,omitempty"`
- PeakDiskGiB *float64 `json:"peakDiskGiB,omitempty"`
- DiskReadIOps *int64 `json:"diskReadIOps,omitempty"`
- DiskWriteIOps *int64 `json:"diskWriteIOps,omitempty"`
- DiskReadGiB *float64 `json:"diskReadGiB,omitempty"`
- DiskWriteGiB *float64 `json:"diskWriteGiB,omitempty"`
- NetworkReadGiB *float64 `json:"networkReadGiB,omitempty"`
- NetworkWriteGiB *float64 `json:"networkWriteGiB,omitempty"`
-}
-
-// Schedule ...
-type Schedule struct {
- // DoNotRunUntil - If you do not specify a doNotRunUntil time, the schedule becomes ready to create jobs immediately.
- DoNotRunUntil *date.Time `json:"doNotRunUntil,omitempty"`
- // DoNotRunAfter - If you do not specify a doNotRunAfter time, and you are creating a recurring job schedule, the job schedule will remain active until you explicitly terminate it.
- DoNotRunAfter *date.Time `json:"doNotRunAfter,omitempty"`
- // StartWindow - If a job is not created within the startWindow interval, then the 'opportunity' is lost; no job will be created until the next recurrence of the schedule. If the schedule is recurring, and the startWindow is longer than the recurrence interval, then this is equivalent to an infinite startWindow, because the job that is 'due' in one recurrenceInterval is not carried forward into the next recurrence interval. The default is infinite. The minimum value is 1 minute. If you specify a lower value, the Batch service rejects the schedule with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- StartWindow *string `json:"startWindow,omitempty"`
- // RecurrenceInterval - Because a job schedule can have at most one active job under it at any given time, if it is time to create a new job under a job schedule, but the previous job is still running, the Batch service will not create the new job until the previous job finishes. If the previous job does not finish within the startWindow period of the new recurrenceInterval, then no new job will be scheduled for that interval. For recurring jobs, you should normally specify a jobManagerTask in the jobSpecification. If you do not use jobManagerTask, you will need an external process to monitor when jobs are created, add tasks to the jobs and terminate the jobs ready for the next recurrence. The default is that the schedule does not recur: one job is created, within the startWindow after the doNotRunUntil time, and the schedule is complete as soon as that job finishes. The minimum value is 1 minute. If you specify a lower value, the Batch service rejects the schedule with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
- RecurrenceInterval *string `json:"recurrenceInterval,omitempty"`
-}
-
-// StartTask ...
-type StartTask struct {
- // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux.
- CommandLine *string `json:"commandLine,omitempty"`
- // ContainerSettings - When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all task environment variables are mapped into the container, and the task command line is executed in the container.
- ContainerSettings *TaskContainerSettings `json:"containerSettings,omitempty"`
- // ResourceFiles - Files listed under this element are located in the task's working directory.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task.
- UserIdentity *UserIdentity `json:"userIdentity,omitempty"`
- // MaxTaskRetryCount - The Batch service retries a task if its exit code is nonzero. Note that this value specifically controls the number of retries. The Batch service will try the task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the task. If the maximum retry count is -1, the Batch service retries the task without limit.
- MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"`
- // WaitForSuccess - If true and the start task fails on a compute node, the Batch service retries the start task up to its maximum retry count (maxTaskRetryCount). If the task has still not completed successfully after all retries, then the Batch service marks the compute node unusable, and will not schedule tasks to it. This condition can be detected via the node state and failure info details. If false, the Batch service will not wait for the start task to complete. In this case, other tasks can start executing on the compute node while the start task is still running; and even if the start task fails, new tasks will continue to be scheduled on the node. The default is false.
- WaitForSuccess *bool `json:"waitForSuccess,omitempty"`
-}
-
-// StartTaskInformation ...
-type StartTaskInformation struct {
- // State - Possible values include: 'StartTaskStateRunning', 'StartTaskStateCompleted'
- State StartTaskState `json:"state,omitempty"`
- // StartTime - This value is reset every time the task is restarted or retried (that is, this is the most recent time at which the start task started running).
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - This is the end time of the most recent run of the start task, if that run has completed (even if that run failed and a retry is pending). This element is not present if the start task is currently running.
- EndTime *date.Time `json:"endTime,omitempty"`
- // ExitCode - This property is set only if the start task is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the start task (due to timeout, or user termination via the API) you may see an operating system-defined exit code.
- ExitCode *int32 `json:"exitCode,omitempty"`
- // ContainerInfo - This property is set only if the task runs in a container context.
- ContainerInfo *TaskContainerExecutionInformation `json:"containerInfo,omitempty"`
- // FailureInfo - This property is set only if the task is in the completed state and encountered a failure.
- FailureInfo *TaskFailureInformation `json:"failureInfo,omitempty"`
- // RetryCount - Task application failures (non-zero exit code) are retried, pre-processing errors (the task could not be run) and file upload errors are not retried. The Batch service will retry the task up to the limit specified by the constraints.
- RetryCount *int32 `json:"retryCount,omitempty"`
- // LastRetryTime - This element is present only if the task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the task has been restarted for reasons other than retry; for example, if the compute node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not.
- LastRetryTime *date.Time `json:"lastRetryTime,omitempty"`
- // Result - If the value is 'failed', then the details of the failure can be found in the failureInfo property. Possible values include: 'Success', 'Failure'
- Result TaskExecutionResult `json:"result,omitempty"`
-}
-
-// SubtaskInformation ...
-type SubtaskInformation struct {
- ID *int32 `json:"id,omitempty"`
- NodeInfo *ComputeNodeInformation `json:"nodeInfo,omitempty"`
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - This property is set only if the subtask is in the Completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
- // ExitCode - This property is set only if the subtask is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the subtask (due to timeout, or user termination via the API) you may see an operating system-defined exit code.
- ExitCode *int32 `json:"exitCode,omitempty"`
- // ContainerInfo - This property is set only if the task runs in a container context.
- ContainerInfo *TaskContainerExecutionInformation `json:"containerInfo,omitempty"`
- // FailureInfo - This property is set only if the task is in the completed state and encountered a failure.
- FailureInfo *TaskFailureInformation `json:"failureInfo,omitempty"`
- // State - Possible values include: 'SubtaskStatePreparing', 'SubtaskStateRunning', 'SubtaskStateCompleted'
- State SubtaskState `json:"state,omitempty"`
- StateTransitionTime *date.Time `json:"stateTransitionTime,omitempty"`
- // PreviousState - This property is not set if the subtask is in its initial running state. Possible values include: 'SubtaskStatePreparing', 'SubtaskStateRunning', 'SubtaskStateCompleted'
- PreviousState SubtaskState `json:"previousState,omitempty"`
- // PreviousStateTransitionTime - This property is not set if the subtask is in its initial running state.
- PreviousStateTransitionTime *date.Time `json:"previousStateTransitionTime,omitempty"`
- // Result - If the value is 'failed', then the details of the failure can be found in the failureInfo property. Possible values include: 'Success', 'Failure'
- Result TaskExecutionResult `json:"result,omitempty"`
-}
-
-// TaskAddCollectionParameter ...
-type TaskAddCollectionParameter struct {
- // Value - The total serialized size of this collection must be less than 4MB. If it is greater than 4MB (for example if each task has 100's of resource files or environment variables), the request will fail with code 'RequestBodyTooLarge' and should be retried again with fewer tasks.
- Value *[]TaskAddParameter `json:"value,omitempty"`
-}
-
-// TaskAddCollectionResult ...
-type TaskAddCollectionResult struct {
- autorest.Response `json:"-"`
- Value *[]TaskAddResult `json:"value,omitempty"`
-}
-
-// TaskAddParameter ...
-type TaskAddParameter struct {
- // ID - The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within a job that differ only by case).
- ID *string `json:"id,omitempty"`
- // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
- DisplayName *string `json:"displayName,omitempty"`
- // CommandLine - For multi-instance tasks, the command line is executed as the primary task, after the primary task and all subtasks have finished executing the coordination command line. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux.
- CommandLine *string `json:"commandLine,omitempty"`
- // ContainerSettings - If the pool that will run this task has containerConfiguration set, this must be set as well. If the pool that will run this task doesn't have containerConfiguration set, this must not be set. When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all task environment variables are mapped into the container, and the task command line is executed in the container.
- ContainerSettings *TaskContainerSettings `json:"containerSettings,omitempty"`
- // ExitConditions - How the Batch service should respond when the task completes.
- ExitConditions *ExitConditions `json:"exitConditions,omitempty"`
- // ResourceFiles - For multi-instance tasks, the resource files will only be downloaded to the compute node on which the primary task is executed.
- ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"`
- // OutputFiles - For multi-instance tasks, the files will only be uploaded from the compute node on which the primary task is executed.
- OutputFiles *[]OutputFile `json:"outputFiles,omitempty"`
- EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"`
- AffinityInfo *AffinityInformation `json:"affinityInfo,omitempty"`
- // Constraints - If you do not specify constraints, the maxTaskRetryCount is the maxTaskRetryCount specified for the job, and the maxWallClockTime and retentionTime are infinite.
- Constraints *TaskConstraints `json:"constraints,omitempty"`
- // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task.
- UserIdentity *UserIdentity `json:"userIdentity,omitempty"`
- MultiInstanceSettings *MultiInstanceSettings `json:"multiInstanceSettings,omitempty"`
- // DependsOn - This task will not be scheduled until all tasks that it depends on have completed successfully. If any of those tasks fail and exhaust their retry counts, this task will never be scheduled. If the job does not have usesTaskDependencies set to true, and this element is present, the request fails with error code TaskDependenciesNotSpecifiedOnJob.
- DependsOn *TaskDependencies `json:"dependsOn,omitempty"`
- // ApplicationPackageReferences - Application packages are downloaded and deployed to a shared directory, not the task working directory. Therefore, if a referenced package is already on the compute node, and is up to date, then it is not re-downloaded; the existing copy on the compute node is used. If a referenced application package cannot be installed, for example because the package has been deleted or because download failed, the task fails.
- ApplicationPackageReferences *[]ApplicationPackageReference `json:"applicationPackageReferences,omitempty"`
- // AuthenticationTokenSettings - If this property is set, the Batch service provides the task with an authentication token which can be used to authenticate Batch service operations without requiring an account access key. The token is provided via the AZ_BATCH_AUTHENTICATION_TOKEN environment variable. The operations that the task can carry out using the token depend on the settings. For example, a task can request job permissions in order to add other tasks to the job, or check the status of the job or of other tasks under the job.
- AuthenticationTokenSettings *AuthenticationTokenSettings `json:"authenticationTokenSettings,omitempty"`
-}
-
-// TaskAddResult ...
-type TaskAddResult struct {
- // Status - Possible values include: 'TaskAddStatusSuccess', 'TaskAddStatusClientError', 'TaskAddStatusServerError'
- Status TaskAddStatus `json:"status,omitempty"`
- TaskID *string `json:"taskId,omitempty"`
- // ETag - You can use this to detect whether the task has changed between requests. In particular, you can be pass the ETag with an Update Task request to specify that your changes should take effect only if nobody else has modified the job in the meantime.
- ETag *string `json:"eTag,omitempty"`
- LastModified *date.Time `json:"lastModified,omitempty"`
- Location *string `json:"location,omitempty"`
- Error *Error `json:"error,omitempty"`
-}
-
-// TaskConstraints ...
-type TaskConstraints struct {
- // MaxWallClockTime - If this is not specified, there is no time limit on how long the task may run.
- MaxWallClockTime *string `json:"maxWallClockTime,omitempty"`
- // RetentionTime - The default is infinite, i.e. the task directory will be retained until the compute node is removed or reimaged.
- RetentionTime *string `json:"retentionTime,omitempty"`
- // MaxTaskRetryCount - Note that this value specifically controls the number of retries. The Batch service will try the task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the task. If the maximum retry count is -1, the Batch service retries the task without limit.
- MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"`
-}
-
-// TaskContainerExecutionInformation ...
-type TaskContainerExecutionInformation struct {
- ContainerID *string `json:"containerId,omitempty"`
- // State - This is the state of the container according to the Docker service. It is equivalent to the status field returned by "docker inspect".
- State *string `json:"state,omitempty"`
- // Error - This is the detailed error string from the Docker service, if available. It is equivalent to the error field returned by "docker inspect".
- Error *string `json:"error,omitempty"`
-}
-
-// TaskContainerSettings ...
-type TaskContainerSettings struct {
- // ContainerRunOptions - These additional options are supplied as arguments to the "docker create" command, in addition to those controlled by the Batch Service.
- ContainerRunOptions *string `json:"containerRunOptions,omitempty"`
- // ImageName - This is the full image reference, as would be specified to "docker pull". If no tag is provided as part of the image name, the tag ":latest" is used as a default.
- ImageName *string `json:"imageName,omitempty"`
- // Registry - This setting can be omitted if was already provided at pool creation.
- Registry *ContainerRegistry `json:"registry,omitempty"`
-}
-
-// TaskCounts ...
-type TaskCounts struct {
- autorest.Response `json:"-"`
- Active *int32 `json:"active,omitempty"`
- Running *int32 `json:"running,omitempty"`
- Completed *int32 `json:"completed,omitempty"`
- Succeeded *int32 `json:"succeeded,omitempty"`
- Failed *int32 `json:"failed,omitempty"`
- // ValidationStatus - Possible values include: 'Validated', 'Unvalidated'
- ValidationStatus TaskCountValidationStatus `json:"validationStatus,omitempty"`
-}
-
-// TaskDependencies ...
-type TaskDependencies struct {
- // TaskIds - The taskIds collection is limited to 64000 characters total (i.e. the combined length of all task IDs). If the taskIds collection exceeds the maximum length, the Add Task request fails with error code TaskDependencyListTooLong. In this case consider using task ID ranges instead.
- TaskIds *[]string `json:"taskIds,omitempty"`
- TaskIDRanges *[]TaskIDRange `json:"taskIdRanges,omitempty"`
-}
-
-// TaskExecutionInformation ...
-type TaskExecutionInformation struct {
- // StartTime - 'Running' corresponds to the running state, so if the task specifies resource files or application packages, then the start time reflects the time at which the task started downloading or deploying these. If the task has been restarted or retried, this is the most recent time at which the task started running. This property is present only for tasks that are in the running or completed state.
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - This property is set only if the task is in the Completed state.
- EndTime *date.Time `json:"endTime,omitempty"`
- // ExitCode - This property is set only if the task is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the task (due to timeout, or user termination via the API) you may see an operating system-defined exit code.
- ExitCode *int32 `json:"exitCode,omitempty"`
- // ContainerInfo - This property is set only if the task runs in a container context.
- ContainerInfo *TaskContainerExecutionInformation `json:"containerInfo,omitempty"`
- // FailureInfo - This property is set only if the task is in the completed state and encountered a failure.
- FailureInfo *TaskFailureInformation `json:"failureInfo,omitempty"`
- // RetryCount - Task application failures (non-zero exit code) are retried, pre-processing errors (the task could not be run) and file upload errors are not retried. The Batch service will retry the task up to the limit specified by the constraints.
- RetryCount *int32 `json:"retryCount,omitempty"`
- // LastRetryTime - This element is present only if the task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the task has been restarted for reasons other than retry; for example, if the compute node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not.
- LastRetryTime *date.Time `json:"lastRetryTime,omitempty"`
- // RequeueCount - When the user removes nodes from a pool (by resizing/shrinking the pool) or when the job is being disabled, the user can specify that running tasks on the nodes be requeued for execution. This count tracks how many times the task has been requeued for these reasons.
- RequeueCount *int32 `json:"requeueCount,omitempty"`
- // LastRequeueTime - This property is set only if the requeueCount is nonzero.
- LastRequeueTime *date.Time `json:"lastRequeueTime,omitempty"`
- // Result - If the value is 'failed', then the details of the failure can be found in the failureInfo property. Possible values include: 'Success', 'Failure'
- Result TaskExecutionResult `json:"result,omitempty"`
-}
-
-// TaskFailureInformation ...
-type TaskFailureInformation struct {
- // Category - Possible values include: 'UserError', 'ServerError'
- Category ErrorCategory `json:"category,omitempty"`
- Code *string `json:"code,omitempty"`
- Message *string `json:"message,omitempty"`
- Details *[]NameValuePair `json:"details,omitempty"`
-}
-
-// TaskIDRange the start and end of the range are inclusive. For example, if a range has start 9 and end 12, then
-// it represents tasks '9', '10', '11' and '12'.
-type TaskIDRange struct {
- Start *int32 `json:"start,omitempty"`
- End *int32 `json:"end,omitempty"`
-}
-
-// TaskInformation ...
-type TaskInformation struct {
- TaskURL *string `json:"taskUrl,omitempty"`
- JobID *string `json:"jobId,omitempty"`
- TaskID *string `json:"taskId,omitempty"`
- SubtaskID *int32 `json:"subtaskId,omitempty"`
- // TaskState - Possible values include: 'TaskStateActive', 'TaskStatePreparing', 'TaskStateRunning', 'TaskStateCompleted'
- TaskState TaskState `json:"taskState,omitempty"`
- ExecutionInfo *TaskExecutionInformation `json:"executionInfo,omitempty"`
-}
-
-// TaskSchedulingPolicy ...
-type TaskSchedulingPolicy struct {
- // NodeFillType - Possible values include: 'Spread', 'Pack'
- NodeFillType ComputeNodeFillType `json:"nodeFillType,omitempty"`
-}
-
-// TaskStatistics ...
-type TaskStatistics struct {
- URL *string `json:"url,omitempty"`
- StartTime *date.Time `json:"startTime,omitempty"`
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- UserCPUTime *string `json:"userCPUTime,omitempty"`
- KernelCPUTime *string `json:"kernelCPUTime,omitempty"`
- // WallClockTime - The wall clock time is the elapsed time from when the task started running on a compute node to when it finished (or to the last time the statistics were updated, if the task had not finished by then). If the task was retried, this includes the wall clock time of all the task retries.
- WallClockTime *string `json:"wallClockTime,omitempty"`
- ReadIOps *int64 `json:"readIOps,omitempty"`
- WriteIOps *int64 `json:"writeIOps,omitempty"`
- ReadIOGiB *float64 `json:"readIOGiB,omitempty"`
- WriteIOGiB *float64 `json:"writeIOGiB,omitempty"`
- WaitTime *string `json:"waitTime,omitempty"`
-}
-
-// TaskUpdateParameter ...
-type TaskUpdateParameter struct {
- // Constraints - If omitted, the task is given the default constraints. For multi-instance tasks, updating the retention time applies only to the primary task and not subtasks.
- Constraints *TaskConstraints `json:"constraints,omitempty"`
-}
-
-// UsageStatistics ...
-type UsageStatistics struct {
- StartTime *date.Time `json:"startTime,omitempty"`
- LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
- DedicatedCoreTime *string `json:"dedicatedCoreTime,omitempty"`
-}
-
-// UserAccount ...
-type UserAccount struct {
- Name *string `json:"name,omitempty"`
- Password *string `json:"password,omitempty"`
- // ElevationLevel - nonAdmin - The auto user is a standard user without elevated access. admin - The auto user is a user with elevated access and operates with full Administrator permissions. The default value is nonAdmin. Possible values include: 'NonAdmin', 'Admin'
- ElevationLevel ElevationLevel `json:"elevationLevel,omitempty"`
- // LinuxUserConfiguration - This property is ignored if specified on a Windows pool. If not specified, the user is created with the default options.
- LinuxUserConfiguration *LinuxUserConfiguration `json:"linuxUserConfiguration,omitempty"`
-}
-
-// UserIdentity specify either the userName or autoUser property, but not both.
-type UserIdentity struct {
- // UserName - The userName and autoUser properties are mutually exclusive; you must specify one but not both.
- UserName *string `json:"username,omitempty"`
- // AutoUser - The userName and autoUser properties are mutually exclusive; you must specify one but not both.
- AutoUser *AutoUserSpecification `json:"autoUser,omitempty"`
-}
-
-// VirtualMachineConfiguration ...
-type VirtualMachineConfiguration struct {
- ImageReference *ImageReference `json:"imageReference,omitempty"`
- OsDisk *OSDisk `json:"osDisk,omitempty"`
- // NodeAgentSKUID - The Batch node agent is a program that runs on each node in the pool, and provides the command-and-control interface between the node and the Batch service. There are different implementations of the node agent, known as SKUs, for different operating systems. You must specify a node agent SKU which matches the selected image reference. To get the list of supported node agent SKUs along with their list of verified image references, see the 'List supported node agent SKUs' operation.
- NodeAgentSKUID *string `json:"nodeAgentSKUId,omitempty"`
- // WindowsConfiguration - This property must not be specified if the imageReference or osDisk property specifies a Linux OS image.
- WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"`
- // DataDisks - This property must be specified if the compute nodes in the pool need to have empty data disks attached to them. This cannot be updated. Each node gets its own disk (the disk is not a file share). Existing disks cannot be attached, each attached disk is empty. When the node is removed from the pool, the disk and all data associated with it is also deleted. The disk is not formatted after being attached, it must be formatted before use - for more information see https://docs.microsoft.com/en-us/azure/virtual-machines/linux/classic/attach-disk#initialize-a-new-data-disk-in-linux and https://docs.microsoft.com/en-us/azure/virtual-machines/windows/attach-disk-ps#add-an-empty-data-disk-to-a-virtual-machine.
- DataDisks *[]DataDisk `json:"dataDisks,omitempty"`
- // LicenseType - This only applies to images that contain the Windows operating system, and should only be used when you hold valid on-premises licenses for the nodes which will be deployed. If omitted, no on-premises licensing discount is applied. Values are:
- // Windows_Server - The on-premises license is for Windows Server.
- // Windows_Client - The on-premises license is for Windows Client.
- LicenseType *string `json:"licenseType,omitempty"`
- // ContainerConfiguration - If specified, setup is performed on each node in the pool to allow tasks to run in containers. All regular tasks and job manager tasks run on this pool must specify the containerSettings property, and all other tasks may specify it.
- ContainerConfiguration *ContainerConfiguration `json:"containerConfiguration,omitempty"`
-}
-
-// WindowsConfiguration ...
-type WindowsConfiguration struct {
- // EnableAutomaticUpdates - If omitted, the default value is true.
- EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"`
-}
diff --git a/services/batch/2017-09-01.6.0/batch/pool.go b/services/batch/2017-09-01.6.0/batch/pool.go
deleted file mode 100644
index b9846a345fb4..000000000000
--- a/services/batch/2017-09-01.6.0/batch/pool.go
+++ /dev/null
@@ -1,1897 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// PoolClient is the a client for issuing REST requests to the Azure Batch service.
-type PoolClient struct {
- BaseClient
-}
-
-// NewPoolClient creates an instance of the PoolClient client.
-func NewPoolClient() PoolClient {
- return NewPoolClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewPoolClientWithBaseURI creates an instance of the PoolClient client.
-func NewPoolClientWithBaseURI(baseURI string) PoolClient {
- return PoolClient{NewWithBaseURI(baseURI)}
-}
-
-// Add when naming pools, avoid including sensitive information such as user names or secret project names. This
-// information may appear in telemetry logs accessible to Microsoft Support engineers.
-//
-// pool is the pool to be added. timeout is the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a
-// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are
-// calling the REST API directly.
-func (client PoolClient) Add(ctx context.Context, pool PoolAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: pool,
- Constraints: []validation.Constraint{{Target: "pool.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "pool.VMSize", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "pool.CloudServiceConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "pool.CloudServiceConfiguration.OsFamily", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "pool.VirtualMachineConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "pool.VirtualMachineConfiguration.ImageReference", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "pool.VirtualMachineConfiguration.NodeAgentSKUID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "pool.VirtualMachineConfiguration.ContainerConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "pool.VirtualMachineConfiguration.ContainerConfiguration.Type", Name: validation.Null, Rule: true, Chain: nil}}},
- }},
- {Target: "pool.NetworkConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "pool.NetworkConfiguration.EndpointConfiguration", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "pool.NetworkConfiguration.EndpointConfiguration.InboundNATPools", Name: validation.Null, Rule: true, Chain: nil}}},
- }},
- {Target: "pool.StartTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "pool.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "pool.StartTask.ContainerSettings", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "pool.StartTask.ContainerSettings.ImageName", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "pool.StartTask.ContainerSettings.Registry", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "pool.StartTask.ContainerSettings.Registry.UserName", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "pool.StartTask.ContainerSettings.Registry.Password", Name: validation.Null, Rule: true, Chain: nil},
- }},
- }},
- }}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "Add", err.Error())
- }
-
- req, err := client.AddPreparer(ctx, pool, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Add", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPreparer prepares the Add request.
-func (client PoolClient) AddPreparer(ctx context.Context, pool PoolAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/pools"),
- autorest.WithJSON(pool),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSender sends the Add request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) AddSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddResponder handles the response to the Add request. The method always
-// closes the http.Response Body.
-func (client PoolClient) AddResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Delete when you request that a pool be deleted, the following actions occur: the pool state is set to deleting; any
-// ongoing resize operation on the pool are stopped; the Batch service starts resizing the pool to zero nodes; any
-// tasks running on existing nodes are terminated and requeued (as if a resize pool operation had been requested with
-// the default requeue option); finally, the pool is removed from the system. Because running tasks are requeued, the
-// user can rerun these tasks by updating their job to target a different pool. The tasks can then run on the new pool.
-// If you want to override the requeue behavior, then you should call resize pool explicitly to shrink the pool to zero
-// size before deleting the pool. If you call an Update, Patch or Delete API on a pool in the deleting state, it will
-// fail with HTTP status code 409 with error code PoolBeingDeleted.
-//
-// poolID is the ID of the pool to delete. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. Client libraries typically set this to the current system clock time; set it
-// explicitly if you are calling the REST API directly. ifMatch is an ETag value associated with the version of the
-// resource known to the client. The operation will be performed only if the resource's current ETag on the service
-// exactly matches the value specified by the client. ifNoneMatch is an ETag value associated with the version of
-// the resource known to the client. The operation will be performed only if the resource's current ETag on the
-// service does not match the value specified by the client. ifModifiedSince is a timestamp indicating the last
-// modified time of the resource known to the client. The operation will be performed only if the resource on the
-// service has been modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last
-// modified time of the resource known to the client. The operation will be performed only if the resource on the
-// service has not been modified since the specified time.
-func (client PoolClient) Delete(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeletePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client PoolClient) DeletePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client PoolClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// DisableAutoScale sends the disable auto scale request.
-//
-// poolID is the ID of the pool on which to disable automatic scaling. timeout is the maximum time that the server
-// can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated
-// request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client PoolClient) DisableAutoScale(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DisableAutoScalePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DisableAutoScaleSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", resp, "Failure sending request")
- return
- }
-
- result, err = client.DisableAutoScaleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "DisableAutoScale", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DisableAutoScalePreparer prepares the DisableAutoScale request.
-func (client PoolClient) DisableAutoScalePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/disableautoscale", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DisableAutoScaleSender sends the DisableAutoScale request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) DisableAutoScaleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DisableAutoScaleResponder handles the response to the DisableAutoScale request. The method always
-// closes the http.Response Body.
-func (client PoolClient) DisableAutoScaleResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// EnableAutoScale you cannot enable automatic scaling on a pool if a resize operation is in progress on the pool. If
-// automatic scaling of the pool is currently disabled, you must specify a valid autoscale formula as part of the
-// request. If automatic scaling of the pool is already enabled, you may specify a new autoscale formula and/or a new
-// evaluation interval. You cannot call this API for the same pool more than once every 30 seconds.
-//
-// poolID is the ID of the pool on which to enable automatic scaling. poolEnableAutoScaleParameter is the
-// parameters for the request. timeout is the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a
-// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are
-// calling the REST API directly. ifMatch is an ETag value associated with the version of the resource known to the
-// client. The operation will be performed only if the resource's current ETag on the service exactly matches the
-// value specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to
-// the client. The operation will be performed only if the resource's current ETag on the service does not match
-// the value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the
-// resource known to the client. The operation will be performed only if the resource on the service has been
-// modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the
-// resource known to the client. The operation will be performed only if the resource on the service has not been
-// modified since the specified time.
-func (client PoolClient) EnableAutoScale(ctx context.Context, poolID string, poolEnableAutoScaleParameter PoolEnableAutoScaleParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.EnableAutoScalePreparer(ctx, poolID, poolEnableAutoScaleParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.EnableAutoScaleSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", resp, "Failure sending request")
- return
- }
-
- result, err = client.EnableAutoScaleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EnableAutoScale", resp, "Failure responding to request")
- }
-
- return
-}
-
-// EnableAutoScalePreparer prepares the EnableAutoScale request.
-func (client PoolClient) EnableAutoScalePreparer(ctx context.Context, poolID string, poolEnableAutoScaleParameter PoolEnableAutoScaleParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/enableautoscale", pathParameters),
- autorest.WithJSON(poolEnableAutoScaleParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// EnableAutoScaleSender sends the EnableAutoScale request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) EnableAutoScaleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// EnableAutoScaleResponder handles the response to the EnableAutoScale request. The method always
-// closes the http.Response Body.
-func (client PoolClient) EnableAutoScaleResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// EvaluateAutoScale this API is primarily for validating an autoscale formula, as it simply returns the result without
-// applying the formula to the pool. The pool must have auto scaling enabled in order to evaluate a formula.
-//
-// poolID is the ID of the pool on which to evaluate the automatic scaling formula. poolEvaluateAutoScaleParameter
-// is the parameters for the request. timeout is the maximum time that the server can spend processing the request,
-// in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of
-// a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are
-// calling the REST API directly.
-func (client PoolClient) EvaluateAutoScale(ctx context.Context, poolID string, poolEvaluateAutoScaleParameter PoolEvaluateAutoScaleParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result AutoScaleRun, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: poolEvaluateAutoScaleParameter,
- Constraints: []validation.Constraint{{Target: "poolEvaluateAutoScaleParameter.AutoScaleFormula", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "EvaluateAutoScale", err.Error())
- }
-
- req, err := client.EvaluateAutoScalePreparer(ctx, poolID, poolEvaluateAutoScaleParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.EvaluateAutoScaleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", resp, "Failure sending request")
- return
- }
-
- result, err = client.EvaluateAutoScaleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "EvaluateAutoScale", resp, "Failure responding to request")
- }
-
- return
-}
-
-// EvaluateAutoScalePreparer prepares the EvaluateAutoScale request.
-func (client PoolClient) EvaluateAutoScalePreparer(ctx context.Context, poolID string, poolEvaluateAutoScaleParameter PoolEvaluateAutoScaleParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/evaluateautoscale", pathParameters),
- autorest.WithJSON(poolEvaluateAutoScaleParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// EvaluateAutoScaleSender sends the EvaluateAutoScale request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) EvaluateAutoScaleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// EvaluateAutoScaleResponder handles the response to the EvaluateAutoScale request. The method always
-// closes the http.Response Body.
-func (client PoolClient) EvaluateAutoScaleResponder(resp *http.Response) (result AutoScaleRun, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Exists gets basic properties of a pool.
-//
-// poolID is the ID of the pool to get. timeout is the maximum time that the server can spend processing the
-// request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the
-// form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.
-// returnClientRequestID is whether the server should return the client-request-id in the response. ocpDate is the
-// time the request was issued. Client libraries typically set this to the current system clock time; set it
-// explicitly if you are calling the REST API directly. ifMatch is an ETag value associated with the version of the
-// resource known to the client. The operation will be performed only if the resource's current ETag on the service
-// exactly matches the value specified by the client. ifNoneMatch is an ETag value associated with the version of
-// the resource known to the client. The operation will be performed only if the resource's current ETag on the
-// service does not match the value specified by the client. ifModifiedSince is a timestamp indicating the last
-// modified time of the resource known to the client. The operation will be performed only if the resource on the
-// service has been modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last
-// modified time of the resource known to the client. The operation will be performed only if the resource on the
-// service has not been modified since the specified time.
-func (client PoolClient) Exists(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.ExistsPreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ExistsSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", resp, "Failure sending request")
- return
- }
-
- result, err = client.ExistsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Exists", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ExistsPreparer prepares the Exists request.
-func (client PoolClient) ExistsPreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsHead(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ExistsSender sends the Exists request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) ExistsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ExistsResponder handles the response to the Exists request. The method always
-// closes the http.Response Body.
-func (client PoolClient) ExistsResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get gets information about the specified pool.
-//
-// poolID is the ID of the pool to get. selectParameter is an OData $select clause. expand is an OData $expand
-// clause. timeout is the maximum time that the server can spend processing the request, in seconds. The default is
-// 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration
-// such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server
-// should return the client-request-id in the response. ocpDate is the time the request was issued. Client
-// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API
-// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The
-// operation will be performed only if the resource's current ETag on the service exactly matches the value
-// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the
-// client. The operation will be performed only if the resource's current ETag on the service does not match the
-// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource
-// known to the client. The operation will be performed only if the resource on the service has been modified since
-// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to
-// the client. The operation will be performed only if the resource on the service has not been modified since the
-// specified time.
-func (client PoolClient) Get(ctx context.Context, poolID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudPool, err error) {
- req, err := client.GetPreparer(ctx, poolID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client PoolClient) GetPreparer(ctx context.Context, poolID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client PoolClient) GetResponder(resp *http.Response) (result CloudPool, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetAllLifetimeStatistics statistics are aggregated across all pools that have ever existed in the account, from
-// account creation to the last update time of the statistics.
-//
-// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30
-// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such
-// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should
-// return the client-request-id in the response. ocpDate is the time the request was issued. Client libraries
-// typically set this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client PoolClient) GetAllLifetimeStatistics(ctx context.Context, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolStatistics, err error) {
- req, err := client.GetAllLifetimeStatisticsPreparer(ctx, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllLifetimeStatistics", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetAllLifetimeStatisticsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllLifetimeStatistics", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetAllLifetimeStatisticsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "GetAllLifetimeStatistics", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetAllLifetimeStatisticsPreparer prepares the GetAllLifetimeStatistics request.
-func (client PoolClient) GetAllLifetimeStatisticsPreparer(ctx context.Context, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/lifetimepoolstats"),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetAllLifetimeStatisticsSender sends the GetAllLifetimeStatistics request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) GetAllLifetimeStatisticsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetAllLifetimeStatisticsResponder handles the response to the GetAllLifetimeStatistics request. The method always
-// closes the http.Response Body.
-func (client PoolClient) GetAllLifetimeStatisticsResponder(resp *http.Response) (result PoolStatistics, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List sends the list request.
-//
-// filter is an OData $filter clause. For more information on constructing this filter, see
-// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-pools. selectParameter is an
-// OData $select clause. expand is an OData $expand clause. maxResults is the maximum number of items to return in
-// the response. A maximum of 1000 pools can be returned. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client PoolClient) List(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudPoolListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "List", err.Error())
- }
-
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.cplr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", resp, "Failure sending request")
- return
- }
-
- result.cplr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client PoolClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/pools"),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client PoolClient) ListResponder(resp *http.Response) (result CloudPoolListResult, 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 PoolClient) listNextResults(lastResults CloudPoolListResult) (result CloudPoolListResult, err error) {
- req, err := lastResults.cloudPoolListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.PoolClient", "listNextResults", 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.PoolClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client PoolClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudPoolListResultIterator, err error) {
- result.page, err = client.List(ctx, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// ListUsageMetrics if you do not specify a $filter clause including a poolId, the response includes all pools that
-// existed in the account in the time range of the returned aggregation intervals. If you do not specify a $filter
-// clause including a startTime or endTime these filters default to the start and end times of the last aggregation
-// interval currently available; that is, only the last aggregation interval is returned.
-//
-// startTime is the earliest time from which to include metrics. This must be at least two and a half hours before
-// the current time. If not specified this defaults to the start time of the last aggregation interval currently
-// available. endTime is the latest time from which to include metrics. This must be at least two hours before the
-// current time. If not specified this defaults to the end time of the last aggregation interval currently
-// available. filter is an OData $filter clause. For more information on constructing this filter, see
-// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-account-usage-metrics.
-// maxResults is the maximum number of items to return in the response. A maximum of 1000 results will be returned.
-// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30
-// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such
-// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should
-// return the client-request-id in the response. ocpDate is the time the request was issued. Client libraries
-// typically set this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client PoolClient) ListUsageMetrics(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolListUsageMetricsResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "ListUsageMetrics", err.Error())
- }
-
- result.fn = client.listUsageMetricsNextResults
- req, err := client.ListUsageMetricsPreparer(ctx, startTime, endTime, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListUsageMetrics", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListUsageMetricsSender(req)
- if err != nil {
- result.plumr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListUsageMetrics", resp, "Failure sending request")
- return
- }
-
- result.plumr, err = client.ListUsageMetricsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "ListUsageMetrics", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListUsageMetricsPreparer prepares the ListUsageMetrics request.
-func (client PoolClient) ListUsageMetricsPreparer(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if startTime != nil {
- queryParameters["starttime"] = autorest.Encode("query", *startTime)
- }
- if endTime != nil {
- queryParameters["endtime"] = autorest.Encode("query", *endTime)
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/poolusagemetrics"),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListUsageMetricsSender sends the ListUsageMetrics request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) ListUsageMetricsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListUsageMetricsResponder handles the response to the ListUsageMetrics request. The method always
-// closes the http.Response Body.
-func (client PoolClient) ListUsageMetricsResponder(resp *http.Response) (result PoolListUsageMetricsResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listUsageMetricsNextResults retrieves the next set of results, if any.
-func (client PoolClient) listUsageMetricsNextResults(lastResults PoolListUsageMetricsResult) (result PoolListUsageMetricsResult, err error) {
- req, err := lastResults.poolListUsageMetricsResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.PoolClient", "listUsageMetricsNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListUsageMetricsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "batch.PoolClient", "listUsageMetricsNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListUsageMetricsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "listUsageMetricsNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListUsageMetricsComplete enumerates all values, automatically crossing page boundaries as required.
-func (client PoolClient) ListUsageMetricsComplete(ctx context.Context, startTime *date.Time, endTime *date.Time, filter string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result PoolListUsageMetricsResultIterator, err error) {
- result.page, err = client.ListUsageMetrics(ctx, startTime, endTime, filter, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// Patch this only replaces the pool properties specified in the request. For example, if the pool has a start task
-// associated with it, and a request does not specify a start task element, then the pool keeps the existing start
-// task.
-//
-// poolID is the ID of the pool to update. poolPatchParameter is the parameters for the request. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client PoolClient) Patch(ctx context.Context, poolID string, poolPatchParameter PoolPatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.PatchPreparer(ctx, poolID, poolPatchParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.PatchSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", resp, "Failure sending request")
- return
- }
-
- result, err = client.PatchResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Patch", resp, "Failure responding to request")
- }
-
- return
-}
-
-// PatchPreparer prepares the Patch request.
-func (client PoolClient) PatchPreparer(ctx context.Context, poolID string, poolPatchParameter PoolPatchParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPatch(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}", pathParameters),
- autorest.WithJSON(poolPatchParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// PatchSender sends the Patch request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) PatchSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// PatchResponder handles the response to the Patch request. The method always
-// closes the http.Response Body.
-func (client PoolClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// RemoveNodes this operation can only run when the allocation state of the pool is steady. When this operation runs,
-// the allocation state changes from steady to resizing.
-//
-// poolID is the ID of the pool from which you want to remove nodes. nodeRemoveParameter is the parameters for the
-// request. timeout is the maximum time that the server can spend processing the request, in seconds. The default
-// is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no
-// decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the
-// server should return the client-request-id in the response. ocpDate is the time the request was issued. Client
-// libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API
-// directly. ifMatch is an ETag value associated with the version of the resource known to the client. The
-// operation will be performed only if the resource's current ETag on the service exactly matches the value
-// specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to the
-// client. The operation will be performed only if the resource's current ETag on the service does not match the
-// value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the resource
-// known to the client. The operation will be performed only if the resource on the service has been modified since
-// the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to
-// the client. The operation will be performed only if the resource on the service has not been modified since the
-// specified time.
-func (client PoolClient) RemoveNodes(ctx context.Context, poolID string, nodeRemoveParameter NodeRemoveParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: nodeRemoveParameter,
- Constraints: []validation.Constraint{{Target: "nodeRemoveParameter.NodeList", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "nodeRemoveParameter.NodeList", Name: validation.MaxItems, Rule: 100, Chain: nil}}}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "RemoveNodes", err.Error())
- }
-
- req, err := client.RemoveNodesPreparer(ctx, poolID, nodeRemoveParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.RemoveNodesSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", resp, "Failure sending request")
- return
- }
-
- result, err = client.RemoveNodesResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "RemoveNodes", resp, "Failure responding to request")
- }
-
- return
-}
-
-// RemoveNodesPreparer prepares the RemoveNodes request.
-func (client PoolClient) RemoveNodesPreparer(ctx context.Context, poolID string, nodeRemoveParameter NodeRemoveParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/removenodes", pathParameters),
- autorest.WithJSON(nodeRemoveParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// RemoveNodesSender sends the RemoveNodes request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) RemoveNodesSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// RemoveNodesResponder handles the response to the RemoveNodes request. The method always
-// closes the http.Response Body.
-func (client PoolClient) RemoveNodesResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Resize you can only resize a pool when its allocation state is steady. If the pool is already resizing, the request
-// fails with status code 409. When you resize a pool, the pool's allocation state changes from steady to resizing. You
-// cannot resize pools which are configured for automatic scaling. If you try to do this, the Batch service returns an
-// error 409. If you resize a pool downwards, the Batch service chooses which nodes to remove. To remove specific
-// nodes, use the pool remove nodes API instead.
-//
-// poolID is the ID of the pool to resize. poolResizeParameter is the parameters for the request. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client PoolClient) Resize(ctx context.Context, poolID string, poolResizeParameter PoolResizeParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.ResizePreparer(ctx, poolID, poolResizeParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ResizeSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", resp, "Failure sending request")
- return
- }
-
- result, err = client.ResizeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "Resize", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ResizePreparer prepares the Resize request.
-func (client PoolClient) ResizePreparer(ctx context.Context, poolID string, poolResizeParameter PoolResizeParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/resize", pathParameters),
- autorest.WithJSON(poolResizeParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ResizeSender sends the Resize request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) ResizeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ResizeResponder handles the response to the Resize request. The method always
-// closes the http.Response Body.
-func (client PoolClient) ResizeResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// StopResize this does not restore the pool to its previous state before the resize operation: it only stops any
-// further changes being made, and the pool maintains its current state. After stopping, the pool stabilizes at the
-// number of nodes it was at when the stop operation was done. During the stop operation, the pool allocation state
-// changes first to stopping and then to steady. A resize operation need not be an explicit resize pool request; this
-// API can also be used to halt the initial sizing of the pool when it is created.
-//
-// poolID is the ID of the pool whose resizing you want to stop. timeout is the maximum time that the server can
-// spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated
-// request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client PoolClient) StopResize(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.StopResizePreparer(ctx, poolID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.StopResizeSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", resp, "Failure sending request")
- return
- }
-
- result, err = client.StopResizeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "StopResize", resp, "Failure responding to request")
- }
-
- return
-}
-
-// StopResizePreparer prepares the StopResize request.
-func (client PoolClient) StopResizePreparer(ctx context.Context, poolID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/stopresize", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// StopResizeSender sends the StopResize request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) StopResizeSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// StopResizeResponder handles the response to the StopResize request. The method always
-// closes the http.Response Body.
-func (client PoolClient) StopResizeResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// UpdateProperties this fully replaces all the updateable properties of the pool. For example, if the pool has a start
-// task associated with it and if start task is not specified with this request, then the Batch service will remove the
-// existing start task.
-//
-// poolID is the ID of the pool to update. poolUpdatePropertiesParameter is the parameters for the request. timeout
-// is the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client PoolClient) UpdateProperties(ctx context.Context, poolID string, poolUpdatePropertiesParameter PoolUpdatePropertiesParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: poolUpdatePropertiesParameter,
- Constraints: []validation.Constraint{{Target: "poolUpdatePropertiesParameter.StartTask", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "poolUpdatePropertiesParameter.StartTask.CommandLine", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "poolUpdatePropertiesParameter.StartTask.ContainerSettings", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "poolUpdatePropertiesParameter.StartTask.ContainerSettings.ImageName", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "poolUpdatePropertiesParameter.StartTask.ContainerSettings.Registry", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "poolUpdatePropertiesParameter.StartTask.ContainerSettings.Registry.UserName", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "poolUpdatePropertiesParameter.StartTask.ContainerSettings.Registry.Password", Name: validation.Null, Rule: true, Chain: nil},
- }},
- }},
- }},
- {Target: "poolUpdatePropertiesParameter.CertificateReferences", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "poolUpdatePropertiesParameter.ApplicationPackageReferences", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "poolUpdatePropertiesParameter.Metadata", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "UpdateProperties", err.Error())
- }
-
- req, err := client.UpdatePropertiesPreparer(ctx, poolID, poolUpdatePropertiesParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdatePropertiesSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdatePropertiesResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpdateProperties", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePropertiesPreparer prepares the UpdateProperties request.
-func (client PoolClient) UpdatePropertiesPreparer(ctx context.Context, poolID string, poolUpdatePropertiesParameter PoolUpdatePropertiesParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/updateproperties", pathParameters),
- autorest.WithJSON(poolUpdatePropertiesParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdatePropertiesSender sends the UpdateProperties request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) UpdatePropertiesSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdatePropertiesResponder handles the response to the UpdateProperties request. The method always
-// closes the http.Response Body.
-func (client PoolClient) UpdatePropertiesResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// UpgradeOS during an upgrade, the Batch service upgrades each compute node in the pool. When a compute node is chosen
-// for upgrade, any tasks running on that node are removed from the node and returned to the queue to be rerun later
-// (or on a different compute node). The node will be unavailable until the upgrade is complete. This operation results
-// in temporarily reduced pool capacity as nodes are taken out of service to be upgraded. Although the Batch service
-// tries to avoid upgrading all compute nodes at the same time, it does not guarantee to do this (particularly on small
-// pools); therefore, the pool may be temporarily unavailable to run tasks. When this operation runs, the pool state
-// changes to upgrading. When all compute nodes have finished upgrading, the pool state returns to active. While the
-// upgrade is in progress, the pool's currentOSVersion reflects the OS version that nodes are upgrading from, and
-// targetOSVersion reflects the OS version that nodes are upgrading to. Once the upgrade is complete, currentOSVersion
-// is updated to reflect the OS version now running on all nodes. This operation can only be invoked on pools created
-// with the cloudServiceConfiguration property.
-//
-// poolID is the ID of the pool to upgrade. poolUpgradeOSParameter is the parameters for the request. timeout is
-// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client PoolClient) UpgradeOS(ctx context.Context, poolID string, poolUpgradeOSParameter PoolUpgradeOSParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: poolUpgradeOSParameter,
- Constraints: []validation.Constraint{{Target: "poolUpgradeOSParameter.TargetOSVersion", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("batch.PoolClient", "UpgradeOS", err.Error())
- }
-
- req, err := client.UpgradeOSPreparer(ctx, poolID, poolUpgradeOSParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpgradeOSSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpgradeOSResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.PoolClient", "UpgradeOS", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpgradeOSPreparer prepares the UpgradeOS request.
-func (client PoolClient) UpgradeOSPreparer(ctx context.Context, poolID string, poolUpgradeOSParameter PoolUpgradeOSParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "poolId": autorest.Encode("path", poolID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/pools/{poolId}/upgradeos", pathParameters),
- autorest.WithJSON(poolUpgradeOSParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpgradeOSSender sends the UpgradeOS request. The method will close the
-// http.Response Body if it receives an error.
-func (client PoolClient) UpgradeOSSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpgradeOSResponder handles the response to the UpgradeOS request. The method always
-// closes the http.Response Body.
-func (client PoolClient) UpgradeOSResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff --git a/services/batch/2017-09-01.6.0/batch/task.go b/services/batch/2017-09-01.6.0/batch/task.go
deleted file mode 100644
index f2f82a81ff7b..000000000000
--- a/services/batch/2017-09-01.6.0/batch/task.go
+++ /dev/null
@@ -1,1081 +0,0 @@
-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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// TaskClient is the a client for issuing REST requests to the Azure Batch service.
-type TaskClient struct {
- BaseClient
-}
-
-// NewTaskClient creates an instance of the TaskClient client.
-func NewTaskClient() TaskClient {
- return NewTaskClientWithBaseURI(DefaultBaseURI)
-}
-
-// NewTaskClientWithBaseURI creates an instance of the TaskClient client.
-func NewTaskClientWithBaseURI(baseURI string) TaskClient {
- return TaskClient{NewWithBaseURI(baseURI)}
-}
-
-// Add the maximum lifetime of a task from addition to completion is 7 days. If a task has not completed within 7 days
-// of being added it will be terminated by the Batch service and left in whatever state it was in at that time.
-//
-// jobID is the ID of the job to which the task is to be added. task is the task to be added. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client TaskClient) Add(ctx context.Context, jobID string, task TaskAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: task,
- Constraints: []validation.Constraint{{Target: "task.ID", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "task.CommandLine", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "task.ContainerSettings", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "task.ContainerSettings.ImageName", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "task.ContainerSettings.Registry", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "task.ContainerSettings.Registry.UserName", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "task.ContainerSettings.Registry.Password", Name: validation.Null, Rule: true, Chain: nil},
- }},
- }},
- {Target: "task.AffinityInfo", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "task.AffinityInfo.AffinityID", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "task.MultiInstanceSettings", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "task.MultiInstanceSettings.CoordinationCommandLine", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil {
- return result, validation.NewError("batch.TaskClient", "Add", err.Error())
- }
-
- req, err := client.AddPreparer(ctx, jobID, task, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Add", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPreparer prepares the Add request.
-func (client TaskClient) AddPreparer(ctx context.Context, jobID string, task TaskAddParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks", pathParameters),
- autorest.WithJSON(task),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSender sends the Add request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) AddSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddResponder handles the response to the Add request. The method always
-// closes the http.Response Body.
-func (client TaskClient) AddResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// AddCollection note that each task must have a unique ID. The Batch service may not return the results for each task
-// in the same order the tasks were submitted in this request. If the server times out or the connection is closed
-// during the request, the request may have been partially or fully processed, or not at all. In such cases, the user
-// should re-issue the request. Note that it is up to the user to correctly handle failures when re-issuing a request.
-// For example, you should use the same task IDs during a retry so that if the prior operation succeeded, the retry
-// will not create extra tasks unexpectedly. If the response contains any tasks which failed to add, a client can retry
-// the request. In a retry, it is most efficient to resubmit only tasks that failed to add, and to omit tasks that were
-// successfully added on the first attempt. The maximum lifetime of a task from addition to completion is 7 days. If a
-// task has not completed within 7 days of being added it will be terminated by the Batch service and left in whatever
-// state it was in at that time.
-//
-// jobID is the ID of the job to which the task collection is to be added. taskCollection is the tasks to be added.
-// timeout is the maximum time that the server can spend processing the request, in seconds. The default is 30
-// seconds. clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such
-// as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should
-// return the client-request-id in the response. ocpDate is the time the request was issued. Client libraries
-// typically set this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client TaskClient) AddCollection(ctx context.Context, jobID string, taskCollection TaskAddCollectionParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result TaskAddCollectionResult, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: taskCollection,
- Constraints: []validation.Constraint{{Target: "taskCollection.Value", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "taskCollection.Value", Name: validation.MaxItems, Rule: 100, Chain: nil}}}}}}); err != nil {
- return result, validation.NewError("batch.TaskClient", "AddCollection", err.Error())
- }
-
- req, err := client.AddCollectionPreparer(ctx, jobID, taskCollection, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "AddCollection", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddCollectionSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "AddCollection", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddCollectionResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "AddCollection", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddCollectionPreparer prepares the AddCollection request.
-func (client TaskClient) AddCollectionPreparer(ctx context.Context, jobID string, taskCollection TaskAddCollectionParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/addtaskcollection", pathParameters),
- autorest.WithJSON(taskCollection),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddCollectionSender sends the AddCollection request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) AddCollectionSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddCollectionResponder handles the response to the AddCollection request. The method always
-// closes the http.Response Body.
-func (client TaskClient) AddCollectionResponder(resp *http.Response) (result TaskAddCollectionResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Delete when a task is deleted, all of the files in its directory on the compute node where it ran are also deleted
-// (regardless of the retention time). For multi-instance tasks, the delete task operation applies synchronously to the
-// primary task; subtasks and their files are then deleted asynchronously in the background.
-//
-// jobID is the ID of the job from which to delete the task. taskID is the ID of the task to delete. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client TaskClient) Delete(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.DeletePreparer(ctx, jobID, taskID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client TaskClient) DeletePreparer(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client TaskClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get for multi-instance tasks, information such as affinityId, executionInfo and nodeInfo refer to the primary task.
-// Use the list subtasks API to retrieve information about subtasks.
-//
-// jobID is the ID of the job that contains the task. taskID is the ID of the task to get information about.
-// selectParameter is an OData $select clause. expand is an OData $expand clause. timeout is the maximum time that
-// the server can spend processing the request, in seconds. The default is 30 seconds. clientRequestID is the
-// caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client TaskClient) Get(ctx context.Context, jobID string, taskID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result CloudTask, err error) {
- req, err := client.GetPreparer(ctx, jobID, taskID, selectParameter, expand, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client TaskClient) GetPreparer(ctx context.Context, jobID string, taskID string, selectParameter string, expand string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client TaskClient) GetResponder(resp *http.Response) (result CloudTask, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List for multi-instance tasks, information such as affinityId, executionInfo and nodeInfo refer to the primary task.
-// Use the list subtasks API to retrieve information about subtasks.
-//
-// jobID is the ID of the job. filter is an OData $filter clause. For more information on constructing this filter,
-// see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-tasks. selectParameter is
-// an OData $select clause. expand is an OData $expand clause. maxResults is the maximum number of items to return
-// in the response. A maximum of 1000 tasks can be returned. timeout is the maximum time that the server can spend
-// processing the request, in seconds. The default is 30 seconds. clientRequestID is the caller-generated request
-// identity, in the form of a GUID with no decoration such as curly braces, e.g.
-// 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client TaskClient) List(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListResultPage, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: maxResults,
- Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil},
- {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("batch.TaskClient", "List", err.Error())
- }
-
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, jobID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.ctlr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", resp, "Failure sending request")
- return
- }
-
- result.ctlr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client TaskClient) ListPreparer(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if maxResults != nil {
- queryParameters["maxresults"] = autorest.Encode("query", *maxResults)
- } else {
- queryParameters["maxresults"] = autorest.Encode("query", 1000)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client TaskClient) ListResponder(resp *http.Response) (result CloudTaskListResult, 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 TaskClient) listNextResults(lastResults CloudTaskListResult) (result CloudTaskListResult, err error) {
- req, err := lastResults.cloudTaskListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "batch.TaskClient", "listNextResults", 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.TaskClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client TaskClient) ListComplete(ctx context.Context, jobID string, filter string, selectParameter string, expand string, maxResults *int32, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListResultIterator, err error) {
- result.page, err = client.List(ctx, jobID, filter, selectParameter, expand, maxResults, timeout, clientRequestID, returnClientRequestID, ocpDate)
- return
-}
-
-// ListSubtasks if the task is not a multi-instance task then this returns an empty collection.
-//
-// jobID is the ID of the job. taskID is the ID of the task. selectParameter is an OData $select clause. timeout is
-// the maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly.
-func (client TaskClient) ListSubtasks(ctx context.Context, jobID string, taskID string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (result CloudTaskListSubtasksResult, err error) {
- req, err := client.ListSubtasksPreparer(ctx, jobID, taskID, selectParameter, timeout, clientRequestID, returnClientRequestID, ocpDate)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSubtasksSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListSubtasksResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "ListSubtasks", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListSubtasksPreparer prepares the ListSubtasks request.
-func (client TaskClient) ListSubtasksPreparer(ctx context.Context, jobID string, taskID string, selectParameter string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/subtasksinfo", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSubtasksSender sends the ListSubtasks request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) ListSubtasksSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListSubtasksResponder handles the response to the ListSubtasks request. The method always
-// closes the http.Response Body.
-func (client TaskClient) ListSubtasksResponder(resp *http.Response) (result CloudTaskListSubtasksResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Reactivate reactivation makes a task eligible to be retried again up to its maximum retry count. The task's state is
-// changed to active. As the task is no longer in the completed state, any previous exit code or failure information is
-// no longer available after reactivation. Each time a task is reactivated, its retry count is reset to 0. Reactivation
-// will fail for tasks that are not completed or that previously completed successfully (with an exit code of 0).
-// Additionally, it will fail if the job has completed (or is terminating or deleting).
-//
-// jobID is the ID of the job containing the task. taskID is the ID of the task to reactivate. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client TaskClient) Reactivate(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.ReactivatePreparer(ctx, jobID, taskID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Reactivate", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ReactivateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Reactivate", resp, "Failure sending request")
- return
- }
-
- result, err = client.ReactivateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Reactivate", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ReactivatePreparer prepares the Reactivate request.
-func (client TaskClient) ReactivatePreparer(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/reactivate", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ReactivateSender sends the Reactivate request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) ReactivateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ReactivateResponder handles the response to the Reactivate request. The method always
-// closes the http.Response Body.
-func (client TaskClient) ReactivateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Terminate when the task has been terminated, it moves to the completed state. For multi-instance tasks, the
-// terminate task operation applies synchronously to the primary task; subtasks are then terminated asynchronously in
-// the background.
-//
-// jobID is the ID of the job containing the task. taskID is the ID of the task to terminate. timeout is the
-// maximum time that the server can spend processing the request, in seconds. The default is 30 seconds.
-// clientRequestID is the caller-generated request identity, in the form of a GUID with no decoration such as curly
-// braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID is whether the server should return the
-// client-request-id in the response. ocpDate is the time the request was issued. Client libraries typically set
-// this to the current system clock time; set it explicitly if you are calling the REST API directly. ifMatch is an
-// ETag value associated with the version of the resource known to the client. The operation will be performed only
-// if the resource's current ETag on the service exactly matches the value specified by the client. ifNoneMatch is
-// an ETag value associated with the version of the resource known to the client. The operation will be performed
-// only if the resource's current ETag on the service does not match the value specified by the client.
-// ifModifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has been modified since the specified time.
-// ifUnmodifiedSince is a timestamp indicating the last modified time of the resource known to the client. The
-// operation will be performed only if the resource on the service has not been modified since the specified time.
-func (client TaskClient) Terminate(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.TerminatePreparer(ctx, jobID, taskID, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.TerminateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", resp, "Failure sending request")
- return
- }
-
- result, err = client.TerminateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Terminate", resp, "Failure responding to request")
- }
-
- return
-}
-
-// TerminatePreparer prepares the Terminate request.
-func (client TaskClient) TerminatePreparer(ctx context.Context, jobID string, taskID string, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}/terminate", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// TerminateSender sends the Terminate request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) TerminateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// TerminateResponder handles the response to the Terminate request. The method always
-// closes the http.Response Body.
-func (client TaskClient) TerminateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Update updates the properties of the specified task.
-//
-// jobID is the ID of the job containing the task. taskID is the ID of the task to update. taskUpdateParameter is
-// the parameters for the request. timeout is the maximum time that the server can spend processing the request, in
-// seconds. The default is 30 seconds. clientRequestID is the caller-generated request identity, in the form of a
-// GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. returnClientRequestID
-// is whether the server should return the client-request-id in the response. ocpDate is the time the request was
-// issued. Client libraries typically set this to the current system clock time; set it explicitly if you are
-// calling the REST API directly. ifMatch is an ETag value associated with the version of the resource known to the
-// client. The operation will be performed only if the resource's current ETag on the service exactly matches the
-// value specified by the client. ifNoneMatch is an ETag value associated with the version of the resource known to
-// the client. The operation will be performed only if the resource's current ETag on the service does not match
-// the value specified by the client. ifModifiedSince is a timestamp indicating the last modified time of the
-// resource known to the client. The operation will be performed only if the resource on the service has been
-// modified since the specified time. ifUnmodifiedSince is a timestamp indicating the last modified time of the
-// resource known to the client. The operation will be performed only if the resource on the service has not been
-// modified since the specified time.
-func (client TaskClient) Update(ctx context.Context, jobID string, taskID string, taskUpdateParameter TaskUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (result autorest.Response, err error) {
- req, err := client.UpdatePreparer(ctx, jobID, taskID, taskUpdateParameter, timeout, clientRequestID, returnClientRequestID, ocpDate, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "batch.TaskClient", "Update", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePreparer prepares the Update request.
-func (client TaskClient) UpdatePreparer(ctx context.Context, jobID string, taskID string, taskUpdateParameter TaskUpdateParameter, timeout *int32, clientRequestID *uuid.UUID, returnClientRequestID *bool, ocpDate *date.TimeRFC1123, ifMatch string, ifNoneMatch string, ifModifiedSince *date.TimeRFC1123, ifUnmodifiedSince *date.TimeRFC1123) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "jobId": autorest.Encode("path", jobID),
- "taskId": autorest.Encode("path", taskID),
- }
-
- const APIVersion = "2017-09-01.6.0"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if timeout != nil {
- queryParameters["timeout"] = autorest.Encode("query", *timeout)
- } else {
- queryParameters["timeout"] = autorest.Encode("query", 30)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; odata=minimalmetadata; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/jobs/{jobId}/tasks/{taskId}", pathParameters),
- autorest.WithJSON(taskUpdateParameter),
- autorest.WithQueryParameters(queryParameters))
- if clientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("client-request-id", autorest.String(clientRequestID)))
- }
- if returnClientRequestID != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(returnClientRequestID)))
- } else {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("return-client-request-id", autorest.String(false)))
- }
- if ocpDate != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("ocp-date", autorest.String(ocpDate)))
- }
- if len(ifMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Match", autorest.String(ifMatch)))
- }
- if len(ifNoneMatch) > 0 {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
- }
- if ifModifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
- }
- if ifUnmodifiedSince != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSender sends the Update request. The method will close the
-// http.Response Body if it receives an error.
-func (client TaskClient) UpdateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateResponder handles the response to the Update request. The method always
-// closes the http.Response Body.
-func (client TaskClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff --git a/services/batch/2017-09-01.6.0/batch/version.go b/services/batch/2017-09-01.6.0/batch/version.go
deleted file mode 100644
index 836672bf5620..000000000000
--- a/services/batch/2017-09-01.6.0/batch/version.go
+++ /dev/null
@@ -1,30 +0,0 @@
-package batch
-
-import "github.com/Azure/azure-sdk-for-go/version"
-
-// 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.
-
-// UserAgent returns the UserAgent string to use when sending http.Requests.
-func UserAgent() string {
- return "Azure-SDK-For-Go/" + version.Number + " batch/2017-09-01.6.0"
-}
-
-// Version returns the semantic version (see http://semver.org) of the client.
-func Version() string {
- return version.Number
-}
diff --git a/services/batch/mgmt/2019-08-01/batch/applicationpackage.go b/services/batch/mgmt/2019-08-01/batch/applicationpackage.go
index a210f623ea73..b4611bcdad58 100644
--- a/services/batch/mgmt/2019-08-01/batch/applicationpackage.go
+++ b/services/batch/mgmt/2019-08-01/batch/applicationpackage.go
@@ -41,7 +41,8 @@ func NewApplicationPackageClientWithBaseURI(baseURI string, subscriptionID strin
return ApplicationPackageClient{NewWithBaseURI(baseURI, subscriptionID)}
}
-// Activate activates the specified application package.
+// Activate activates the specified application package. This should be done after the `ApplicationPackage` was created
+// and uploaded. This needs to be done before an `ApplicationPackage` can be used on Pools or Tasks
// Parameters:
// resourceGroupName - the name of the resource group that contains the Batch account.
// accountName - the name of the Batch account.
@@ -143,7 +144,9 @@ func (client ApplicationPackageClient) ActivateResponder(resp *http.Response) (r
return
}
-// Create creates an application package record.
+// Create creates an application package record. The record contains the SAS where the package should be uploaded to.
+// Once it is uploaded the `ApplicationPackage` needs to be activated using `ApplicationPackageActive` before it can be
+// used.
// Parameters:
// resourceGroupName - the name of the resource group that contains the Batch account.
// accountName - the name of the Batch account.
diff --git a/services/classic/management/README.md b/services/classic/management/README.md
deleted file mode 100644
index d9518b59666f..000000000000
--- a/services/classic/management/README.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# Azure Service Management packages for Go
-
-The `github.com/Azure/azure-sdk-for-go/services/classic/management` packages are used to perform operations using the Azure Service Management (ASM), aka classic deployment model. Read more about [Azure Resource Manager vs. classic deployment](https://azure.microsoft.com/documentation/articles/resource-manager-deployment-model/). Packages for Azure Resource Manager are in the [arm](../arm) folder.
-Note that this package requires Go 1.7+ to build.
-This package is in mainteinance mode and will only receive bug fixes. It is recommended to [migrate to Azure Resource Manager](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-deployment-model) deployment model.
-
-## First a Sidenote: Authentication and the Azure Service Manager
-
-The client currently supports authentication to the Service Management
-API with certificates or Azure `.publishSettings` file. You can
-download the `.publishSettings` file for your subscriptions
-[here](https://manage.windowsazure.com/publishsettings).
diff --git a/services/classic/management/affinitygroup/client.go b/services/classic/management/affinitygroup/client.go
deleted file mode 100644
index d527d6d2ac78..000000000000
--- a/services/classic/management/affinitygroup/client.go
+++ /dev/null
@@ -1,147 +0,0 @@
-// +build go1.7
-
-package affinitygroup
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "encoding/base64"
- "encoding/xml"
- "fmt"
-
- "github.com/Azure/azure-sdk-for-go/services/classic/management"
-)
-
-const (
- azureCreateAffinityGroupURL = "/affinitygroups"
- azureGetAffinityGroupURL = "/affinitygroups/%s"
- azureListAffinityGroupsURL = "/affinitygroups"
- azureUpdateAffinityGroupURL = "/affinitygroups/%s"
- azureDeleteAffinityGroupURL = "/affinitygroups/%s"
-
- errParameterNotSpecified = "Parameter %s not specified."
-)
-
-// AffinityGroupClient simply contains a management.Client and has
-// methods for doing all affinity group-related API calls to Azure.
-type AffinityGroupClient struct {
- mgmtClient management.Client
-}
-
-// NewClient returns an AffinityGroupClient with the given management.Client.
-func NewClient(mgmtClient management.Client) AffinityGroupClient {
- return AffinityGroupClient{mgmtClient}
-}
-
-// CreateAffinityGroup creates a new affinity group.
-//
-// https://msdn.microsoft.com/en-us/library/azure/gg715317.aspx
-func (c AffinityGroupClient) CreateAffinityGroup(params CreateAffinityGroupParams) error {
- params.Label = encodeLabel(params.Label)
-
- req, err := xml.Marshal(params)
- if err != nil {
- return err
- }
-
- _, err = c.mgmtClient.SendAzurePostRequest(azureCreateAffinityGroupURL, req)
- return err
-}
-
-// GetAffinityGroup returns the system properties that are associated with the
-// specified affinity group.
-//
-// https://msdn.microsoft.com/en-us/library/azure/ee460789.aspx
-func (c AffinityGroupClient) GetAffinityGroup(name string) (AffinityGroup, error) {
- var affgroup AffinityGroup
- if name == "" {
- return affgroup, fmt.Errorf(errParameterNotSpecified, "name")
- }
-
- url := fmt.Sprintf(azureGetAffinityGroupURL, name)
- resp, err := c.mgmtClient.SendAzureGetRequest(url)
- if err != nil {
- return affgroup, err
- }
-
- err = xml.Unmarshal(resp, &affgroup)
- affgroup.Label = decodeLabel(affgroup.Label)
- return affgroup, err
-}
-
-// ListAffinityGroups lists the affinity groups off Azure.
-//
-// https://msdn.microsoft.com/en-us/library/azure/ee460797.aspx
-func (c AffinityGroupClient) ListAffinityGroups() (ListAffinityGroupsResponse, error) {
- var affinitygroups ListAffinityGroupsResponse
-
- resp, err := c.mgmtClient.SendAzureGetRequest(azureListAffinityGroupsURL)
- if err != nil {
- return affinitygroups, err
- }
-
- err = xml.Unmarshal(resp, &affinitygroups)
-
- for i, grp := range affinitygroups.AffinityGroups {
- affinitygroups.AffinityGroups[i].Label = decodeLabel(grp.Label)
- }
-
- return affinitygroups, err
-}
-
-// UpdateAffinityGroup updates the label or description for an the group.
-//
-// https://msdn.microsoft.com/en-us/library/azure/gg715316.aspx
-func (c AffinityGroupClient) UpdateAffinityGroup(name string, params UpdateAffinityGroupParams) error {
- if name == "" {
- return fmt.Errorf(errParameterNotSpecified, "name")
- }
-
- params.Label = encodeLabel(params.Label)
- req, err := xml.Marshal(params)
- if err != nil {
- return err
- }
-
- url := fmt.Sprintf(azureUpdateAffinityGroupURL, name)
- _, err = c.mgmtClient.SendAzurePutRequest(url, "text/xml", req)
- return err
-}
-
-// DeleteAffinityGroup deletes the given affinity group.
-//
-// https://msdn.microsoft.com/en-us/library/azure/gg715314.aspx
-func (c AffinityGroupClient) DeleteAffinityGroup(name string) error {
- if name == "" {
- return fmt.Errorf(errParameterNotSpecified, name)
- }
-
- url := fmt.Sprintf(azureDeleteAffinityGroupURL, name)
- _, err := c.mgmtClient.SendAzureDeleteRequest(url)
- return err
-}
-
-// encodeLabel is a helper function which encodes the given string
-// to the base64 string which will be sent to Azure as a Label.
-func encodeLabel(label string) string {
- return base64.StdEncoding.EncodeToString([]byte(label))
-}
-
-// decodeLabel is a helper function which decodes the base64 encoded
-// label received from Azure into standard encoding.
-func decodeLabel(label string) string {
- res, _ := base64.StdEncoding.DecodeString(label)
- return string(res)
-}
diff --git a/services/classic/management/affinitygroup/entities.go b/services/classic/management/affinitygroup/entities.go
deleted file mode 100644
index 3c810a000c40..000000000000
--- a/services/classic/management/affinitygroup/entities.go
+++ /dev/null
@@ -1,96 +0,0 @@
-// +build go1.7
-
-package affinitygroup
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "encoding/xml"
-)
-
-// CreateAffinityGroupParams respresents the set of parameters required for
-// creating an affinity group creation request to Azure.
-//
-// https://msdn.microsoft.com/en-us/library/azure/gg715317.aspx
-type CreateAffinityGroupParams struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure CreateAffinityGroup"`
- Name string
- Label string
- Description string `xml:",omitempty"`
- Location string
-}
-
-// HostedService is a struct containing details about a hosted service that is
-// part of an affinity group on Azure.
-type HostedService struct {
- URL string `xml:"Url"`
- ServiceName string
-}
-
-// StorageService is a struct containing details about a storage service that is
-// part of an affinity group on Azure.
-type StorageService struct {
- URL string `xml:"Url"`
- ServiceName string
-}
-
-// AffinityGroup respresents the properties of an affinity group on Azure.
-//
-// https://msdn.microsoft.com/en-us/library/azure/ee460789.aspx
-type AffinityGroup struct {
- Name string
- Label string
- Description string
- Location string
- HostedServices []HostedService
- StorageServices []StorageService
- Capabilities []string
-}
-
-// ComputeCapabilities represents the sets of capabilities of an affinity group
-// obtained from an affinity group list call to Azure.
-type ComputeCapabilities struct {
- VirtualMachineRoleSizes []string
- WebWorkerRoleSizes []string
-}
-
-// AffinityGroupListResponse represents the properties obtained for each
-// affinity group listed off Azure.
-//
-// https://msdn.microsoft.com/en-us/library/azure/ee460797.aspx
-type AffinityGroupListResponse struct {
- Name string
- Label string
- Description string
- Location string
- Capabilities []string
- ComputeCapabilities ComputeCapabilities
-}
-
-// ListAffinityGroupsResponse contains all the affinity groups obtained from a
-// call to the Azure API to list all affinity groups.
-type ListAffinityGroupsResponse struct {
- AffinityGroups []AffinityGroupListResponse `xml:"AffinityGroup"`
-}
-
-// UpdateAffinityGroupParams if the set of parameters required to update an
-// affinity group on Azure.
-//
-// https://msdn.microsoft.com/en-us/library/azure/gg715316.aspx
-type UpdateAffinityGroupParams struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure UpdateAffinityGroup"`
- Label string `xml:",omitempty"`
- Description string `xml:",omitempty"`
-}
diff --git a/services/classic/management/client.go b/services/classic/management/client.go
deleted file mode 100644
index 6d3d350b6e47..000000000000
--- a/services/classic/management/client.go
+++ /dev/null
@@ -1,178 +0,0 @@
-// +build go1.7
-
-// Package management provides the main API client to construct other clients
-// and make requests to the Microsoft Azure Service Management REST API.
-package management
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "errors"
- "fmt"
- "net/http"
- "runtime"
- "time"
-
- "github.com/Azure/azure-sdk-for-go/version"
-)
-
-var (
- DefaultUserAgent = userAgent()
-)
-
-const (
- DefaultAzureManagementURL = "https://management.core.windows.net"
- DefaultOperationPollInterval = time.Second * 30
- DefaultAPIVersion = "2014-10-01"
-
- errPublishSettingsConfiguration = "PublishSettingsFilePath is set. Consequently ManagementCertificatePath and SubscriptionId must not be set."
- errManagementCertificateConfiguration = "Both ManagementCertificatePath and SubscriptionId should be set, and PublishSettingsFilePath must not be set."
- errParamNotSpecified = "Parameter %s is not specified."
-)
-
-type client struct {
- publishSettings publishSettings
- config ClientConfig
- httpClient *http.Client
-}
-
-// Client is the base Azure Service Management API client instance that
-// can be used to construct client instances for various services.
-type Client interface {
- // SendAzureGetRequest sends a request to the management API using the HTTP GET method
- // and returns the response body or an error.
- SendAzureGetRequest(url string) ([]byte, error)
-
- // SendAzurePostRequest sends a request to the management API using the HTTP POST method
- // and returns the request ID or an error.
- SendAzurePostRequest(url string, data []byte) (OperationID, error)
-
- // SendAzurePostRequestWithReturnedResponse sends a request to the management API using
- // the HTTP POST method and returns the response body or an error.
- SendAzurePostRequestWithReturnedResponse(url string, data []byte) ([]byte, error)
-
- // SendAzurePutRequest sends a request to the management API using the HTTP PUT method
- // and returns the request ID or an error. The content type can be specified, however
- // if an empty string is passed, the default of "application/xml" will be used.
- SendAzurePutRequest(url, contentType string, data []byte) (OperationID, error)
-
- // SendAzureDeleteRequest sends a request to the management API using the HTTP DELETE method
- // and returns the request ID or an error.
- SendAzureDeleteRequest(url string) (OperationID, error)
-
- // GetOperationStatus gets the status of operation with given Operation ID.
- // WaitForOperation utility method can be used for polling for operation status.
- GetOperationStatus(operationID OperationID) (GetOperationStatusResponse, error)
-
- // WaitForOperation polls the Azure API for given operation ID indefinitely
- // until the operation is completed with either success or failure.
- // It is meant to be used for waiting for the result of the methods that
- // return an OperationID value (meaning a long running operation has started).
- //
- // Cancellation of the polling loop (for instance, timing out) is done through
- // cancel channel. If the user does not want to cancel, a nil chan can be provided.
- // To cancel the method, it is recommended to close the channel provided to this
- // method.
- //
- // If the operation was not successful or cancelling is signaled, an error
- // is returned.
- WaitForOperation(operationID OperationID, cancel chan struct{}) error
-}
-
-// ClientConfig provides a configuration for use by a Client.
-type ClientConfig struct {
- ManagementURL string
- OperationPollInterval time.Duration
- UserAgent string
- APIVersion string
-}
-
-// NewAnonymousClient creates a new azure.Client with no credentials set.
-func NewAnonymousClient() Client {
- return client{}
-}
-
-// DefaultConfig returns the default client configuration used to construct
-// a client. This value can be used to make modifications on the default API
-// configuration.
-func DefaultConfig() ClientConfig {
- return ClientConfig{
- ManagementURL: DefaultAzureManagementURL,
- OperationPollInterval: DefaultOperationPollInterval,
- APIVersion: DefaultAPIVersion,
- UserAgent: DefaultUserAgent,
- }
-}
-
-// NewClient creates a new Client using the given subscription ID and
-// management certificate.
-func NewClient(subscriptionID string, managementCert []byte) (Client, error) {
- return NewClientFromConfig(subscriptionID, managementCert, DefaultConfig())
-}
-
-// NewClientFromConfig creates a new Client using a given ClientConfig.
-func NewClientFromConfig(subscriptionID string, managementCert []byte, config ClientConfig) (Client, error) {
- return makeClient(subscriptionID, managementCert, config)
-}
-
-func makeClient(subscriptionID string, managementCert []byte, config ClientConfig) (Client, error) {
- var c client
-
- if subscriptionID == "" {
- return c, errors.New("azure: subscription ID required")
- }
-
- if len(managementCert) == 0 {
- return c, errors.New("azure: management certificate required")
- }
-
- publishSettings := publishSettings{
- SubscriptionID: subscriptionID,
- SubscriptionCert: managementCert,
- SubscriptionKey: managementCert,
- }
-
- // Validate client configuration
- switch {
- case config.ManagementURL == "":
- return c, errors.New("azure: base URL required")
- case config.OperationPollInterval <= 0:
- return c, errors.New("azure: operation polling interval must be a positive duration")
- case config.APIVersion == "":
- return c, errors.New("azure: client configuration must specify an API version")
- case config.UserAgent == "":
- config.UserAgent = DefaultUserAgent
- }
-
- clientObj := client{
- publishSettings: publishSettings,
- config: config,
- }
- var err error
- clientObj.httpClient, err = clientObj.createHTTPClient()
- if err != nil {
- return nil, err
- }
- return clientObj, nil
-}
-
-func userAgent() string {
- return fmt.Sprintf("Go/%s (%s-%s) Azure-SDK-For-Go/%s asm/%s",
- runtime.Version(),
- runtime.GOARCH,
- runtime.GOOS,
- version.Number,
- DefaultAPIVersion)
-}
diff --git a/services/classic/management/errors.go b/services/classic/management/errors.go
deleted file mode 100644
index eca555cb4518..000000000000
--- a/services/classic/management/errors.go
+++ /dev/null
@@ -1,52 +0,0 @@
-// +build go1.7
-
-package management
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "encoding/xml"
- "fmt"
-)
-
-// AzureError represents an error returned by the management API. It has an error
-// code (for example, ResourceNotFound) and a descriptive message.
-type AzureError struct {
- Code string
- Message string
-}
-
-//Error implements the error interface for the AzureError type.
-func (e AzureError) Error() string {
- return fmt.Sprintf("Error response from Azure. Code: %s, Message: %s", e.Code, e.Message)
-}
-
-// IsResourceNotFoundError returns true if the provided error is an AzureError
-// reporting that a given resource has not been found.
-func IsResourceNotFoundError(err error) bool {
- azureErr, ok := err.(AzureError)
- return ok && azureErr.Code == "ResourceNotFound"
-}
-
-// getAzureError converts an error response body into an AzureError instance.
-func getAzureError(responseBody []byte) error {
- var azErr AzureError
- err := xml.Unmarshal(responseBody, &azErr)
- if err != nil {
- return fmt.Errorf("Failed parsing contents to AzureError format: %v", err)
- }
- return azErr
-
-}
diff --git a/services/classic/management/errors_test.go b/services/classic/management/errors_test.go
deleted file mode 100644
index d58a987d2b3a..000000000000
--- a/services/classic/management/errors_test.go
+++ /dev/null
@@ -1,46 +0,0 @@
-// +build go1.7
-
-package management_test
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "fmt"
- "testing"
-
- "github.com/Azure/azure-sdk-for-go/services/classic/management"
-)
-
-// TestIsResourceNotFoundError tests IsResourceNotFoundError with the
-// set of given test cases.
-func TestIsResourceNotFoundError(t *testing.T) {
- // isResourceNotFoundTestCases is a set of structs comprising of the error
- // IsResourceNotFoundError should test and the expected result.
- var isResourceNotFoundTestCases = []struct {
- err error
- expected bool
- }{
- {nil, false},
- {fmt.Errorf("Some other random error."), false},
- {management.AzureError{Code: "ResourceNotFound"}, true},
- {management.AzureError{Code: "NotAResourceNotFound"}, false},
- }
-
- for i, testCase := range isResourceNotFoundTestCases {
- if res := management.IsResourceNotFoundError(testCase.err); res != testCase.expected {
- t.Fatalf("Test %d: error %s - expected %t - got %t", i+1, testCase.err, testCase.expected, res)
- }
- }
-}
diff --git a/services/classic/management/hostedservice/client.go b/services/classic/management/hostedservice/client.go
deleted file mode 100644
index f6d2a712abc2..000000000000
--- a/services/classic/management/hostedservice/client.go
+++ /dev/null
@@ -1,141 +0,0 @@
-// +build go1.7
-
-// Package hostedservice provides a client for Hosted Services.
-package hostedservice
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "encoding/base64"
- "encoding/xml"
- "fmt"
-
- "github.com/Azure/azure-sdk-for-go/services/classic/management"
-)
-
-const (
- azureXmlns = "http://schemas.microsoft.com/windowsazure"
- azureDeploymentListURL = "services/hostedservices/%s/deployments"
- azureHostedServiceListURL = "services/hostedservices"
- azureHostedServiceAvailabilityURL = "services/hostedservices/operations/isavailable/%s"
- azureDeploymentURL = "services/hostedservices/%s/deployments/%s"
- deleteAzureDeploymentURL = "services/hostedservices/%s/deployments/%s"
- getHostedServicePropertiesURL = "services/hostedservices/%s"
- azureServiceCertificateURL = "services/hostedservices/%s/certificates"
-
- errParamNotSpecified = "Parameter %s is not specified."
-)
-
-//NewClient is used to return a handle to the HostedService API
-func NewClient(client management.Client) HostedServiceClient {
- return HostedServiceClient{client: client}
-}
-
-func (h HostedServiceClient) CreateHostedService(params CreateHostedServiceParameters) error {
- req, err := xml.Marshal(params)
- if err != nil {
- return err
- }
-
- _, err = h.client.SendAzurePostRequest(azureHostedServiceListURL, req) // not a long running operation
- return err
-}
-
-func (h HostedServiceClient) CheckHostedServiceNameAvailability(dnsName string) (AvailabilityResponse, error) {
- var r AvailabilityResponse
- if dnsName == "" {
- return r, fmt.Errorf(errParamNotSpecified, "dnsName")
- }
-
- requestURL := fmt.Sprintf(azureHostedServiceAvailabilityURL, dnsName)
- response, err := h.client.SendAzureGetRequest(requestURL)
- if err != nil {
- return r, err
- }
-
- err = xml.Unmarshal(response, &r)
- return r, err
-}
-
-func (h HostedServiceClient) DeleteHostedService(dnsName string, deleteDisksAndBlobs bool) (management.OperationID, error) {
- if dnsName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "dnsName")
- }
-
- requestURL := fmt.Sprintf(getHostedServicePropertiesURL, dnsName)
- if deleteDisksAndBlobs {
- requestURL += "?comp=media"
- }
- return h.client.SendAzureDeleteRequest(requestURL)
-}
-
-func (h HostedServiceClient) GetHostedService(name string) (HostedService, error) {
- hostedService := HostedService{}
- if name == "" {
- return hostedService, fmt.Errorf(errParamNotSpecified, "name")
- }
-
- requestURL := fmt.Sprintf(getHostedServicePropertiesURL, name)
- response, err := h.client.SendAzureGetRequest(requestURL)
- if err != nil {
- return hostedService, err
- }
-
- err = xml.Unmarshal(response, &hostedService)
- if err != nil {
- return hostedService, err
- }
-
- decodedLabel, err := base64.StdEncoding.DecodeString(hostedService.LabelBase64)
- if err != nil {
- return hostedService, err
- }
- hostedService.Label = string(decodedLabel)
- return hostedService, nil
-}
-
-func (h HostedServiceClient) ListHostedServices() (ListHostedServicesResponse, error) {
- var response ListHostedServicesResponse
-
- data, err := h.client.SendAzureGetRequest(azureHostedServiceListURL)
- if err != nil {
- return response, err
- }
-
- err = xml.Unmarshal(data, &response)
- return response, err
-}
-
-func (h HostedServiceClient) AddCertificate(dnsName string, certData []byte, certificateFormat CertificateFormat, password string) (management.OperationID, error) {
- if dnsName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "dnsName")
- }
-
- certBase64 := base64.StdEncoding.EncodeToString(certData)
-
- addCertificate := CertificateFile{
- Data: certBase64,
- CertificateFormat: certificateFormat,
- Password: password,
- Xmlns: azureXmlns,
- }
- buffer, err := xml.Marshal(addCertificate)
- if err != nil {
- return "", err
- }
-
- requestURL := fmt.Sprintf(azureServiceCertificateURL, dnsName)
- return h.client.SendAzurePostRequest(requestURL, buffer)
-}
diff --git a/services/classic/management/hostedservice/entities.go b/services/classic/management/hostedservice/entities.go
deleted file mode 100644
index aa5b994515b7..000000000000
--- a/services/classic/management/hostedservice/entities.go
+++ /dev/null
@@ -1,74 +0,0 @@
-// +build go1.7
-
-package hostedservice
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "encoding/xml"
-
- "github.com/Azure/azure-sdk-for-go/services/classic/management"
-)
-
-//HostedServiceClient is used to perform operations on Azure Hosted Services
-type HostedServiceClient struct {
- client management.Client
-}
-
-type CreateHostedServiceParameters struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure CreateHostedService"`
- ServiceName string
- Label string
- Description string
- Location string
- ReverseDNSFqdn string `xml:"ReverseDnsFqdn,omitempty"`
-}
-
-type AvailabilityResponse struct {
- Xmlns string `xml:"xmlns,attr"`
- Result bool
- Reason string
-}
-
-type HostedService struct {
- URL string `xml:"Url"`
- ServiceName string
- Description string `xml:"HostedServiceProperties>Description"`
- AffinityGroup string `xml:"HostedServiceProperties>AffinityGroup"`
- Location string `xml:"HostedServiceProperties>Location"`
- LabelBase64 string `xml:"HostedServiceProperties>Label"`
- Label string
- Status string `xml:"HostedServiceProperties>Status"`
- ReverseDNSFqdn string `xml:"HostedServiceProperties>ReverseDnsFqdn"`
- DefaultWinRmCertificateThumbprint string
-}
-
-type CertificateFile struct {
- Xmlns string `xml:"xmlns,attr"`
- Data string
- CertificateFormat CertificateFormat
- Password string `xml:",omitempty"`
-}
-
-type CertificateFormat string
-
-const (
- CertificateFormatPfx = CertificateFormat("pfx")
- CertificateFormatCer = CertificateFormat("cer")
-)
-
-type ListHostedServicesResponse struct {
- HostedServices []HostedService `xml:"HostedService"`
-}
diff --git a/services/classic/management/http.go b/services/classic/management/http.go
deleted file mode 100644
index a12f8a156ded..000000000000
--- a/services/classic/management/http.go
+++ /dev/null
@@ -1,206 +0,0 @@
-// +build go1.7
-
-package management
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "bytes"
- "crypto/tls"
- "fmt"
- "net/http"
- "time"
-)
-
-const (
- msVersionHeader = "x-ms-version"
- requestIDHeader = "x-ms-request-id"
- uaHeader = "User-Agent"
- contentHeader = "Content-Type"
- defaultContentHeaderValue = "application/xml"
-)
-
-func (client client) SendAzureGetRequest(url string) ([]byte, error) {
- resp, err := client.sendAzureRequest("GET", url, "", nil)
- if err != nil {
- return nil, err
- }
- return getResponseBody(resp)
-}
-
-func (client client) SendAzurePostRequest(url string, data []byte) (OperationID, error) {
- return client.doAzureOperation("POST", url, "", data)
-}
-
-func (client client) SendAzurePostRequestWithReturnedResponse(url string, data []byte) ([]byte, error) {
- resp, err := client.sendAzureRequest("POST", url, "", data)
- if err != nil {
- return nil, err
- }
-
- return getResponseBody(resp)
-}
-
-func (client client) SendAzurePutRequest(url, contentType string, data []byte) (OperationID, error) {
- return client.doAzureOperation("PUT", url, contentType, data)
-}
-
-func (client client) SendAzureDeleteRequest(url string) (OperationID, error) {
- return client.doAzureOperation("DELETE", url, "", nil)
-}
-
-func (client client) doAzureOperation(method, url, contentType string, data []byte) (OperationID, error) {
- response, err := client.sendAzureRequest(method, url, contentType, data)
- if err != nil {
- return "", err
- }
- return getOperationID(response)
-}
-
-func getOperationID(response *http.Response) (OperationID, error) {
- requestID := response.Header.Get(requestIDHeader)
- if requestID == "" {
- return "", fmt.Errorf("Could not retrieve operation id from %q header", requestIDHeader)
- }
- return OperationID(requestID), nil
-}
-
-// sendAzureRequest constructs an HTTP client for the request, sends it to the
-// management API and returns the response or an error.
-func (client client) sendAzureRequest(method, url, contentType string, data []byte) (*http.Response, error) {
- if method == "" {
- return nil, fmt.Errorf(errParamNotSpecified, "method")
- }
- if url == "" {
- return nil, fmt.Errorf(errParamNotSpecified, "url")
- }
-
- response, err := client.sendRequest(client.httpClient, url, method, contentType, data, 5)
- if err != nil {
- return nil, err
- }
-
- return response, nil
-}
-
-// createHTTPClient creates an HTTP Client configured with the key pair for
-// the subscription for this client.
-func (client client) createHTTPClient() (*http.Client, error) {
- cert, err := tls.X509KeyPair(client.publishSettings.SubscriptionCert, client.publishSettings.SubscriptionKey)
- if err != nil {
- return nil, err
- }
-
- return &http.Client{
- Transport: &http.Transport{
- Proxy: http.ProxyFromEnvironment,
- TLSClientConfig: &tls.Config{
- Renegotiation: tls.RenegotiateOnceAsClient,
- Certificates: []tls.Certificate{cert},
- },
- },
- }, nil
-}
-
-// sendRequest sends a request to the Azure management API using the given
-// HTTP client and parameters. It returns the response from the call or an
-// error.
-func (client client) sendRequest(httpClient *http.Client, url, requestType, contentType string, data []byte, numberOfRetries int) (*http.Response, error) {
-
- absURI := client.createAzureRequestURI(url)
-
- for {
- request, reqErr := client.createAzureRequest(absURI, requestType, contentType, data)
- if reqErr != nil {
- return nil, reqErr
- }
-
- response, err := httpClient.Do(request)
- if err != nil {
- if numberOfRetries == 0 {
- return nil, err
- }
-
- return client.sendRequest(httpClient, url, requestType, contentType, data, numberOfRetries-1)
- }
- if response.StatusCode == http.StatusTemporaryRedirect {
- // ASM's way of moving traffic around, see https://msdn.microsoft.com/en-us/library/azure/ee460801.aspx
- // Only handled automatically for GET/HEAD requests. This is for the rest of the http verbs.
- u, err := response.Location()
- if err != nil {
- return response, fmt.Errorf("Redirect requested but location header could not be retrieved: %v", err)
- }
- absURI = u.String()
- continue // re-issue request
- }
-
- if response.StatusCode >= http.StatusBadRequest {
- body, err := getResponseBody(response)
- if err != nil {
- // Failed to read the response body
- return nil, err
- }
- azureErr := getAzureError(body)
- if azureErr != nil {
- if numberOfRetries == 0 {
- return nil, azureErr
- }
- if response.StatusCode == http.StatusServiceUnavailable || response.StatusCode == http.StatusTooManyRequests {
- // Wait before retrying the operation
- time.Sleep(client.config.OperationPollInterval)
- }
-
- return client.sendRequest(httpClient, url, requestType, contentType, data, numberOfRetries-1)
- }
- }
-
- return response, nil
- }
-}
-
-// createAzureRequestURI constructs the request uri using the management API endpoint and
-// subscription ID associated with the client.
-func (client client) createAzureRequestURI(url string) string {
- return fmt.Sprintf("%s/%s/%s", client.config.ManagementURL, client.publishSettings.SubscriptionID, url)
-}
-
-// createAzureRequest packages up the request with the correct set of headers and returns
-// the request object or an error.
-func (client client) createAzureRequest(url string, requestType string, contentType string, data []byte) (*http.Request, error) {
- var request *http.Request
- var err error
-
- if data != nil {
- body := bytes.NewBuffer(data)
- request, err = http.NewRequest(requestType, url, body)
- } else {
- request, err = http.NewRequest(requestType, url, nil)
- }
-
- if err != nil {
- return nil, err
- }
-
- request.Header.Set(msVersionHeader, client.config.APIVersion)
- request.Header.Set(uaHeader, client.config.UserAgent)
-
- if contentType != "" {
- request.Header.Set(contentHeader, contentType)
- } else {
- request.Header.Set(contentHeader, defaultContentHeaderValue)
- }
-
- return request, nil
-}
diff --git a/services/classic/management/location/client.go b/services/classic/management/location/client.go
deleted file mode 100644
index aa735a20a5db..000000000000
--- a/services/classic/management/location/client.go
+++ /dev/null
@@ -1,46 +0,0 @@
-// +build go1.7
-
-// Package location provides a client for Locations.
-package location
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "encoding/xml"
-
- "github.com/Azure/azure-sdk-for-go/services/classic/management"
-)
-
-const (
- azureLocationListURL = "locations"
- errParamNotSpecified = "Parameter %s is not specified."
-)
-
-//NewClient is used to instantiate a new LocationClient from an Azure client
-func NewClient(client management.Client) LocationClient {
- return LocationClient{client: client}
-}
-
-func (c LocationClient) ListLocations() (ListLocationsResponse, error) {
- var l ListLocationsResponse
-
- response, err := c.client.SendAzureGetRequest(azureLocationListURL)
- if err != nil {
- return l, err
- }
-
- err = xml.Unmarshal(response, &l)
- return l, err
-}
diff --git a/services/classic/management/location/entities.go b/services/classic/management/location/entities.go
deleted file mode 100644
index 7b12c1079d8c..000000000000
--- a/services/classic/management/location/entities.go
+++ /dev/null
@@ -1,53 +0,0 @@
-// +build go1.7
-
-package location
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "bytes"
- "encoding/xml"
- "fmt"
- "strings"
-
- "github.com/Azure/azure-sdk-for-go/services/classic/management"
-)
-
-//LocationClient is used to perform operations on Azure Locations
-type LocationClient struct {
- client management.Client
-}
-
-type ListLocationsResponse struct {
- XMLName xml.Name `xml:"Locations"`
- Locations []Location `xml:"Location"`
-}
-
-type Location struct {
- Name string
- DisplayName string
- AvailableServices []string `xml:"AvailableServices>AvailableService"`
- WebWorkerRoleSizes []string `xml:"ComputeCapabilities>WebWorkerRoleSizes>RoleSize"`
- VirtualMachineRoleSizes []string `xml:"ComputeCapabilities>VirtualMachinesRoleSizes>RoleSize"`
-}
-
-func (ll ListLocationsResponse) String() string {
- var buf bytes.Buffer
- for _, l := range ll.Locations {
- fmt.Fprintf(&buf, "%s, ", l.Name)
- }
-
- return strings.Trim(buf.String(), ", ")
-}
diff --git a/services/classic/management/networksecuritygroup/client.go b/services/classic/management/networksecuritygroup/client.go
deleted file mode 100644
index 6c7f9ce9c7ab..000000000000
--- a/services/classic/management/networksecuritygroup/client.go
+++ /dev/null
@@ -1,266 +0,0 @@
-// +build go1.7
-
-// Package networksecuritygroup provides a client for Network Security Groups.
-package networksecuritygroup
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "encoding/xml"
- "fmt"
-
- "github.com/Azure/azure-sdk-for-go/services/classic/management"
-)
-
-const (
- createSecurityGroupURL = "services/networking/networksecuritygroups"
- deleteSecurityGroupURL = "services/networking/networksecuritygroups/%s"
- getSecurityGroupURL = "services/networking/networksecuritygroups/%s?detaillevel=full"
- listSecurityGroupsURL = "services/networking/networksecuritygroups"
- addSecurityGroupToSubnetURL = "services/networking/virtualnetwork/%s/subnets/%s/networksecuritygroups"
- getSecurityGroupForSubnetURL = "services/networking/virtualnetwork/%s/subnets/%s/networksecuritygroups"
- removeSecurityGroupFromSubnetURL = "services/networking/virtualnetwork/%s/subnets/%s/networksecuritygroups/%s"
- setSecurityGroupRuleURL = "services/networking/networksecuritygroups/%s/rules/%s"
- deleteSecurityGroupRuleURL = "services/networking/networksecuritygroups/%s/rules/%s"
-
- errParamNotSpecified = "Parameter %s is not specified."
-)
-
-// NewClient is used to instantiate a new SecurityGroupClient from an Azure client
-func NewClient(client management.Client) SecurityGroupClient {
- return SecurityGroupClient{client: client}
-}
-
-// CreateNetworkSecurityGroup creates a new network security group within
-// the context of the specified subscription
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn913818.aspx
-func (sg SecurityGroupClient) CreateNetworkSecurityGroup(
- name string,
- label string,
- location string) (management.OperationID, error) {
- if name == "" {
- return "", fmt.Errorf(errParamNotSpecified, "name")
- }
- if location == "" {
- return "", fmt.Errorf(errParamNotSpecified, "location")
- }
-
- data, err := xml.Marshal(SecurityGroupRequest{
- Name: name,
- Label: label,
- Location: location,
- })
- if err != nil {
- return "", err
- }
-
- requestURL := fmt.Sprintf(createSecurityGroupURL)
- return sg.client.SendAzurePostRequest(requestURL, data)
-}
-
-// DeleteNetworkSecurityGroup deletes the specified network security group from the subscription
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn913825.aspx
-func (sg SecurityGroupClient) DeleteNetworkSecurityGroup(
- name string) (management.OperationID, error) {
- if name == "" {
- return "", fmt.Errorf(errParamNotSpecified, "name")
- }
-
- requestURL := fmt.Sprintf(deleteSecurityGroupURL, name)
- return sg.client.SendAzureDeleteRequest(requestURL)
-}
-
-// GetNetworkSecurityGroup returns information about the specified network security group
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn913821.aspx
-func (sg SecurityGroupClient) GetNetworkSecurityGroup(name string) (SecurityGroupResponse, error) {
- if name == "" {
- return SecurityGroupResponse{}, fmt.Errorf(errParamNotSpecified, "name")
- }
-
- var securityGroup SecurityGroupResponse
-
- requestURL := fmt.Sprintf(getSecurityGroupURL, name)
- response, err := sg.client.SendAzureGetRequest(requestURL)
- if err != nil {
- return securityGroup, err
- }
-
- err = xml.Unmarshal(response, &securityGroup)
- return securityGroup, err
-}
-
-// ListNetworkSecurityGroups returns a list of the network security groups
-// in the specified subscription
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn913815.aspx
-func (sg SecurityGroupClient) ListNetworkSecurityGroups() (SecurityGroupList, error) {
- // the list of NetworkSecurityGroup items is wrapped in a NetworkSecurityGroups
- // element so we need an outer struct representing this element.
- type NetworkSecurityGroups struct {
- SecurityGroupList SecurityGroupList `xml:"http://schemas.microsoft.com/windowsazure NetworkSecurityGroup"`
- }
- var securityGroups NetworkSecurityGroups
-
- response, err := sg.client.SendAzureGetRequest(listSecurityGroupsURL)
- if err != nil {
- return securityGroups.SecurityGroupList, err
- }
-
- err = xml.Unmarshal(response, &securityGroups)
- return securityGroups.SecurityGroupList, err
-}
-
-// AddNetworkSecurityToSubnet associates the network security group with
-// specified subnet in a virtual network
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn913822.aspx
-func (sg SecurityGroupClient) AddNetworkSecurityToSubnet(
- name string,
- subnet string,
- virtualNetwork string) (management.OperationID, error) {
- if name == "" {
- return "", fmt.Errorf(errParamNotSpecified, "name")
- }
- if subnet == "" {
- return "", fmt.Errorf(errParamNotSpecified, "subnet")
- }
- if virtualNetwork == "" {
- return "", fmt.Errorf(errParamNotSpecified, "virtualNetwork")
- }
-
- data, err := xml.Marshal(SecurityGroupRequest{Name: name})
- if err != nil {
- return "", err
- }
-
- requestURL := fmt.Sprintf(addSecurityGroupToSubnetURL, virtualNetwork, subnet)
- return sg.client.SendAzurePostRequest(requestURL, data)
-}
-
-// GetNetworkSecurityGroupForSubnet returns information about the network
-// security group associated with a subnet
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn913817.aspx
-func (sg SecurityGroupClient) GetNetworkSecurityGroupForSubnet(
- subnet string,
- virtualNetwork string) (SecurityGroupResponse, error) {
- if subnet == "" {
- return SecurityGroupResponse{}, fmt.Errorf(errParamNotSpecified, "subnet")
- }
- if virtualNetwork == "" {
- return SecurityGroupResponse{}, fmt.Errorf(errParamNotSpecified, "virtualNetwork")
- }
-
- var securityGroup SecurityGroupResponse
-
- requestURL := fmt.Sprintf(getSecurityGroupForSubnetURL, virtualNetwork, subnet)
- response, err := sg.client.SendAzureGetRequest(requestURL)
- if err != nil {
- return securityGroup, err
- }
-
- err = xml.Unmarshal(response, &securityGroup)
- return securityGroup, err
-}
-
-// RemoveNetworkSecurityGroupFromSubnet removes the association of the
-// specified network security group from the specified subnet
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn913820.aspx
-func (sg SecurityGroupClient) RemoveNetworkSecurityGroupFromSubnet(
- name string,
- subnet string,
- virtualNetwork string) (management.OperationID, error) {
- if name == "" {
- return "", fmt.Errorf(errParamNotSpecified, "name")
- }
- if subnet == "" {
- return "", fmt.Errorf(errParamNotSpecified, "subnet")
- }
- if virtualNetwork == "" {
- return "", fmt.Errorf(errParamNotSpecified, "virtualNetwork")
- }
-
- requestURL := fmt.Sprintf(removeSecurityGroupFromSubnetURL, virtualNetwork, subnet, name)
- return sg.client.SendAzureDeleteRequest(requestURL)
-}
-
-// SetNetworkSecurityGroupRule adds or updates a network security rule that
-// is associated with the specified network security group
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn913819.aspx
-func (sg SecurityGroupClient) SetNetworkSecurityGroupRule(
- securityGroup string,
- rule RuleRequest) (management.OperationID, error) {
- if securityGroup == "" {
- return "", fmt.Errorf(errParamNotSpecified, "securityGroup")
- }
- if rule.Name == "" {
- return "", fmt.Errorf(errParamNotSpecified, "Name")
- }
- if rule.Type == "" {
- return "", fmt.Errorf(errParamNotSpecified, "Type")
- }
- if rule.Priority == 0 {
- return "", fmt.Errorf(errParamNotSpecified, "Priority")
- }
- if rule.Action == "" {
- return "", fmt.Errorf(errParamNotSpecified, "Action")
- }
- if rule.SourceAddressPrefix == "" {
- return "", fmt.Errorf(errParamNotSpecified, "SourceAddressPrefix")
- }
- if rule.SourcePortRange == "" {
- return "", fmt.Errorf(errParamNotSpecified, "SourcePortRange")
- }
- if rule.DestinationAddressPrefix == "" {
- return "", fmt.Errorf(errParamNotSpecified, "DestinationAddressPrefix")
- }
- if rule.DestinationPortRange == "" {
- return "", fmt.Errorf(errParamNotSpecified, "DestinationPortRange")
- }
- if rule.Protocol == "" {
- return "", fmt.Errorf(errParamNotSpecified, "Protocol")
- }
-
- data, err := xml.Marshal(rule)
- if err != nil {
- return "", err
- }
-
- requestURL := fmt.Sprintf(setSecurityGroupRuleURL, securityGroup, rule.Name)
- return sg.client.SendAzurePutRequest(requestURL, "", data)
-}
-
-// DeleteNetworkSecurityGroupRule deletes a network security group rule from
-// the specified network security group
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn913816.aspx
-func (sg SecurityGroupClient) DeleteNetworkSecurityGroupRule(
- securityGroup string,
- rule string) (management.OperationID, error) {
- if securityGroup == "" {
- return "", fmt.Errorf(errParamNotSpecified, "securityGroup")
- }
- if rule == "" {
- return "", fmt.Errorf(errParamNotSpecified, "rule")
- }
-
- requestURL := fmt.Sprintf(deleteSecurityGroupRuleURL, securityGroup, rule)
- return sg.client.SendAzureDeleteRequest(requestURL)
-}
diff --git a/services/classic/management/networksecuritygroup/entities.go b/services/classic/management/networksecuritygroup/entities.go
deleted file mode 100644
index 1073eac79e2c..000000000000
--- a/services/classic/management/networksecuritygroup/entities.go
+++ /dev/null
@@ -1,131 +0,0 @@
-// +build go1.7
-
-// Package networksecuritygroup implements operations for managing network security groups
-// using the Service Management REST API
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn913824.aspx
-package networksecuritygroup
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "encoding/xml"
-
- "github.com/Azure/azure-sdk-for-go/services/classic/management"
-)
-
-// SecurityGroupClient is used to perform operations on network security groups
-type SecurityGroupClient struct {
- client management.Client
-}
-
-// SecurityGroupRequest represents a network security group
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn913821.aspx
-type SecurityGroupRequest struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure NetworkSecurityGroup"`
- Name string
- Label string `xml:",omitempty"`
- Location string `xml:",omitempty"`
-}
-
-// SecurityGroupResponse represents a network security group
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn913821.aspx
-type SecurityGroupResponse struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure NetworkSecurityGroup"`
- Name string
- Label string `xml:",omitempty"`
- Location string `xml:",omitempty"`
- State SecurityGroupState `xml:",omitempty"`
- Rules []RuleResponse `xml:">Rule,omitempty"`
-}
-
-// SecurityGroupList represents a list of security groups
-type SecurityGroupList []SecurityGroupResponse
-
-// SecurityGroupState represents a security group state
-type SecurityGroupState string
-
-// These constants represent the possible security group states
-const (
- SecurityGroupStateCreated SecurityGroupState = "Created"
- SecurityGroupStateCreating SecurityGroupState = "Creating"
- SecurityGroupStateUpdating SecurityGroupState = "Updating"
- SecurityGroupStateDeleting SecurityGroupState = "Deleting"
- SecurityGroupStateUnavailable SecurityGroupState = "Unavailable"
-)
-
-// RuleRequest represents a single rule of a network security group
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn913821.aspx#bk_rules
-type RuleRequest struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure Rule"`
- Name string
- Type RuleType
- Priority int
- Action RuleAction
- SourceAddressPrefix string
- SourcePortRange string
- DestinationAddressPrefix string
- DestinationPortRange string
- Protocol RuleProtocol
-}
-
-// RuleResponse represents a single rule of a network security group
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn913821.aspx#bk_rules
-type RuleResponse struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure Rule"`
- Name string
- Type RuleType
- Priority int
- Action RuleAction
- SourceAddressPrefix string
- SourcePortRange string
- DestinationAddressPrefix string
- DestinationPortRange string
- Protocol RuleProtocol
- State string `xml:",omitempty"`
- IsDefault bool `xml:",omitempty"`
-}
-
-// RuleType represents a rule type
-type RuleType string
-
-// These constants represent the possible rule types
-const (
- RuleTypeInbound RuleType = "Inbound"
- RuleTypeOutbound RuleType = "Outbound"
-)
-
-// RuleAction represents a rule action
-type RuleAction string
-
-// These constants represent the possible rule actions
-const (
- RuleActionAllow RuleAction = "Allow"
- RuleActionDeny RuleAction = "Deny"
-)
-
-// RuleProtocol represents a rule protocol
-type RuleProtocol string
-
-// These constants represent the possible rule types
-const (
- RuleProtocolTCP RuleProtocol = "TCP"
- RuleProtocolUDP RuleProtocol = "UDP"
- RuleProtocolAll RuleProtocol = "*"
-)
diff --git a/services/classic/management/operations.go b/services/classic/management/operations.go
deleted file mode 100644
index eb306b8b14bd..000000000000
--- a/services/classic/management/operations.go
+++ /dev/null
@@ -1,108 +0,0 @@
-// +build go1.7
-
-package management
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "encoding/xml"
- "errors"
- "fmt"
- "time"
-)
-
-var (
- // ErrOperationCancelled from WaitForOperation when the polling loop is
- // cancelled through signaling the channel.
- ErrOperationCancelled = errors.New("Polling for operation status cancelled")
-)
-
-// GetOperationStatusResponse represents an in-flight operation. Use
-// client.GetOperationStatus() to get the operation given the operation ID, or
-// use WaitForOperation() to poll and wait until the operation has completed.
-// See https://msdn.microsoft.com/en-us/library/azure/ee460783.aspx
-type GetOperationStatusResponse struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure Operation"`
- ID string
- Status OperationStatus
- HTTPStatusCode string
- Error *AzureError
-}
-
-// OperationStatus describes the states an Microsoft Azure Service Management
-// operation an be in.
-type OperationStatus string
-
-// List of states an operation can be reported as
-const (
- OperationStatusInProgress OperationStatus = "InProgress"
- OperationStatusSucceeded OperationStatus = "Succeeded"
- OperationStatusFailed OperationStatus = "Failed"
-)
-
-// OperationID is assigned by Azure API and can be used to look up the status of
-// an operation
-type OperationID string
-
-func (c client) GetOperationStatus(operationID OperationID) (GetOperationStatusResponse, error) {
- operation := GetOperationStatusResponse{}
- if operationID == "" {
- return operation, fmt.Errorf(errParamNotSpecified, "operationID")
- }
-
- url := fmt.Sprintf("operations/%s", operationID)
- response, azureErr := c.SendAzureGetRequest(url)
- if azureErr != nil {
- return operation, azureErr
- }
-
- err := xml.Unmarshal(response, &operation)
- return operation, err
-}
-
-func (c client) WaitForOperation(operationID OperationID, cancel chan struct{}) error {
- for {
- done, err := c.checkOperationStatus(operationID)
- if err != nil || done {
- return err
- }
- select {
- case <-time.After(c.config.OperationPollInterval):
- case <-cancel:
- return ErrOperationCancelled
- }
- }
-}
-
-func (c client) checkOperationStatus(id OperationID) (done bool, err error) {
- op, err := c.GetOperationStatus(id)
- if err != nil {
- return false, fmt.Errorf("Failed to get operation status '%s': %v", id, err)
- }
-
- switch op.Status {
- case OperationStatusSucceeded:
- return true, nil
- case OperationStatusFailed:
- if op.Error != nil {
- return true, op.Error
- }
- return true, fmt.Errorf("Azure Operation (x-ms-request-id=%s) has failed", id)
- case OperationStatusInProgress:
- return false, nil
- default:
- return false, fmt.Errorf("Unknown operation status returned from API: %s (x-ms-request-id=%s)", op.Status, id)
- }
-}
diff --git a/services/classic/management/osimage/client.go b/services/classic/management/osimage/client.go
deleted file mode 100644
index 3726abd88634..000000000000
--- a/services/classic/management/osimage/client.go
+++ /dev/null
@@ -1,60 +0,0 @@
-// +build go1.7
-
-// Package osimage provides a client for Operating System Images.
-package osimage
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "encoding/xml"
-
- "github.com/Azure/azure-sdk-for-go/services/classic/management"
-)
-
-const (
- azureImageListURL = "services/images"
- errInvalidImage = "Can not find image %s in specified subscription, please specify another image name."
- errParamNotSpecified = "Parameter %s is not specified."
-)
-
-// NewClient is used to instantiate a new OSImageClient from an Azure client.
-func NewClient(client management.Client) OSImageClient {
- return OSImageClient{client: client}
-}
-
-func (c OSImageClient) ListOSImages() (ListOSImagesResponse, error) {
- var l ListOSImagesResponse
-
- response, err := c.client.SendAzureGetRequest(azureImageListURL)
- if err != nil {
- return l, err
- }
-
- err = xml.Unmarshal(response, &l)
- return l, err
-}
-
-// AddOSImage adds an operating system image to the image repository that is associated with the specified subscription.
-//
-// See https://msdn.microsoft.com/en-us/library/azure/jj157192.aspx for details.
-func (c OSImageClient) AddOSImage(osi *OSImage) (management.OperationID, error) {
- data, err := xml.Marshal(osi)
- if err != nil {
- return "", err
- }
-
- return c.client.SendAzurePostRequest(azureImageListURL, data)
-
-}
diff --git a/services/classic/management/osimage/entities.go b/services/classic/management/osimage/entities.go
deleted file mode 100644
index 970f131e8959..000000000000
--- a/services/classic/management/osimage/entities.go
+++ /dev/null
@@ -1,65 +0,0 @@
-// +build go1.7
-
-package osimage
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "encoding/xml"
-
- "github.com/Azure/azure-sdk-for-go/services/classic/management"
-)
-
-// OSImageClient is used to perform operations on Azure Locations
-type OSImageClient struct {
- client management.Client
-}
-
-type ListOSImagesResponse struct {
- XMLName xml.Name `xml:"Images"`
- OSImages []OSImage `xml:"OSImage"`
-}
-
-type OSImage struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure OSImage"`
- Category string // Public || Private || MSDN
- Label string // Specifies an identifier for the image.
- LogicalSizeInGB float64 //Specifies the size, in GB, of the image.
- Name string // Specifies the name of the operating system image. This is the name that is used when creating one or more virtual machines using the image.
- OS string // Linux || Windows
- Eula string // Specifies the End User License Agreement that is associated with the image. The value for this element is a string, but it is recommended that the value be a URL that points to a EULA.
- Description string // Specifies the description of the image.
- Location string // The geo-location in which this media is located. The Location value is derived from storage account that contains the blob in which the media is located. If the storage account belongs to an affinity group the value is NULL.
- AffinityGroup string // Specifies the affinity in which the media is located. The AffinityGroup value is derived from storage account that contains the blob in which the media is located. If the storage account does not belong to an affinity group the value is NULL and the element is not displayed in the response. This value is NULL for platform images.
- MediaLink string // Specifies the location of the vhd file for the image. The storage account where the vhd is located must be associated with the specified subscription.
- ImageFamily string // Specifies a value that can be used to group images.
- PublishedDate string // Specifies the date when the image was added to the image repository.
- IsPremium string // Indicates whether the image contains software or associated services that will incur charges above the core price for the virtual machine. For additional details, see the PricingDetailLink element.
- PrivacyURI string `xml:"PrivacyUri"` // Specifies the URI that points to a document that contains the privacy policy related to the image.
- RecommendedVMSize string // Specifies the size to use for the virtual machine that is created from the image.
- PublisherName string // The name of the publisher of the image. All user images have a publisher name of User.
- PricingDetailLink string // Specifies a URL for an image with IsPremium set to true, which contains the pricing details for a virtual machine that is created from the image.
- IconURI string `xml:"IconUri"` // Specifies the Uri to the icon that is displayed for the image in the Management Portal.
- SmallIconURI string `xml:"SmallIconUri"` // Specifies the URI to the small icon that is displayed when the image is presented in the Microsoft Azure Management Portal.
- Language string // Specifies the language of the image.
- IOType IOType // Provisioned || Standard
-}
-
-type IOType string
-
-const (
- IOTypeProvisioned IOType = "Provisioned"
- IOTypeStandard IOType = "Standard"
-)
diff --git a/services/classic/management/publishSettings.go b/services/classic/management/publishSettings.go
deleted file mode 100644
index 8effb38eb8c6..000000000000
--- a/services/classic/management/publishSettings.go
+++ /dev/null
@@ -1,124 +0,0 @@
-// +build go1.7
-
-package management
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "encoding/base64"
- "encoding/pem"
- "encoding/xml"
- "fmt"
- "io/ioutil"
-
- "golang.org/x/crypto/pkcs12"
-)
-
-// ClientFromPublishSettingsData unmarshalls the contents of a publish settings file
-// from https://manage.windowsazure.com/publishsettings.
-// If subscriptionID is left empty, the first subscription in the file is used.
-func ClientFromPublishSettingsData(settingsData []byte, subscriptionID string) (client Client, err error) {
- return ClientFromPublishSettingsDataWithConfig(settingsData, subscriptionID, DefaultConfig())
-}
-
-// ClientFromPublishSettingsFile reads a publish settings file downloaded from https://manage.windowsazure.com/publishsettings.
-// If subscriptionID is left empty, the first subscription in the file is used.
-func ClientFromPublishSettingsFile(filePath, subscriptionID string) (client Client, err error) {
- return ClientFromPublishSettingsFileWithConfig(filePath, subscriptionID, DefaultConfig())
-}
-
-// ClientFromPublishSettingsFileWithConfig reads a publish settings file downloaded from https://manage.windowsazure.com/publishsettings.
-// If subscriptionID is left empty, the first subscription in the file is used.
-func ClientFromPublishSettingsFileWithConfig(filePath, subscriptionID string, config ClientConfig) (client Client, err error) {
- if filePath == "" {
- return client, fmt.Errorf(errParamNotSpecified, "filePath")
- }
-
- publishSettingsContent, err := ioutil.ReadFile(filePath)
- if err != nil {
- return client, err
- }
-
- return ClientFromPublishSettingsDataWithConfig(publishSettingsContent, subscriptionID, config)
-}
-
-// ClientFromPublishSettingsDataWithConfig unmarshalls the contents of a publish settings file
-// from https://manage.windowsazure.com/publishsettings.
-// If subscriptionID is left empty, the first subscription in the string is used.
-func ClientFromPublishSettingsDataWithConfig(data []byte, subscriptionID string, config ClientConfig) (client Client, err error) {
- publishData := publishData{}
- if err = xml.Unmarshal(data, &publishData); err != nil {
- return client, err
- }
-
- for _, profile := range publishData.PublishProfiles {
- for _, sub := range profile.Subscriptions {
- if sub.ID == subscriptionID || subscriptionID == "" {
- base64Cert := sub.ManagementCertificate
- if base64Cert == "" {
- base64Cert = profile.ManagementCertificate
- }
-
- pfxData, err := base64.StdEncoding.DecodeString(base64Cert)
- if err != nil {
- return client, err
- }
-
- pems, err := pkcs12.ToPEM(pfxData, "")
- if err != nil {
- return client, err
- }
-
- cert := []byte{}
- for _, b := range pems {
- cert = append(cert, pem.EncodeToMemory(b)...)
- }
-
- config.ManagementURL = sub.ServiceManagementURL
- return makeClient(sub.ID, cert, config)
- }
- }
- }
-
- return client, fmt.Errorf("could not find subscription '%s' in settings provided", subscriptionID)
-}
-
-type publishSettings struct {
- SubscriptionID string
- SubscriptionCert []byte
- SubscriptionKey []byte
-}
-
-type publishData struct {
- XMLName xml.Name `xml:"PublishData"`
- PublishProfiles []publishProfile `xml:"PublishProfile"`
-}
-
-type publishProfile struct {
- XMLName xml.Name `xml:"PublishProfile"`
- SchemaVersion string `xml:",attr"`
- PublishMethod string `xml:",attr"`
- URL string `xml:"Url,attr"`
- ManagementCertificate string `xml:",attr"`
- Subscriptions []subscription `xml:"Subscription"`
-}
-
-type subscription struct {
- XMLName xml.Name `xml:"Subscription"`
- ServiceManagementURL string `xml:"ServiceManagementUrl,attr"`
- ID string `xml:"Id,attr"`
- Name string `xml:",attr"`
- ManagementCertificate string `xml:",attr"`
-}
diff --git a/services/classic/management/sql/client.go b/services/classic/management/sql/client.go
deleted file mode 100644
index 483428a47a07..000000000000
--- a/services/classic/management/sql/client.go
+++ /dev/null
@@ -1,332 +0,0 @@
-// +build go1.7
-
-package sql
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "encoding/xml"
- "fmt"
- "time"
-
- "github.com/Azure/azure-sdk-for-go/services/classic/management"
-)
-
-// Definitions of numerous constants representing API endpoints.
-const (
- azureCreateDatabaseServerURL = "services/sqlservers/servers"
- azureListDatabaseServersURL = "services/sqlservers/servers"
- azureDeleteDatabaseServerURL = "services/sqlservers/servers/%s"
-
- azureCreateFirewallRuleURL = "services/sqlservers/servers/%s/firewallrules"
- azureGetFirewallRuleURL = "services/sqlservers/servers/%s/firewallrules/%s"
- azureListFirewallRulesURL = "services/sqlservers/servers/%s/firewallrules"
- azureUpdateFirewallRuleURL = "services/sqlservers/servers/%s/firewallrules/%s"
- azureDeleteFirewallRuleURL = "services/sqlservers/servers/%s/firewallrules/%s"
-
- azureCreateDatabaseURL = "services/sqlservers/servers/%s/databases"
- azureGetDatabaseURL = "services/sqlservers/servers/%s/databases/%s"
- azureListDatabasesURL = "services/sqlservers/servers/%s/databases?contentview=generic"
- azureUpdateDatabaseURL = "services/sqlservers/servers/%s/databases/%s"
- azureDeleteDatabaseURL = "services/sqlservers/servers/%s/databases/%s"
-
- errParamNotSpecified = "Parameter %s was not specified."
-
- DatabaseStateCreating = "Creating"
-)
-
-// SQLDatabaseClient defines various database CRUD operations.
-// It contains a management.Client for making the actual http calls.
-type SQLDatabaseClient struct {
- mgmtClient management.Client
-}
-
-// NewClient returns a new SQLDatabaseClient struct with the provided
-// management.Client as the underlying client.
-func NewClient(mgmtClient management.Client) SQLDatabaseClient {
- return SQLDatabaseClient{mgmtClient}
-}
-
-// CreateServer creates a new Azure SQL Database server and return its name.
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn505699.aspx
-func (c SQLDatabaseClient) CreateServer(params DatabaseServerCreateParams) (string, error) {
- req, err := xml.Marshal(params)
- if err != nil {
- return "", err
- }
-
- resp, err := c.mgmtClient.SendAzurePostRequestWithReturnedResponse(azureCreateDatabaseServerURL, req)
- if err != nil {
- return "", err
- }
-
- var name string
- err = xml.Unmarshal(resp, &name)
-
- return name, err
-}
-
-// ListServers retrieves the Azure SQL Database servers for this subscription.
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn505702.aspx
-func (c SQLDatabaseClient) ListServers() (ListServersResponse, error) {
- var resp ListServersResponse
-
- data, err := c.mgmtClient.SendAzureGetRequest(azureListDatabaseServersURL)
- if err != nil {
- return resp, err
- }
-
- err = xml.Unmarshal(data, &resp)
- return resp, err
-}
-
-// DeleteServer deletes an Azure SQL Database server (including all its databases).
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn505695.aspx
-func (c SQLDatabaseClient) DeleteServer(name string) error {
- if name == "" {
- return fmt.Errorf(errParamNotSpecified, "name")
- }
-
- url := fmt.Sprintf(azureDeleteDatabaseServerURL, name)
- _, err := c.mgmtClient.SendAzureDeleteRequest(url)
- return err
-}
-
-// CreateFirewallRule creates an Azure SQL Database server
-// firewall rule.
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn505712.aspx
-func (c SQLDatabaseClient) CreateFirewallRule(server string, params FirewallRuleCreateParams) error {
- if server == "" {
- return fmt.Errorf(errParamNotSpecified, "server")
- }
-
- req, err := xml.Marshal(params)
- if err != nil {
- return err
- }
-
- url := fmt.Sprintf(azureCreateFirewallRuleURL, server)
-
- _, err = c.mgmtClient.SendAzurePostRequest(url, req)
- return err
-}
-
-// GetFirewallRule gets the details of an Azure SQL Database Server firewall rule.
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn505698.aspx
-func (c SQLDatabaseClient) GetFirewallRule(server, ruleName string) (FirewallRuleResponse, error) {
- var rule FirewallRuleResponse
-
- if server == "" {
- return rule, fmt.Errorf(errParamNotSpecified, "server")
- }
- if ruleName == "" {
- return rule, fmt.Errorf(errParamNotSpecified, "ruleName")
- }
-
- url := fmt.Sprintf(azureGetFirewallRuleURL, server, ruleName)
- resp, err := c.mgmtClient.SendAzureGetRequest(url)
- if err != nil {
- return rule, err
- }
-
- err = xml.Unmarshal(resp, &rule)
- return rule, err
-}
-
-// ListFirewallRules retrieves the set of firewall rules for an Azure SQL
-// Database Server.
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn505715.aspx
-func (c SQLDatabaseClient) ListFirewallRules(server string) (ListFirewallRulesResponse, error) {
- var rules ListFirewallRulesResponse
-
- if server == "" {
- return rules, fmt.Errorf(errParamNotSpecified, "server")
- }
-
- url := fmt.Sprintf(azureListFirewallRulesURL, server)
- resp, err := c.mgmtClient.SendAzureGetRequest(url)
- if err != nil {
- return rules, err
- }
-
- err = xml.Unmarshal(resp, &rules)
- return rules, err
-}
-
-// UpdateFirewallRule update a firewall rule for an Azure SQL Database server.
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn505707.aspx
-func (c SQLDatabaseClient) UpdateFirewallRule(server, ruleName string, params FirewallRuleUpdateParams) error {
- if server == "" {
- return fmt.Errorf(errParamNotSpecified, "server")
- }
- if ruleName == "" {
- return fmt.Errorf(errParamNotSpecified, "ruleName")
- }
-
- req, err := xml.Marshal(params)
- if err != nil {
- return err
- }
-
- url := fmt.Sprintf(azureUpdateFirewallRuleURL, server, ruleName)
- _, err = c.mgmtClient.SendAzurePutRequest(url, "text/xml", req)
- return err
-}
-
-// DeleteFirewallRule deletes an Azure SQL Database server firewall rule.
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn505706.aspx
-func (c SQLDatabaseClient) DeleteFirewallRule(server, ruleName string) error {
- if server == "" {
- return fmt.Errorf(errParamNotSpecified, "server")
- }
- if ruleName == "" {
- return fmt.Errorf(errParamNotSpecified, "ruleName")
- }
-
- url := fmt.Sprintf(azureDeleteFirewallRuleURL, server, ruleName)
-
- _, err := c.mgmtClient.SendAzureDeleteRequest(url)
- return err
-}
-
-// CreateDatabase creates a new Microsoft Azure SQL Database on the given database server.
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn505701.aspx
-func (c SQLDatabaseClient) CreateDatabase(server string, params DatabaseCreateParams) error {
- if server == "" {
- return fmt.Errorf(errParamNotSpecified, "server")
- }
-
- req, err := xml.Marshal(params)
- if err != nil {
- return err
- }
-
- target := fmt.Sprintf(azureCreateDatabaseURL, server)
- _, err = c.mgmtClient.SendAzurePostRequest(target, req)
- return err
-}
-
-// WaitForDatabaseCreation is a helper method which waits
-// for the creation of the database on the given server.
-func (c SQLDatabaseClient) WaitForDatabaseCreation(
- server, database string,
- cancel chan struct{}) error {
- for {
- stat, err := c.GetDatabase(server, database)
- if err != nil {
- return err
- }
- if stat.State != DatabaseStateCreating {
- return nil
- }
-
- select {
- case <-time.After(management.DefaultOperationPollInterval):
- case <-cancel:
- return management.ErrOperationCancelled
- }
- }
-}
-
-// GetDatabase gets the details for an Azure SQL Database.
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn505708.aspx
-func (c SQLDatabaseClient) GetDatabase(server, database string) (ServiceResource, error) {
- var db ServiceResource
-
- if database == "" {
- return db, fmt.Errorf(errParamNotSpecified, "database")
- }
- if server == "" {
- return db, fmt.Errorf(errParamNotSpecified, "server")
- }
-
- url := fmt.Sprintf(azureGetDatabaseURL, server, database)
- resp, err := c.mgmtClient.SendAzureGetRequest(url)
- if err != nil {
- return db, err
- }
-
- err = xml.Unmarshal(resp, &db)
- return db, err
-}
-
-// ListDatabases returns a list of Azure SQL Databases on the given server.
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn505711.aspx
-func (c SQLDatabaseClient) ListDatabases(server string) (ListDatabasesResponse, error) {
- var databases ListDatabasesResponse
- if server == "" {
- return databases, fmt.Errorf(errParamNotSpecified, "server name")
- }
-
- url := fmt.Sprintf(azureListDatabasesURL, server)
- resp, err := c.mgmtClient.SendAzureGetRequest(url)
- if err != nil {
- return databases, err
- }
-
- err = xml.Unmarshal(resp, &databases)
- return databases, err
-}
-
-// UpdateDatabase updates the details of the given Database off the given server.
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn505718.aspx
-func (c SQLDatabaseClient) UpdateDatabase(
- server, database string,
- params ServiceResourceUpdateParams) (management.OperationID, error) {
- if database == "" {
- return "", fmt.Errorf(errParamNotSpecified, "database")
- }
- if server == "" {
- return "", fmt.Errorf(errParamNotSpecified, "server")
- }
-
- url := fmt.Sprintf(azureUpdateDatabaseURL, server, database)
- req, err := xml.Marshal(params)
- if err != nil {
- return "", err
- }
-
- return c.mgmtClient.SendAzurePutRequest(url, "text/xml", req)
-}
-
-// DeleteDatabase deletes the Azure SQL Database off the given server.
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn505705.aspx
-func (c SQLDatabaseClient) DeleteDatabase(server, database string) error {
- if database == "" {
- return fmt.Errorf(errParamNotSpecified, "database")
- }
- if server == "" {
- return fmt.Errorf(errParamNotSpecified, "server")
- }
-
- url := fmt.Sprintf(azureDeleteDatabaseURL, server, database)
-
- _, err := c.mgmtClient.SendAzureDeleteRequest(url)
-
- return err
-}
diff --git a/services/classic/management/sql/entities.go b/services/classic/management/sql/entities.go
deleted file mode 100644
index 7006e81697c7..000000000000
--- a/services/classic/management/sql/entities.go
+++ /dev/null
@@ -1,140 +0,0 @@
-// +build go1.7
-
-package sql
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "encoding/xml"
-)
-
-// DatabaseServerCreateParams represents the set of possible parameters
-// when issuing a database server creation request to Azure.
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn505699.aspx
-type DatabaseServerCreateParams struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/sqlazure/2010/12/ Server"`
- AdministratorLogin string
- AdministratorLoginPassword string
- Location string
- Version string
-}
-
-// DatabaseServerCreateResponse represents the response following the creation of
-// a database server on Azure.
-type DatabaseServerCreateResponse struct {
- ServerName string
-}
-
-const (
- DatabaseServerVersion11 = "2.0"
- DatabaseServerVersion12 = "12.0"
-)
-
-// DatabaseServer represents the set of data received from
-// a database server list operation.
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn505702.aspx
-type DatabaseServer struct {
- Name string
- AdministratorLogin string
- Location string
- FullyQualifiedDomainName string
- Version string
- State string
-}
-
-type ListServersResponse struct {
- DatabaseServers []DatabaseServer `xml:"Server"`
-}
-
-// FirewallRuleCreateParams represents the set of possible
-// parameters when creating a firewall rule on an Azure database server.
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn505712.aspx
-type FirewallRuleCreateParams struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure ServiceResource"`
- Name string
- StartIPAddress string
- EndIPAddress string
-}
-
-// FirewallRuleResponse represents the set of data received from
-// an Azure database server firewall rule get response.
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn505698.aspx
-type FirewallRuleResponse struct {
- Name string
- StartIPAddress string
- EndIPAddress string
-}
-
-type ListFirewallRulesResponse struct {
- FirewallRules []FirewallRuleResponse `xml:"ServiceResource"`
-}
-
-// FirewallRuleUpdateParams represents the set of possible
-// parameters when issuing an update of a database server firewall rule.
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn505707.aspx
-type FirewallRuleUpdateParams struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure ServiceResource"`
- Name string
- StartIPAddress string
- EndIPAddress string
-}
-
-// DatabaseCreateParams represents the set of possible parameters when issuing
-// a database creation to Azure, and reading a list response from Azure.
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn505701.aspx
-type DatabaseCreateParams struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure ServiceResource"`
- Name string
- Edition string `xml:",omitempty"`
- CollationName string `xml:",omitempty"`
- MaxSizeBytes int64 `xml:",omitempty"`
- ServiceObjectiveID string `xml:"ServiceObjectiveId,omitempty"`
-}
-
-// ServiceResource represents the set of parameters obtained from a database
-// get or list call.
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn505708.aspx
-type ServiceResource struct {
- Name string
- State string
- SelfLink string
- Edition string
- CollationName string
- MaxSizeBytes int64
- ServiceObjectiveID string `xml:"ServiceObjectiveId,omitempty"`
-}
-
-type ListDatabasesResponse struct {
- ServiceResources []ServiceResource `xml:"ServiceResource"`
-}
-
-// ServiceResourceUpdateParams represents the set of parameters available
-// for a database service update operation.
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn505718.aspx
-type ServiceResourceUpdateParams struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure ServiceResource"`
- Name string
- Edition string `xml:",omitempty"`
- MaxSizeBytes int64 `xml:",omitempty"`
- ServiceObjectiveID string `xml:"ServiceObjectiveId,omitempty"`
-}
diff --git a/services/classic/management/storageservice/client.go b/services/classic/management/storageservice/client.go
deleted file mode 100644
index fb08c1403104..000000000000
--- a/services/classic/management/storageservice/client.go
+++ /dev/null
@@ -1,124 +0,0 @@
-// +build go1.7
-
-// Package storageservice provides a client for Storage Services.
-package storageservice
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "encoding/xml"
- "fmt"
-
- "github.com/Azure/azure-sdk-for-go/services/classic/management"
-)
-
-const (
- azureStorageServiceListURL = "services/storageservices"
- azureStorageServiceURL = "services/storageservices/%s"
- azureStorageServiceKeysURL = "services/storageservices/%s/keys"
- azureStorageAccountAvailabilityURL = "services/storageservices/operations/isavailable/%s"
-
- azureXmlns = "http://schemas.microsoft.com/windowsazure"
-
- errParamNotSpecified = "Parameter %s is not specified."
-)
-
-// NewClient is used to instantiate a new StorageServiceClient from an Azure
-// client.
-func NewClient(s management.Client) StorageServiceClient {
- return StorageServiceClient{client: s}
-}
-
-func (s StorageServiceClient) ListStorageServices() (ListStorageServicesResponse, error) {
- var l ListStorageServicesResponse
- response, err := s.client.SendAzureGetRequest(azureStorageServiceListURL)
- if err != nil {
- return l, err
- }
-
- err = xml.Unmarshal(response, &l)
- return l, err
-}
-
-func (s StorageServiceClient) GetStorageService(serviceName string) (StorageServiceResponse, error) {
- var svc StorageServiceResponse
- if serviceName == "" {
- return svc, fmt.Errorf(errParamNotSpecified, "serviceName")
- }
-
- requestURL := fmt.Sprintf(azureStorageServiceURL, serviceName)
- response, err := s.client.SendAzureGetRequest(requestURL)
- if err != nil {
- return svc, err
- }
-
- err = xml.Unmarshal(response, &svc)
- return svc, err
-}
-
-func (s StorageServiceClient) GetStorageServiceKeys(serviceName string) (GetStorageServiceKeysResponse, error) {
- var r GetStorageServiceKeysResponse
- if serviceName == "" {
- return r, fmt.Errorf(errParamNotSpecified, "serviceName")
- }
-
- requestURL := fmt.Sprintf(azureStorageServiceKeysURL, serviceName)
- data, err := s.client.SendAzureGetRequest(requestURL)
- if err != nil {
- return r, err
- }
-
- err = xml.Unmarshal(data, &r)
- return r, err
-}
-
-func (s StorageServiceClient) CreateStorageService(parameters StorageAccountCreateParameters) (management.OperationID, error) {
- data, err := xml.Marshal(CreateStorageServiceInput{
- StorageAccountCreateParameters: parameters})
- if err != nil {
- return "", err
- }
-
- return s.client.SendAzurePostRequest(azureStorageServiceListURL, data)
-}
-
-func (s StorageServiceClient) DeleteStorageService(serviceName string) (management.OperationID, error) {
- if serviceName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "serviceName")
- }
-
- requestURL := fmt.Sprintf(azureStorageServiceURL, serviceName)
- return s.client.SendAzureDeleteRequest(requestURL)
-}
-
-// CheckStorageAccountNameAvailability checks to if the specified storage account
-// name is available.
-//
-// See https://msdn.microsoft.com/en-us/library/azure/jj154125.aspx
-func (s StorageServiceClient) CheckStorageAccountNameAvailability(name string) (AvailabilityResponse, error) {
- var r AvailabilityResponse
- if name == "" {
- return r, fmt.Errorf(errParamNotSpecified, "name")
- }
-
- requestURL := fmt.Sprintf(azureStorageAccountAvailabilityURL, name)
- response, err := s.client.SendAzureGetRequest(requestURL)
- if err != nil {
- return r, err
- }
-
- err = xml.Unmarshal(response, &r)
- return r, err
-}
diff --git a/services/classic/management/storageservice/entities.go b/services/classic/management/storageservice/entities.go
deleted file mode 100644
index 0d928a280eec..000000000000
--- a/services/classic/management/storageservice/entities.go
+++ /dev/null
@@ -1,95 +0,0 @@
-// +build go1.7
-
-package storageservice
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "encoding/xml"
-
- "github.com/Azure/azure-sdk-for-go/services/classic/management"
-)
-
-// StorageServiceClient is used to perform operations on Azure Storage
-type StorageServiceClient struct {
- client management.Client
-}
-
-type ListStorageServicesResponse struct {
- StorageServices []StorageServiceResponse `xml:"StorageService"`
-}
-
-type StorageServiceResponse struct {
- URL string `xml:"Url"`
- ServiceName string
- StorageServiceProperties StorageServiceProperties
-}
-
-type StorageServiceProperties struct {
- Description string
- Location string
- Label string
- Status string
- Endpoints []string `xml:"Endpoints>Endpoint"`
- GeoReplicationEnabled string
- GeoPrimaryRegion string
-}
-
-type GetStorageServiceKeysResponse struct {
- URL string `xml:"Url"`
- PrimaryKey string `xml:"StorageServiceKeys>Primary"`
- SecondaryKey string `xml:"StorageServiceKeys>Secondary"`
-}
-
-type CreateStorageServiceInput struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure CreateStorageServiceInput"`
- StorageAccountCreateParameters
-}
-
-type StorageAccountCreateParameters struct {
- ServiceName string
- Description string `xml:",omitempty"`
- Label string
- AffinityGroup string `xml:",omitempty"`
- Location string `xml:",omitempty"`
- ExtendedProperties ExtendedPropertyList
- AccountType AccountType
-}
-
-type AccountType string
-
-const (
- AccountTypeStandardLRS AccountType = "Standard_LRS"
- AccountTypeStandardZRS AccountType = "Standard_ZRS"
- AccountTypeStandardGRS AccountType = "Standard_GRS"
- AccountTypeStandardRAGRS AccountType = "Standard_RAGRS"
- AccountTypePremiumLRS AccountType = "Premium_LRS"
-)
-
-type ExtendedPropertyList struct {
- ExtendedProperty []ExtendedProperty
-}
-
-type ExtendedProperty struct {
- Name string
- Value string
-}
-
-type AvailabilityResponse struct {
- XMLName xml.Name `xml:"AvailabilityResponse"`
- Xmlns string `xml:"xmlns,attr"`
- Result bool
- Reason string
-}
diff --git a/services/classic/management/storageservice/entities_test.go b/services/classic/management/storageservice/entities_test.go
deleted file mode 100644
index 23a6e9afc850..000000000000
--- a/services/classic/management/storageservice/entities_test.go
+++ /dev/null
@@ -1,47 +0,0 @@
-// +build go1.7
-
-package storageservice
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "encoding/xml"
- "testing"
-)
-
-func Test_StorageServiceKeysResponse_Unmarshal(t *testing.T) {
- // from https://msdn.microsoft.com/en-us/library/azure/ee460785.aspx
- response := []byte(`
-
- storage-service-url
-
- primary-key
- secondary-key
-
- `)
-
- keysResponse := GetStorageServiceKeysResponse{}
- err := xml.Unmarshal(response, &keysResponse)
- if err != nil {
- t.Fatal(err)
- }
-
- if expected := "primary-key"; keysResponse.PrimaryKey != expected {
- t.Fatalf("Expected %q but got %q", expected, keysResponse.PrimaryKey)
- }
- if expected := "secondary-key"; keysResponse.SecondaryKey != expected {
- t.Fatalf("Expected %q but got %q", expected, keysResponse.SecondaryKey)
- }
-}
diff --git a/services/classic/management/testutils/managementclient.go b/services/classic/management/testutils/managementclient.go
deleted file mode 100644
index 693c9bd15822..000000000000
--- a/services/classic/management/testutils/managementclient.go
+++ /dev/null
@@ -1,103 +0,0 @@
-// +build go1.7
-
-// Package testutils contains some test utilities for the Azure SDK
-package testutils
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "encoding/base64"
- "os"
- "testing"
-
- "github.com/Azure/azure-sdk-for-go/services/classic/management"
-)
-
-// GetTestClient returns a management Client for testing. Expects
-// AZSUBSCRIPTIONID and AZCERTDATA to be present in the environment. AZCERTDATA
-// is the base64encoded binary representation of the PEM certificate data.
-func GetTestClient(t *testing.T) management.Client {
- subid := os.Getenv("AZSUBSCRIPTIONID")
- certdata := os.Getenv("AZCERTDATA")
- if subid == "" || certdata == "" {
- t.Skip("AZSUBSCRIPTIONID or AZCERTDATA not set, skipping test")
- }
- cert, err := base64.StdEncoding.DecodeString(certdata)
- if err != nil {
- t.Fatal(err)
- }
-
- client, err := management.NewClient(subid, cert)
- if err != nil {
- t.Fatal(err)
- }
- return testClient{client, t}
-}
-
-type testClient struct {
- management.Client
- t *testing.T
-}
-
-func chop(d []byte) string {
- const maxlen = 5000
-
- s := string(d)
-
- if len(s) > maxlen {
- return s[:maxlen] + "..."
- }
- return s
-}
-
-func (l testClient) SendAzureGetRequest(url string) ([]byte, error) {
- d, err := l.Client.SendAzureGetRequest(url)
- logOperation(l.t, "GET", url, nil, d, "", err)
- return d, err
-}
-
-func (l testClient) SendAzurePostRequest(url string, data []byte) (management.OperationID, error) {
- oid, err := l.Client.SendAzurePostRequest(url, data)
- logOperation(l.t, "POST", url, data, nil, oid, err)
- return oid, err
-}
-
-func (l testClient) SendAzurePutRequest(url string, contentType string, data []byte) (management.OperationID, error) {
- oid, err := l.Client.SendAzurePutRequest(url, contentType, data)
- logOperation(l.t, "PUT", url, data, nil, oid, err)
- return oid, err
-}
-
-func (l testClient) SendAzureDeleteRequest(url string) (management.OperationID, error) {
- oid, err := l.Client.SendAzureDeleteRequest(url)
- logOperation(l.t, "DELETE", url, nil, nil, oid, err)
- return oid, err
-}
-
-func logOperation(t *testing.T, method, url string, requestData, responseData []byte, oid management.OperationID, err error) {
- t.Logf("AZURE> %s %s\n", method, url)
- if requestData != nil {
- t.Logf(" >>> %s\n", chop(requestData))
- }
- if err != nil {
- t.Logf(" <<< ERROR: %+v\n", err)
- } else {
- if responseData != nil {
- t.Logf(" <<< %s\n", chop(responseData))
- } else {
- t.Logf(" <<< OperationID: %s\n", oid)
- }
- }
-}
diff --git a/services/classic/management/util.go b/services/classic/management/util.go
deleted file mode 100644
index 9a32f20eabae..000000000000
--- a/services/classic/management/util.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// +build go1.7
-
-package management
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "io/ioutil"
- "net/http"
-)
-
-func getResponseBody(response *http.Response) ([]byte, error) {
- defer response.Body.Close()
- return ioutil.ReadAll(response.Body)
-}
diff --git a/services/classic/management/virtualmachine/client.go b/services/classic/management/virtualmachine/client.go
deleted file mode 100644
index b9533c8410c7..000000000000
--- a/services/classic/management/virtualmachine/client.go
+++ /dev/null
@@ -1,606 +0,0 @@
-// +build go1.7
-
-// Package virtualmachine provides a client for Virtual Machines.
-package virtualmachine
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "encoding/xml"
- "fmt"
-
- "github.com/Azure/azure-sdk-for-go/services/classic/management"
-)
-
-const (
- azureDeploymentListURL = "services/hostedservices/%s/deployments"
- azureDeploymentURL = "services/hostedservices/%s/deployments/%s"
- azureUpdateDeploymentURL = "services/hostedservices/%s/deployments/%s?comp=%s"
- azureDeploymentSlotSwapURL = "services/hostedservices/%s"
- azureDeploymentSlotURL = "services/hostedservices/%s/deploymentslots/%s"
- azureUpdateDeploymentSlotConfigurationURL = "services/hostedservices/%s/deploymentslots/%s?comp=%s"
- deleteAzureDeploymentURL = "services/hostedservices/%s/deployments/%s?comp=media"
- azureDeleteDeploymentBySlotURL = "services/hostedservices/%s/deploymentslots/%s"
- azureAddRoleURL = "services/hostedservices/%s/deployments/%s/roles"
- azureRoleURL = "services/hostedservices/%s/deployments/%s/roles/%s"
- azureOperationsURL = "services/hostedservices/%s/deployments/%s/roleinstances/%s/Operations"
- azureRoleSizeListURL = "rolesizes"
-
- errParamNotSpecified = "Parameter %s is not specified."
-)
-
-//NewClient is used to instantiate a new VirtualMachineClient from an Azure client
-func NewClient(client management.Client) VirtualMachineClient {
- return VirtualMachineClient{client: client}
-}
-
-// CreateDeploymentOptions can be used to create a customized deployement request
-type CreateDeploymentOptions struct {
- DNSServers []DNSServer
- LoadBalancers []LoadBalancer
- ReservedIPName string
- VirtualNetworkName string
-}
-
-// CreateDeployment creates a deployment and then creates a virtual machine
-// in the deployment based on the specified configuration.
-//
-// https://msdn.microsoft.com/en-us/library/azure/jj157194.aspx
-func (vm VirtualMachineClient) CreateDeployment(
- role Role,
- cloudServiceName string,
- options CreateDeploymentOptions) (management.OperationID, error) {
-
- req := DeploymentRequest{
- Name: role.RoleName,
- DeploymentSlot: "Production",
- Label: role.RoleName,
- RoleList: []Role{role},
- DNSServers: options.DNSServers,
- LoadBalancers: options.LoadBalancers,
- ReservedIPName: options.ReservedIPName,
- VirtualNetworkName: options.VirtualNetworkName,
- }
-
- data, err := xml.Marshal(req)
- if err != nil {
- return "", err
- }
-
- requestURL := fmt.Sprintf(azureDeploymentListURL, cloudServiceName)
- return vm.client.SendAzurePostRequest(requestURL, data)
-}
-
-// CreateDeploymentFromPackageOptions can be used to create a customized deployement request
-type CreateDeploymentFromPackageOptions struct {
- Name string
- PackageURL string
- Label string
- Configuration string
- StartDeployment bool
- TreatWarningsAsError bool
- ExtendedProperties []ExtendedProperty
- ExtensionConfiguration ExtensionConfiguration
-}
-
-// CreateDeploymentRequest is the type for creating a deployment of a cloud service package
-// in the deployment based on the specified configuration. See
-// https://docs.microsoft.com/en-us/rest/api/compute/cloudservices/rest-create-deployment
-type CreateDeploymentRequest struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure CreateDeployment"`
- // Required parameters:
- Name string `` // Specifies the name of the deployment.
- PackageURL string `xml:"PackageUrl"` // Specifies a URL that refers to the location of the service package in the Blob service. The service package can be located either in a storage account beneath the same subscription or a Shared Access Signature (SAS) URI from any storage account.
- Label string `` // Specifies an identifier for the deployment that is base-64 encoded. The identifier can be up to 100 characters in length. It is recommended that the label be unique within the subscription. The label can be used for your tracking purposes.
- Configuration string `` // Specifies the base-64 encoded service configuration file for the deployment.
- // Optional parameters:
- StartDeployment bool `` // Indicates whether to start the deployment immediately after it is created. The default value is false
- TreatWarningsAsError bool `` // Indicates whether to treat package validation warnings as errors. The default value is false. If set to true, the Created Deployment operation fails if there are validation warnings on the service package.
- ExtendedProperties []ExtendedProperty `xml:">ExtendedProperty,omitempty"` // Array of ExtendedProprties. Each extended property must have both a defined name and value. You can have a maximum of 25 extended property name and value pairs.
- ExtensionConfiguration ExtensionConfiguration `xml:",omitempty"`
-}
-
-// CreateDeploymentFromPackage creates a deployment from a cloud services package (.cspkg) and configuration file (.cscfg)
-func (vm VirtualMachineClient) CreateDeploymentFromPackage(
- cloudServiceName string,
- deploymentSlot DeploymentSlot,
- options CreateDeploymentFromPackageOptions) (management.OperationID, error) {
-
- if cloudServiceName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName")
- }
-
- req := CreateDeploymentRequest{
- Name: options.Name,
- Label: options.Label,
- Configuration: options.Configuration,
- PackageURL: options.PackageURL,
- StartDeployment: options.StartDeployment,
- TreatWarningsAsError: options.TreatWarningsAsError,
- ExtendedProperties: options.ExtendedProperties,
- ExtensionConfiguration: options.ExtensionConfiguration,
- }
-
- data, err := xml.Marshal(req)
- if err != nil {
- return "", err
- }
-
- requestURL := fmt.Sprintf(azureDeploymentSlotURL, cloudServiceName, deploymentSlot)
- return vm.client.SendAzurePostRequest(requestURL, data)
-}
-
-// SwapDeploymentRequest is the type used for specifying information to swap the deployments in
-// a cloud service
-// https://docs.microsoft.com/en-us/rest/api/compute/cloudservices/rest-swap-deployment
-type SwapDeploymentRequest struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure Swap"`
- // Required parameters:
- Production string
- SourceDeployment string
-}
-
-// SwapDeployment initiates a virtual IP address swap between the staging and production deployment environments for a service.
-// If the service is currently running in the staging environment, it will be swapped to the production environment.
-// If it is running in the production environment, it will be swapped to staging.
-func (vm VirtualMachineClient) SwapDeployment(
- cloudServiceName string) (management.OperationID, error) {
-
- if cloudServiceName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName")
- }
-
- productionDeploymentName, err := vm.GetDeploymentNameForSlot(cloudServiceName, DeploymentSlotProduction)
- if err != nil {
- return "", err
- }
-
- stagingDeploymentName, err := vm.GetDeploymentNameForSlot(cloudServiceName, DeploymentSlotStaging)
- if err != nil {
- return "", err
- }
-
- req := SwapDeploymentRequest{
- Production: productionDeploymentName,
- SourceDeployment: stagingDeploymentName,
- }
-
- data, err := xml.Marshal(req)
- if err != nil {
- return "", err
- }
-
- requestURL := fmt.Sprintf(azureDeploymentSlotSwapURL, cloudServiceName)
- return vm.client.SendAzurePostRequest(requestURL, data)
-}
-
-// ChangeDeploymentConfigurationRequestOptions can be used to update configuration of a deployment
-type ChangeDeploymentConfigurationRequestOptions struct {
- Mode UpgradeType
- Configuration string
- TreatWarningsAsError bool
- ExtendedProperties []ExtendedProperty
- ExtensionConfiguration ExtensionConfiguration
-}
-
-// ChangeDeploymentConfigurationRequest is the type for changing the configuration of a deployment of a cloud service p
-// https://docs.microsoft.com/en-us/rest/api/compute/cloudservices/rest-change-deployment-configuration
-type ChangeDeploymentConfigurationRequest struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure ChangeConfiguration"`
- // Required parameters:
- Configuration string `` // Specifies the base-64 encoded service configuration file for the deployment.
- // Optional parameters:
- Mode UpgradeType `` // Specifies the type of Upgrade (Auto | Manual | Simultaneous) .
- TreatWarningsAsError bool `` // Indicates whether to treat package validation warnings as errors. The default value is false. If set to true, the Created Deployment operation fails if there are validation warnings on the service package.
- ExtendedProperties []ExtendedProperty `xml:">ExtendedProperty,omitempty"` // Array of ExtendedProprties. Each extended property must have both a defined name and value. You can have a maximum of 25 extended property name and value pairs.
- ExtensionConfiguration ExtensionConfiguration `xml:",omitempty"`
-}
-
-// ChangeDeploymentConfiguration updates the configuration for a deployment from a configuration file (.cscfg)
-func (vm VirtualMachineClient) ChangeDeploymentConfiguration(
- cloudServiceName string,
- deploymentSlot DeploymentSlot,
- options ChangeDeploymentConfigurationRequestOptions) (management.OperationID, error) {
-
- if cloudServiceName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName")
- }
-
- req := ChangeDeploymentConfigurationRequest{
- Mode: options.Mode,
- Configuration: options.Configuration,
- TreatWarningsAsError: options.TreatWarningsAsError,
- ExtendedProperties: options.ExtendedProperties,
- ExtensionConfiguration: options.ExtensionConfiguration,
- }
- if req.Mode == "" {
- req.Mode = UpgradeTypeAuto
- }
-
- data, err := xml.Marshal(req)
- if err != nil {
- return "", err
- }
-
- requestURL := fmt.Sprintf(azureUpdateDeploymentSlotConfigurationURL, cloudServiceName, deploymentSlot, "config")
- return vm.client.SendAzurePostRequest(requestURL, data)
-}
-
-// UpdateDeploymentStatusRequest is the type used to make UpdateDeploymentStatus requests
-type UpdateDeploymentStatusRequest struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure UpdateDeploymentStatus"`
- // Required parameters:
- Status string
-}
-
-// UpdateDeploymentStatus changes the running status of a deployment. The status of a deployment can be running or suspended.
-// https://docs.microsoft.com/en-us/rest/api/compute/cloudservices/rest-update-deployment-status
-func (vm VirtualMachineClient) UpdateDeploymentStatus(
- cloudServiceName string,
- deploymentSlot DeploymentSlot,
- status string) (management.OperationID, error) {
-
- if cloudServiceName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName")
- }
-
- if status != "Running" && status != "Suspended" {
- return "", fmt.Errorf("Invalid status provided")
- }
-
- req := UpdateDeploymentStatusRequest{
- Status: status,
- }
-
- data, err := xml.Marshal(req)
- if err != nil {
- return "", err
- }
-
- requestURL := fmt.Sprintf(azureUpdateDeploymentSlotConfigurationURL, cloudServiceName, deploymentSlot, "status")
- return vm.client.SendAzurePostRequest(requestURL, data)
-}
-
-// UpdateDeploymentStatusByName changes the running status of a deployment. The status of a deployment can be running or suspended.
-// https://docs.microsoft.com/en-us/rest/api/compute/cloudservices/rest-update-deployment-status
-func (vm VirtualMachineClient) UpdateDeploymentStatusByName(
- cloudServiceName string,
- deploymentName string,
- status string) (management.OperationID, error) {
-
- if cloudServiceName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName")
- }
-
- if status != "Running" && status != "Suspended" {
- return "", fmt.Errorf("Invalid status provided")
- }
-
- req := UpdateDeploymentStatusRequest{
- Status: status,
- }
-
- data, err := xml.Marshal(req)
- if err != nil {
- return "", err
- }
-
- requestURL := fmt.Sprintf(azureUpdateDeploymentURL, cloudServiceName, deploymentName, "status")
- return vm.client.SendAzurePostRequest(requestURL, data)
-}
-
-// GetDeploymentName queries an existing Azure cloud service for the name of the Deployment,
-// if any, in its 'Production' slot (the only slot possible). If none exists, it returns empty
-// string but no error
-//
-//https://msdn.microsoft.com/en-us/library/azure/ee460804.aspx
-func (vm VirtualMachineClient) GetDeploymentName(cloudServiceName string) (string, error) {
- return vm.GetDeploymentNameForSlot(cloudServiceName, DeploymentSlotProduction)
-}
-
-// GetDeploymentNameForSlot queries an existing Azure cloud service for the name of the Deployment,
-// in a given slot. If none exists, it returns empty
-// string but no error
-//
-//https://msdn.microsoft.com/en-us/library/azure/ee460804.aspx
-func (vm VirtualMachineClient) GetDeploymentNameForSlot(cloudServiceName string, deploymentSlot DeploymentSlot) (string, error) {
- var deployment DeploymentResponse
- if cloudServiceName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName")
- }
- requestURL := fmt.Sprintf(azureDeploymentSlotURL, cloudServiceName, deploymentSlot)
- response, err := vm.client.SendAzureGetRequest(requestURL)
- if err != nil {
- if management.IsResourceNotFoundError(err) {
- return "", nil
- }
- return "", err
- }
- err = xml.Unmarshal(response, &deployment)
- if err != nil {
- return "", err
- }
-
- return deployment.Name, nil
-}
-
-func (vm VirtualMachineClient) GetDeployment(cloudServiceName, deploymentName string) (DeploymentResponse, error) {
- var deployment DeploymentResponse
- if cloudServiceName == "" {
- return deployment, fmt.Errorf(errParamNotSpecified, "cloudServiceName")
- }
- if deploymentName == "" {
- return deployment, fmt.Errorf(errParamNotSpecified, "deploymentName")
- }
- requestURL := fmt.Sprintf(azureDeploymentURL, cloudServiceName, deploymentName)
- response, azureErr := vm.client.SendAzureGetRequest(requestURL)
- if azureErr != nil {
- return deployment, azureErr
- }
-
- err := xml.Unmarshal(response, &deployment)
- return deployment, err
-}
-
-// GetDeploymentBySlot used to retrieve deployment events for a single deployment slot (staging or production)
-func (vm VirtualMachineClient) GetDeploymentBySlot(cloudServiceName string, deploymentSlot DeploymentSlot) (DeploymentResponse, error) {
- var deployment DeploymentResponse
- if cloudServiceName == "" {
- return deployment, fmt.Errorf(errParamNotSpecified, "cloudServiceName")
- }
- if deploymentSlot == "" {
- return deployment, fmt.Errorf(errParamNotSpecified, "deploymentSlot")
- }
- requestURL := fmt.Sprintf(azureDeploymentSlotURL, cloudServiceName, deploymentSlot)
- response, azureErr := vm.client.SendAzureGetRequest(requestURL)
- if azureErr != nil {
- return deployment, azureErr
- }
-
- err := xml.Unmarshal(response, &deployment)
- return deployment, err
-}
-
-func (vm VirtualMachineClient) DeleteDeployment(cloudServiceName, deploymentName string) (management.OperationID, error) {
- if cloudServiceName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName")
- }
- if deploymentName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "deploymentName")
- }
-
- requestURL := fmt.Sprintf(deleteAzureDeploymentURL, cloudServiceName, deploymentName)
- return vm.client.SendAzureDeleteRequest(requestURL)
-}
-
-func (vm VirtualMachineClient) DeleteDeploymentBySlot(cloudServiceName string, deploymentSlot DeploymentSlot) (management.OperationID, error) {
- if cloudServiceName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName")
- }
- if deploymentSlot == "" {
- return "", fmt.Errorf(errParamNotSpecified, "deploymentSlot")
- }
-
- requestURL := fmt.Sprintf(azureDeleteDeploymentBySlotURL, cloudServiceName, deploymentSlot)
- return vm.client.SendAzureDeleteRequest(requestURL)
-}
-
-func (vm VirtualMachineClient) GetRole(cloudServiceName, deploymentName, roleName string) (*Role, error) {
- if cloudServiceName == "" {
- return nil, fmt.Errorf(errParamNotSpecified, "cloudServiceName")
- }
- if deploymentName == "" {
- return nil, fmt.Errorf(errParamNotSpecified, "deploymentName")
- }
- if roleName == "" {
- return nil, fmt.Errorf(errParamNotSpecified, "roleName")
- }
-
- role := new(Role)
-
- requestURL := fmt.Sprintf(azureRoleURL, cloudServiceName, deploymentName, roleName)
- response, azureErr := vm.client.SendAzureGetRequest(requestURL)
- if azureErr != nil {
- return nil, azureErr
- }
-
- err := xml.Unmarshal(response, role)
- if err != nil {
- return nil, err
- }
-
- return role, nil
-}
-
-// AddRole adds a Virtual Machine to a deployment of Virtual Machines, where role name = VM name
-// See https://msdn.microsoft.com/en-us/library/azure/jj157186.aspx
-func (vm VirtualMachineClient) AddRole(cloudServiceName string, deploymentName string, role Role) (management.OperationID, error) {
- if cloudServiceName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName")
- }
- if deploymentName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "deploymentName")
- }
-
- data, err := xml.Marshal(PersistentVMRole{Role: role})
- if err != nil {
- return "", err
- }
-
- requestURL := fmt.Sprintf(azureAddRoleURL, cloudServiceName, deploymentName)
- return vm.client.SendAzurePostRequest(requestURL, data)
-}
-
-// UpdateRole updates the configuration of the specified virtual machine
-// See https://msdn.microsoft.com/en-us/library/azure/jj157187.aspx
-func (vm VirtualMachineClient) UpdateRole(cloudServiceName, deploymentName, roleName string, role Role) (management.OperationID, error) {
- if cloudServiceName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName")
- }
- if deploymentName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "deploymentName")
- }
- if roleName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "roleName")
- }
-
- data, err := xml.Marshal(PersistentVMRole{Role: role})
- if err != nil {
- return "", err
- }
-
- requestURL := fmt.Sprintf(azureRoleURL, cloudServiceName, deploymentName, roleName)
- return vm.client.SendAzurePutRequest(requestURL, "text/xml", data)
-}
-
-func (vm VirtualMachineClient) StartRole(cloudServiceName, deploymentName, roleName string) (management.OperationID, error) {
- if cloudServiceName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName")
- }
- if deploymentName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "deploymentName")
- }
- if roleName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "roleName")
- }
-
- startRoleOperationBytes, err := xml.Marshal(StartRoleOperation{
- OperationType: "StartRoleOperation",
- })
- if err != nil {
- return "", err
- }
-
- requestURL := fmt.Sprintf(azureOperationsURL, cloudServiceName, deploymentName, roleName)
- return vm.client.SendAzurePostRequest(requestURL, startRoleOperationBytes)
-}
-
-func (vm VirtualMachineClient) ShutdownRole(cloudServiceName, deploymentName, roleName string, postaction PostShutdownAction) (management.OperationID, error) {
- if cloudServiceName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName")
- }
- if deploymentName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "deploymentName")
- }
- if roleName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "roleName")
- }
-
- shutdownRoleOperationBytes, err := xml.Marshal(ShutdownRoleOperation{
- OperationType: "ShutdownRoleOperation",
- PostShutdownAction: postaction,
- })
- if err != nil {
- return "", err
- }
-
- requestURL := fmt.Sprintf(azureOperationsURL, cloudServiceName, deploymentName, roleName)
- return vm.client.SendAzurePostRequest(requestURL, shutdownRoleOperationBytes)
-}
-
-func (vm VirtualMachineClient) RestartRole(cloudServiceName, deploymentName, roleName string) (management.OperationID, error) {
- if cloudServiceName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName")
- }
- if deploymentName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "deploymentName")
- }
- if roleName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "roleName")
- }
-
- restartRoleOperationBytes, err := xml.Marshal(RestartRoleOperation{
- OperationType: "RestartRoleOperation",
- })
- if err != nil {
- return "", err
- }
-
- requestURL := fmt.Sprintf(azureOperationsURL, cloudServiceName, deploymentName, roleName)
- return vm.client.SendAzurePostRequest(requestURL, restartRoleOperationBytes)
-}
-
-func (vm VirtualMachineClient) DeleteRole(cloudServiceName, deploymentName, roleName string, deleteVHD bool) (management.OperationID, error) {
- if cloudServiceName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName")
- }
- if deploymentName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "deploymentName")
- }
- if roleName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "roleName")
- }
-
- requestURL := fmt.Sprintf(azureRoleURL, cloudServiceName, deploymentName, roleName)
- if deleteVHD {
- requestURL += "?comp=media"
- }
- return vm.client.SendAzureDeleteRequest(requestURL)
-}
-
-func (vm VirtualMachineClient) GetRoleSizeList() (RoleSizeList, error) {
- roleSizeList := RoleSizeList{}
-
- response, err := vm.client.SendAzureGetRequest(azureRoleSizeListURL)
- if err != nil {
- return roleSizeList, err
- }
-
- err = xml.Unmarshal(response, &roleSizeList)
- return roleSizeList, err
-}
-
-// CaptureRole captures a VM role. If reprovisioningConfigurationSet is non-nil,
-// the VM role is redeployed after capturing the image, otherwise, the original
-// VM role is deleted.
-//
-// NOTE: an image resulting from this operation shows up in
-// osimage.GetImageList() as images with Category "User".
-func (vm VirtualMachineClient) CaptureRole(cloudServiceName, deploymentName, roleName, imageName, imageLabel string,
- reprovisioningConfigurationSet *ConfigurationSet) (management.OperationID, error) {
- if cloudServiceName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName")
- }
- if deploymentName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "deploymentName")
- }
- if roleName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "roleName")
- }
-
- if reprovisioningConfigurationSet != nil &&
- !(reprovisioningConfigurationSet.ConfigurationSetType == ConfigurationSetTypeLinuxProvisioning ||
- reprovisioningConfigurationSet.ConfigurationSetType == ConfigurationSetTypeWindowsProvisioning) {
- return "", fmt.Errorf("ConfigurationSet type can only be WindowsProvisioningConfiguration or LinuxProvisioningConfiguration")
- }
-
- operation := CaptureRoleOperation{
- OperationType: "CaptureRoleOperation",
- PostCaptureAction: PostCaptureActionReprovision,
- ProvisioningConfiguration: reprovisioningConfigurationSet,
- TargetImageLabel: imageLabel,
- TargetImageName: imageName,
- }
- if reprovisioningConfigurationSet == nil {
- operation.PostCaptureAction = PostCaptureActionDelete
- }
-
- data, err := xml.Marshal(operation)
- if err != nil {
- return "", err
- }
-
- return vm.client.SendAzurePostRequest(fmt.Sprintf(azureOperationsURL, cloudServiceName, deploymentName, roleName), data)
-}
diff --git a/services/classic/management/virtualmachine/entities.go b/services/classic/management/virtualmachine/entities.go
deleted file mode 100644
index 25360223b36e..000000000000
--- a/services/classic/management/virtualmachine/entities.go
+++ /dev/null
@@ -1,626 +0,0 @@
-// +build go1.7
-
-package virtualmachine
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "encoding/xml"
-
- "github.com/Azure/azure-sdk-for-go/services/classic/management"
- vmdisk "github.com/Azure/azure-sdk-for-go/services/classic/management/virtualmachinedisk"
-)
-
-// VirtualMachineClient is used to perform operations on Azure Virtual Machines
-type VirtualMachineClient struct {
- client management.Client
-}
-
-// DeploymentRequest is the type for creating a deployment and Virtual Machine
-// in the deployment based on the specified configuration. See
-// https://msdn.microsoft.com/en-us/library/azure/jj157194.aspx
-type DeploymentRequest struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure Deployment"`
- // Required parameters:
- Name string `` // Specifies a name for the deployment. The deployment name must be unique among other deployments for the cloud service.
- DeploymentSlot string `` // Specifies the environment in which the Virtual Machine is to be deployed. The only allowable value is Production.
- Label string `` // Specifies an identifier for the deployment. The label can be up to 100 characters long. The label can be used for tracking purposes.
- RoleList []Role `xml:">Role"` // Contains information about the Virtual Machines that are to be deployed.
- // Optional parameters:
- VirtualNetworkName string `xml:",omitempty"` // Specifies the name of an existing virtual network to which the deployment will belong.
- DNSServers []DNSServer `xml:"Dns>DnsServers>DnsServer,omitempty"` // Contains a list of DNS servers to associate with the Virtual Machine.
- LoadBalancers []LoadBalancer `xml:">LoadBalancer,omitempty"` // Contains a list of internal load balancers that can be assigned to input endpoints.
- ReservedIPName string `xml:",omitempty"` // Specifies the name of a reserved IP address that is to be assigned to the deployment.
-}
-
-// DeploymentResponse is the type for receiving deployment information
-// See https://msdn.microsoft.com/en-us/library/azure/ee460804.aspx
-type DeploymentResponse struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure Deployment"`
-
- Name string
- DeploymentSlot string
- PrivateID string
- Status DeploymentStatus
- Label string
- URL string `xml:"Url"`
- Configuration string
- RoleInstanceList []RoleInstance `xml:">RoleInstance"`
- UpgradeStatus UpgradeStatus
- UpgradeDomainCount int
- RoleList []Role `xml:">Role"`
- SdkVersion string
- Locked bool
- RollbackAllowed bool
- CreatedTime string
- LastModifiedTime string
- VirtualNetworkName string
- DNSServers []DNSServer `xml:"Dns>DnsServers>DnsServer"`
- LoadBalancers []LoadBalancer `xml:">LoadBalancer"`
- ExtendedProperties []ExtendedProperty `xml:">ExtendedProperty"`
- PersistentVMDowntime PersistentVMDowntime
- VirtualIPs []VirtualIP `xml:">VirtualIP"`
- ExtensionConfiguration ExtensionConfiguration
- ReservedIPName string
- InternalDNSSuffix string `xml:"InternalDnsSuffix"`
-}
-
-type DeploymentStatus string
-
-const (
- DeploymentStatusRunning DeploymentStatus = "Running"
- DeploymentStatusSuspended DeploymentStatus = "Suspended"
- DeploymentStatusRunningTransitioning DeploymentStatus = "RunningTransitioning"
- DeploymentStatusSuspendedTransitioning DeploymentStatus = "SuspendedTransitioning"
- DeploymentStatusStarting DeploymentStatus = "Starting"
- DeploymentStatusSuspending DeploymentStatus = "Suspending"
- DeploymentStatusDeploying DeploymentStatus = "Deploying"
- DeploymentStatusDeleting DeploymentStatus = "Deleting"
-)
-
-// DeploymentSlot for cloud services are either Production or Staging Slots
-type DeploymentSlot string
-
-const (
- // DeploymentSlotProduction represents the Production slot of a cloud service
- DeploymentSlotProduction DeploymentSlot = "Production"
- // DeploymentSlotStaging represents the Staging slot of a cloud service
- DeploymentSlotStaging DeploymentSlot = "Staging"
-)
-
-type RoleInstance struct {
- RoleName string
- InstanceName string
- InstanceStatus InstanceStatus
- ExtendedInstanceStatus string
- InstanceUpgradeDomain int
- InstanceFaultDomain int
- InstanceSize string
- InstanceStateDetails string
- InstanceErrorCode string
- IPAddress string `xml:"IpAddress"`
- InstanceEndpoints []InstanceEndpoint `xml:">InstanceEndpoint"`
- PowerState PowerState
- HostName string
- RemoteAccessCertificateThumbprint string
- GuestAgentStatus string // todo: implement
- ResourceExtensionStatusList []ResourceExtensionStatus `xml:">ResourceExtensionStatus"`
- PublicIPs []PublicIP `xml:">PublicIP"`
-}
-
-type InstanceStatus string
-
-const (
- InstanceStatusUnknown = "Unknown"
- InstanceStatusCreatingVM = "CreatingVM"
- InstanceStatusStartingVM = "StartingVM"
- InstanceStatusCreatingRole = "CreatingRole"
- InstanceStatusStartingRole = "StartingRole"
- InstanceStatusReadyRole = "ReadyRole"
- InstanceStatusBusyRole = "BusyRole"
- InstanceStatusStoppingRole = "StoppingRole"
- InstanceStatusStoppingVM = "StoppingVM"
- InstanceStatusDeletingVM = "DeletingVM"
- InstanceStatusStoppedVM = "StoppedVM"
- InstanceStatusRestartingRole = "RestartingRole"
- InstanceStatusCyclingRole = "CyclingRole"
- InstanceStatusFailedStartingRole = "FailedStartingRole"
- InstanceStatusFailedStartingVM = "FailedStartingVM"
- InstanceStatusUnresponsiveRole = "UnresponsiveRole"
- InstanceStatusStoppedDeallocated = "StoppedDeallocated"
- InstanceStatusPreparing = "Preparing"
-)
-
-type InstanceEndpoint struct {
- Name string
- Vip string
- PublicPort int
- LocalPort int
- Protocol InputEndpointProtocol
-}
-
-type PowerState string
-
-const (
- PowerStateStarting PowerState = "Starting"
- PowerStateStarted PowerState = "Started"
- PowerStateStopping PowerState = "Stopping"
- PowerStateStopped PowerState = "Stopped"
- PowerStateUnknown PowerState = "Unknown"
-)
-
-type ResourceExtensionStatus struct {
- HandlerName string
- Version string
- Status ResourceExtensionState
- Code string
- FormattedMessage FormattedMessage
- ExtensionSettingStatus ExtensionSettingStatus
-}
-
-type ResourceExtensionState string
-
-const (
- ResourceExtensionStateInstalling ResourceExtensionState = "Installing"
- ResourceExtensionStateReady ResourceExtensionState = "Ready"
- ResourceExtensionStateNotReady ResourceExtensionState = "NotReady"
- ResourceExtensionStateUnresponsive ResourceExtensionState = "Unresponsive"
-)
-
-type FormattedMessage struct {
- Language string
- Message string
-}
-
-type ExtensionSettingStatus struct {
- Timestamp string
- Name string
- Operation string
- Status ExtensionSettingState
- Code string
- FormattedMessage FormattedMessage
- SubStatusList []SubStatus `xml:">SubStatus"`
-}
-
-type ExtensionSettingState string
-
-const (
- ExtensionSettingStateTransitioning ExtensionSettingState = "transitioning"
- ExtensionSettingStateError ExtensionSettingState = "error"
- ExtensionSettingStateSuccess ExtensionSettingState = "success"
- ExtensionSettingStateWarning ExtensionSettingState = "warning"
-)
-
-type SubStatus struct {
- Name string
- Status ExtensionSettingState
- FormattedMessage FormattedMessage
-}
-
-type UpgradeStatus struct {
- UpgradeType UpgradeType
- CurrentUpgradeDomainState CurrentUpgradeDomainState
- CurrentUpgradeDomain int
-}
-
-type UpgradeType string
-
-const (
- UpgradeTypeAuto UpgradeType = "Auto"
- UpgradeTypeManual UpgradeType = "Manual"
- UpgradeTypeSimultaneous UpgradeType = "Simultaneous"
-)
-
-type CurrentUpgradeDomainState string
-
-const (
- CurrentUpgradeDomainStateBefore CurrentUpgradeDomainState = "Before"
- CurrentUpgradeDomainStateDuring CurrentUpgradeDomainState = "During"
-)
-
-type ExtendedProperty struct {
- Name string
- Value string
-}
-
-type PersistentVMDowntime struct {
- StartTime string
- EndTime string
- Status string
-}
-
-type VirtualIP struct {
- Address string
- IsReserved bool
- ReservedIPName string
- Type IPAddressType
-}
-
-// Role contains the configuration sets that are used to create virtual
-// machines.
-type Role struct {
- RoleName string `xml:",omitempty"` // Specifies the name for the Virtual Machine.
- RoleType string `xml:",omitempty"` // Specifies the type of role to use. For Virtual Machines, this must be PersistentVMRole.
- ConfigurationSets []ConfigurationSet `xml:"ConfigurationSets>ConfigurationSet,omitempty"`
- ResourceExtensionReferences *[]ResourceExtensionReference `xml:"ResourceExtensionReferences>ResourceExtensionReference,omitempty"`
- VMImageName string `xml:",omitempty"` // Specifies the name of the VM Image that is to be used to create the Virtual Machine. If this element is used, the ConfigurationSets element is not used.
- MediaLocation string `xml:",omitempty"` // Required if the Virtual Machine is being created from a published VM Image. Specifies the location of the VHD file that is created when VMImageName specifies a published VM Image.
- AvailabilitySetName string `xml:",omitempty"` // Specifies the name of a collection of Virtual Machines. Virtual Machines specified in the same availability set are allocated to different nodes to maximize availability.
- DataVirtualHardDisks []DataVirtualHardDisk `xml:"DataVirtualHardDisks>DataVirtualHardDisk,omitempty"` // Contains the parameters that are used to add a data disk to a Virtual Machine. If you are creating a Virtual Machine by using a VM Image, this element is not used.
- OSVirtualHardDisk *OSVirtualHardDisk `xml:",omitempty"` // Contains the parameters that are used to create the operating system disk for a Virtual Machine. If you are creating a Virtual Machine by using a VM Image, this element is not used.
- RoleSize string `xml:",omitempty"` // Specifies the size of the Virtual Machine. The default size is Small.
- ProvisionGuestAgent bool `xml:",omitempty"` // Indicates whether the VM Agent is installed on the Virtual Machine. To run a resource extension in a Virtual Machine, this service must be installed.
- VMImageInput *VMImageInput `xml:",omitempty"` // When a VM Image is used to create a new PersistentVMRole, the DiskConfigurations in the VM Image are used to create new Disks for the new VM. This parameter can be used to resize the newly created Disks to a larger size than the underlying DiskConfigurations in the VM Image.
-
- UseCertAuth bool `xml:"-"`
- CertPath string `xml:"-"`
-}
-
-// VMImageInput is for when a VM Image is used to create a new PersistantVMRole,
-// the DiskConfigurations in the VM Image are used to create new Disks for the
-// new VM. This parameter can be used to resize the newly created Disks to a
-// larger size than the underlying DiskConfigurations in the VM Image.
-type VMImageInput struct {
- OSDiskConfiguration *OSDiskConfiguration `xml:",omitempty"` // This corresponds to the OSDiskConfiguration of the VM Image used to create a new role. The OSDiskConfiguration element is only available using version 2014-10-01 or higher.
- DataDiskConfigurations []DataDiskConfiguration `xml:">DataDiskConfiguration,omitempty"` // This corresponds to the DataDiskConfigurations of the VM Image used to create a new role. The DataDiskConfigurations element is only available using version 2014-10-01 or higher.
-}
-
-// OSDiskConfiguration is used to resize the OS disk of a new VM created from a
-// previously saved VM image.
-type OSDiskConfiguration struct {
- ResizedSizeInGB int
-}
-
-// DataDiskConfiguration is used to resize the data disks of a new VM created
-// from a previously saved VM image.
-type DataDiskConfiguration struct {
- OSDiskConfiguration
- Name string // The Name of the DataDiskConfiguration being referenced to.
-
-}
-
-// ExtensionConfiguration Contains extensions that are added to the cloud service.
-// https://docs.microsoft.com/en-us/rest/api/compute/cloudservices/rest-get-deployment#bk_extensionconfig
-type ExtensionConfiguration struct {
- NamedRoles []NamedRole `xml:"NamedRoles>Role,omitempty"`
-}
-
-// NamedRole specifies a list of extensions that are applied to specific roles in a deployment.
-// https://docs.microsoft.com/en-us/rest/api/compute/cloudservices/rest-get-deployment#bk_namedroles
-type NamedRole struct {
- RoleName string `xml:",omitempty"`
- Extensions []Extension `xml:"Extensions>Extension,omitempty"`
-}
-
-// Extension Specifies an extension that is to be deployed to a role in a cloud service.
-// https://docs.microsoft.com/en-us/rest/api/compute/cloudservices/rest-get-deployment#bk_extension
-type Extension struct {
- ID string `xml:"Id"`
- State string
-}
-
-// ResourceExtensionReference contains a collection of resource extensions that
-// are to be installed on the Virtual Machine. The VM Agent must be installed on
-// the Virtual Machine to install resource extensions. For more information, see
-// Manage Extensions:
-//
-// https://msdn.microsoft.com/en-us/library/dn606311.aspx.
-type ResourceExtensionReference struct {
- ReferenceName string
- Publisher string
- Name string
- Version string
- ParameterValues []ResourceExtensionParameter `xml:"ResourceExtensionParameterValues>ResourceExtensionParameterValue,omitempty"`
- State string
-}
-
-// ResourceExtensionParameter specifies the key, value, and type of a parameter that is passed to the
-// resource extension when it is installed.
-type ResourceExtensionParameter struct {
- Key string
- Value string
- Type ResourceExtensionParameterType // If this value is set to Private, the parameter will not be returned by Get Deployment ().
-}
-
-type ResourceExtensionParameterType string
-
-// Enum values for ResourceExtensionParameterType
-const (
- ResourceExtensionParameterTypePublic ResourceExtensionParameterType = "Public"
- ResourceExtensionParameterTypePrivate ResourceExtensionParameterType = "Private"
-)
-
-// DataVirtualHardDisk specifies the properties that are used to create a data
-// disk.
-type DataVirtualHardDisk struct {
- HostCaching vmdisk.HostCachingType `xml:",omitempty"` // Specifies the caching mode of the data disk. The default value is None.
- DiskLabel string `xml:",omitempty"` // If the disk that is being added is already registered in the subscription, this element is ignored. If a new disk is being created, this element is used to provide a description of the disk. The value of this element is only obtained programmatically and does not appear in the Management Portal.
- DiskName string `xml:",omitempty"` // If the disk that is being added is already registered in the subscription, this element is used to identify the disk to add. If a new disk and the associated VHD are being created by Azure, this element is not used and Azure assigns a unique name that is a combination of the deployment name, role name, and identifying number. The name of the disk must contain only alphanumeric characters, underscores, periods, or dashes. The name must not be longer than 256 characters. The name must not end with period or dash.
- Lun int `xml:",omitempty"` // Specifies the Logical Unit Number (LUN) for the data disk. If the disk is the first disk that is added, this element is optional and the default value of 0 is used. If more than one disk is being added, this element is required. Valid LUN values are 0 through 31.
- LogicalDiskSizeInGB int `xml:",omitempty"` // Specifies the size, in GB, of an empty disk to be attached to the Virtual Machine. If the disk that is being added is already registered in the subscription, this element is ignored. If the disk and VHD is being created by Azure as it is added, this element defines the size of the new disk.
- MediaLink string `xml:",omitempty"` // If the disk that is being added is already registered in the subscription or the VHD for the disk already exists in blob storage, this element is ignored. If a VHD file does not exist in blob storage, this element defines the location of the new VHD that is created when the new disk is added.
- SourceMediaLink string `xml:",omitempty"` // If the disk that is being added is already registered in the subscription or the VHD for the disk does not exist in blob storage, this element is ignored. If the VHD file exists in blob storage, this element defines the path to the VHD and a disk is registered from it and attached to the virtual machine.
-}
-
-// OSVirtualHardDisk specifies the properties that are used to create an OS
-// disk.
-type OSVirtualHardDisk struct {
- HostCaching vmdisk.HostCachingType `xml:",omitempty"` // Specifies the caching mode of the data disk. The default value is None.
- DiskLabel string `xml:",omitempty"` // If the disk that is being added is already registered in the subscription, this element is ignored. If a new disk is being created, this element is used to provide a description of the disk. The value of this element is only obtained programmatically and does not appear in the Management Portal.
- DiskName string `xml:",omitempty"` // If the disk that is being added is already registered in the subscription, this element is used to identify the disk to add. If a new disk and the associated VHD are being created by Azure, this element is not used and Azure assigns a unique name that is a combination of the deployment name, role name, and identifying number. The name of the disk must contain only alphanumeric characters, underscores, periods, or dashes. The name must not be longer than 256 characters. The name must not end with period or dash.
- MediaLink string `xml:",omitempty"` // If the disk that is being added is already registered in the subscription or the VHD for the disk already exists in blob storage, this element is ignored. If a VHD file does not exist in blob storage, this element defines the location of the new VHD that is created when the new disk is added.
- SourceImageName string `xml:",omitempty"`
- OS string `xml:",omitempty"`
- RemoteSourceImageLink string `xml:",omitempty"` // Specifies a publicly accessible URI or a SAS URI to the location where an OS image is stored that is used to create the Virtual Machine. This location can be a different location than the user or platform image repositories in Azure. An image is always associated with a VHD, which is a .vhd file stored as a page blob in a storage account in Azure. If you specify the path to an image with this element, an associated VHD is created and you must use the MediaLink element to specify the location in storage where the VHD will be located. If this element is used, SourceImageName is not used.
- ResizedSizeInGB int `xml:",omitempty"`
-}
-
-// ConfigurationSet specifies the configuration elements of the Virtual Machine.
-// The type attribute is required to prevent the administrator password from
-// being written to the operation history file.
-type ConfigurationSet struct {
- ConfigurationSetType ConfigurationSetType
-
- // Windows provisioning:
- ComputerName string `xml:",omitempty"` // Optional. Specifies the computer name for the Virtual Machine. If you do not specify a computer name, one is assigned that is a combination of the deployment name, role name, and identifying number. Computer names must be 1 to 15 characters long.
- AdminPassword string `xml:",omitempty"` // Optional. Specifies the password to use for an administrator account on the Virtual Machine that is being created. If you are creating a Virtual Machine using an image, you must specify a name of an administrator account to be created on the machine using the AdminUsername element. You must use the AdminPassword element to specify the password of the administrator account that is being created. If you are creating a Virtual Machine using an existing specialized disk, this element is not used because the account should already exist on the disk.
- EnableAutomaticUpdates bool `xml:",omitempty"` // Optional. Specifies whether automatic updates are enabled for the Virtual Machine. The default value is true.
- TimeZone string `xml:",omitempty"` // Optional. Specifies the time zone for the Virtual Machine.
- DomainJoin *DomainJoin `xml:",omitempty"` // Optional. Contains properties that define a domain to which the Virtual Machine will be joined.
- StoredCertificateSettings []CertificateSetting `xml:">StoredCertificateSetting,omitempty"` // Optional. Contains a list of service certificates with which to provision to the new Virtual Machine.
- WinRMListeners *[]WinRMListener `xml:"WinRM>Listeners>Listener,omitempty"` // Optional. Contains configuration settings for the Windows Remote Management service on the Virtual Machine. This enables remote Windows PowerShell.
- AdminUsername string `xml:",omitempty"` // Optional. Specifies the name of the administrator account that is created to access the Virtual Machine. If you are creating a Virtual Machine using an image, you must specify a name of an administrator account to be created by using this element. You must use the AdminPassword element to specify the password of the administrator account that is being created. If you are creating a Virtual Machine using an existing specialized disk, this element is not used because the account should already exist on the disk.
- AdditionalUnattendContent string `xml:",omitempty"` // Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup.
-
- // Linux provisioning:
- HostName string `xml:",omitempty"` // Required. Specifies the host name for the Virtual Machine. Host names must be 1 to 64 characters long.
- UserName string `xml:",omitempty"` // Required. Specifies the name of a user account to be created in the sudoer group of the Virtual Machine. User account names must be 1 to 32 characters long.
- UserPassword string `xml:",omitempty"` // Required. Specifies the password for the user account. Passwords must be 6 to 72 characters long.
- DisableSSHPasswordAuthentication string `xml:"DisableSshPasswordAuthentication,omitempty"` // Optional. Specifies whether SSH password authentication is disabled. By default this value is set to true.
- SSH *SSH `xml:",omitempty"` // Optional. Specifies the SSH public keys and key pairs to use with the Virtual Machine.
-
- // In WindowsProvisioningConfiguration: The base-64 encoded string is decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array is 65535 bytes. The file is saved to %SYSTEMDRIVE%\AzureData\CustomData.bin. If the file exists, it is overwritten. The security on directory is set to System:Full Control and Administrators:Full Control.
- // In LinuxProvisioningConfiguration: The base-64 encoded string is located in the ovf-env.xml file on the ISO of the Virtual Machine. The file is copied to /var/lib/waagent/ovf-env.xml by the Azure Linux Agent. The Azure Linux Agent will also place the base-64 encoded data in /var/lib/waagent/CustomData during provisioning. The maximum length of the binary array is 65535 bytes.
- CustomData string `xml:",omitempty"` // Specifies a base-64 encoded string of custom data.
-
- // Network configuration:
- InputEndpoints []InputEndpoint `xml:">InputEndpoint,omitempty"` // Optional in NetworkConfiguration. Contains a collection of external endpoints for the Virtual Machine.
- SubnetNames []string `xml:">SubnetName,omitempty"` // Required if StaticVirtualNetworkIPAddress is specified; otherwise, optional in NetworkConfiguration. Contains a list of subnets to which the Virtual Machine will belong.
- StaticVirtualNetworkIPAddress string `xml:",omitempty"` // Specifies the internal IP address for the Virtual Machine in a Virtual Network. If you specify this element, you must also specify the SubnetNames element with only one subnet defined. The IP address specified in this element must belong to the subnet that is defined in SubnetNames and it should not be the one of the first four IP addresses or the last IP address in the subnet. Deploying web roles or worker roles into a subnet that has Virtual Machines with StaticVirtualNetworkIPAddress defined is not supported.
- NetworkSecurityGroup string `xml:",omitempty"` // Optional in NetworkConfiguration. Represents the name of the Network Security Group that will be associated with the Virtual Machine. Network Security Group must exist in the context of subscription and be created in same region to which the virtual machine will be deployed.
- PublicIPs []PublicIP `xml:">PublicIP,omitempty"` // Contains a public IP address that can be used in addition to the default virtual IP address for the Virtual Machine.
-}
-
-type ConfigurationSetType string
-
-// Enum values for ConfigurationSetType
-const (
- ConfigurationSetTypeWindowsProvisioning ConfigurationSetType = "WindowsProvisioningConfiguration"
- ConfigurationSetTypeLinuxProvisioning ConfigurationSetType = "LinuxProvisioningConfiguration"
- ConfigurationSetTypeNetwork ConfigurationSetType = "NetworkConfiguration"
-)
-
-// DomainJoin contains properties that define a domain to which the Virtual
-// Machine will be joined.
-type DomainJoin struct {
- Credentials Credentials `xml:",omitempty"` // Specifies the credentials to use to join the Virtual Machine to the domain.
- JoinDomain string `xml:",omitempty"` // Specifies the domain to join.
- MachineObjectOU string `xml:",omitempty"` // Specifies the Lightweight Directory Access Protocol (LDAP) X 500-distinguished name of the organizational unit (OU) in which the computer account is created. This account is in Active Directory on a domain controller in the domain to which the computer is being joined.
-}
-
-// Credentials specifies the credentials to use to join the Virtual Machine to
-// the domain. If Domain is not specified, Username must specify the user
-// principal name (UPN) format (user@fully-qualified-DNS-domain) or the fully-
-// qualified-DNS-domain\username format.
-type Credentials struct {
- Domain string // Specifies the name of the domain used to authenticate an account. The value is a fully qualified DNS domain.
- Username string // Specifies a user name in the domain that can be used to join the domain.
- Password string // Specifies the password to use to join the domain.
-}
-
-// CertificateSetting specifies the parameters for the certificate which to
-// provision to the new Virtual Machine.
-type CertificateSetting struct {
- StoreLocation string // Required. Specifies the certificate store location on the Virtual Machine. The only supported value is "LocalMachine".
- StoreName string // Required. Specifies the name of the certificate store from which the certificate is retrieved. For example, "My".
- Thumbprint string // Required. Specifies the thumbprint of the certificate. The thumbprint must specify an existing service certificate.
-}
-
-// WinRMListener specifies the protocol and certificate information for a WinRM
-// listener.
-type WinRMListener struct {
- Protocol WinRMProtocol // Specifies the protocol of listener.
- CertificateThumbprint string `xml:",omitempty"` // Specifies the certificate thumbprint for the secure connection. If this value is not specified, a self-signed certificate is generated and used for the Virtual Machine.
-}
-
-type WinRMProtocol string
-
-// Enum values for WinRMProtocol
-const (
- WinRMProtocolHTTP WinRMProtocol = "Http"
- WinRMProtocolHTTPS WinRMProtocol = "Https"
-)
-
-// SSH specifies the SSH public keys and key pairs to use with the Virtual Machine.
-type SSH struct {
- PublicKeys []PublicKey `xml:">PublicKey"`
- KeyPairs []KeyPair `xml:">KeyPair"`
-}
-
-// PublicKey specifies a public SSH key.
-type PublicKey struct {
- Fingerprint string // Specifies the SHA1 fingerprint of an X509 certificate associated with the cloud service and includes the SSH public key.
- // Specifies the full path of a file, on the Virtual Machine, where the SSH public key is stored. If
- // the file already exists, the specified key is appended to the file.
- Path string // Usually /home/username/.ssh/authorized_keys
-}
-
-// KeyPair specifies an SSH keypair.
-type KeyPair struct {
- Fingerprint string // Specifies the SHA1 fingerprint of an X509 certificate that is associated with the cloud service and includes the SSH keypair.
- // Specifies the full path of a file, on the virtual machine, which stores the SSH private key. The
- // file is overwritten when multiple keys are written to it. The SSH public key is stored in the same
- // directory and has the same name as the private key file with .pub suffix.
- Path string // Usually /home/username/.ssh/id_rsa
-}
-
-// InputEndpoint specifies the properties that define an external endpoint for
-// the Virtual Machine.
-type InputEndpoint struct {
- LocalPort int // Specifies the internal port on which the Virtual Machine is listening.
- Name string // Specifies the name of the external endpoint.
- Port int // Specifies the external port to use for the endpoint.
- Protocol InputEndpointProtocol //Specifies the transport protocol for the endpoint.
- Vip string `xml:",omitempty"`
-}
-
-type InputEndpointProtocol string
-
-// Enum values for InputEndpointProtocol
-const (
- InputEndpointProtocolTCP InputEndpointProtocol = "TCP"
- InputEndpointProtocolUDP InputEndpointProtocol = "UDP"
-)
-
-// PublicIP contains a public IP address that can be used in addition to default
-// virtual IP address for the Virtual Machine.
-type PublicIP struct {
- Name string // Specifies the name of the public IP address.
- Address string // Specifies the IP address.
- IdleTimeoutInMinutes int `xml:",omitempty"` // Specifies the timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.
-}
-
-// ServiceCertificate contains a certificate for adding it to a hosted service
-type ServiceCertificate struct {
- XMLName xml.Name `xml:"CertificateFile"`
- Data string
- CertificateFormat string
- Password string `xml:",omitempty"`
-}
-
-// StartRoleOperation contains the information for starting a Role.
-type StartRoleOperation struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure StartRoleOperation"`
- OperationType string
-}
-
-type PostShutdownAction string
-
-// Enum values for PostShutdownAction
-const (
- PostShutdownActionStopped PostShutdownAction = "Stopped"
- PostShutdownActionStoppedDeallocated PostShutdownAction = "StoppedDeallocated"
-)
-
-// ShutdownRoleOperation contains the information for shutting down a Role.
-type ShutdownRoleOperation struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure ShutdownRoleOperation"`
- OperationType string
- PostShutdownAction PostShutdownAction
-}
-
-// RestartRoleOperation contains the information for restarting a Role.
-type RestartRoleOperation struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure RestartRoleOperation"`
- OperationType string
-}
-
-// CaptureRoleOperation contains the information for capturing a Role
-type CaptureRoleOperation struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure CaptureRoleOperation"`
- OperationType string
- PostCaptureAction PostCaptureAction
- ProvisioningConfiguration *ConfigurationSet `xml:",omitempty"`
- TargetImageLabel string
- TargetImageName string
-}
-
-type PostCaptureAction string
-
-// Enum values for PostCaptureAction
-const (
- PostCaptureActionDelete PostCaptureAction = "Delete"
- PostCaptureActionReprovision PostCaptureAction = "Reprovision"
-)
-
-// RoleSizeList contains a list of the available role sizes
-type RoleSizeList struct {
- XMLName xml.Name `xml:"RoleSizes"`
- RoleSizes []RoleSize `xml:"RoleSize"`
-}
-
-// RoleSize contains a detailed explanation of a role size
-type RoleSize struct {
- Name string
- Label string
- Cores int
- MemoryInMb int
- SupportedByWebWorkerRoles bool
- SupportedByVirtualMachines bool
- MaxDataDiskCount int
- WebWorkerResourceDiskSizeInMb int
- VirtualMachineResourceDiskSizeInMb int
-}
-
-// DNSServer contains the definition of a DNS server for virtual machine deployment
-type DNSServer struct {
- Name string
- Address string
-}
-
-// LoadBalancer contains the definition of a load balancer for virtual machine deployment
-type LoadBalancer struct {
- Name string // Specifies the name of the internal load balancer.
- Type IPAddressType `xml:"FrontendIpConfiguration>Type"` // Specifies the type of virtual IP address that is provided by the load balancer. The only allowable value is Private.
- SubnetName string `xml:"FrontendIpConfiguration>SubnetName,omitempty"` // Required if the deployment exists in a virtual network and a StaticVirtualNetworkIPAddress is assigned. Specifies the subnet of the virtual network that the load balancer uses. The virtual IP address that is managed by the load balancer is contained in this subnet.
- StaticVirtualNetworkIPAddress string `xml:"FrontendIpConfiguration>StaticVirtualNetworkIPAddress,omitempty"` // Specifies a specific virtual IP address that the load balancer uses from the subnet in the virtual network.
-}
-
-type IPAddressType string
-
-// Enum values for IPAddressType
-const (
- IPAddressTypePrivate IPAddressType = "Private" // Only allowed value (currently) for IPAddressType
-)
-
-type ResourceExtensions struct {
- List []ResourceExtension `xml:"ResourceExtension"`
-}
-
-type ResourceExtension struct {
- Publisher string
- Name string
- Version string
- Label string
- Description string
- PublicConfigurationSchema string
- PrivateConfigurationSchema string
- SampleConfig string
- ReplicationCompleted string
- Eula string
- PrivacyURI string `xml:"PrivacyUri"`
- HomepageURI string `xml:"HomepageUri"`
- IsJSONExtension bool `xml:"IsJsonExtension"`
- IsInternalExtension bool
- DisallowMajorVersionUpgrade bool
- CompanyName string
- SupportedOS string
- PublishedDate string
-}
-
-type PersistentVMRole struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure PersistentVMRole"`
- Role
-}
diff --git a/services/classic/management/virtualmachine/entities_test.go b/services/classic/management/virtualmachine/entities_test.go
deleted file mode 100644
index 75002e6f8f80..000000000000
--- a/services/classic/management/virtualmachine/entities_test.go
+++ /dev/null
@@ -1,315 +0,0 @@
-// +build go1.7
-
-package virtualmachine
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "encoding/xml"
- "testing"
-)
-
-func TestDocumentedDeploymentRequest(t *testing.T) {
- // xml based on https://msdn.microsoft.com/en-us/library/azure/jj157194.aspx
- // fixed typos, replaced strongly typed fields with values of correct type
- xmlString := `
- name-of-deployment
- deployment-environment
-
-
-
- name-of-the-virtual-machine
- PersistentVMRole
-
-
- WindowsProvisioningConfiguration
- name-of-computer
- administrator-password
- true
- time-zone
-
-
- domain-to-join
- user-name-in-the-domain
- password-for-the-user-name
-
- domain-to-join
- distinguished-name-of-the-ou
-
-
-
- LocalMachine
- name-of-store-on-the-machine
- certificate-thumbprint
-
-
-
-
-
- listener-protocol
-
-
- certificate-thumbprint
- listener-protocol
-
-
-
- name-of-administrator-account
- base-64-encoded-data
-
-
-
- name-of-pass
-
-
- name-of-component
-
-
- name-of-setting
- base-64-encoded-XML-content
-
-
-
-
-
-
-
-
-
- LinuxProvisioningConfiguration
- host-name-for-the-virtual-machine
- new-user-name
- password-for-the-new-user
- true
-
-
-
- certificate-fingerprint
- SSH-public-key-storage-location
-
-
-
-
- certificate-fingerprint
- SSH-public-key-storage-location
-
-
-
- base-64-encoded-data
-
-
- NetworkConfiguration
-
-
- name-of-load-balanced-set
- 22
- ZZH
- 33
-
- /probe/me
- 80
- http
- 30
- 5
-
- endpoint-protocol
- enable-direct-server-return
-
-
-
- priority-of-the-rule
- permit-rule
- subnet-of-the-rule
- description-of-the-rule
-
-
-
- name-of-internal-loadbalancer
- 9
-
-
-
- name-of-subnet
-
- ip-address
-
-
- name-of-public-ip
- 11
-
-
-
-
-
-
- name-of-reference
- name-of-publisher
- name-of-extension
- version-of-extension
-
-
- name-of-parameter-key
- parameter-value
- type-of-parameter
-
-
- state-of-resource
-
-
- certificate-thumbprint
- certificate-algorithm
-
-
-
-
- name-of-vm-image
- path-to-vhd
- name-of-availability-set
-
-
- caching-mode
- label-of-data-disk
- name-of-disk
- 0
- 50
- path-to-vhd
-
-
-
- caching-mode
- label-of-operating-system-disk
- name-of-disk
- path-to-vhd
- name-of-source-image
- operating-system-of-image
- path-to-source-image
- 125
-
- size-of-virtual-machine
- true
-
-
- 126
-
-
-
- disk-name
- 127
-
-
-
-
-
- name-of-virtual-network
-
-
-
- dns-name
- dns-ip-address
-
-
-
- name-of-reserved-ip
-
-
- name-of-internal-load-balancer
-
- Private
- name-of-subnet
- static-ip-address
-
-
-
-`
-
- deployment := DeploymentRequest{}
- if err := xml.Unmarshal([]byte(xmlString), &deployment); err != nil {
- t.Fatal(err)
- }
-
- if deployment.Name != "name-of-deployment" {
- t.Fatalf("Expected deployment.Name=\"name-of-deployment\", but got \"%s\"",
- deployment.Name)
- }
-
- // ======
-
- t.Logf("deployment.RoleList[0]: %+v", deployment.RoleList[0])
- if expected := "name-of-the-virtual-machine"; deployment.RoleList[0].RoleName != expected {
- t.Fatalf("Expected deployment.RoleList[0].RoleName=%v, but got %v", expected, deployment.RoleList[0].RoleName)
- }
-
- // ======
-
- t.Logf("deployment.DNSServers[0]: %+v", deployment.DNSServers[0])
- if deployment.DNSServers[0].Name != "dns-name" {
- t.Fatalf("Expected deployment.DNSServers[0].Name=\"dns-name\", but got \"%s\"",
- deployment.DNSServers[0].Name)
- }
-
- // ======
-
- t.Logf("deployment.LoadBalancers[0]: %+v", deployment.LoadBalancers[0])
- if deployment.LoadBalancers[0].Name != "name-of-internal-load-balancer" {
- t.Fatalf("Expected deployment.LoadBalancers[0].Name=\"name-of-internal-load-balancer\", but got \"%s\"",
- deployment.LoadBalancers[0].Name)
- }
-
- if deployment.LoadBalancers[0].Type != IPAddressTypePrivate {
- t.Fatalf("Expected deployment.LoadBalancers[0].Type=IPAddressTypePrivate, but got \"%s\"",
- deployment.LoadBalancers[0].Type)
- }
-
- if deployment.LoadBalancers[0].StaticVirtualNetworkIPAddress != "static-ip-address" {
- t.Fatalf("Expected deployment.LoadBalancers[0].StaticVirtualNetworkIPAddress=\"static-ip-address\", but got \"%s\"",
- deployment.LoadBalancers[0].StaticVirtualNetworkIPAddress)
- }
-
- // ======
-
- extensionReferences := (*deployment.RoleList[0].ResourceExtensionReferences)
- t.Logf("(*deployment.RoleList[0].ResourceExtensionReferences)[0]: %+v", extensionReferences[0])
- if extensionReferences[0].Name != "name-of-extension" {
- t.Fatalf("Expected (*deployment.RoleList[0].ResourceExtensionReferences)[0].Name=\"name-of-extension\", but got \"%s\"",
- extensionReferences[0].Name)
- }
-
- if extensionReferences[0].ParameterValues[0].Key != "name-of-parameter-key" {
- t.Fatalf("Expected (*deployment.RoleList[0].ResourceExtensionReferences)[0].ParameterValues[0].Key=\"name-of-parameter-key\", but got %v",
- extensionReferences[0].ParameterValues[0].Key)
- }
-
- // ======
-
- if deployment.RoleList[0].VMImageInput.DataDiskConfigurations[0].ResizedSizeInGB != 127 {
- t.Fatalf("Expected deployment.RoleList[0].VMImageInput.DataDiskConfigurations[0].ResizedSizeInGB=127, but got %v",
- deployment.RoleList[0].VMImageInput.DataDiskConfigurations[0].ResizedSizeInGB)
- }
-
- // ======
-
- winRMlisteners := *deployment.RoleList[0].ConfigurationSets[0].WinRMListeners
- if string(winRMlisteners[0].Protocol) != "listener-protocol" {
- t.Fatalf("Expected winRMlisteners[0].Protocol to be listener-protocol, but got %s",
- string(winRMlisteners[0].Protocol))
- }
-
- winRMlisteners2 := *deployment.RoleList[0].ConfigurationSets[0].WinRMListeners
- if winRMlisteners2[1].CertificateThumbprint != "certificate-thumbprint" {
- t.Fatalf("Expected winRMlisteners2[1].CertificateThumbprint to be certificate-thumbprint, but got %s",
- winRMlisteners2[1].CertificateThumbprint)
- }
-
-}
diff --git a/services/classic/management/virtualmachine/resourceextensions.go b/services/classic/management/virtualmachine/resourceextensions.go
deleted file mode 100644
index 03135f95c3df..000000000000
--- a/services/classic/management/virtualmachine/resourceextensions.go
+++ /dev/null
@@ -1,183 +0,0 @@
-// +build go1.7
-
-package virtualmachine
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "encoding/xml"
- "fmt"
-
- "github.com/Azure/azure-sdk-for-go/services/classic/management"
-)
-
-const (
- azureResourceExtensionsURL = "services/resourceextensions"
- azureCloudServiceExtensionsURL = "services/hostedservices/%s/extensions"
- azureCloudServiceExtensionURL = "services/hostedservices/%s/extensions/%s"
-)
-
-// GetResourceExtensions lists the resource extensions that are available to add
-// to a virtual machine.
-//
-// See https://msdn.microsoft.com/en-us/library/azure/dn495441.aspx
-func (c VirtualMachineClient) GetResourceExtensions() (extensions []ResourceExtension, err error) {
- data, err := c.client.SendAzureGetRequest(azureResourceExtensionsURL)
- if err != nil {
- return extensions, err
- }
-
- var response ResourceExtensions
- err = xml.Unmarshal(data, &response)
- extensions = response.List
- return
-}
-
-// Extensions is a list of extensions returned by the ListExtensions response
-type Extensions struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure Extensions"`
- Extensions []ExtensionInfo `xml:"Extension"`
-}
-
-// ExtensionInfo defined the type retured by GetExtension
-// https://docs.microsoft.com/en-us/rest/api/compute/cloudservices/rest-get-extension
-type ExtensionInfo struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure Extension"`
- ProviderNameSpace string
- Type string
- ID string `xml:"Id"`
- Version string
- Thumbprint string
- PublicConfigurationSchema string
- ThumbprintAlgorithm string
- IsJSONExtension bool `xml:"IsJsonExtension"`
- DisallowMajorVersionUpgrade bool
-}
-
-// GetExtension retrieves information about a specified extension that was added to a cloud service.
-// https://docs.microsoft.com/en-us/rest/api/compute/cloudservices/rest-get-extension
-func (c VirtualMachineClient) GetExtension(cloudServiceName string, extensionID string) (extension ExtensionInfo, err error) {
-
- if cloudServiceName == "" {
- return ExtensionInfo{}, fmt.Errorf(errParamNotSpecified, "cloudServiceName")
- }
- if extensionID == "" {
- return ExtensionInfo{}, fmt.Errorf(errParamNotSpecified, "extensionID")
- }
-
- requestURL := fmt.Sprintf(azureCloudServiceExtensionURL, cloudServiceName, extensionID)
- data, err := c.client.SendAzureGetRequest(requestURL)
- if err != nil {
- return ExtensionInfo{}, err
- }
- err = xml.Unmarshal(data, &extension)
- return
-}
-
-// ListExtensions lists all of the extensions that were added to a cloud service.
-// https://docs.microsoft.com/en-us/rest/api/compute/cloudservices/rest-list-extensions
-func (c VirtualMachineClient) ListExtensions(cloudServiceName string) (extensions []ExtensionInfo, err error) {
-
- if cloudServiceName == "" {
- return []ExtensionInfo{}, fmt.Errorf(errParamNotSpecified, "cloudServiceName")
- }
-
- requestURL := fmt.Sprintf(azureCloudServiceExtensionsURL, cloudServiceName)
- data, err := c.client.SendAzureGetRequest(requestURL)
- if err != nil {
- return []ExtensionInfo{}, err
- }
- var response Extensions
- err = xml.Unmarshal(data, &response)
- extensions = response.Extensions
- return
-}
-
-// AddExtensionOptions defines the options available for adding extensions to a cloud service
-type AddExtensionOptions struct {
- ProviderNameSpace string
- Type string
- ID string
- Thumbprint string
- ThumbprintAlgorithm string
- PublicConfiguration string
- PrivateConfiguration string
- Version string
-}
-
-// AddExtensionRequest is the type used to submit AddExtension requests
-type AddExtensionRequest struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure Extension"`
- ProviderNameSpace string
- Type string
- ID string `xml:"Id"`
- Thumbprint string
- ThumbprintAlgorithm string
- PublicConfiguration string
- PrivateConfiguration string
- Version string
-}
-
-// AddExtension addes an extension to the cloud service
-// https://docs.microsoft.com/en-us/rest/api/compute/cloudservices/rest-add-extension
-func (c VirtualMachineClient) AddExtension(cloudServiceName string, options AddExtensionOptions) (management.OperationID, error) {
-
- if cloudServiceName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName")
- }
- if options.ID == "" {
- return "", fmt.Errorf(errParamNotSpecified, "options.ID")
- }
- if options.ProviderNameSpace == "" {
- return "", fmt.Errorf(errParamNotSpecified, "options.ProviderNameSpace")
- }
- if options.Type == "" {
- return "", fmt.Errorf(errParamNotSpecified, "options.Type")
- }
-
- req := AddExtensionRequest{
- ProviderNameSpace: options.ProviderNameSpace,
- Type: options.Type,
- ID: options.ID,
- Thumbprint: options.Thumbprint,
- ThumbprintAlgorithm: options.ThumbprintAlgorithm,
- PublicConfiguration: options.PublicConfiguration,
- PrivateConfiguration: options.PrivateConfiguration,
- Version: options.Version,
- }
-
- data, err := xml.Marshal(req)
- if err != nil {
- return "", err
- }
-
- requestURL := fmt.Sprintf(azureCloudServiceExtensionsURL, cloudServiceName)
- return c.client.SendAzurePostRequest(requestURL, data)
-}
-
-// DeleteExtension deletes the specified extension from a cloud service.
-// https://docs.microsoft.com/en-us/rest/api/compute/cloudservices/rest-delete-extension
-func (c VirtualMachineClient) DeleteExtension(cloudServiceName string, extensionID string) (management.OperationID, error) {
-
- if cloudServiceName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName")
- }
- if extensionID == "" {
- return "", fmt.Errorf(errParamNotSpecified, "extensionID")
- }
-
- requestURL := fmt.Sprintf(azureCloudServiceExtensionURL, cloudServiceName, extensionID)
- return c.client.SendAzureDeleteRequest(requestURL)
-}
diff --git a/services/classic/management/virtualmachine/resourceextensions_test.go b/services/classic/management/virtualmachine/resourceextensions_test.go
deleted file mode 100644
index a8e6a84032e1..000000000000
--- a/services/classic/management/virtualmachine/resourceextensions_test.go
+++ /dev/null
@@ -1,43 +0,0 @@
-// +build go1.7
-
-package virtualmachine
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "testing"
-
- "github.com/Azure/azure-sdk-for-go/services/classic/management/testutils"
-)
-
-func TestAzureGetResourceExtensions(t *testing.T) {
- client := testutils.GetTestClient(t)
-
- list, err := NewClient(client).GetResourceExtensions()
- if err != nil {
- t.Fatal(err)
- }
-
- t.Logf("Found %d extensions", len(list))
- if len(list) == 0 {
- t.Fatal("Huh, no resource extensions at all? Something must be wrong.")
- }
-
- for _, extension := range list {
- if extension.Name == "" {
- t.Fatalf("Resource with empty name? Something must have gone wrong with serialization: %+v", extension)
- }
- }
-}
diff --git a/services/classic/management/virtualmachinedisk/client.go b/services/classic/management/virtualmachinedisk/client.go
deleted file mode 100644
index 89cb7161a303..000000000000
--- a/services/classic/management/virtualmachinedisk/client.go
+++ /dev/null
@@ -1,246 +0,0 @@
-// +build go1.7
-
-// Package virtualmachinedisk provides a client for Virtual Machine Disks.
-package virtualmachinedisk
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "encoding/xml"
- "fmt"
-
- "github.com/Azure/azure-sdk-for-go/services/classic/management"
-)
-
-const (
- addDataDiskURL = "services/hostedservices/%s/deployments/%s/roles/%s/DataDisks"
- addDiskURL = "services/disks"
- deleteDataDiskURL = "services/hostedservices/%s/deployments/%s/roles/%s/DataDisks/%d"
- deleteDiskURL = "services/disks/%s"
- getDataDiskURL = "services/hostedservices/%s/deployments/%s/roles/%s/DataDisks/%d"
- getDiskURL = "services/disks/%s"
- listDisksURL = "services/disks"
- updateDataDiskURL = "services/hostedservices/%s/deployments/%s/roles/%s/DataDisks/%d"
- updateDiskURL = "services/disks/%s"
-
- errParamNotSpecified = "Parameter %s is not specified."
-)
-
-//NewClient is used to instantiate a new DiskClient from an Azure client
-func NewClient(client management.Client) DiskClient {
- return DiskClient{client: client}
-}
-
-// AddDataDisk adds a data disk to a Virtual Machine
-//
-// https://msdn.microsoft.com/en-us/library/azure/jj157199.aspx
-func (c DiskClient) AddDataDisk(
- service string,
- deployment string,
- role string,
- params CreateDataDiskParameters) (management.OperationID, error) {
- if service == "" {
- return "", fmt.Errorf(errParamNotSpecified, "service")
- }
- if deployment == "" {
- return "", fmt.Errorf(errParamNotSpecified, "deployment")
- }
- if role == "" {
- return "", fmt.Errorf(errParamNotSpecified, "role")
- }
-
- requestURL := fmt.Sprintf(addDataDiskURL, service, deployment, role)
-
- req, err := xml.Marshal(params)
- if err != nil {
- return "", err
- }
-
- return c.client.SendAzurePostRequest(requestURL, req)
-}
-
-// AddDisk adds an operating system disk or data disk to the user image repository
-//
-// https://msdn.microsoft.com/en-us/library/azure/jj157178.aspx
-func (c DiskClient) AddDisk(params CreateDiskParameters) (management.OperationID, error) {
- req, err := xml.Marshal(params)
- if err != nil {
- return "", err
- }
-
- return c.client.SendAzurePostRequest(addDiskURL, req)
-}
-
-// DeleteDataDisk removes the specified data disk from a Virtual Machine
-//
-// https://msdn.microsoft.com/en-us/library/azure/jj157179.aspx
-func (c DiskClient) DeleteDataDisk(
- service string,
- deployment string,
- role string,
- lun int,
- deleteVHD bool) (management.OperationID, error) {
- if service == "" {
- return "", fmt.Errorf(errParamNotSpecified, "service")
- }
- if deployment == "" {
- return "", fmt.Errorf(errParamNotSpecified, "deployment")
- }
- if role == "" {
- return "", fmt.Errorf(errParamNotSpecified, "role")
- }
-
- requestURL := fmt.Sprintf(deleteDataDiskURL, service, deployment, role, lun)
- if deleteVHD {
- requestURL += "?comp=media"
- }
-
- return c.client.SendAzureDeleteRequest(requestURL)
-}
-
-// DeleteDisk deletes the specified data or operating system disk from the image
-// repository that is associated with the specified subscription
-//
-// https://msdn.microsoft.com/en-us/library/azure/jj157200.aspx
-func (c DiskClient) DeleteDisk(name string, deleteVHD bool) error {
- if name == "" {
- return fmt.Errorf(errParamNotSpecified, "name")
- }
-
- requestURL := fmt.Sprintf(deleteDiskURL, name)
- if deleteVHD {
- requestURL += "?comp=media"
- }
-
- _, err := c.client.SendAzureDeleteRequest(requestURL) // request is handled synchronously
- return err
-}
-
-// GetDataDisk retrieves the specified data disk from a Virtual Machine
-//
-// https://msdn.microsoft.com/en-us/library/azure/jj157180.aspx
-func (c DiskClient) GetDataDisk(
- service string,
- deployment string,
- role string,
- lun int) (DataDiskResponse, error) {
- var response DataDiskResponse
- if service == "" {
- return response, fmt.Errorf(errParamNotSpecified, "service")
- }
- if deployment == "" {
- return response, fmt.Errorf(errParamNotSpecified, "deployment")
- }
- if role == "" {
- return response, fmt.Errorf(errParamNotSpecified, "role")
- }
-
- requestURL := fmt.Sprintf(getDataDiskURL, service, deployment, role, lun)
-
- data, err := c.client.SendAzureGetRequest(requestURL)
- if err != nil {
- return response, err
- }
-
- err = xml.Unmarshal(data, &response)
- return response, err
-}
-
-// GetDisk retrieves information about the specified disk
-//
-// https://msdn.microsoft.com/en-us/library/azure/dn775053.aspx
-func (c DiskClient) GetDisk(name string) (DiskResponse, error) {
- var response DiskResponse
- if name == "" {
- return response, fmt.Errorf(errParamNotSpecified, "name")
- }
-
- requestURL := fmt.Sprintf(getDiskURL, name)
-
- data, err := c.client.SendAzureGetRequest(requestURL)
- if err != nil {
- return response, err
- }
-
- err = xml.Unmarshal(data, &response)
- return response, err
-}
-
-// ListDisks retrieves a list of the disks in the image repository that is associated
-// with the specified subscription
-//
-// https://msdn.microsoft.com/en-us/library/azure/jj157176.aspx
-func (c DiskClient) ListDisks() (ListDiskResponse, error) {
- var response ListDiskResponse
-
- data, err := c.client.SendAzureGetRequest(listDisksURL)
- if err != nil {
- return response, err
- }
-
- err = xml.Unmarshal(data, &response)
- return response, err
-}
-
-// UpdateDataDisk updates the configuration of the specified data disk that is
-// attached to the specified Virtual Machine
-//
-// https://msdn.microsoft.com/en-us/library/azure/jj157190.aspx
-func (c DiskClient) UpdateDataDisk(
- service string,
- deployment string,
- role string,
- lun int,
- params UpdateDataDiskParameters) (management.OperationID, error) {
- if service == "" {
- return "", fmt.Errorf(errParamNotSpecified, "service")
- }
- if deployment == "" {
- return "", fmt.Errorf(errParamNotSpecified, "deployment")
- }
- if role == "" {
- return "", fmt.Errorf(errParamNotSpecified, "role")
- }
-
- requestURL := fmt.Sprintf(updateDataDiskURL, service, deployment, role, lun)
-
- req, err := xml.Marshal(params)
- if err != nil {
- return "", err
- }
-
- return c.client.SendAzurePutRequest(requestURL, "", req)
-}
-
-// UpdateDisk updates the label of an existing disk in the image repository that is
-// associated with the specified subscription
-//
-// https://msdn.microsoft.com/en-us/library/azure/jj157205.aspx
-func (c DiskClient) UpdateDisk(
- name string,
- params UpdateDiskParameters) (management.OperationID, error) {
- if name == "" {
- return "", fmt.Errorf(errParamNotSpecified, "name")
- }
-
- requestURL := fmt.Sprintf(updateDiskURL, name)
-
- req, err := xml.Marshal(params)
- if err != nil {
- return "", err
- }
-
- return c.client.SendAzurePutRequest(requestURL, "", req)
-}
diff --git a/services/classic/management/virtualmachinedisk/entities.go b/services/classic/management/virtualmachinedisk/entities.go
deleted file mode 100644
index ff558e29e29e..000000000000
--- a/services/classic/management/virtualmachinedisk/entities.go
+++ /dev/null
@@ -1,150 +0,0 @@
-// +build go1.7
-
-package virtualmachinedisk
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "encoding/xml"
-
- "github.com/Azure/azure-sdk-for-go/services/classic/management"
-)
-
-// DiskClient is used to perform operations on Azure Disks
-type DiskClient struct {
- client management.Client
-}
-
-// CreateDiskParameters represents a disk
-//
-// https://msdn.microsoft.com/en-us/library/azure/jj157188.aspx
-type CreateDiskParameters struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure Disk"`
- OS OperatingSystemType `xml:",omitempty"`
- Label string
- MediaLink string `xml:",omitempty"`
- Name string
-}
-
-// UpdateDiskParameters represents a disk
-//
-// https://msdn.microsoft.com/en-us/library/azure/jj157188.aspx
-type UpdateDiskParameters struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure Disk"`
- Label string `xml:",omitempty"`
- Name string
- ResizedSizeInGB int `xml:",omitempty"`
-}
-
-// ListDiskResponse represents a disk
-//
-// https://msdn.microsoft.com/en-us/library/azure/jj157188.aspx
-type ListDiskResponse struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure Disks"`
- Disk []DiskResponse
-}
-
-// DiskResponse represents a disk
-//
-// https://msdn.microsoft.com/en-us/library/azure/jj157188.aspx
-type DiskResponse struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure Disk"`
- AffinityGroup string
- AttachedTo Resource
- IsCorrupted bool
- OS OperatingSystemType
- Location string
- LogicalDiskSizeInGB int
- MediaLink string
- Name string
- SourceImageName string
- CreatedTime string
- IOType IOType
-}
-
-// Resource describes the resource details a disk is currently attached to
-type Resource struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure AttachedTo"`
- DeploymentName string
- HostedServiceName string
- RoleName string
-}
-
-// IOType represents an IO type
-type IOType string
-
-// These constants represent the possible IO types
-const (
- IOTypeProvisioned IOType = "Provisioned"
- IOTypeStandard IOType = "Standard"
-)
-
-// OperatingSystemType represents an operating system type
-type OperatingSystemType string
-
-// These constants represent the valid operating system types
-const (
- OperatingSystemTypeNull OperatingSystemType = "NULL"
- OperatingSystemTypeLinux OperatingSystemType = "Linux"
- OperatingSystemTypeWindows OperatingSystemType = "Windows"
-)
-
-// CreateDataDiskParameters represents a data disk
-//
-// https://msdn.microsoft.com/en-us/library/azure/jj157188.aspx
-type CreateDataDiskParameters struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure DataVirtualHardDisk"`
- HostCaching HostCachingType `xml:",omitempty"`
- DiskLabel string `xml:",omitempty"`
- DiskName string `xml:",omitempty"`
- Lun int `xml:",omitempty"`
- LogicalDiskSizeInGB int `xml:",omitempty"`
- MediaLink string
- SourceMediaLink string `xml:",omitempty"`
-}
-
-// UpdateDataDiskParameters represents a data disk
-//
-// https://msdn.microsoft.com/en-us/library/azure/jj157188.aspx
-type UpdateDataDiskParameters struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure DataVirtualHardDisk"`
- HostCaching HostCachingType `xml:",omitempty"`
- DiskName string
- Lun int
- MediaLink string
-}
-
-// DataDiskResponse represents a data disk
-//
-// https://msdn.microsoft.com/en-us/library/azure/jj157188.aspx
-type DataDiskResponse struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure DataVirtualHardDisk"`
- HostCaching HostCachingType
- DiskLabel string
- DiskName string
- Lun int
- LogicalDiskSizeInGB int
- MediaLink string
-}
-
-// HostCachingType represents a host caching type
-type HostCachingType string
-
-// These constants represent the valid host caching types
-const (
- HostCachingTypeNone HostCachingType = "None"
- HostCachingTypeReadOnly HostCachingType = "ReadOnly"
- HostCachingTypeReadWrite HostCachingType = "ReadWrite"
-)
diff --git a/services/classic/management/virtualmachineimage/client.go b/services/classic/management/virtualmachineimage/client.go
deleted file mode 100644
index 47f14f23cf78..000000000000
--- a/services/classic/management/virtualmachineimage/client.go
+++ /dev/null
@@ -1,126 +0,0 @@
-// +build go1.7
-
-// Package virtualmachineimage provides a client for Virtual Machine Images.
-package virtualmachineimage
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "encoding/xml"
- "fmt"
- "net/url"
-
- "github.com/Azure/azure-sdk-for-go/services/classic/management"
-)
-
-const (
- azureImageListURL = "services/vmimages"
- azureImageDeleteURLformat = "services/vmimages/%s"
- azureRoleOperationsURL = "services/hostedservices/%s/deployments/%s/roleinstances/%s/operations"
- errParamNotSpecified = "Parameter %s is not specified."
-)
-
-//NewClient is used to instantiate a new Client from an Azure client
-func NewClient(client management.Client) Client {
- return Client{client}
-}
-
-//ListVirtualMachineImages lists the available VM images, filtered by the optional parameters.
-//See https://msdn.microsoft.com/en-us/library/azure/dn499770.aspx
-func (c Client) ListVirtualMachineImages(parameters ListParameters) (ListVirtualMachineImagesResponse, error) {
- var imageList ListVirtualMachineImagesResponse
-
- listURL := azureImageListURL
-
- v := url.Values{}
- if parameters.Location != "" {
- v.Add("location", parameters.Location)
- }
-
- if parameters.Publisher != "" {
- v.Add("publisher", parameters.Publisher)
- }
-
- if parameters.Category != "" {
- v.Add("category", parameters.Category)
- }
-
- query := v.Encode()
- if query != "" {
- listURL = listURL + "?" + query
- }
-
- response, err := c.SendAzureGetRequest(listURL)
- if err != nil {
- return imageList, err
- }
- err = xml.Unmarshal(response, &imageList)
- return imageList, err
-}
-
-//DeleteVirtualMachineImage deletes the named VM image. If deleteVHDs is specified,
-//the referenced OS and data disks are also deleted.
-//See https://msdn.microsoft.com/en-us/library/azure/dn499769.aspx
-func (c Client) DeleteVirtualMachineImage(name string, deleteVHDs bool) error {
- if name == "" {
- return fmt.Errorf(errParamNotSpecified, "name")
- }
-
- uri := fmt.Sprintf(azureImageDeleteURLformat, name)
-
- if deleteVHDs {
- uri = uri + "?comp=media"
- }
-
- _, err := c.SendAzureDeleteRequest(uri) // delete is synchronous for this operation
- return err
-}
-
-type ListParameters struct {
- Location string
- Publisher string
- Category string
-}
-
-const CategoryUser = "User"
-
-//Capture captures a VM into a VM image. The VM has to be shut down previously.
-//See https://msdn.microsoft.com/en-us/library/azure/dn499768.aspx
-func (c Client) Capture(cloudServiceName, deploymentName, roleName string,
- name, label string, osState OSState, parameters CaptureParameters) (management.OperationID, error) {
- if cloudServiceName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "cloudServiceName")
- }
- if deploymentName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "deploymentName")
- }
- if roleName == "" {
- return "", fmt.Errorf(errParamNotSpecified, "roleName")
- }
-
- request := CaptureRoleAsVMImageOperation{
- VMImageName: name,
- VMImageLabel: label,
- OSState: osState,
- CaptureParameters: parameters,
- }
- data, err := xml.Marshal(request)
- if err != nil {
- return "", err
- }
-
- return c.SendAzurePostRequest(fmt.Sprintf(azureRoleOperationsURL,
- cloudServiceName, deploymentName, roleName), data)
-}
diff --git a/services/classic/management/virtualmachineimage/entities.go b/services/classic/management/virtualmachineimage/entities.go
deleted file mode 100644
index ebc868e6b17d..000000000000
--- a/services/classic/management/virtualmachineimage/entities.go
+++ /dev/null
@@ -1,111 +0,0 @@
-// +build go1.7
-
-package virtualmachineimage
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "encoding/xml"
-
- "github.com/Azure/azure-sdk-for-go/services/classic/management"
- vmdisk "github.com/Azure/azure-sdk-for-go/services/classic/management/virtualmachinedisk"
-)
-
-// Client is used to perform operations on Azure VM Images.
-type Client struct {
- management.Client
-}
-
-type ListVirtualMachineImagesResponse struct {
- VMImages []VMImage `xml:"VMImage"`
-}
-
-type VMImage struct {
- Name string // Specifies the name of the image.
- Label string // Specifies an identifier for the image.
- Category string // Specifies the repository classification of the image. All user images have the category User.
- Description string // Specifies the description of the image.
- OSDiskConfiguration OSDiskConfiguration // Specifies configuration information for the operating system disk that is associated with the image.
- DataDiskConfigurations []DataDiskConfiguration `xml:">DataDiskConfiguration"` // Specifies configuration information for the data disks that are associated with the image. A VM Image might not have data disks associated with it.
- ServiceName string // Specifies the name of the cloud service that contained the Virtual Machine from which the image was created.
- DeploymentName string // Specifies the name of the deployment that contained the Virtual Machine from which the image was created.
- RoleName string // Specifies the name of the Virtual Machine from which the image was created.
- Location string // Specifies the geo-location in which the media is located. The Location value is derived from the storage account that contains the blob in which the media is located. If the storage account belongs to an affinity group the value is NULL and the element is not displayed in the response.
- AffinityGroup string // Specifies the affinity group in which the media is located. The AffinityGroup value is derived from the storage account that contains the blob in which the media is located. If the storage account does not belong to an affinity group the value is NULL and the element is not displayed in the response.
- CreatedTime string // Specifies the time that the image was created.
- ModifiedTime string // Specifies the time that the image was last updated.
- Language string // Specifies the language of the image.
- ImageFamily string // Specifies a value that can be used to group VM Images.
- RecommendedVMSize string // Optional. Specifies the size to use for the Virtual Machine that is created from the VM Image.
- IsPremium string // Indicates whether the image contains software or associated services that will incur charges above the core price for the virtual machine. For additional details, see the PricingDetailLink element.
- Eula string // Specifies the End User License Agreement that is associated with the image. The value for this element is a string, but it is recommended that the value be a URL that points to a EULA.
- IconURI string `xml:"IconUri"` // Specifies the URI to the icon that is displayed for the image in the Management Portal.
- SmallIconURI string `xml:"SmallIconUri"` // Specifies the URI to the small icon that is displayed for the image in the Management Portal.
- PrivacyURI string `xml:"PrivacyUri"` // Specifies the URI that points to a document that contains the privacy policy related to the image.
- PublishedDate string // Specifies the date when the image was added to the image repository.
-}
-
-type OSState string
-
-const (
- OSStateGeneralized OSState = "Generalized"
- OSStateSpecialized OSState = "Specialized"
-)
-
-type IOType string
-
-const (
- IOTypeProvisioned IOType = "Provisioned"
- IOTypeStandard IOType = "Standard"
-)
-
-// OSDiskConfiguration specifies configuration information for the operating
-// system disk that is associated with the image.
-type OSDiskConfiguration struct {
- Name string // Specifies the name of the operating system disk.
- HostCaching vmdisk.HostCachingType // Specifies the caching behavior of the operating system disk.
- OSState OSState // Specifies the state of the operating system in the image.
- OS string // Specifies the operating system type of the image.
- MediaLink string // Specifies the location of the blob in Azure storage. The blob location belongs to a storage account in the subscription specified by the value in the operation call.
- LogicalSizeInGB float64 // Specifies the size, in GB, of the operating system disk.
- IOType IOType // Identifies the type of the storage account for the backing VHD. If the backing VHD is in an Provisioned Storage account, “Provisioned” is returned otherwise “Standard” is returned.
-}
-
-// DataDiskConfiguration specifies configuration information for the data disks
-// that are associated with the image.
-type DataDiskConfiguration struct {
- Name string // Specifies the name of the data disk.
- HostCaching vmdisk.HostCachingType // Specifies the caching behavior of the data disk.
- Lun string // Specifies the Logical Unit Number (LUN) for the data disk.
- MediaLink string // Specifies the location of the blob in Azure storage. The blob location belongs to a storage account in the subscription specified by the value in the operation call.
- LogicalSizeInGB float64 // Specifies the size, in GB, of the data disk.
- IOType IOType // Identifies the type of the storage account for the backing VHD. If the backing VHD is in an Provisioned Storage account, “Provisioned” is returned otherwise “Standard” is returned.
-}
-
-type CaptureRoleAsVMImageOperation struct {
- XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure CaptureRoleAsVMImageOperation"`
- OperationType string //CaptureRoleAsVMImageOperation
- OSState OSState
- VMImageName string
- VMImageLabel string
- CaptureParameters
-}
-
-type CaptureParameters struct {
- Description string `xml:",omitempty"`
- Language string `xml:",omitempty"`
- ImageFamily string `xml:",omitempty"`
- RecommendedVMSize string `xml:",omitempty"`
-}
diff --git a/services/classic/management/virtualmachineimage/entities_test.go b/services/classic/management/virtualmachineimage/entities_test.go
deleted file mode 100644
index b1b7f0f78a3e..000000000000
--- a/services/classic/management/virtualmachineimage/entities_test.go
+++ /dev/null
@@ -1,126 +0,0 @@
-// +build go1.7
-
-package virtualmachineimage
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "encoding/xml"
- "testing"
-)
-
-const xml1 = `
-
- imgName
-
- User
- packer made image
-
- OSDisk
- ReadWrite
- Generalized
- Linux
- https://sa.blob.core.windows.net/images/PackerMade_Ubuntu_Serv14_2015-12-12.vhd
- 30
- Standard
-
-
- PkrSrvf3mz03u4mi
- PkrVMf3mz03u4mi
- PkrVMf3mz03u4mi
- Central US
- 2015-12-12T08:59:29.1936858Z
- 2015-12-12T08:59:29.1936858Z
- PackerMade
- Small
- false
- VMImageReadyForUse
- StoppedVM
- Small
-`
-const xml2 = `
-
- imgName
-
- User
- packer made image
-
- OSDisk
- ReadWrite
- Generalized
- Linux
- https://sa.blob.core.windows.net/images/PackerMade_Ubuntu_Serv14_2015-12-12.vhd
- 30
- Standard
-
-
-
- DataDisk1
- ReadWrite
- https://sa.blob.core.windows.net/images/PackerMade_Ubuntu_Serv14_2015-12-12-dd1.vhd
- 31
- Standard
-
-
- DataDisk2
- ReadWrite
- https://sa.blob.core.windows.net/images/PackerMade_Ubuntu_Serv14_2015-12-12-dd2.vhd
- 32
- Standard
-
-
- PkrSrvf3mz03u4mi
- PkrVMf3mz03u4mi
- PkrVMf3mz03u4mi
- Central US
- 2015-12-12T08:59:29.1936858Z
- 2015-12-12T08:59:29.1936858Z
- PackerMade
- Small
- false
- VMImageReadyForUse
- StoppedVM
- Small
-`
-
-func Test_NoDataDisksUnmarshal(t *testing.T) {
- var image VMImage
- if err := xml.Unmarshal([]byte(xml1), &image); err != nil {
- t.Fatal(err)
- }
-
- check := checker{t}
- check.Equal(0, len(image.DataDiskConfigurations))
-}
-
-func Test_DataDiskCountUnmarshal(t *testing.T) {
- var image VMImage
- if err := xml.Unmarshal([]byte(xml2), &image); err != nil {
- t.Fatal(err)
- }
-
- check := checker{t}
- check.Equal(2, len(image.DataDiskConfigurations))
- check.Equal("DataDisk1", image.DataDiskConfigurations[0].Name)
- check.Equal("DataDisk2", image.DataDiskConfigurations[1].Name)
-}
-
-type checker struct{ *testing.T }
-
-func (a *checker) Equal(expected, actual interface{}) {
- if expected != actual {
- a.T.Fatalf("Expected %q, but got %q", expected, actual)
- }
-}
diff --git a/services/classic/management/virtualnetwork/client.go b/services/classic/management/virtualnetwork/client.go
deleted file mode 100644
index 5c8dc2d8c2ef..000000000000
--- a/services/classic/management/virtualnetwork/client.go
+++ /dev/null
@@ -1,63 +0,0 @@
-// +build go1.7
-
-// Package virtualnetwork provides a client for Virtual Networks.
-package virtualnetwork
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "encoding/xml"
-
- "github.com/Azure/azure-sdk-for-go/services/classic/management"
-)
-
-const (
- azureNetworkConfigurationURL = "services/networking/media"
-)
-
-// NewClient is used to return new VirtualNetworkClient instance
-func NewClient(client management.Client) VirtualNetworkClient {
- return VirtualNetworkClient{client: client}
-}
-
-// GetVirtualNetworkConfiguration retreives the current virtual network
-// configuration for the currently active subscription. Note that the
-// underlying Azure API means that network related operations are not safe
-// for running concurrently.
-func (c VirtualNetworkClient) GetVirtualNetworkConfiguration() (NetworkConfiguration, error) {
- networkConfiguration := c.NewNetworkConfiguration()
- response, err := c.client.SendAzureGetRequest(azureNetworkConfigurationURL)
- if err != nil {
- return networkConfiguration, err
- }
-
- err = xml.Unmarshal(response, &networkConfiguration)
- return networkConfiguration, err
-
-}
-
-// SetVirtualNetworkConfiguration configures the virtual networks for the
-// currently active subscription according to the NetworkConfiguration given.
-// Note that the underlying Azure API means that network related operations
-// are not safe for running concurrently.
-func (c VirtualNetworkClient) SetVirtualNetworkConfiguration(networkConfiguration NetworkConfiguration) (management.OperationID, error) {
- networkConfiguration.setXMLNamespaces()
- networkConfigurationBytes, err := xml.Marshal(networkConfiguration)
- if err != nil {
- return "", err
- }
-
- return c.client.SendAzurePutRequest(azureNetworkConfigurationURL, "text/plain", networkConfigurationBytes)
-}
diff --git a/services/classic/management/virtualnetwork/entities.go b/services/classic/management/virtualnetwork/entities.go
deleted file mode 100644
index 3cb0c9b70a5f..000000000000
--- a/services/classic/management/virtualnetwork/entities.go
+++ /dev/null
@@ -1,106 +0,0 @@
-// +build go1.7
-
-package virtualnetwork
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "encoding/xml"
-
- "github.com/Azure/azure-sdk-for-go/services/classic/management"
-)
-
-const xmlNamespace = "http://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration"
-const xmlNamespaceXsd = "http://www.w3.org/2001/XMLSchema"
-const xmlNamespaceXsi = "http://www.w3.org/2001/XMLSchema-instance"
-
-// VirtualNetworkClient is used to perform operations on Virtual Networks.
-type VirtualNetworkClient struct {
- client management.Client
-}
-
-// NetworkConfiguration represents the network configuration for an entire Azure
-// subscription.
-type NetworkConfiguration struct {
- XMLName xml.Name `xml:"NetworkConfiguration"`
- XMLNamespaceXsd string `xml:"xmlns:xsd,attr"`
- XMLNamespaceXsi string `xml:"xmlns:xsi,attr"`
- XMLNs string `xml:"xmlns,attr"`
- Configuration VirtualNetworkConfiguration `xml:"VirtualNetworkConfiguration"`
-
- // TODO: Nicer builder methods for these that abstract away the
- // underlying structure.
-}
-
-// NewNetworkConfiguration creates a new empty NetworkConfiguration structure
-// for further configuration. The XML namespaces are already set correctly.
-func (client *VirtualNetworkClient) NewNetworkConfiguration() NetworkConfiguration {
- networkConfiguration := NetworkConfiguration{}
- networkConfiguration.setXMLNamespaces()
- return networkConfiguration
-}
-
-// setXMLNamespaces ensure that all of the required namespaces are set. It
-// should be called prior to marshalling the structure to XML for use with the
-// Azure REST endpoint. It is used internally prior to submitting requests, but
-// since it is idempotent there is no harm in repeat calls.
-func (n *NetworkConfiguration) setXMLNamespaces() {
- n.XMLNamespaceXsd = xmlNamespaceXsd
- n.XMLNamespaceXsi = xmlNamespaceXsi
- n.XMLNs = xmlNamespace
-}
-
-type VirtualNetworkConfiguration struct {
- DNS DNS `xml:"Dns,omitempty"`
- LocalNetworkSites []LocalNetworkSite `xml:"LocalNetworkSites>LocalNetworkSite"`
- VirtualNetworkSites []VirtualNetworkSite `xml:"VirtualNetworkSites>VirtualNetworkSite"`
-}
-
-type DNS struct {
- DNSServers []DNSServer `xml:"DnsServers>DnsServer,omitempty"`
-}
-
-type DNSServer struct {
- XMLName xml.Name `xml:"DnsServer"`
- Name string `xml:"name,attr"`
- IPAddress string `xml:"IPAddress,attr"`
-}
-
-type DNSServerRef struct {
- Name string `xml:"name,attr"`
-}
-
-type VirtualNetworkSite struct {
- Name string `xml:"name,attr"`
- Location string `xml:"Location,attr"`
- AddressSpace AddressSpace `xml:"AddressSpace"`
- Subnets []Subnet `xml:"Subnets>Subnet"`
- DNSServersRef []DNSServerRef `xml:"DnsServersRef>DnsServerRef,omitempty"`
-}
-
-type LocalNetworkSite struct {
- Name string `xml:"name,attr"`
- VPNGatewayAddress string
- AddressSpace AddressSpace
-}
-
-type AddressSpace struct {
- AddressPrefix []string
-}
-
-type Subnet struct {
- Name string `xml:"name,attr"`
- AddressPrefix string
-}
diff --git a/services/classic/management/vmutils/configurationset.go b/services/classic/management/vmutils/configurationset.go
deleted file mode 100644
index 623a394ff82b..000000000000
--- a/services/classic/management/vmutils/configurationset.go
+++ /dev/null
@@ -1,44 +0,0 @@
-// +build go1.7
-
-package vmutils
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- vm "github.com/Azure/azure-sdk-for-go/services/classic/management/virtualmachine"
-)
-
-func updateOrAddConfig(configs []vm.ConfigurationSet, configType vm.ConfigurationSetType, update func(*vm.ConfigurationSet)) []vm.ConfigurationSet {
- config := findConfig(configs, configType)
- if config == nil {
- configs = append(configs, vm.ConfigurationSet{ConfigurationSetType: configType})
- config = findConfig(configs, configType)
- }
- update(config)
-
- return configs
-}
-
-func findConfig(configs []vm.ConfigurationSet, configType vm.ConfigurationSetType) *vm.ConfigurationSet {
- for i, config := range configs {
- if config.ConfigurationSetType == configType {
- // need to return a pointer to the original set in configs,
- // not the copy made by the range iterator
- return &configs[i]
- }
- }
-
- return nil
-}
diff --git a/services/classic/management/vmutils/datadisks.go b/services/classic/management/vmutils/datadisks.go
deleted file mode 100644
index 5e463a3ab1af..000000000000
--- a/services/classic/management/vmutils/datadisks.go
+++ /dev/null
@@ -1,74 +0,0 @@
-// +build go1.7
-
-package vmutils
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "fmt"
-
- vm "github.com/Azure/azure-sdk-for-go/services/classic/management/virtualmachine"
- vmdisk "github.com/Azure/azure-sdk-for-go/services/classic/management/virtualmachinedisk"
-)
-
-// ConfigureWithNewDataDisk adds configuration for a new (empty) data disk
-func ConfigureWithNewDataDisk(role *vm.Role, label, destinationVhdStorageURL string, sizeInGB int, cachingType vmdisk.HostCachingType) error {
- if role == nil {
- return fmt.Errorf(errParamNotSpecified, "role")
- }
-
- appendDataDisk(role, vm.DataVirtualHardDisk{
- DiskLabel: label,
- HostCaching: cachingType,
- LogicalDiskSizeInGB: sizeInGB,
- MediaLink: destinationVhdStorageURL,
- })
-
- return nil
-}
-
-// ConfigureWithExistingDataDisk adds configuration for an existing data disk
-func ConfigureWithExistingDataDisk(role *vm.Role, diskName string, cachingType vmdisk.HostCachingType) error {
- if role == nil {
- return fmt.Errorf(errParamNotSpecified, "role")
- }
-
- appendDataDisk(role, vm.DataVirtualHardDisk{
- DiskName: diskName,
- HostCaching: cachingType,
- })
-
- return nil
-}
-
-// ConfigureWithVhdDataDisk adds configuration for adding a vhd in a storage
-// account as a data disk
-func ConfigureWithVhdDataDisk(role *vm.Role, sourceVhdStorageURL string, cachingType vmdisk.HostCachingType) error {
- if role == nil {
- return fmt.Errorf(errParamNotSpecified, "role")
- }
-
- appendDataDisk(role, vm.DataVirtualHardDisk{
- SourceMediaLink: sourceVhdStorageURL,
- HostCaching: cachingType,
- })
-
- return nil
-}
-
-func appendDataDisk(role *vm.Role, disk vm.DataVirtualHardDisk) {
- disk.Lun = len(role.DataVirtualHardDisks)
- role.DataVirtualHardDisks = append(role.DataVirtualHardDisks, disk)
-}
diff --git a/services/classic/management/vmutils/deployment.go b/services/classic/management/vmutils/deployment.go
deleted file mode 100644
index 403897c73e89..000000000000
--- a/services/classic/management/vmutils/deployment.go
+++ /dev/null
@@ -1,107 +0,0 @@
-// +build go1.7
-
-package vmutils
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "fmt"
-
- vm "github.com/Azure/azure-sdk-for-go/services/classic/management/virtualmachine"
-)
-
-// ConfigureDeploymentFromRemoteImage configures VM Role to deploy from a remote
-// image source. "remoteImageSourceURL" can be any publically accessible URL to
-// a VHD file, including but not limited to a SAS Azure Storage blob url. "os"
-// needs to be either "Linux" or "Windows". "label" is optional.
-func ConfigureDeploymentFromRemoteImage(
- role *vm.Role,
- remoteImageSourceURL string,
- os string,
- newDiskName string,
- destinationVhdStorageURL string,
- label string) error {
- if role == nil {
- return fmt.Errorf(errParamNotSpecified, "role")
- }
-
- role.OSVirtualHardDisk = &vm.OSVirtualHardDisk{
- RemoteSourceImageLink: remoteImageSourceURL,
- MediaLink: destinationVhdStorageURL,
- DiskName: newDiskName,
- OS: os,
- DiskLabel: label,
- }
- return nil
-}
-
-// ConfigureDeploymentFromPlatformImage configures VM Role to deploy from a
-// platform image. See osimage package for methods to retrieve a list of the
-// available platform images. "label" is optional.
-func ConfigureDeploymentFromPlatformImage(
- role *vm.Role,
- imageName string,
- mediaLink string,
- label string) error {
- if role == nil {
- return fmt.Errorf(errParamNotSpecified, "role")
- }
-
- role.OSVirtualHardDisk = &vm.OSVirtualHardDisk{
- SourceImageName: imageName,
- MediaLink: mediaLink,
- }
- return nil
-}
-
-// ConfigureDeploymentFromPublishedVMImage configures VM Role to deploy from
-// a published (public) VM image.
-func ConfigureDeploymentFromPublishedVMImage(
- role *vm.Role,
- vmImageName string,
- mediaLocation string,
- provisionGuestAgent bool) error {
- if role == nil {
- return fmt.Errorf(errParamNotSpecified, "role")
- }
-
- role.VMImageName = vmImageName
- role.MediaLocation = mediaLocation
- role.ProvisionGuestAgent = provisionGuestAgent
- return nil
-}
-
-// ConfigureDeploymentFromUserVMImage configures VM Role to deploy from a previously
-// captured (user generated) VM image.
-func ConfigureDeploymentFromUserVMImage(
- role *vm.Role,
- vmImageName string) error {
- if role == nil {
- return fmt.Errorf(errParamNotSpecified, "role")
- }
-
- role.VMImageName = vmImageName
- return nil
-}
-
-// ConfigureDeploymentFromExistingOSDisk configures VM Role to deploy from an
-// existing disk. 'label' is optional.
-func ConfigureDeploymentFromExistingOSDisk(role *vm.Role, osDiskName, label string) error {
- role.OSVirtualHardDisk = &vm.OSVirtualHardDisk{
- DiskName: osDiskName,
- DiskLabel: label,
- }
- return nil
-}
diff --git a/services/classic/management/vmutils/extensions.go b/services/classic/management/vmutils/extensions.go
deleted file mode 100644
index e96668dedec6..000000000000
--- a/services/classic/management/vmutils/extensions.go
+++ /dev/null
@@ -1,106 +0,0 @@
-// +build go1.7
-
-package vmutils
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "encoding/base64"
- "encoding/json"
- "fmt"
-
- vm "github.com/Azure/azure-sdk-for-go/services/classic/management/virtualmachine"
-)
-
-const (
- dockerPublicConfigVersion = 2
-)
-
-func AddAzureVMExtensionConfiguration(role *vm.Role, name, publisher, version, referenceName, state string,
- publicConfigurationValue, privateConfigurationValue []byte) error {
- if role == nil {
- return fmt.Errorf(errParamNotSpecified, "role")
- }
-
- extension := vm.ResourceExtensionReference{
- Name: name,
- Publisher: publisher,
- Version: version,
- ReferenceName: referenceName,
- State: state,
- }
-
- if len(privateConfigurationValue) != 0 {
- extension.ParameterValues = append(extension.ParameterValues, vm.ResourceExtensionParameter{
- Key: "ignored",
- Value: base64.StdEncoding.EncodeToString(privateConfigurationValue),
- Type: "Private",
- })
- }
-
- if len(publicConfigurationValue) != 0 {
- extension.ParameterValues = append(extension.ParameterValues, vm.ResourceExtensionParameter{
- Key: "ignored",
- Value: base64.StdEncoding.EncodeToString(publicConfigurationValue),
- Type: "Public",
- })
- }
-
- if role.ResourceExtensionReferences == nil {
- role.ResourceExtensionReferences = &[]vm.ResourceExtensionReference{}
- }
- extensionList := append(*role.ResourceExtensionReferences, extension)
- role.ResourceExtensionReferences = &extensionList
- return nil
-}
-
-// AddAzureDockerVMExtensionConfiguration adds the DockerExtension to the role
-// configuratioon and opens a port "dockerPort"
-// TODO(ahmetalpbalkan) Deprecate this and move to 'docker-machine' codebase.
-func AddAzureDockerVMExtensionConfiguration(role *vm.Role, dockerPort int, version string) error {
- if role == nil {
- return fmt.Errorf(errParamNotSpecified, "role")
- }
-
- if err := ConfigureWithExternalPort(role, "docker", dockerPort, dockerPort, vm.InputEndpointProtocolTCP); err != nil {
- return err
- }
-
- publicConfiguration, err := createDockerPublicConfig(dockerPort)
- if err != nil {
- return err
- }
-
- privateConfiguration, err := json.Marshal(dockerPrivateConfig{})
- if err != nil {
- return err
- }
-
- return AddAzureVMExtensionConfiguration(role,
- "DockerExtension", "MSOpenTech.Extensions",
- version, "DockerExtension", "enable",
- publicConfiguration, privateConfiguration)
-}
-
-func createDockerPublicConfig(dockerPort int) ([]byte, error) {
- return json.Marshal(dockerPublicConfig{DockerPort: dockerPort, Version: dockerPublicConfigVersion})
-}
-
-type dockerPublicConfig struct {
- DockerPort int `json:"dockerport"`
- Version int `json:"version"`
-}
-
-type dockerPrivateConfig struct{}
diff --git a/services/classic/management/vmutils/extensions_test.go b/services/classic/management/vmutils/extensions_test.go
deleted file mode 100644
index eb158450e7b3..000000000000
--- a/services/classic/management/vmutils/extensions_test.go
+++ /dev/null
@@ -1,58 +0,0 @@
-// +build go1.7
-
-package vmutils
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "encoding/xml"
- "testing"
-
- vm "github.com/Azure/azure-sdk-for-go/services/classic/management/virtualmachine"
-)
-
-func Test_AddAzureVMExtensionConfiguration(t *testing.T) {
-
- role := vm.Role{}
- AddAzureVMExtensionConfiguration(&role,
- "nameOfExtension", "nameOfPublisher", "versionOfExtension", "nameOfReference", "state", []byte{1, 2, 3}, []byte{})
-
- data, err := xml.MarshalIndent(role, "", " ")
- if err != nil {
- t.Fatal(err)
- }
- if expected := `
-
-
-
- nameOfReference
- nameOfPublisher
- nameOfExtension
- versionOfExtension
-
-
- ignored
- AQID
- Public
-
-
- state
-
-
-
-`; string(data) != expected {
- t.Fatalf("Expected %q, but got %q", expected, string(data))
- }
-}
diff --git a/services/classic/management/vmutils/integration_test.go b/services/classic/management/vmutils/integration_test.go
deleted file mode 100644
index 5fbc9051435a..000000000000
--- a/services/classic/management/vmutils/integration_test.go
+++ /dev/null
@@ -1,474 +0,0 @@
-// +build go1.7
-
-package vmutils
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "encoding/base64"
- "fmt"
- "math/rand"
- "testing"
- "time"
-
- "github.com/Azure/azure-sdk-for-go/services/classic/management"
- "github.com/Azure/azure-sdk-for-go/services/classic/management/hostedservice"
- "github.com/Azure/azure-sdk-for-go/services/classic/management/location"
- "github.com/Azure/azure-sdk-for-go/services/classic/management/osimage"
- storage "github.com/Azure/azure-sdk-for-go/services/classic/management/storageservice"
- "github.com/Azure/azure-sdk-for-go/services/classic/management/testutils"
- vm "github.com/Azure/azure-sdk-for-go/services/classic/management/virtualmachine"
- vmimage "github.com/Azure/azure-sdk-for-go/services/classic/management/virtualmachineimage"
-)
-
-func TestDeployPlatformImage(t *testing.T) {
- client := testutils.GetTestClient(t)
- vmname := GenerateName()
- sa := GetTestStorageAccount(t, client)
- location := sa.StorageServiceProperties.Location
-
- role := NewVMConfiguration(vmname, "Standard_D3")
- ConfigureDeploymentFromPlatformImage(&role,
- GetLinuxTestImage(t, client).Name,
- fmt.Sprintf("http://%s.blob.core.windows.net/sdktest/%s.vhd", sa.ServiceName, vmname),
- GenerateName())
- ConfigureForLinux(&role, "myvm", "azureuser", GeneratePassword())
- ConfigureWithPublicSSH(&role)
-
- testRoleConfiguration(t, client, role, location)
-}
-
-func TestDeployPlatformWindowsImage(t *testing.T) {
- client := testutils.GetTestClient(t)
- vmname := GenerateName()
- sa := GetTestStorageAccount(t, client)
- location := sa.StorageServiceProperties.Location
-
- role := NewVMConfiguration(vmname, "Standard_D3")
- ConfigureDeploymentFromPlatformImage(&role,
- GetWindowsTestImage(t, client).Name,
- fmt.Sprintf("http://%s.blob.core.windows.net/sdktest/%s.vhd", sa.ServiceName, vmname),
- GenerateName())
- ConfigureForWindows(&role, vmname, "azureuser", GeneratePassword(), true, "")
- ConfigureWinRMOverHTTP(&role)
- ConfigureWinRMOverHTTPS(&role, "")
-
- testRoleConfiguration(t, client, role, location)
-}
-
-func TestVMImageList(t *testing.T) {
- client := testutils.GetTestClient(t)
- vmic := vmimage.NewClient(client)
- il, _ := vmic.ListVirtualMachineImages(vmimage.ListParameters{})
- for _, im := range il.VMImages {
- t.Logf("%s -%s", im.Name, im.Description)
- }
-}
-
-func TestDeployPlatformOSImageCaptureRedeploy(t *testing.T) {
- client := testutils.GetTestClient(t)
- vmname := GenerateName()
- sa := GetTestStorageAccount(t, client)
- location := sa.StorageServiceProperties.Location
-
- role := NewVMConfiguration(vmname, "Standard_D3")
- ConfigureDeploymentFromPlatformImage(&role,
- GetLinuxTestImage(t, client).Name,
- fmt.Sprintf("http://%s.blob.core.windows.net/sdktest/%s.vhd", sa.ServiceName, vmname),
- GenerateName())
- ConfigureForLinux(&role, "myvm", "azureuser", GeneratePassword())
- ConfigureWithPublicSSH(&role)
-
- t.Logf("Deploying VM: %s", vmname)
- createRoleConfiguration(t, client, role, location)
-
- t.Logf("Wait for deployment to enter running state")
- vmc := vm.NewClient(client)
- status := vm.DeploymentStatusDeploying
- for status != vm.DeploymentStatusRunning {
- deployment, err := vmc.GetDeployment(vmname, vmname)
- if err != nil {
- t.Error(err)
- break
- }
- status = deployment.Status
- }
-
- t.Logf("Shutting down VM: %s", vmname)
- if err := Await(client, func() (management.OperationID, error) {
- return vmc.ShutdownRole(vmname, vmname, vmname, vm.PostShutdownActionStopped)
- }); err != nil {
- t.Error(err)
- }
-
- if err := WaitForDeploymentPowerState(client, vmname, vmname, vm.PowerStateStopped); err != nil {
- t.Fatal(err)
- }
-
- imagename := GenerateName()
- t.Logf("Capturing OSImage: %s", imagename)
- if err := Await(client, func() (management.OperationID, error) {
- return vmc.CaptureRole(vmname, vmname, vmname, imagename, imagename, nil)
- }); err != nil {
- t.Error(err)
- }
-
- im := GetUserOSImage(t, client, imagename)
- t.Logf("Found image: %+v", im)
-
- newvmname := GenerateName()
- role = NewVMConfiguration(newvmname, "Standard_D3")
- ConfigureDeploymentFromPlatformImage(&role,
- im.Name,
- fmt.Sprintf("http://%s.blob.core.windows.net/sdktest/%s.vhd", sa.ServiceName, newvmname),
- GenerateName())
- ConfigureForLinux(&role, newvmname, "azureuser", GeneratePassword())
- ConfigureWithPublicSSH(&role)
-
- t.Logf("Deploying new VM from freshly captured OS image: %s", newvmname)
- if err := Await(client, func() (management.OperationID, error) {
- return vmc.CreateDeployment(role, vmname, vm.CreateDeploymentOptions{})
- }); err != nil {
- t.Error(err)
- }
-
- deleteHostedService(t, client, vmname)
-}
-
-func TestDeployPlatformVMImageCaptureRedeploy(t *testing.T) {
- client := testutils.GetTestClient(t)
- vmname := GenerateName()
- sa := GetTestStorageAccount(t, client)
- location := sa.StorageServiceProperties.Location
-
- role := NewVMConfiguration(vmname, "Standard_D3")
- ConfigureDeploymentFromPlatformImage(&role,
- GetLinuxTestImage(t, client).Name,
- fmt.Sprintf("http://%s.blob.core.windows.net/sdktest/%s.vhd", sa.ServiceName, vmname),
- GenerateName())
- ConfigureForLinux(&role, "myvm", "azureuser", GeneratePassword())
- ConfigureWithPublicSSH(&role)
-
- t.Logf("Deploying VM: %s", vmname)
- createRoleConfiguration(t, client, role, location)
-
- t.Logf("Wait for deployment to enter running state")
- vmc := vm.NewClient(client)
- status := vm.DeploymentStatusDeploying
- for status != vm.DeploymentStatusRunning {
- deployment, err := vmc.GetDeployment(vmname, vmname)
- if err != nil {
- t.Error(err)
- break
- }
- status = deployment.Status
- }
-
- t.Logf("Shutting down VM: %s", vmname)
- if err := Await(client, func() (management.OperationID, error) {
- return vmc.ShutdownRole(vmname, vmname, vmname, vm.PostShutdownActionStopped)
- }); err != nil {
- t.Error(err)
- }
-
- if err := WaitForDeploymentInstanceStatus(client, vmname, vmname, vm.InstanceStatusStoppedVM); err != nil {
- t.Fatal(err)
- }
-
- imagename := GenerateName()
- t.Logf("Capturing VMImage: %s", imagename)
- if err := Await(client, func() (management.OperationID, error) {
- return vmimage.NewClient(client).Capture(vmname, vmname, vmname, imagename, imagename, vmimage.OSStateGeneralized, vmimage.CaptureParameters{})
- }); err != nil {
- t.Error(err)
- }
-
- im := GetUserVMImage(t, client, imagename)
- t.Logf("Found image: %+v", im)
-
- newvmname := GenerateName()
- role = NewVMConfiguration(newvmname, "Standard_D3")
- ConfigureDeploymentFromUserVMImage(&role, im.Name)
- ConfigureForLinux(&role, newvmname, "azureuser", GeneratePassword())
- ConfigureWithPublicSSH(&role)
-
- t.Logf("Deploying new VM from freshly captured VM image: %s", newvmname)
- if err := Await(client, func() (management.OperationID, error) {
- return vmc.CreateDeployment(role, vmname, vm.CreateDeploymentOptions{})
- }); err != nil {
- t.Error(err)
- }
-
- deleteHostedService(t, client, vmname)
-}
-
-func TestDeployFromPublishedVmImage(t *testing.T) {
- client := testutils.GetTestClient(t)
- vmname := GenerateName()
- sa := GetTestStorageAccount(t, client)
- location := sa.StorageServiceProperties.Location
-
- im := GetVMImage(t, client, func(im vmimage.VMImage) bool {
- return im.Name ==
- "fb83b3509582419d99629ce476bcb5c8__SQL-Server-2014-RTM-12.0.2430.0-OLTP-ENU-Win2012R2-cy14su11"
- })
-
- role := NewVMConfiguration(vmname, "Standard_D4")
- ConfigureDeploymentFromPublishedVMImage(&role, im.Name,
- fmt.Sprintf("http://%s.blob.core.windows.net/%s", sa.ServiceName, vmname), false)
- ConfigureForWindows(&role, vmname, "azureuser", GeneratePassword(), true, "")
- ConfigureWithPublicSSH(&role)
-
- testRoleConfiguration(t, client, role, location)
-}
-
-func TestRoleStateOperations(t *testing.T) {
- client := testutils.GetTestClient(t)
- vmname := GenerateName()
- sa := GetTestStorageAccount(t, client)
- location := sa.StorageServiceProperties.Location
-
- role := NewVMConfiguration(vmname, "Standard_D3")
- ConfigureDeploymentFromPlatformImage(&role,
- GetLinuxTestImage(t, client).Name,
- fmt.Sprintf("http://%s.blob.core.windows.net/sdktest/%s.vhd", sa.ServiceName, vmname),
- GenerateName())
- ConfigureForLinux(&role, "myvm", "azureuser", GeneratePassword())
-
- createRoleConfiguration(t, client, role, location)
-
- vmc := vm.NewClient(client)
- if err := Await(client, func() (management.OperationID, error) {
- return vmc.ShutdownRole(vmname, vmname, vmname, vm.PostShutdownActionStopped)
- }); err != nil {
- t.Error(err)
- }
- if err := Await(client, func() (management.OperationID, error) {
- return vmc.StartRole(vmname, vmname, vmname)
- }); err != nil {
- t.Error(err)
- }
- if err := Await(client, func() (management.OperationID, error) {
- return vmc.RestartRole(vmname, vmname, vmname)
- }); err != nil {
- t.Error(err)
- }
-
- deleteHostedService(t, client, vmname)
-}
-
-func testRoleConfiguration(t *testing.T, client management.Client, role vm.Role, location string) {
- createRoleConfiguration(t, client, role, location)
-
- deleteHostedService(t, client, role.RoleName)
-}
-
-func createRoleConfiguration(t *testing.T, client management.Client, role vm.Role, location string) {
- vmc := vm.NewClient(client)
- hsc := hostedservice.NewClient(client)
- vmname := role.RoleName
-
- if err := hsc.CreateHostedService(hostedservice.CreateHostedServiceParameters{
- ServiceName: vmname, Location: location,
- Label: base64.StdEncoding.EncodeToString([]byte(vmname))}); err != nil {
- t.Error(err)
- }
-
- if err := Await(client, func() (management.OperationID, error) {
- return vmc.CreateDeployment(role, vmname, vm.CreateDeploymentOptions{})
- }); err != nil {
- t.Error(err)
- }
-}
-
-func deleteHostedService(t *testing.T, client management.Client, vmname string) {
- t.Logf("Deleting hosted service: %s", vmname)
- if err := Await(client, func() (management.OperationID, error) {
- return hostedservice.NewClient(client).DeleteHostedService(vmname, true)
- }); err != nil {
- t.Error(err)
- }
-}
-
-// === utility funcs ===
-
-func GetTestStorageAccount(t *testing.T, client management.Client) storage.StorageServiceResponse {
- t.Log("Retrieving storage account")
- sc := storage.NewClient(client)
- var sa storage.StorageServiceResponse
- ssl, err := sc.ListStorageServices()
- if err != nil {
- t.Fatal(err)
- }
- rnd := rand.New(rand.NewSource(time.Now().UnixNano()))
-
- if len(ssl.StorageServices) == 0 {
- t.Log("No storage accounts found, creating a new one")
- lc := location.NewClient(client)
- ll, err := lc.ListLocations()
- if err != nil {
- t.Fatal(err)
- }
- loc := ll.Locations[rnd.Intn(len(ll.Locations))].Name
-
- t.Logf("Location for new storage account: %s", loc)
- name := GenerateName()
- op, err := sc.CreateStorageService(storage.StorageAccountCreateParameters{
- ServiceName: name,
- Label: base64.StdEncoding.EncodeToString([]byte(name)),
- Location: loc,
- AccountType: storage.AccountTypeStandardLRS})
- if err != nil {
- t.Fatal(err)
- }
- if err := client.WaitForOperation(op, nil); err != nil {
- t.Fatal(err)
- }
- sa, err = sc.GetStorageService(name)
- if err != nil {
- t.Fatal(err)
- }
- } else {
-
- sa = ssl.StorageServices[rnd.Intn(len(ssl.StorageServices))]
- }
-
- t.Logf("Selected storage account '%s' in location '%s'",
- sa.ServiceName, sa.StorageServiceProperties.Location)
-
- return sa
-}
-
-func GetLinuxTestImage(t *testing.T, client management.Client) osimage.OSImage {
- return GetOSImage(t, client, func(im osimage.OSImage) bool {
- return im.Category == "Public" && im.ImageFamily == "Ubuntu Server 14.04 LTS"
- })
-}
-
-func GetWindowsTestImage(t *testing.T, client management.Client) osimage.OSImage {
- return GetOSImage(t, client, func(im osimage.OSImage) bool {
- return im.Category == "Public" && im.ImageFamily == "Windows Server 2012 R2 Datacenter"
- })
-}
-
-func GetUserOSImage(t *testing.T, client management.Client, name string) osimage.OSImage {
- return GetOSImage(t, client, func(im osimage.OSImage) bool {
- return im.Category == "User" && im.Name == name
- })
-}
-
-func GetOSImage(
- t *testing.T,
- client management.Client,
- filter func(osimage.OSImage) bool) osimage.OSImage {
- t.Log("Selecting OS image")
- osc := osimage.NewClient(client)
- allimages, err := osc.ListOSImages()
- if err != nil {
- t.Fatal(err)
- }
- filtered := []osimage.OSImage{}
- for _, im := range allimages.OSImages {
- if filter(im) {
- filtered = append(filtered, im)
- }
- }
- if len(filtered) == 0 {
- t.Fatal("Filter too restrictive, no images left?")
- }
-
- image := filtered[0]
- for _, im := range filtered {
- if im.PublishedDate > image.PublishedDate {
- image = im
- }
- }
-
- t.Logf("Selecting image '%s'", image.Name)
- return image
-}
-
-func GetUserVMImage(t *testing.T, client management.Client, name string) vmimage.VMImage {
- return GetVMImage(t, client, func(im vmimage.VMImage) bool {
- return im.Category == "User" && im.Name == name
- })
-}
-
-func GetVMImage(
- t *testing.T,
- client management.Client,
- filter func(vmimage.VMImage) bool) vmimage.VMImage {
- t.Log("Selecting VM image")
- allimages, err := vmimage.NewClient(client).ListVirtualMachineImages(vmimage.ListParameters{})
- if err != nil {
- t.Fatal(err)
- }
- filtered := []vmimage.VMImage{}
- for _, im := range allimages.VMImages {
- if filter(im) {
- filtered = append(filtered, im)
- }
- }
- if len(filtered) == 0 {
- t.Fatal("Filter too restrictive, no images left?")
- }
-
- image := filtered[0]
- for _, im := range filtered {
- if im.PublishedDate > image.PublishedDate {
- image = im
- }
- }
-
- t.Logf("Selecting image '%s'", image.Name)
- return image
-}
-
-func GenerateName() string {
- from := "1234567890abcdefghijklmnopqrstuvwxyz"
- return "sdk" + GenerateString(12, from)
-}
-
-func GeneratePassword() string {
- pw := GenerateString(20, "1234567890") +
- GenerateString(20, "abcdefghijklmnopqrstuvwxyz") +
- GenerateString(20, "ABCDEFGHIJKLMNOPQRSTUVWXYZ")
-
- rnd := rand.New(rand.NewSource(time.Now().UnixNano()))
- i := rnd.Intn(len(pw)-2) + 1
-
- pw = string(append([]uint8(pw[i:]), pw[:i-1]...))
-
- return pw
-}
-
-func GenerateString(length int, from string) string {
- str := ""
- rnd := rand.New(rand.NewSource(time.Now().UnixNano()))
- for len(str) < length {
- str += string(from[rnd.Intn(len(from))])
- }
- return str
-}
-
-type asyncFunc func() (operationId management.OperationID, err error)
-
-func Await(client management.Client, async asyncFunc) error {
- requestID, err := async()
- if err != nil {
- return err
- }
- return client.WaitForOperation(requestID, nil)
-}
diff --git a/services/classic/management/vmutils/network.go b/services/classic/management/vmutils/network.go
deleted file mode 100644
index f2145b6878da..000000000000
--- a/services/classic/management/vmutils/network.go
+++ /dev/null
@@ -1,99 +0,0 @@
-// +build go1.7
-
-package vmutils
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "fmt"
-
- vm "github.com/Azure/azure-sdk-for-go/services/classic/management/virtualmachine"
-)
-
-// ConfigureWithPublicSSH adds configuration exposing port 22 externally
-func ConfigureWithPublicSSH(role *vm.Role) error {
- if role == nil {
- return fmt.Errorf(errParamNotSpecified, "role")
- }
-
- return ConfigureWithExternalPort(role, "SSH", 22, 22, vm.InputEndpointProtocolTCP)
-}
-
-// ConfigureWithPublicRDP adds configuration exposing port 3389 externally
-func ConfigureWithPublicRDP(role *vm.Role) error {
- if role == nil {
- return fmt.Errorf(errParamNotSpecified, "role")
- }
-
- return ConfigureWithExternalPort(role, "RDP", 3389, 3389, vm.InputEndpointProtocolTCP)
-}
-
-// ConfigureWithPublicPowerShell adds configuration exposing port 5986
-// externally
-func ConfigureWithPublicPowerShell(role *vm.Role) error {
- if role == nil {
- return fmt.Errorf(errParamNotSpecified, "role")
- }
-
- return ConfigureWithExternalPort(role, "PowerShell", 5986, 5986, vm.InputEndpointProtocolTCP)
-}
-
-// ConfigureWithExternalPort adds a new InputEndpoint to the Role, exposing a
-// port externally
-func ConfigureWithExternalPort(role *vm.Role, name string, localport, externalport int, protocol vm.InputEndpointProtocol) error {
- if role == nil {
- return fmt.Errorf(errParamNotSpecified, "role")
- }
-
- role.ConfigurationSets = updateOrAddConfig(role.ConfigurationSets, vm.ConfigurationSetTypeNetwork,
- func(config *vm.ConfigurationSet) {
- config.InputEndpoints = append(config.InputEndpoints, vm.InputEndpoint{
- LocalPort: localport,
- Name: name,
- Port: externalport,
- Protocol: protocol,
- })
- })
-
- return nil
-}
-
-// ConfigureWithSecurityGroup associates the Role with a specific network security group
-func ConfigureWithSecurityGroup(role *vm.Role, networkSecurityGroup string) error {
- if role == nil {
- return fmt.Errorf(errParamNotSpecified, "role")
- }
-
- role.ConfigurationSets = updateOrAddConfig(role.ConfigurationSets, vm.ConfigurationSetTypeNetwork,
- func(config *vm.ConfigurationSet) {
- config.NetworkSecurityGroup = networkSecurityGroup
- })
-
- return nil
-}
-
-// ConfigureWithSubnet associates the Role with a specific subnet
-func ConfigureWithSubnet(role *vm.Role, subnet string) error {
- if role == nil {
- return fmt.Errorf(errParamNotSpecified, "role")
- }
-
- role.ConfigurationSets = updateOrAddConfig(role.ConfigurationSets, vm.ConfigurationSetTypeNetwork,
- func(config *vm.ConfigurationSet) {
- config.SubnetNames = append(config.SubnetNames, subnet)
- })
-
- return nil
-}
diff --git a/services/classic/management/vmutils/rolesize.go b/services/classic/management/vmutils/rolesize.go
deleted file mode 100644
index a381ca3e73e6..000000000000
--- a/services/classic/management/vmutils/rolesize.go
+++ /dev/null
@@ -1,92 +0,0 @@
-// +build go1.7
-
-package vmutils
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "fmt"
-
- "github.com/Azure/azure-sdk-for-go/services/classic/management"
- lc "github.com/Azure/azure-sdk-for-go/services/classic/management/location"
- vm "github.com/Azure/azure-sdk-for-go/services/classic/management/virtualmachine"
-)
-
-// IsRoleSizeValid retrieves the available rolesizes using
-// vmclient.GetRoleSizeList() and returns whether that the provided roleSizeName
-// is part of that list
-func IsRoleSizeValid(vmclient vm.VirtualMachineClient, roleSizeName string) (bool, error) {
- if roleSizeName == "" {
- return false, fmt.Errorf(errParamNotSpecified, "roleSizeName")
- }
-
- roleSizeList, err := vmclient.GetRoleSizeList()
- if err != nil {
- return false, err
- }
-
- for _, roleSize := range roleSizeList.RoleSizes {
- if roleSize.Name == roleSizeName {
- return true, nil
- }
- }
-
- return false, nil
-}
-
-// IsRoleSizeAvailableInLocation retrieves all available sizes in the specified
-// location and returns whether that the provided roleSizeName is part of that list.
-func IsRoleSizeAvailableInLocation(managementclient management.Client, location, roleSizeName string) (bool, error) {
- if location == "" {
- return false, fmt.Errorf(errParamNotSpecified, "location")
- }
- if roleSizeName == "" {
- return false, fmt.Errorf(errParamNotSpecified, "roleSizeName")
- }
-
- locationClient := lc.NewClient(managementclient)
- locationInfo, err := getLocation(locationClient, location)
- if err != nil {
- return false, err
- }
-
- for _, availableRoleSize := range locationInfo.VirtualMachineRoleSizes {
- if availableRoleSize == roleSizeName {
- return true, nil
- }
- }
-
- return false, nil
-}
-
-func getLocation(c lc.LocationClient, location string) (*lc.Location, error) {
- if location == "" {
- return nil, fmt.Errorf(errParamNotSpecified, "location")
- }
-
- locations, err := c.ListLocations()
- if err != nil {
- return nil, err
- }
-
- for _, existingLocation := range locations.Locations {
- if existingLocation.Name != location {
- continue
- }
-
- return &existingLocation, nil
- }
- return nil, fmt.Errorf("Invalid location: %s. Available locations: %s", location, locations)
-}
diff --git a/services/classic/management/vmutils/rolestate.go b/services/classic/management/vmutils/rolestate.go
deleted file mode 100644
index 4ae604cd3e91..000000000000
--- a/services/classic/management/vmutils/rolestate.go
+++ /dev/null
@@ -1,74 +0,0 @@
-// +build go1.7
-
-package vmutils
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "time"
-
- "github.com/Azure/azure-sdk-for-go/services/classic/management"
- vm "github.com/Azure/azure-sdk-for-go/services/classic/management/virtualmachine"
-)
-
-// WaitForDeploymentPowerState blocks until all role instances in deployment
-// reach desired power state.
-func WaitForDeploymentPowerState(client management.Client, cloudServiceName, deploymentName string, desiredPowerstate vm.PowerState) error {
- for {
- deployment, err := vm.NewClient(client).GetDeployment(cloudServiceName, deploymentName)
- if err != nil {
- return err
- }
- if allInstancesInPowerState(deployment.RoleInstanceList, desiredPowerstate) {
- return nil
- }
- time.Sleep(2 * time.Second)
- }
-}
-
-func allInstancesInPowerState(instances []vm.RoleInstance, desiredPowerstate vm.PowerState) bool {
- for _, r := range instances {
- if r.PowerState != desiredPowerstate {
- return false
- }
- }
-
- return true
-}
-
-// WaitForDeploymentInstanceStatus blocks until all role instances in deployment
-// reach desired InstanceStatus.
-func WaitForDeploymentInstanceStatus(client management.Client, cloudServiceName, deploymentName string, desiredInstanceStatus vm.InstanceStatus) error {
- for {
- deployment, err := vm.NewClient(client).GetDeployment(cloudServiceName, deploymentName)
- if err != nil {
- return err
- }
- if allInstancesInInstanceStatus(deployment.RoleInstanceList, desiredInstanceStatus) {
- return nil
- }
- time.Sleep(2 * time.Second)
- }
-}
-
-func allInstancesInInstanceStatus(instances []vm.RoleInstance, desiredInstancestatus vm.InstanceStatus) bool {
- for _, r := range instances {
- if r.InstanceStatus != desiredInstancestatus {
- return false
- }
- }
-
- return true
-}
diff --git a/services/classic/management/vmutils/vmutils.go b/services/classic/management/vmutils/vmutils.go
deleted file mode 100644
index 812851a6c201..000000000000
--- a/services/classic/management/vmutils/vmutils.go
+++ /dev/null
@@ -1,193 +0,0 @@
-// +build go1.7
-
-// Package vmutils provides convenience methods for creating Virtual
-// Machine Role configurations.
-package vmutils
-
-// Copyright 2017 Microsoft Corporation
-//
-// 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.
-
-import (
- "fmt"
-
- vm "github.com/Azure/azure-sdk-for-go/services/classic/management/virtualmachine"
-)
-
-const (
- errParamNotSpecified = "Parameter %s is not specified."
-)
-
-// NewVMConfiguration creates configuration for a new virtual machine Role.
-func NewVMConfiguration(name string, roleSize string) vm.Role {
- return vm.Role{
- RoleName: name,
- RoleType: "PersistentVMRole",
- RoleSize: roleSize,
- ProvisionGuestAgent: true,
- }
-}
-
-// ConfigureForLinux adds configuration when deploying a generalized Linux
-// image. If "password" is left empty, SSH password security will be disabled by
-// default. Certificates with SSH public keys should already be uploaded to the
-// cloud service where the VM will be deployed and referenced here only by their
-// thumbprint.
-func ConfigureForLinux(role *vm.Role, hostname, user, password string, sshPubkeyCertificateThumbprint ...string) error {
- if role == nil {
- return fmt.Errorf(errParamNotSpecified, "role")
- }
-
- role.ConfigurationSets = updateOrAddConfig(role.ConfigurationSets, vm.ConfigurationSetTypeLinuxProvisioning,
- func(config *vm.ConfigurationSet) {
- config.HostName = hostname
- config.UserName = user
- config.UserPassword = password
- if password != "" {
- config.DisableSSHPasswordAuthentication = "false"
- }
- if len(sshPubkeyCertificateThumbprint) != 0 {
- config.SSH = &vm.SSH{}
- for _, k := range sshPubkeyCertificateThumbprint {
- config.SSH.PublicKeys = append(config.SSH.PublicKeys,
- vm.PublicKey{
- Fingerprint: k,
- Path: "/home/" + user + "/.ssh/authorized_keys",
- },
- )
- }
- }
- },
- )
-
- return nil
-}
-
-// ConfigureForWindows adds configuration when deploying a generalized
-// Windows image. timeZone can be left empty. For a complete list of supported
-// time zone entries, you can either refer to the values listed in the registry
-// entry "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time
-// Zones" or you can use the tzutil command-line tool to list the valid time.
-func ConfigureForWindows(role *vm.Role, hostname, user, password string, enableAutomaticUpdates bool, timeZone string) error {
- if role == nil {
- return fmt.Errorf(errParamNotSpecified, "role")
- }
-
- role.ConfigurationSets = updateOrAddConfig(role.ConfigurationSets, vm.ConfigurationSetTypeWindowsProvisioning,
- func(config *vm.ConfigurationSet) {
- config.ComputerName = hostname
- config.AdminUsername = user
- config.AdminPassword = password
- config.EnableAutomaticUpdates = enableAutomaticUpdates
- config.TimeZone = timeZone
- },
- )
-
- return nil
-}
-
-// ConfigureWithCustomDataForLinux configures custom data for Linux-based images.
-// The customData contains either cloud-init or shell script to be executed upon start.
-//
-// The function expects the customData to be base64-encoded.
-func ConfigureWithCustomDataForLinux(role *vm.Role, customData string) error {
- return configureWithCustomData(role, customData, vm.ConfigurationSetTypeLinuxProvisioning)
-}
-
-// ConfigureWithCustomDataForWindows configures custom data for Windows-based images.
-// The customData contains either cloud-init or shell script to be executed upon start.
-//
-// The function expects the customData to be base64-encoded.
-func ConfigureWithCustomDataForWindows(role *vm.Role, customData string) error {
- return configureWithCustomData(role, customData, vm.ConfigurationSetTypeWindowsProvisioning)
-}
-
-func configureWithCustomData(role *vm.Role, customData string, typ vm.ConfigurationSetType) error {
- if role == nil {
- return fmt.Errorf(errParamNotSpecified, "role")
- }
-
- role.ConfigurationSets = updateOrAddConfig(role.ConfigurationSets, typ,
- func(config *vm.ConfigurationSet) {
- config.CustomData = customData
- })
-
- return nil
-}
-
-// ConfigureWindowsToJoinDomain adds configuration to join a new Windows vm to a
-// domain. "username" must be in UPN form (user@domain.com), "machineOU" can be
-// left empty
-func ConfigureWindowsToJoinDomain(role *vm.Role, username, password, domainToJoin, machineOU string) error {
- if role == nil {
- return fmt.Errorf(errParamNotSpecified, "role")
- }
-
- winconfig := findConfig(role.ConfigurationSets, vm.ConfigurationSetTypeWindowsProvisioning)
- if winconfig != nil {
- winconfig.DomainJoin = &vm.DomainJoin{
- Credentials: vm.Credentials{Username: username, Password: password},
- JoinDomain: domainToJoin,
- MachineObjectOU: machineOU,
- }
- }
-
- return nil
-}
-
-func ConfigureWinRMListener(role *vm.Role, protocol vm.WinRMProtocol, certificateThumbprint string) error {
-
- if role == nil {
- return fmt.Errorf(errParamNotSpecified, "role")
- }
-
- winconfig := findConfig(role.ConfigurationSets, vm.ConfigurationSetTypeWindowsProvisioning)
-
- if winconfig != nil {
-
- listener := vm.WinRMListener{
- Protocol: protocol,
- CertificateThumbprint: certificateThumbprint,
- }
-
- if winconfig.WinRMListeners == nil {
- winconfig.WinRMListeners = &[]vm.WinRMListener{}
- }
-
- currentListeners := *winconfig.WinRMListeners
-
- // replace existing listener if it's already configured
- for i, existingListener := range currentListeners {
- if existingListener.Protocol == protocol {
- currentListeners[i] = listener
- return nil
- }
- }
-
- // otherwise append to list of listeners
- newListeners := append(currentListeners, listener)
- winconfig.WinRMListeners = &newListeners
-
- return nil
- }
-
- return fmt.Errorf("WindowsProvisioningConfigurationSet not found in 'role'")
-}
-
-func ConfigureWinRMOverHTTP(role *vm.Role) error {
- return ConfigureWinRMListener(role, vm.WinRMProtocolHTTP, "")
-}
-
-func ConfigureWinRMOverHTTPS(role *vm.Role, certificateThumbprint string) error {
- return ConfigureWinRMListener(role, vm.WinRMProtocolHTTPS, certificateThumbprint)
-}
diff --git a/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/client.go b/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/client.go
index a64fa4de7483..ba2be90e1e99 100644
--- a/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/client.go
+++ b/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/client.go
@@ -99,6 +99,10 @@ func (client BaseClient) CheckDomainAvailability(ctx context.Context, parameters
// CheckDomainAvailabilityPreparer prepares the CheckDomainAvailability request.
func (client BaseClient) CheckDomainAvailabilityPreparer(ctx context.Context, parameters CheckDomainAvailabilityParameter) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
const APIVersion = "2017-04-18"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
@@ -108,7 +112,7 @@ func (client BaseClient) CheckDomainAvailabilityPreparer(ctx context.Context, pa
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/providers/Microsoft.CognitiveServices/checkDomainAvailability"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/checkDomainAvailability", pathParameters),
autorest.WithJSON(parameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
@@ -117,7 +121,7 @@ func (client BaseClient) CheckDomainAvailabilityPreparer(ctx context.Context, pa
// CheckDomainAvailabilitySender sends the CheckDomainAvailability request. The method will close the
// http.Response Body if it receives an error.
func (client BaseClient) CheckDomainAvailabilitySender(req *http.Request) (*http.Response, error) {
- sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
return autorest.SendWithSender(client, req, sd...)
}
diff --git a/services/cognitiveservices/v1.0/computervision/client.go b/services/cognitiveservices/v1.0/computervision/client.go
deleted file mode 100644
index 495cefecccd7..000000000000
--- a/services/cognitiveservices/v1.0/computervision/client.go
+++ /dev/null
@@ -1,1338 +0,0 @@
-// Package computervision implements the Azure ARM Computervision service API version 1.0.
-//
-// The Computer Vision API provides state-of-the-art algorithms to process images and return information. For example,
-// it can be used to determine if an image contains mature content, or it can be used to find all the faces in an
-// image. It also has other features like estimating dominant and accent colors, categorizing the content of images,
-// and describing an image with complete English sentences. Additionally, it can also intelligently generate images
-// thumbnails for displaying large images effectively.
-package computervision
-
-// 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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/validation"
- "io"
- "net/http"
-)
-
-// BaseClient is the base client for Computervision.
-type BaseClient struct {
- autorest.Client
- AzureRegion AzureRegions
-}
-
-// New creates an instance of the BaseClient client.
-func New(azureRegion AzureRegions) BaseClient {
- return NewWithoutDefaults(azureRegion)
-}
-
-// NewWithoutDefaults creates an instance of the BaseClient client.
-func NewWithoutDefaults(azureRegion AzureRegions) BaseClient {
- return BaseClient{
- Client: autorest.NewClientWithUserAgent(UserAgent()),
- AzureRegion: azureRegion,
- }
-}
-
-// AnalyzeImage this operation extracts a rich set of visual features based on the image content. Two input methods are
-// supported -- (1) Uploading an image or (2) specifying an image URL. Within your request, there is an optional
-// parameter to allow you to choose which features to return. By default, image categories are returned in the
-// response.
-// Parameters:
-// imageURL - a JSON document with a URL pointing to the image that is to be analyzed.
-// visualFeatures - a string indicating what visual feature types to return. Multiple values should be
-// comma-separated. Valid visual feature types include:Categories - categorizes image content according to a
-// taxonomy defined in documentation. Tags - tags the image with a detailed list of words related to the image
-// content. Description - describes the image content with a complete English sentence. Faces - detects if
-// faces are present. If present, generate coordinates, gender and age. ImageType - detects if image is clipart
-// or a line drawing. Color - determines the accent color, dominant color, and whether an image is
-// black&white.Adult - detects if the image is pornographic in nature (depicts nudity or a sex act). Sexually
-// suggestive content is also detected.
-// details - a string indicating which domain-specific details to return. Multiple values should be
-// comma-separated. Valid visual feature types include:Celebrities - identifies celebrities if detected in the
-// image.
-// language - the desired language for output generation. If this parameter is not specified, the default value
-// is "en".Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese,
-// zh - Simplified Chinese.
-func (client BaseClient) AnalyzeImage(ctx context.Context, imageURL ImageURL, visualFeatures []VisualFeatureTypes, details []Details, language string) (result ImageAnalysis, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: imageURL,
- Constraints: []validation.Constraint{{Target: "imageURL.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("computervision.BaseClient", "AnalyzeImage", err.Error())
- }
-
- req, err := client.AnalyzeImagePreparer(ctx, imageURL, visualFeatures, details, language)
- if err != nil {
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImage", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AnalyzeImageSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImage", resp, "Failure sending request")
- return
- }
-
- result, err = client.AnalyzeImageResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImage", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AnalyzeImagePreparer prepares the AnalyzeImage request.
-func (client BaseClient) AnalyzeImagePreparer(ctx context.Context, imageURL ImageURL, visualFeatures []VisualFeatureTypes, details []Details, language string) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- queryParameters := map[string]interface{}{}
- if visualFeatures != nil && len(visualFeatures) > 0 {
- queryParameters["visualFeatures"] = autorest.Encode("query", visualFeatures, ",")
- }
- if details != nil && len(details) > 0 {
- queryParameters["details"] = autorest.Encode("query", details, ",")
- }
- if len(string(language)) > 0 {
- queryParameters["language"] = autorest.Encode("query", language)
- } else {
- queryParameters["language"] = autorest.Encode("query", "en")
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.0", urlParameters),
- autorest.WithPath("/analyze"),
- autorest.WithJSON(imageURL),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AnalyzeImageSender sends the AnalyzeImage request. The method will close the
-// http.Response Body if it receives an error.
-func (client BaseClient) AnalyzeImageSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AnalyzeImageResponder handles the response to the AnalyzeImage request. The method always
-// closes the http.Response Body.
-func (client BaseClient) AnalyzeImageResponder(resp *http.Response) (result ImageAnalysis, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// AnalyzeImageByDomain this operation recognizes content within an image by applying a domain-specific model. The
-// list of domain-specific models that are supported by the Computer Vision API can be retrieved using the /models GET
-// request. Currently, the API only provides a single domain-specific model: celebrities. Two input methods are
-// supported -- (1) Uploading an image or (2) specifying an image URL. A successful response will be returned in JSON.
-// If the request failed, the response will contain an error code and a message to help understand what went wrong.
-// Parameters:
-// model - the domain-specific content to recognize.
-// imageURL - a JSON document with a URL pointing to the image that is to be analyzed.
-// language - the desired language for output generation. If this parameter is not specified, the default value
-// is "en".Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese,
-// zh - Simplified Chinese.
-func (client BaseClient) AnalyzeImageByDomain(ctx context.Context, model string, imageURL ImageURL, language string) (result DomainModelResults, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: imageURL,
- Constraints: []validation.Constraint{{Target: "imageURL.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("computervision.BaseClient", "AnalyzeImageByDomain", err.Error())
- }
-
- req, err := client.AnalyzeImageByDomainPreparer(ctx, model, imageURL, language)
- if err != nil {
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImageByDomain", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AnalyzeImageByDomainSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImageByDomain", resp, "Failure sending request")
- return
- }
-
- result, err = client.AnalyzeImageByDomainResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImageByDomain", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AnalyzeImageByDomainPreparer prepares the AnalyzeImageByDomain request.
-func (client BaseClient) AnalyzeImageByDomainPreparer(ctx context.Context, model string, imageURL ImageURL, language string) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "model": autorest.Encode("path", model),
- }
-
- queryParameters := map[string]interface{}{}
- if len(string(language)) > 0 {
- queryParameters["language"] = autorest.Encode("query", language)
- } else {
- queryParameters["language"] = autorest.Encode("query", "en")
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.0", urlParameters),
- autorest.WithPathParameters("/models/{model}/analyze", pathParameters),
- autorest.WithJSON(imageURL),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AnalyzeImageByDomainSender sends the AnalyzeImageByDomain request. The method will close the
-// http.Response Body if it receives an error.
-func (client BaseClient) AnalyzeImageByDomainSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AnalyzeImageByDomainResponder handles the response to the AnalyzeImageByDomain request. The method always
-// closes the http.Response Body.
-func (client BaseClient) AnalyzeImageByDomainResponder(resp *http.Response) (result DomainModelResults, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// AnalyzeImageByDomainInStream this operation recognizes content within an image by applying a domain-specific model.
-// The list of domain-specific models that are supported by the Computer Vision API can be retrieved using the /models
-// GET request. Currently, the API only provides a single domain-specific model: celebrities. Two input methods are
-// supported -- (1) Uploading an image or (2) specifying an image URL. A successful response will be returned in JSON.
-// If the request failed, the response will contain an error code and a message to help understand what went wrong.
-// Parameters:
-// model - the domain-specific content to recognize.
-// imageParameter - an image stream.
-// language - the desired language for output generation. If this parameter is not specified, the default value
-// is "en".Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese,
-// zh - Simplified Chinese.
-func (client BaseClient) AnalyzeImageByDomainInStream(ctx context.Context, model string, imageParameter io.ReadCloser, language string) (result DomainModelResults, err error) {
- req, err := client.AnalyzeImageByDomainInStreamPreparer(ctx, model, imageParameter, language)
- if err != nil {
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImageByDomainInStream", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AnalyzeImageByDomainInStreamSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImageByDomainInStream", resp, "Failure sending request")
- return
- }
-
- result, err = client.AnalyzeImageByDomainInStreamResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImageByDomainInStream", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AnalyzeImageByDomainInStreamPreparer prepares the AnalyzeImageByDomainInStream request.
-func (client BaseClient) AnalyzeImageByDomainInStreamPreparer(ctx context.Context, model string, imageParameter io.ReadCloser, language string) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "model": autorest.Encode("path", model),
- }
-
- queryParameters := map[string]interface{}{}
- if len(string(language)) > 0 {
- queryParameters["language"] = autorest.Encode("query", language)
- } else {
- queryParameters["language"] = autorest.Encode("query", "en")
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/octet-stream"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.0", urlParameters),
- autorest.WithPathParameters("/models/{model}/analyze", pathParameters),
- autorest.WithFile(imageParameter),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AnalyzeImageByDomainInStreamSender sends the AnalyzeImageByDomainInStream request. The method will close the
-// http.Response Body if it receives an error.
-func (client BaseClient) AnalyzeImageByDomainInStreamSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AnalyzeImageByDomainInStreamResponder handles the response to the AnalyzeImageByDomainInStream request. The method always
-// closes the http.Response Body.
-func (client BaseClient) AnalyzeImageByDomainInStreamResponder(resp *http.Response) (result DomainModelResults, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// AnalyzeImageInStream this operation extracts a rich set of visual features based on the image content.
-// Parameters:
-// imageParameter - an image stream.
-// visualFeatures - a string indicating what visual feature types to return. Multiple values should be
-// comma-separated. Valid visual feature types include:Categories - categorizes image content according to a
-// taxonomy defined in documentation. Tags - tags the image with a detailed list of words related to the image
-// content. Description - describes the image content with a complete English sentence. Faces - detects if
-// faces are present. If present, generate coordinates, gender and age. ImageType - detects if image is clipart
-// or a line drawing. Color - determines the accent color, dominant color, and whether an image is
-// black&white.Adult - detects if the image is pornographic in nature (depicts nudity or a sex act). Sexually
-// suggestive content is also detected.
-// details - a string indicating which domain-specific details to return. Multiple values should be
-// comma-separated. Valid visual feature types include:Celebrities - identifies celebrities if detected in the
-// image.
-// language - the desired language for output generation. If this parameter is not specified, the default value
-// is "en".Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese,
-// zh - Simplified Chinese.
-func (client BaseClient) AnalyzeImageInStream(ctx context.Context, imageParameter io.ReadCloser, visualFeatures []VisualFeatureTypes, details string, language string) (result ImageAnalysis, err error) {
- req, err := client.AnalyzeImageInStreamPreparer(ctx, imageParameter, visualFeatures, details, language)
- if err != nil {
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImageInStream", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AnalyzeImageInStreamSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImageInStream", resp, "Failure sending request")
- return
- }
-
- result, err = client.AnalyzeImageInStreamResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImageInStream", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AnalyzeImageInStreamPreparer prepares the AnalyzeImageInStream request.
-func (client BaseClient) AnalyzeImageInStreamPreparer(ctx context.Context, imageParameter io.ReadCloser, visualFeatures []VisualFeatureTypes, details string, language string) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- queryParameters := map[string]interface{}{}
- if visualFeatures != nil && len(visualFeatures) > 0 {
- queryParameters["visualFeatures"] = autorest.Encode("query", visualFeatures, ",")
- }
- if len(string(details)) > 0 {
- queryParameters["details"] = autorest.Encode("query", details)
- }
- if len(string(language)) > 0 {
- queryParameters["language"] = autorest.Encode("query", language)
- } else {
- queryParameters["language"] = autorest.Encode("query", "en")
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/octet-stream"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.0", urlParameters),
- autorest.WithPath("/analyze"),
- autorest.WithFile(imageParameter),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AnalyzeImageInStreamSender sends the AnalyzeImageInStream request. The method will close the
-// http.Response Body if it receives an error.
-func (client BaseClient) AnalyzeImageInStreamSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AnalyzeImageInStreamResponder handles the response to the AnalyzeImageInStream request. The method always
-// closes the http.Response Body.
-func (client BaseClient) AnalyzeImageInStreamResponder(resp *http.Response) (result ImageAnalysis, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// DescribeImage this operation generates a description of an image in human readable language with complete sentences.
-// The description is based on a collection of content tags, which are also returned by the operation. More than one
-// description can be generated for each image. Descriptions are ordered by their confidence score. All descriptions
-// are in English. Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL.A
-// successful response will be returned in JSON. If the request failed, the response will contain an error code and a
-// message to help understand what went wrong.
-// Parameters:
-// imageURL - a JSON document with a URL pointing to the image that is to be analyzed.
-// maxCandidates - maximum number of candidate descriptions to be returned. The default is 1.
-// language - the desired language for output generation. If this parameter is not specified, the default value
-// is "en".Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese,
-// zh - Simplified Chinese.
-func (client BaseClient) DescribeImage(ctx context.Context, imageURL ImageURL, maxCandidates string, language string) (result ImageDescription, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: imageURL,
- Constraints: []validation.Constraint{{Target: "imageURL.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("computervision.BaseClient", "DescribeImage", err.Error())
- }
-
- req, err := client.DescribeImagePreparer(ctx, imageURL, maxCandidates, language)
- if err != nil {
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "DescribeImage", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DescribeImageSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "DescribeImage", resp, "Failure sending request")
- return
- }
-
- result, err = client.DescribeImageResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "DescribeImage", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DescribeImagePreparer prepares the DescribeImage request.
-func (client BaseClient) DescribeImagePreparer(ctx context.Context, imageURL ImageURL, maxCandidates string, language string) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- queryParameters := map[string]interface{}{}
- if len(maxCandidates) > 0 {
- queryParameters["maxCandidates"] = autorest.Encode("query", maxCandidates)
- } else {
- queryParameters["maxCandidates"] = autorest.Encode("query", "1")
- }
- if len(string(language)) > 0 {
- queryParameters["language"] = autorest.Encode("query", language)
- } else {
- queryParameters["language"] = autorest.Encode("query", "en")
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.0", urlParameters),
- autorest.WithPath("/describe"),
- autorest.WithJSON(imageURL),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DescribeImageSender sends the DescribeImage request. The method will close the
-// http.Response Body if it receives an error.
-func (client BaseClient) DescribeImageSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DescribeImageResponder handles the response to the DescribeImage request. The method always
-// closes the http.Response Body.
-func (client BaseClient) DescribeImageResponder(resp *http.Response) (result ImageDescription, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// DescribeImageInStream this operation generates a description of an image in human readable language with complete
-// sentences. The description is based on a collection of content tags, which are also returned by the operation. More
-// than one description can be generated for each image. Descriptions are ordered by their confidence score. All
-// descriptions are in English. Two input methods are supported -- (1) Uploading an image or (2) specifying an image
-// URL.A successful response will be returned in JSON. If the request failed, the response will contain an error code
-// and a message to help understand what went wrong.
-// Parameters:
-// imageParameter - an image stream.
-// maxCandidates - maximum number of candidate descriptions to be returned. The default is 1.
-// language - the desired language for output generation. If this parameter is not specified, the default value
-// is "en".Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese,
-// zh - Simplified Chinese.
-func (client BaseClient) DescribeImageInStream(ctx context.Context, imageParameter io.ReadCloser, maxCandidates string, language string) (result ImageDescription, err error) {
- req, err := client.DescribeImageInStreamPreparer(ctx, imageParameter, maxCandidates, language)
- if err != nil {
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "DescribeImageInStream", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DescribeImageInStreamSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "DescribeImageInStream", resp, "Failure sending request")
- return
- }
-
- result, err = client.DescribeImageInStreamResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "DescribeImageInStream", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DescribeImageInStreamPreparer prepares the DescribeImageInStream request.
-func (client BaseClient) DescribeImageInStreamPreparer(ctx context.Context, imageParameter io.ReadCloser, maxCandidates string, language string) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- queryParameters := map[string]interface{}{}
- if len(maxCandidates) > 0 {
- queryParameters["maxCandidates"] = autorest.Encode("query", maxCandidates)
- } else {
- queryParameters["maxCandidates"] = autorest.Encode("query", "1")
- }
- if len(string(language)) > 0 {
- queryParameters["language"] = autorest.Encode("query", language)
- } else {
- queryParameters["language"] = autorest.Encode("query", "en")
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/octet-stream"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.0", urlParameters),
- autorest.WithPath("/describe"),
- autorest.WithFile(imageParameter),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DescribeImageInStreamSender sends the DescribeImageInStream request. The method will close the
-// http.Response Body if it receives an error.
-func (client BaseClient) DescribeImageInStreamSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DescribeImageInStreamResponder handles the response to the DescribeImageInStream request. The method always
-// closes the http.Response Body.
-func (client BaseClient) DescribeImageInStreamResponder(resp *http.Response) (result ImageDescription, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GenerateThumbnail this operation generates a thumbnail image with the user-specified width and height. By default,
-// the service analyzes the image, identifies the region of interest (ROI), and generates smart cropping coordinates
-// based on the ROI. Smart cropping helps when you specify an aspect ratio that differs from that of the input image. A
-// successful response contains the thumbnail image binary. If the request failed, the response contains an error code
-// and a message to help determine what went wrong.
-// Parameters:
-// width - width of the thumbnail. It must be between 1 and 1024. Recommended minimum of 50.
-// height - height of the thumbnail. It must be between 1 and 1024. Recommended minimum of 50.
-// imageURL - a JSON document with a URL pointing to the image that is to be analyzed.
-// smartCropping - boolean flag for enabling smart cropping.
-func (client BaseClient) GenerateThumbnail(ctx context.Context, width int32, height int32, imageURL ImageURL, smartCropping *bool) (result ReadCloser, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: width,
- Constraints: []validation.Constraint{{Target: "width", Name: validation.InclusiveMaximum, Rule: 1023, Chain: nil},
- {Target: "width", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}},
- {TargetValue: height,
- Constraints: []validation.Constraint{{Target: "height", Name: validation.InclusiveMaximum, Rule: 1023, Chain: nil},
- {Target: "height", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}},
- {TargetValue: imageURL,
- Constraints: []validation.Constraint{{Target: "imageURL.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("computervision.BaseClient", "GenerateThumbnail", err.Error())
- }
-
- req, err := client.GenerateThumbnailPreparer(ctx, width, height, imageURL, smartCropping)
- if err != nil {
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GenerateThumbnail", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GenerateThumbnailSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GenerateThumbnail", resp, "Failure sending request")
- return
- }
-
- result, err = client.GenerateThumbnailResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GenerateThumbnail", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GenerateThumbnailPreparer prepares the GenerateThumbnail request.
-func (client BaseClient) GenerateThumbnailPreparer(ctx context.Context, width int32, height int32, imageURL ImageURL, smartCropping *bool) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- queryParameters := map[string]interface{}{
- "height": autorest.Encode("query", height),
- "width": autorest.Encode("query", width),
- }
- if smartCropping != nil {
- queryParameters["smartCropping"] = autorest.Encode("query", *smartCropping)
- } else {
- queryParameters["smartCropping"] = autorest.Encode("query", false)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.0", urlParameters),
- autorest.WithPath("/generateThumbnail"),
- autorest.WithJSON(imageURL),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GenerateThumbnailSender sends the GenerateThumbnail request. The method will close the
-// http.Response Body if it receives an error.
-func (client BaseClient) GenerateThumbnailSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GenerateThumbnailResponder handles the response to the GenerateThumbnail request. The method always
-// closes the http.Response Body.
-func (client BaseClient) GenerateThumbnailResponder(resp *http.Response) (result ReadCloser, err error) {
- result.Value = &resp.Body
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK))
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GenerateThumbnailInStream this operation generates a thumbnail image with the user-specified width and height. By
-// default, the service analyzes the image, identifies the region of interest (ROI), and generates smart cropping
-// coordinates based on the ROI. Smart cropping helps when you specify an aspect ratio that differs from that of the
-// input image. A successful response contains the thumbnail image binary. If the request failed, the response contains
-// an error code and a message to help determine what went wrong.
-// Parameters:
-// width - width of the thumbnail. It must be between 1 and 1024. Recommended minimum of 50.
-// height - height of the thumbnail. It must be between 1 and 1024. Recommended minimum of 50.
-// imageParameter - an image stream.
-// smartCropping - boolean flag for enabling smart cropping.
-func (client BaseClient) GenerateThumbnailInStream(ctx context.Context, width int32, height int32, imageParameter io.ReadCloser, smartCropping *bool) (result ReadCloser, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: width,
- Constraints: []validation.Constraint{{Target: "width", Name: validation.InclusiveMaximum, Rule: 1023, Chain: nil},
- {Target: "width", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}},
- {TargetValue: height,
- Constraints: []validation.Constraint{{Target: "height", Name: validation.InclusiveMaximum, Rule: 1023, Chain: nil},
- {Target: "height", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}); err != nil {
- return result, validation.NewError("computervision.BaseClient", "GenerateThumbnailInStream", err.Error())
- }
-
- req, err := client.GenerateThumbnailInStreamPreparer(ctx, width, height, imageParameter, smartCropping)
- if err != nil {
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GenerateThumbnailInStream", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GenerateThumbnailInStreamSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GenerateThumbnailInStream", resp, "Failure sending request")
- return
- }
-
- result, err = client.GenerateThumbnailInStreamResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GenerateThumbnailInStream", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GenerateThumbnailInStreamPreparer prepares the GenerateThumbnailInStream request.
-func (client BaseClient) GenerateThumbnailInStreamPreparer(ctx context.Context, width int32, height int32, imageParameter io.ReadCloser, smartCropping *bool) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- queryParameters := map[string]interface{}{
- "height": autorest.Encode("query", height),
- "width": autorest.Encode("query", width),
- }
- if smartCropping != nil {
- queryParameters["smartCropping"] = autorest.Encode("query", *smartCropping)
- } else {
- queryParameters["smartCropping"] = autorest.Encode("query", false)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/octet-stream"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.0", urlParameters),
- autorest.WithPath("/generateThumbnail"),
- autorest.WithFile(imageParameter),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GenerateThumbnailInStreamSender sends the GenerateThumbnailInStream request. The method will close the
-// http.Response Body if it receives an error.
-func (client BaseClient) GenerateThumbnailInStreamSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GenerateThumbnailInStreamResponder handles the response to the GenerateThumbnailInStream request. The method always
-// closes the http.Response Body.
-func (client BaseClient) GenerateThumbnailInStreamResponder(resp *http.Response) (result ReadCloser, err error) {
- result.Value = &resp.Body
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK))
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetTextOperationResult this interface is used for getting text operation result. The URL to this interface should be
-// retrieved from 'Operation-Location' field returned from Recognize Text interface.
-// Parameters:
-// operationID - id of the text operation returned in the response of the 'Recognize Handwritten Text'
-func (client BaseClient) GetTextOperationResult(ctx context.Context, operationID string) (result TextOperationResult, err error) {
- req, err := client.GetTextOperationResultPreparer(ctx, operationID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GetTextOperationResult", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetTextOperationResultSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GetTextOperationResult", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetTextOperationResultResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GetTextOperationResult", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetTextOperationResultPreparer prepares the GetTextOperationResult request.
-func (client BaseClient) GetTextOperationResultPreparer(ctx context.Context, operationID string) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "operationId": autorest.Encode("path", operationID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.0", urlParameters),
- autorest.WithPathParameters("/textOperations/{operationId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetTextOperationResultSender sends the GetTextOperationResult request. The method will close the
-// http.Response Body if it receives an error.
-func (client BaseClient) GetTextOperationResultSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetTextOperationResultResponder handles the response to the GetTextOperationResult request. The method always
-// closes the http.Response Body.
-func (client BaseClient) GetTextOperationResultResponder(resp *http.Response) (result TextOperationResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListModels this operation returns the list of domain-specific models that are supported by the Computer Vision API.
-// Currently, the API only supports one domain-specific model: a celebrity recognizer. A successful response will be
-// returned in JSON. If the request failed, the response will contain an error code and a message to help understand
-// what went wrong.
-func (client BaseClient) ListModels(ctx context.Context) (result ListModelsResult, err error) {
- req, err := client.ListModelsPreparer(ctx)
- if err != nil {
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "ListModels", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListModelsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "ListModels", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListModelsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "ListModels", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListModelsPreparer prepares the ListModels request.
-func (client BaseClient) ListModelsPreparer(ctx context.Context) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.0", urlParameters),
- autorest.WithPath("/models"))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListModelsSender sends the ListModels request. The method will close the
-// http.Response Body if it receives an error.
-func (client BaseClient) ListModelsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListModelsResponder handles the response to the ListModels request. The method always
-// closes the http.Response Body.
-func (client BaseClient) ListModelsResponder(resp *http.Response) (result ListModelsResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// RecognizePrintedText optical Character Recognition (OCR) detects printed text in an image and extracts the
-// recognized characters into a machine-usable character stream. Upon success, the OCR results will be returned. Upon
-// failure, the error code together with an error message will be returned. The error code can be one of
-// InvalidImageUrl, InvalidImageFormat, InvalidImageSize, NotSupportedImage, NotSupportedLanguage, or
-// InternalServerError.
-// Parameters:
-// detectOrientation - whether detect the text orientation in the image. With detectOrientation=true the OCR
-// service tries to detect the image orientation and correct it before further processing (e.g. if it's
-// upside-down).
-// imageURL - a JSON document with a URL pointing to the image that is to be analyzed.
-// language - the BCP-47 language code of the text to be detected in the image. The default value is 'unk'
-func (client BaseClient) RecognizePrintedText(ctx context.Context, detectOrientation bool, imageURL ImageURL, language OcrLanguages) (result OcrResult, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: imageURL,
- Constraints: []validation.Constraint{{Target: "imageURL.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("computervision.BaseClient", "RecognizePrintedText", err.Error())
- }
-
- req, err := client.RecognizePrintedTextPreparer(ctx, detectOrientation, imageURL, language)
- if err != nil {
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizePrintedText", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.RecognizePrintedTextSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizePrintedText", resp, "Failure sending request")
- return
- }
-
- result, err = client.RecognizePrintedTextResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizePrintedText", resp, "Failure responding to request")
- }
-
- return
-}
-
-// RecognizePrintedTextPreparer prepares the RecognizePrintedText request.
-func (client BaseClient) RecognizePrintedTextPreparer(ctx context.Context, detectOrientation bool, imageURL ImageURL, language OcrLanguages) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- queryParameters := map[string]interface{}{
- "detectOrientation": autorest.Encode("query", detectOrientation),
- }
- if len(string(language)) > 0 {
- queryParameters["language"] = autorest.Encode("query", language)
- } else {
- queryParameters["language"] = autorest.Encode("query", "unk")
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.0", urlParameters),
- autorest.WithPath("/ocr"),
- autorest.WithJSON(imageURL),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// RecognizePrintedTextSender sends the RecognizePrintedText request. The method will close the
-// http.Response Body if it receives an error.
-func (client BaseClient) RecognizePrintedTextSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// RecognizePrintedTextResponder handles the response to the RecognizePrintedText request. The method always
-// closes the http.Response Body.
-func (client BaseClient) RecognizePrintedTextResponder(resp *http.Response) (result OcrResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// RecognizePrintedTextInStream optical Character Recognition (OCR) detects printed text in an image and extracts the
-// recognized characters into a machine-usable character stream. Upon success, the OCR results will be returned. Upon
-// failure, the error code together with an error message will be returned. The error code can be one of
-// InvalidImageUrl, InvalidImageFormat, InvalidImageSize, NotSupportedImage, NotSupportedLanguage, or
-// InternalServerError.
-// Parameters:
-// detectOrientation - whether detect the text orientation in the image. With detectOrientation=true the OCR
-// service tries to detect the image orientation and correct it before further processing (e.g. if it's
-// upside-down).
-// imageParameter - an image stream.
-// language - the BCP-47 language code of the text to be detected in the image. The default value is 'unk'
-func (client BaseClient) RecognizePrintedTextInStream(ctx context.Context, detectOrientation bool, imageParameter io.ReadCloser, language OcrLanguages) (result OcrResult, err error) {
- req, err := client.RecognizePrintedTextInStreamPreparer(ctx, detectOrientation, imageParameter, language)
- if err != nil {
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizePrintedTextInStream", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.RecognizePrintedTextInStreamSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizePrintedTextInStream", resp, "Failure sending request")
- return
- }
-
- result, err = client.RecognizePrintedTextInStreamResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizePrintedTextInStream", resp, "Failure responding to request")
- }
-
- return
-}
-
-// RecognizePrintedTextInStreamPreparer prepares the RecognizePrintedTextInStream request.
-func (client BaseClient) RecognizePrintedTextInStreamPreparer(ctx context.Context, detectOrientation bool, imageParameter io.ReadCloser, language OcrLanguages) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- queryParameters := map[string]interface{}{
- "detectOrientation": autorest.Encode("query", detectOrientation),
- }
- if len(string(language)) > 0 {
- queryParameters["language"] = autorest.Encode("query", language)
- } else {
- queryParameters["language"] = autorest.Encode("query", "unk")
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/octet-stream"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.0", urlParameters),
- autorest.WithPath("/ocr"),
- autorest.WithFile(imageParameter),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// RecognizePrintedTextInStreamSender sends the RecognizePrintedTextInStream request. The method will close the
-// http.Response Body if it receives an error.
-func (client BaseClient) RecognizePrintedTextInStreamSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// RecognizePrintedTextInStreamResponder handles the response to the RecognizePrintedTextInStream request. The method always
-// closes the http.Response Body.
-func (client BaseClient) RecognizePrintedTextInStreamResponder(resp *http.Response) (result OcrResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// RecognizeText recognize Text operation. When you use the Recognize Text interface, the response contains a field
-// called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get
-// Handwritten Text Operation Result operation.
-// Parameters:
-// imageURL - a JSON document with a URL pointing to the image that is to be analyzed.
-// detectHandwriting - if 'true' is specified, handwriting recognition is performed. If this parameter is set
-// to 'false' or is not specified, printed text recognition is performed.
-func (client BaseClient) RecognizeText(ctx context.Context, imageURL ImageURL, detectHandwriting *bool) (result autorest.Response, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: imageURL,
- Constraints: []validation.Constraint{{Target: "imageURL.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("computervision.BaseClient", "RecognizeText", err.Error())
- }
-
- req, err := client.RecognizeTextPreparer(ctx, imageURL, detectHandwriting)
- if err != nil {
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizeText", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.RecognizeTextSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizeText", resp, "Failure sending request")
- return
- }
-
- result, err = client.RecognizeTextResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizeText", resp, "Failure responding to request")
- }
-
- return
-}
-
-// RecognizeTextPreparer prepares the RecognizeText request.
-func (client BaseClient) RecognizeTextPreparer(ctx context.Context, imageURL ImageURL, detectHandwriting *bool) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- queryParameters := map[string]interface{}{}
- if detectHandwriting != nil {
- queryParameters["detectHandwriting"] = autorest.Encode("query", *detectHandwriting)
- } else {
- queryParameters["detectHandwriting"] = autorest.Encode("query", false)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.0", urlParameters),
- autorest.WithPath("/recognizeText"),
- autorest.WithJSON(imageURL),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// RecognizeTextSender sends the RecognizeText request. The method will close the
-// http.Response Body if it receives an error.
-func (client BaseClient) RecognizeTextSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// RecognizeTextResponder handles the response to the RecognizeText request. The method always
-// closes the http.Response Body.
-func (client BaseClient) RecognizeTextResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// RecognizeTextInStream recognize Text operation. When you use the Recognize Text interface, the response contains a
-// field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get
-// Handwritten Text Operation Result operation.
-// Parameters:
-// imageParameter - an image stream.
-// detectHandwriting - if 'true' is specified, handwriting recognition is performed. If this parameter is set
-// to 'false' or is not specified, printed text recognition is performed.
-func (client BaseClient) RecognizeTextInStream(ctx context.Context, imageParameter io.ReadCloser, detectHandwriting *bool) (result autorest.Response, err error) {
- req, err := client.RecognizeTextInStreamPreparer(ctx, imageParameter, detectHandwriting)
- if err != nil {
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizeTextInStream", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.RecognizeTextInStreamSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizeTextInStream", resp, "Failure sending request")
- return
- }
-
- result, err = client.RecognizeTextInStreamResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizeTextInStream", resp, "Failure responding to request")
- }
-
- return
-}
-
-// RecognizeTextInStreamPreparer prepares the RecognizeTextInStream request.
-func (client BaseClient) RecognizeTextInStreamPreparer(ctx context.Context, imageParameter io.ReadCloser, detectHandwriting *bool) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- queryParameters := map[string]interface{}{}
- if detectHandwriting != nil {
- queryParameters["detectHandwriting"] = autorest.Encode("query", *detectHandwriting)
- } else {
- queryParameters["detectHandwriting"] = autorest.Encode("query", false)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/octet-stream"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.0", urlParameters),
- autorest.WithPath("/recognizeText"),
- autorest.WithFile(imageParameter),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// RecognizeTextInStreamSender sends the RecognizeTextInStream request. The method will close the
-// http.Response Body if it receives an error.
-func (client BaseClient) RecognizeTextInStreamSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// RecognizeTextInStreamResponder handles the response to the RecognizeTextInStream request. The method always
-// closes the http.Response Body.
-func (client BaseClient) RecognizeTextInStreamResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// TagImage this operation generates a list of words, or tags, that are relevant to the content of the supplied image.
-// The Computer Vision API can return tags based on objects, living beings, scenery or actions found in images. Unlike
-// categories, tags are not organized according to a hierarchical classification system, but correspond to image
-// content. Tags may contain hints to avoid ambiguity or provide context, for example the tag 'cello' may be
-// accompanied by the hint 'musical instrument'. All tags are in English.
-// Parameters:
-// imageURL - a JSON document with a URL pointing to the image that is to be analyzed.
-// language - the desired language for output generation. If this parameter is not specified, the default value
-// is "en".Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese,
-// zh - Simplified Chinese.
-func (client BaseClient) TagImage(ctx context.Context, imageURL ImageURL, language string) (result TagResult, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: imageURL,
- Constraints: []validation.Constraint{{Target: "imageURL.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("computervision.BaseClient", "TagImage", err.Error())
- }
-
- req, err := client.TagImagePreparer(ctx, imageURL, language)
- if err != nil {
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "TagImage", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.TagImageSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "TagImage", resp, "Failure sending request")
- return
- }
-
- result, err = client.TagImageResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "TagImage", resp, "Failure responding to request")
- }
-
- return
-}
-
-// TagImagePreparer prepares the TagImage request.
-func (client BaseClient) TagImagePreparer(ctx context.Context, imageURL ImageURL, language string) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- queryParameters := map[string]interface{}{}
- if len(string(language)) > 0 {
- queryParameters["language"] = autorest.Encode("query", language)
- } else {
- queryParameters["language"] = autorest.Encode("query", "en")
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.0", urlParameters),
- autorest.WithPath("/tag"),
- autorest.WithJSON(imageURL),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// TagImageSender sends the TagImage request. The method will close the
-// http.Response Body if it receives an error.
-func (client BaseClient) TagImageSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// TagImageResponder handles the response to the TagImage request. The method always
-// closes the http.Response Body.
-func (client BaseClient) TagImageResponder(resp *http.Response) (result TagResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// TagImageInStream this operation generates a list of words, or tags, that are relevant to the content of the supplied
-// image. The Computer Vision API can return tags based on objects, living beings, scenery or actions found in images.
-// Unlike categories, tags are not organized according to a hierarchical classification system, but correspond to image
-// content. Tags may contain hints to avoid ambiguity or provide context, for example the tag 'cello' may be
-// accompanied by the hint 'musical instrument'. All tags are in English.
-// Parameters:
-// imageParameter - an image stream.
-// language - the desired language for output generation. If this parameter is not specified, the default value
-// is "en".Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese,
-// zh - Simplified Chinese.
-func (client BaseClient) TagImageInStream(ctx context.Context, imageParameter io.ReadCloser, language string) (result TagResult, err error) {
- req, err := client.TagImageInStreamPreparer(ctx, imageParameter, language)
- if err != nil {
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "TagImageInStream", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.TagImageInStreamSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "TagImageInStream", resp, "Failure sending request")
- return
- }
-
- result, err = client.TagImageInStreamResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "computervision.BaseClient", "TagImageInStream", resp, "Failure responding to request")
- }
-
- return
-}
-
-// TagImageInStreamPreparer prepares the TagImageInStream request.
-func (client BaseClient) TagImageInStreamPreparer(ctx context.Context, imageParameter io.ReadCloser, language string) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- queryParameters := map[string]interface{}{}
- if len(string(language)) > 0 {
- queryParameters["language"] = autorest.Encode("query", language)
- } else {
- queryParameters["language"] = autorest.Encode("query", "en")
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/octet-stream"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/vision/v1.0", urlParameters),
- autorest.WithPath("/tag"),
- autorest.WithFile(imageParameter),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// TagImageInStreamSender sends the TagImageInStream request. The method will close the
-// http.Response Body if it receives an error.
-func (client BaseClient) TagImageInStreamSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// TagImageInStreamResponder handles the response to the TagImageInStream request. The method always
-// closes the http.Response Body.
-func (client BaseClient) TagImageInStreamResponder(resp *http.Response) (result TagResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/services/cognitiveservices/v1.0/computervision/models.go b/services/cognitiveservices/v1.0/computervision/models.go
deleted file mode 100644
index d740047c3945..000000000000
--- a/services/cognitiveservices/v1.0/computervision/models.go
+++ /dev/null
@@ -1,551 +0,0 @@
-package computervision
-
-// 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 (
- "encoding/json"
- "github.com/Azure/go-autorest/autorest"
- "io"
-)
-
-// AzureRegions enumerates the values for azure regions.
-type AzureRegions string
-
-const (
- // Australiaeast ...
- Australiaeast AzureRegions = "australiaeast"
- // Brazilsouth ...
- Brazilsouth AzureRegions = "brazilsouth"
- // Eastasia ...
- Eastasia AzureRegions = "eastasia"
- // Eastus ...
- Eastus AzureRegions = "eastus"
- // Eastus2 ...
- Eastus2 AzureRegions = "eastus2"
- // Northeurope ...
- Northeurope AzureRegions = "northeurope"
- // Southcentralus ...
- Southcentralus AzureRegions = "southcentralus"
- // Southeastasia ...
- Southeastasia AzureRegions = "southeastasia"
- // Westcentralus ...
- Westcentralus AzureRegions = "westcentralus"
- // Westeurope ...
- Westeurope AzureRegions = "westeurope"
- // Westus ...
- Westus AzureRegions = "westus"
- // Westus2 ...
- Westus2 AzureRegions = "westus2"
-)
-
-// PossibleAzureRegionsValues returns an array of possible values for the AzureRegions const type.
-func PossibleAzureRegionsValues() []AzureRegions {
- return []AzureRegions{Australiaeast, Brazilsouth, Eastasia, Eastus, Eastus2, Northeurope, Southcentralus, Southeastasia, Westcentralus, Westeurope, Westus, Westus2}
-}
-
-// Details enumerates the values for details.
-type Details string
-
-const (
- // Celebrities ...
- Celebrities Details = "Celebrities"
- // Landmarks ...
- Landmarks Details = "Landmarks"
-)
-
-// PossibleDetailsValues returns an array of possible values for the Details const type.
-func PossibleDetailsValues() []Details {
- return []Details{Celebrities, Landmarks}
-}
-
-// ErrorCodes enumerates the values for error codes.
-type ErrorCodes string
-
-const (
- // BadArgument ...
- BadArgument ErrorCodes = "BadArgument"
- // FailedToProcess ...
- FailedToProcess ErrorCodes = "FailedToProcess"
- // InternalServerError ...
- InternalServerError ErrorCodes = "InternalServerError"
- // InvalidDetails ...
- InvalidDetails ErrorCodes = "InvalidDetails"
- // InvalidImageFormat ...
- InvalidImageFormat ErrorCodes = "InvalidImageFormat"
- // InvalidImageSize ...
- InvalidImageSize ErrorCodes = "InvalidImageSize"
- // InvalidImageURL ...
- InvalidImageURL ErrorCodes = "InvalidImageUrl"
- // NotSupportedImage ...
- NotSupportedImage ErrorCodes = "NotSupportedImage"
- // NotSupportedLanguage ...
- NotSupportedLanguage ErrorCodes = "NotSupportedLanguage"
- // NotSupportedVisualFeature ...
- NotSupportedVisualFeature ErrorCodes = "NotSupportedVisualFeature"
- // StorageException ...
- StorageException ErrorCodes = "StorageException"
- // Timeout ...
- Timeout ErrorCodes = "Timeout"
- // Unspecified ...
- Unspecified ErrorCodes = "Unspecified"
-)
-
-// PossibleErrorCodesValues returns an array of possible values for the ErrorCodes const type.
-func PossibleErrorCodesValues() []ErrorCodes {
- return []ErrorCodes{BadArgument, FailedToProcess, InternalServerError, InvalidDetails, InvalidImageFormat, InvalidImageSize, InvalidImageURL, NotSupportedImage, NotSupportedLanguage, NotSupportedVisualFeature, StorageException, Timeout, Unspecified}
-}
-
-// Gender enumerates the values for gender.
-type Gender string
-
-const (
- // Female ...
- Female Gender = "Female"
- // Male ...
- Male Gender = "Male"
-)
-
-// PossibleGenderValues returns an array of possible values for the Gender const type.
-func PossibleGenderValues() []Gender {
- return []Gender{Female, Male}
-}
-
-// OcrLanguages enumerates the values for ocr languages.
-type OcrLanguages string
-
-const (
- // Ar ...
- Ar OcrLanguages = "ar"
- // Cs ...
- Cs OcrLanguages = "cs"
- // Da ...
- Da OcrLanguages = "da"
- // De ...
- De OcrLanguages = "de"
- // El ...
- El OcrLanguages = "el"
- // En ...
- En OcrLanguages = "en"
- // Es ...
- Es OcrLanguages = "es"
- // Fi ...
- Fi OcrLanguages = "fi"
- // Fr ...
- Fr OcrLanguages = "fr"
- // Hu ...
- Hu OcrLanguages = "hu"
- // It ...
- It OcrLanguages = "it"
- // Ja ...
- Ja OcrLanguages = "ja"
- // Ko ...
- Ko OcrLanguages = "ko"
- // Nb ...
- Nb OcrLanguages = "nb"
- // Nl ...
- Nl OcrLanguages = "nl"
- // Pl ...
- Pl OcrLanguages = "pl"
- // Pt ...
- Pt OcrLanguages = "pt"
- // Ro ...
- Ro OcrLanguages = "ro"
- // Ru ...
- Ru OcrLanguages = "ru"
- // Sk ...
- Sk OcrLanguages = "sk"
- // SrCyrl ...
- SrCyrl OcrLanguages = "sr-Cyrl"
- // SrLatn ...
- SrLatn OcrLanguages = "sr-Latn"
- // Sv ...
- Sv OcrLanguages = "sv"
- // Tr ...
- Tr OcrLanguages = "tr"
- // Unk ...
- Unk OcrLanguages = "unk"
- // ZhHans ...
- ZhHans OcrLanguages = "zh-Hans"
- // ZhHant ...
- ZhHant OcrLanguages = "zh-Hant"
-)
-
-// PossibleOcrLanguagesValues returns an array of possible values for the OcrLanguages const type.
-func PossibleOcrLanguagesValues() []OcrLanguages {
- return []OcrLanguages{Ar, Cs, Da, De, El, En, Es, Fi, Fr, Hu, It, Ja, Ko, Nb, Nl, Pl, Pt, Ro, Ru, Sk, SrCyrl, SrLatn, Sv, Tr, Unk, ZhHans, ZhHant}
-}
-
-// TextOperationStatusCodes enumerates the values for text operation status codes.
-type TextOperationStatusCodes string
-
-const (
- // Failed ...
- Failed TextOperationStatusCodes = "Failed"
- // NotStarted ...
- NotStarted TextOperationStatusCodes = "Not Started"
- // Running ...
- Running TextOperationStatusCodes = "Running"
- // Succeeded ...
- Succeeded TextOperationStatusCodes = "Succeeded"
-)
-
-// PossibleTextOperationStatusCodesValues returns an array of possible values for the TextOperationStatusCodes const type.
-func PossibleTextOperationStatusCodesValues() []TextOperationStatusCodes {
- return []TextOperationStatusCodes{Failed, NotStarted, Running, Succeeded}
-}
-
-// VisualFeatureTypes enumerates the values for visual feature types.
-type VisualFeatureTypes string
-
-const (
- // VisualFeatureTypesAdult ...
- VisualFeatureTypesAdult VisualFeatureTypes = "Adult"
- // VisualFeatureTypesCategories ...
- VisualFeatureTypesCategories VisualFeatureTypes = "Categories"
- // VisualFeatureTypesColor ...
- VisualFeatureTypesColor VisualFeatureTypes = "Color"
- // VisualFeatureTypesDescription ...
- VisualFeatureTypesDescription VisualFeatureTypes = "Description"
- // VisualFeatureTypesFaces ...
- VisualFeatureTypesFaces VisualFeatureTypes = "Faces"
- // VisualFeatureTypesImageType ...
- VisualFeatureTypesImageType VisualFeatureTypes = "ImageType"
- // VisualFeatureTypesTags ...
- VisualFeatureTypesTags VisualFeatureTypes = "Tags"
-)
-
-// PossibleVisualFeatureTypesValues returns an array of possible values for the VisualFeatureTypes const type.
-func PossibleVisualFeatureTypesValues() []VisualFeatureTypes {
- return []VisualFeatureTypes{VisualFeatureTypesAdult, VisualFeatureTypesCategories, VisualFeatureTypesColor, VisualFeatureTypesDescription, VisualFeatureTypesFaces, VisualFeatureTypesImageType, VisualFeatureTypesTags}
-}
-
-// AdultInfo an object describing whether the image contains adult-oriented content and/or is racy.
-type AdultInfo struct {
- // IsAdultContent - A value indicating if the image contains adult-oriented content.
- IsAdultContent *bool `json:"isAdultContent,omitempty"`
- // IsRacyContent - A value indicating if the image is race.
- IsRacyContent *bool `json:"isRacyContent,omitempty"`
- // AdultScore - Score from 0 to 1 that indicates how much of adult content is within the image.
- AdultScore *float64 `json:"adultScore,omitempty"`
- // RacyScore - Score from 0 to 1 that indicates how suggestive is the image.
- RacyScore *float64 `json:"racyScore,omitempty"`
-}
-
-// Category an object describing identified category.
-type Category struct {
- // Name - Name of the category.
- Name *string `json:"name,omitempty"`
- // Score - Scoring of the category.
- Score *float64 `json:"score,omitempty"`
- Detail *CategoryDetail `json:"detail,omitempty"`
-}
-
-// CategoryDetail an object describing additional category details.
-type CategoryDetail struct {
- // Celebrities - An array of celebrities if any identified.
- Celebrities *[]CelebritiesModel `json:"celebrities,omitempty"`
-}
-
-// CelebritiesModel an object describing possible celebrity identification.
-type CelebritiesModel struct {
- // Name - Name of the celebrity.
- Name *string `json:"name,omitempty"`
- // Confidence - Level of confidence ranging from 0 to 1.
- Confidence *float64 `json:"confidence,omitempty"`
- FaceRectangle *FaceRectangle `json:"faceRectangle,omitempty"`
-}
-
-// CelebrityResults list of celebrities recognized in the image.
-type CelebrityResults struct {
- Celebrities *[]CelebritiesModel `json:"celebrities,omitempty"`
- // RequestID - Id of the REST API request.
- RequestID *string `json:"requestId,omitempty"`
- Metadata *ImageMetadata `json:"metadata,omitempty"`
-}
-
-// ColorInfo an object providing additional metadata describing color attributes.
-type ColorInfo struct {
- // DominantColorForeground - Possible dominant foreground color.
- DominantColorForeground *string `json:"dominantColorForeground,omitempty"`
- // DominantColorBackground - Possible dominant background color.
- DominantColorBackground *string `json:"dominantColorBackground,omitempty"`
- // DominantColors - An array of possible dominant colors.
- DominantColors *[]string `json:"dominantColors,omitempty"`
- // AccentColor - Possible accent color.
- AccentColor *string `json:"accentColor,omitempty"`
- // IsBWImg - A value indicating if the image is black and white.
- IsBWImg *bool `json:"isBWImg,omitempty"`
-}
-
-// DomainModelResults result of image analysis using a specific domain model including additional metadata.
-type DomainModelResults struct {
- autorest.Response `json:"-"`
- // Result - Model-specific response
- Result interface{} `json:"result,omitempty"`
- // RequestID - Id of the REST API request.
- RequestID *string `json:"requestId,omitempty"`
- Metadata *ImageMetadata `json:"metadata,omitempty"`
-}
-
-// Error ...
-type Error struct {
- // Code - The error code. Possible values include: 'InvalidImageURL', 'InvalidImageFormat', 'InvalidImageSize', 'NotSupportedVisualFeature', 'NotSupportedImage', 'InvalidDetails', 'NotSupportedLanguage', 'BadArgument', 'FailedToProcess', 'Timeout', 'InternalServerError', 'Unspecified', 'StorageException'
- Code ErrorCodes `json:"code,omitempty"`
- // Message - A message explaining the error reported by the service.
- Message *string `json:"message,omitempty"`
- // RequestID - A unique request identifier.
- RequestID *string `json:"requestId,omitempty"`
-}
-
-// FaceDescription an object describing a face identified in the image.
-type FaceDescription struct {
- // Age - Possible age of the face.
- Age *int32 `json:"age,omitempty"`
- // Gender - Possible gender of the face. Possible values include: 'Male', 'Female'
- Gender Gender `json:"gender,omitempty"`
- FaceRectangle *FaceRectangle `json:"faceRectangle,omitempty"`
-}
-
-// FaceRectangle an object describing face rectangle.
-type FaceRectangle struct {
- // Left - X-coordinate of the top left point of the face.
- Left *int32 `json:"left,omitempty"`
- // Top - Y-coordinate of the top left point of the face.
- Top *int32 `json:"top,omitempty"`
- // Width - Width measured from the top-left point of the face.
- Width *int32 `json:"width,omitempty"`
- // Height - Height measured from the top-left point of the face.
- Height *int32 `json:"height,omitempty"`
-}
-
-// ImageAnalysis result of AnalyzeImage operation.
-type ImageAnalysis struct {
- autorest.Response `json:"-"`
- // Categories - An array indicating identified categories.
- Categories *[]Category `json:"categories,omitempty"`
- Adult *AdultInfo `json:"adult,omitempty"`
- Color *ColorInfo `json:"color,omitempty"`
- ImageType *ImageType `json:"imageType,omitempty"`
- // Tags - A list of tags with confidence level.
- Tags *[]ImageTag `json:"tags,omitempty"`
- Description *ImageDescriptionDetails `json:"description,omitempty"`
- // Faces - An array of possible faces within the image.
- Faces *[]FaceDescription `json:"faces,omitempty"`
- // RequestID - Id of the request for tracking purposes.
- RequestID *string `json:"requestId,omitempty"`
- Metadata *ImageMetadata `json:"metadata,omitempty"`
-}
-
-// ImageCaption an image caption, i.e. a brief description of what the image depicts.
-type ImageCaption struct {
- // Text - The text of the caption
- Text *string `json:"text,omitempty"`
- // Confidence - The level of confidence the service has in the caption
- Confidence *float64 `json:"confidence,omitempty"`
-}
-
-// ImageDescription a collection of content tags, along with a list of captions sorted by confidence level, and
-// image metadata.
-type ImageDescription struct {
- autorest.Response `json:"-"`
- *ImageDescriptionDetails `json:"description,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for ImageDescription.
-func (ID ImageDescription) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if ID.ImageDescriptionDetails != nil {
- objectMap["description"] = ID.ImageDescriptionDetails
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for ImageDescription struct.
-func (ID *ImageDescription) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "description":
- if v != nil {
- var imageDescriptionDetails ImageDescriptionDetails
- err = json.Unmarshal(*v, &imageDescriptionDetails)
- if err != nil {
- return err
- }
- ID.ImageDescriptionDetails = &imageDescriptionDetails
- }
- }
- }
-
- return nil
-}
-
-// ImageDescriptionDetails a collection of content tags, along with a list of captions sorted by confidence level,
-// and image metadata.
-type ImageDescriptionDetails struct {
- // Tags - A collection of image tags.
- Tags *[]string `json:"tags,omitempty"`
- // Captions - A list of captions, sorted by confidence level.
- Captions *[]ImageCaption `json:"captions,omitempty"`
- // RequestID - Id of the REST API request.
- RequestID *string `json:"requestId,omitempty"`
- Metadata *ImageMetadata `json:"metadata,omitempty"`
-}
-
-// ImageMetadata image metadata
-type ImageMetadata struct {
- // Width - Image width
- Width *int32 `json:"width,omitempty"`
- // Height - Image height
- Height *int32 `json:"height,omitempty"`
- // Format - Image format
- Format *string `json:"format,omitempty"`
-}
-
-// ImageTag an image caption, i.e. a brief description of what the image depicts.
-type ImageTag struct {
- // Name - The tag value
- Name *string `json:"name,omitempty"`
- // Confidence - The level of confidence the service has in the caption
- Confidence *float64 `json:"confidence,omitempty"`
-}
-
-// ImageType an object providing possible image types and matching confidence levels.
-type ImageType struct {
- // ClipArtType - Confidence level that the image is a clip art.
- ClipArtType *float64 `json:"clipArtType,omitempty"`
- // LineDrawingType - Confidence level that the image is a line drawing.
- LineDrawingType *float64 `json:"lineDrawingType,omitempty"`
-}
-
-// ImageURL ...
-type ImageURL struct {
- // URL - Publicly reachable URL of an image
- URL *string `json:"url,omitempty"`
-}
-
-// LandmarkResults list of landmarks recognized in the image.
-type LandmarkResults struct {
- Landmarks *[]LandmarkResultsLandmarksItem `json:"landmarks,omitempty"`
- // RequestID - Id of the REST API request.
- RequestID *string `json:"requestId,omitempty"`
- Metadata *ImageMetadata `json:"metadata,omitempty"`
-}
-
-// LandmarkResultsLandmarksItem a landmark recognized in the image
-type LandmarkResultsLandmarksItem struct {
- // Name - Name of the landmark.
- Name *string `json:"name,omitempty"`
- // Confidence - Confidence level for the landmark recognition.
- Confidence *float64 `json:"confidence,omitempty"`
-}
-
-// Line ...
-type Line struct {
- BoundingBox *[]int32 `json:"boundingBox,omitempty"`
- Text *string `json:"text,omitempty"`
- Words *[]Word `json:"words,omitempty"`
-}
-
-// ListModelsResult result of the List Domain Models operation.
-type ListModelsResult struct {
- autorest.Response `json:"-"`
- // ModelsProperty - An array of supported models.
- ModelsProperty *[]ModelDescription `json:"models,omitempty"`
-}
-
-// ModelDescription an object describing supported model by name and categories.
-type ModelDescription struct {
- Name *string `json:"name,omitempty"`
- Categories *[]string `json:"categories,omitempty"`
-}
-
-// OcrLine an object describing a single recognized line of text.
-type OcrLine struct {
- // BoundingBox - Bounding box of a recognized line. The four integers represent the x-coordinate of the left edge, the y-coordinate of the top edge, width, and height of the bounding box, in the coordinate system of the input image, after it has been rotated around its center according to the detected text angle (see textAngle property), with the origin at the top-left corner, and the y-axis pointing down.
- BoundingBox *string `json:"boundingBox,omitempty"`
- // Words - An array of objects, where each object represents a recognized word.
- Words *[]OcrWord `json:"words,omitempty"`
-}
-
-// OcrRegion a region consists of multiple lines (e.g. a column of text in a multi-column document).
-type OcrRegion struct {
- // BoundingBox - Bounding box of a recognized region. The four integers represent the x-coordinate of the left edge, the y-coordinate of the top edge, width, and height of the bounding box, in the coordinate system of the input image, after it has been rotated around its center according to the detected text angle (see textAngle property), with the origin at the top-left corner, and the y-axis pointing down.
- BoundingBox *string `json:"boundingBox,omitempty"`
- Lines *[]OcrLine `json:"lines,omitempty"`
-}
-
-// OcrResult ...
-type OcrResult struct {
- autorest.Response `json:"-"`
- // Language - The BCP-47 language code of the text in the image.
- Language *string `json:"language,omitempty"`
- // TextAngle - The angle, in degrees, of the detected text with respect to the closest horizontal or vertical direction. After rotating the input image clockwise by this angle, the recognized text lines become horizontal or vertical. In combination with the orientation property it can be used to overlay recognition results correctly on the original image, by rotating either the original image or recognition results by a suitable angle around the center of the original image. If the angle cannot be confidently detected, this property is not present. If the image contains text at different angles, only part of the text will be recognized correctly.
- TextAngle *float64 `json:"textAngle,omitempty"`
- // Orientation - Orientation of the text recognized in the image. The value (up,down,left, or right) refers to the direction that the top of the recognized text is facing, after the image has been rotated around its center according to the detected text angle (see textAngle property).
- Orientation *string `json:"orientation,omitempty"`
- // Regions - An array of objects, where each object represents a region of recognized text.
- Regions *[]OcrRegion `json:"regions,omitempty"`
-}
-
-// OcrWord information on a recognized word.
-type OcrWord struct {
- // BoundingBox - Bounding box of a recognized word. The four integers represent the x-coordinate of the left edge, the y-coordinate of the top edge, width, and height of the bounding box, in the coordinate system of the input image, after it has been rotated around its center according to the detected text angle (see textAngle property), with the origin at the top-left corner, and the y-axis pointing down.
- BoundingBox *string `json:"boundingBox,omitempty"`
- // Text - String value of a recognized word.
- Text *string `json:"text,omitempty"`
-}
-
-// ReadCloser ...
-type ReadCloser struct {
- autorest.Response `json:"-"`
- Value *io.ReadCloser `json:"value,omitempty"`
-}
-
-// RecognitionResult ...
-type RecognitionResult struct {
- Lines *[]Line `json:"lines,omitempty"`
-}
-
-// TagResult the results of a image tag operation, including any tags and image metadata.
-type TagResult struct {
- autorest.Response `json:"-"`
- // Tags - A list of tags with confidence level.
- Tags *[]ImageTag `json:"tags,omitempty"`
- // RequestID - Id of the REST API request.
- RequestID *string `json:"requestId,omitempty"`
- Metadata *ImageMetadata `json:"metadata,omitempty"`
-}
-
-// TextOperationResult ...
-type TextOperationResult struct {
- autorest.Response `json:"-"`
- // Status - Status of the text operation. Possible values include: 'NotStarted', 'Running', 'Failed', 'Succeeded'
- Status TextOperationStatusCodes `json:"status,omitempty"`
- RecognitionResult *RecognitionResult `json:"recognitionResult,omitempty"`
-}
-
-// Word ...
-type Word struct {
- BoundingBox *[]int32 `json:"boundingBox,omitempty"`
- Text *string `json:"text,omitempty"`
-}
diff --git a/services/cognitiveservices/v1.0/computervision/version.go b/services/cognitiveservices/v1.0/computervision/version.go
deleted file mode 100644
index a25f5e0a9ea2..000000000000
--- a/services/cognitiveservices/v1.0/computervision/version.go
+++ /dev/null
@@ -1,30 +0,0 @@
-package computervision
-
-import "github.com/Azure/azure-sdk-for-go/version"
-
-// 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.
-
-// UserAgent returns the UserAgent string to use when sending http.Requests.
-func UserAgent() string {
- return "Azure-SDK-For-Go/" + version.Number + " computervision/1.0"
-}
-
-// Version returns the semantic version (see http://semver.org) of the client.
-func Version() string {
- return version.Number
-}
diff --git a/services/cognitiveservices/v1.0/localsearch/client.go b/services/cognitiveservices/v1.0/localsearch/client.go
index b23863673898..13b2c0290c80 100644
--- a/services/cognitiveservices/v1.0/localsearch/client.go
+++ b/services/cognitiveservices/v1.0/localsearch/client.go
@@ -28,7 +28,7 @@ import (
const (
// DefaultBaseURI is the default URI used for the service Localsearch
- DefaultBaseURI = "https://api.cognitive.microsoft.com/localbusinesses/v7.0/search"
+ DefaultBaseURI = "https://api.cognitive.microsoft.com/bing"
)
// BaseClient is the base client for Localsearch.
diff --git a/services/cognitiveservices/v1.0/localsearch/local.go b/services/cognitiveservices/v1.0/localsearch/local.go
index eac55bbe6914..667c0df99d1b 100644
--- a/services/cognitiveservices/v1.0/localsearch/local.go
+++ b/services/cognitiveservices/v1.0/localsearch/local.go
@@ -226,7 +226,7 @@ func (client LocalClient) SearchPreparer(ctx context.Context, query string, acce
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/localbusinesses/v7.0/search"),
+ autorest.WithPath("/v7.0/localbusinesses/search"),
autorest.WithQueryParameters(queryParameters),
autorest.WithHeader("X-BingApis-SDK", "true"))
if len(acceptLanguage) > 0 {
diff --git a/services/cognitiveservices/v1.0/spellcheck/client.go b/services/cognitiveservices/v1.0/spellcheck/client.go
index b76d0d64281b..89cc236c1f2e 100644
--- a/services/cognitiveservices/v1.0/spellcheck/client.go
+++ b/services/cognitiveservices/v1.0/spellcheck/client.go
@@ -216,7 +216,9 @@ func (client BaseClient) SpellCheckerMethodPreparer(ctx context.Context, textPar
"Endpoint": client.Endpoint,
}
- queryParameters := map[string]interface{}{}
+ queryParameters := map[string]interface{}{
+ "Text": autorest.Encode("query", textParameter),
+ }
if len(string(actionType)) > 0 {
queryParameters["ActionType"] = autorest.Encode("query", actionType)
}
@@ -244,18 +246,14 @@ func (client BaseClient) SpellCheckerMethodPreparer(ctx context.Context, textPar
if len(userID) > 0 {
queryParameters["UserId"] = autorest.Encode("query", userID)
}
-
- formDataParameters := map[string]interface{}{
- "Text": textParameter,
- }
if len(string(mode)) > 0 {
- formDataParameters["Mode"] = mode
+ queryParameters["Mode"] = autorest.Encode("query", mode)
}
if len(preContextText) > 0 {
- formDataParameters["PreContextText"] = preContextText
+ queryParameters["PreContextText"] = autorest.Encode("query", preContextText)
}
if len(postContextText) > 0 {
- formDataParameters["PostContextText"] = postContextText
+ queryParameters["PostContextText"] = autorest.Encode("query", postContextText)
}
preparer := autorest.CreatePreparer(
@@ -263,7 +261,6 @@ func (client BaseClient) SpellCheckerMethodPreparer(ctx context.Context, textPar
autorest.WithCustomBaseURL("{Endpoint}/bing/v7.0", urlParameters),
autorest.WithPath("/spellcheck"),
autorest.WithQueryParameters(queryParameters),
- autorest.WithFormData(autorest.MapToValues(formDataParameters)),
autorest.WithHeader("X-BingApis-SDK", "true"))
if len(acceptLanguage) > 0 {
preparer = autorest.DecoratePreparer(preparer,
diff --git a/services/cognitiveservices/v2.0/anomalyfinder/anomalyfinderapi/interfaces.go b/services/cognitiveservices/v2.0/anomalyfinder/anomalyfinderapi/interfaces.go
deleted file mode 100644
index 8207746acb0f..000000000000
--- a/services/cognitiveservices/v2.0/anomalyfinder/anomalyfinderapi/interfaces.go
+++ /dev/null
@@ -1,31 +0,0 @@
-package anomalyfinderapi
-
-// 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 (
- "context"
- "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/anomalyfinder"
-)
-
-// BaseClientAPI contains the set of methods on the BaseClient type.
-type BaseClientAPI interface {
- EntireDetect(ctx context.Context, body anomalyfinder.Request) (result anomalyfinder.EntireDetectResponse, err error)
- LastDetect(ctx context.Context, body anomalyfinder.Request) (result anomalyfinder.LastDetectResponse, err error)
-}
-
-var _ BaseClientAPI = (*anomalyfinder.BaseClient)(nil)
diff --git a/services/cognitiveservices/v2.0/anomalyfinder/client.go b/services/cognitiveservices/v2.0/anomalyfinder/client.go
deleted file mode 100644
index b02ba0768ddd..000000000000
--- a/services/cognitiveservices/v2.0/anomalyfinder/client.go
+++ /dev/null
@@ -1,208 +0,0 @@
-// Package anomalyfinder implements the Azure ARM Anomalyfinder service API version 2.0.
-//
-// The Anomaly Finder API detects anomalies automatically in time series data. It supports two functionalities, one is
-// for detecting the whole series with model trained by the timeseries, another is detecting last point with model
-// trained by points before. By using this service, business customers can discover incidents and establish a logic
-// flow for root cause analysis.
-package anomalyfinder
-
-// 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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// BaseClient is the base client for Anomalyfinder.
-type BaseClient struct {
- autorest.Client
- Endpoint string
-}
-
-// New creates an instance of the BaseClient client.
-func New(endpoint string) BaseClient {
- return NewWithoutDefaults(endpoint)
-}
-
-// NewWithoutDefaults creates an instance of the BaseClient client.
-func NewWithoutDefaults(endpoint string) BaseClient {
- return BaseClient{
- Client: autorest.NewClientWithUserAgent(UserAgent()),
- Endpoint: endpoint,
- }
-}
-
-// EntireDetect the operation will generate a model using the entire series, each point will be detected with the same
-// model. In this method, points before and after a certain point will be used to determine whether it's an anomaly.
-// The entire detection can give user an overall status of the time series.
-// Parameters:
-// body - time series points and period if needed. Advanced model parameters can also be set in the request.
-func (client BaseClient) EntireDetect(ctx context.Context, body Request) (result EntireDetectResponse, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.EntireDetect")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: body,
- Constraints: []validation.Constraint{{Target: "body.Series", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("anomalyfinder.BaseClient", "EntireDetect", err.Error())
- }
-
- req, err := client.EntireDetectPreparer(ctx, body)
- if err != nil {
- err = autorest.NewErrorWithError(err, "anomalyfinder.BaseClient", "EntireDetect", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.EntireDetectSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "anomalyfinder.BaseClient", "EntireDetect", resp, "Failure sending request")
- return
- }
-
- result, err = client.EntireDetectResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "anomalyfinder.BaseClient", "EntireDetect", resp, "Failure responding to request")
- }
-
- return
-}
-
-// EntireDetectPreparer prepares the EntireDetect request.
-func (client BaseClient) EntireDetectPreparer(ctx context.Context, body Request) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "Endpoint": client.Endpoint,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("{Endpoint}/anomalyfinder/v2.0", urlParameters),
- autorest.WithPath("/timeseries/entire/detect"),
- autorest.WithJSON(body))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// EntireDetectSender sends the EntireDetect request. The method will close the
-// http.Response Body if it receives an error.
-func (client BaseClient) EntireDetectSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// EntireDetectResponder handles the response to the EntireDetect request. The method always
-// closes the http.Response Body.
-func (client BaseClient) EntireDetectResponder(resp *http.Response) (result EntireDetectResponse, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// LastDetect the operation will generate a model using points before the latest one, In this method, only history
-// points are used for determine whether the target point is an anomaly. Latest point detecting matches the scenario of
-// real-time monitoring of business metrics.
-// Parameters:
-// body - time series points and period if needed. Advanced model parameters can also be set in the request.
-func (client BaseClient) LastDetect(ctx context.Context, body Request) (result LastDetectResponse, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.LastDetect")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: body,
- Constraints: []validation.Constraint{{Target: "body.Series", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("anomalyfinder.BaseClient", "LastDetect", err.Error())
- }
-
- req, err := client.LastDetectPreparer(ctx, body)
- if err != nil {
- err = autorest.NewErrorWithError(err, "anomalyfinder.BaseClient", "LastDetect", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.LastDetectSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "anomalyfinder.BaseClient", "LastDetect", resp, "Failure sending request")
- return
- }
-
- result, err = client.LastDetectResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "anomalyfinder.BaseClient", "LastDetect", resp, "Failure responding to request")
- }
-
- return
-}
-
-// LastDetectPreparer prepares the LastDetect request.
-func (client BaseClient) LastDetectPreparer(ctx context.Context, body Request) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "Endpoint": client.Endpoint,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("{Endpoint}/anomalyfinder/v2.0", urlParameters),
- autorest.WithPath("/timeseries/last/detect"),
- autorest.WithJSON(body))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// LastDetectSender sends the LastDetect request. The method will close the
-// http.Response Body if it receives an error.
-func (client BaseClient) LastDetectSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// LastDetectResponder handles the response to the LastDetect request. The method always
-// closes the http.Response Body.
-func (client BaseClient) LastDetectResponder(resp *http.Response) (result LastDetectResponse, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/services/cognitiveservices/v2.0/anomalyfinder/models.go b/services/cognitiveservices/v2.0/anomalyfinder/models.go
deleted file mode 100644
index 8ea88ea46f2b..000000000000
--- a/services/cognitiveservices/v2.0/anomalyfinder/models.go
+++ /dev/null
@@ -1,121 +0,0 @@
-package anomalyfinder
-
-// 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/date"
-)
-
-// The package's fully qualified name.
-const fqdn = "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/anomalyfinder"
-
-// Granularity enumerates the values for granularity.
-type Granularity string
-
-const (
- // Daily ...
- Daily Granularity = "daily"
- // Hourly ...
- Hourly Granularity = "hourly"
- // Minutely ...
- Minutely Granularity = "minutely"
- // Monthly ...
- Monthly Granularity = "monthly"
- // Weekly ...
- Weekly Granularity = "weekly"
- // Yearly ...
- Yearly Granularity = "yearly"
-)
-
-// PossibleGranularityValues returns an array of possible values for the Granularity const type.
-func PossibleGranularityValues() []Granularity {
- return []Granularity{Daily, Hourly, Minutely, Monthly, Weekly, Yearly}
-}
-
-// APIError error information returned by the API.
-type APIError struct {
- // Code - The error code.
- Code interface{} `json:"code,omitempty"`
- // Message - A message explaining the error reported by the service.
- Message *string `json:"message,omitempty"`
-}
-
-// EntireDetectResponse ...
-type EntireDetectResponse struct {
- autorest.Response `json:"-"`
- // Period - Frequency extracted from the series, zero means no recurrent pattern has been found.
- Period *int32 `json:"period,omitempty"`
- // ExpectedValues - ExpectedValues contain expected value for each input point. The index of the array is consistent with the input series.
- ExpectedValues *[]float64 `json:"expectedValues,omitempty"`
- // UpperMargins - UpperMargins contain upper margin of each input point. UpperMargin is used to calculate upperBoundary, which equals to expectedValue + (100 - sensitivity)*upperMargin. Anomalies in response can be filtered by upperBoundary and lowerBoundary. By adjusting sensitivity value, less significant anomalies can be filtered in client side. The index of the array is consistent with the input series.
- UpperMargins *[]float64 `json:"upperMargins,omitempty"`
- // LowerMargins - LowerMargins contain lower margin of each input point. LowerMargin is used to calculate lowerBoundary, which equals to expectedValue - (100 - sensitivity)*lowerMargin. Points between the boundary can be marked as normal ones in client side. The index of the array is consistent with the input series.
- LowerMargins *[]float64 `json:"lowerMargins,omitempty"`
- // IsAnomaly - IsAnomaly contains anomaly properties for each input point. True means an anomaly either negative or positive has been detected. The index of the array is consistent with the input series.
- IsAnomaly *[]bool `json:"isAnomaly,omitempty"`
- // IsNegativeAnomaly - IsNegativeAnomaly contains anomaly status in negative direction for each input point. True means a negative anomaly has been detected. A negative anomaly means the point is detected as an anomaly and its real value is smaller than the expected one. The index of the array is consistent with the input series.
- IsNegativeAnomaly *[]bool `json:"isNegativeAnomaly,omitempty"`
- // IsPositiveAnomaly - IsPositiveAnomaly contain anomaly status in positive direction for each input point. True means a positive anomaly has been detected. A positive anomaly means the point is detected as an anomaly and its real value is larger than the expected one. The index of the array is consistent with the input series.
- IsPositiveAnomaly *[]bool `json:"isPositiveAnomaly,omitempty"`
-}
-
-// LastDetectResponse ...
-type LastDetectResponse struct {
- autorest.Response `json:"-"`
- // Period - Frequency extracted from the series, zero means no recurrent pattern has been found.
- Period *int32 `json:"period,omitempty"`
- // SuggestedWindow - Suggested input series points needed for detecting the latest point.
- SuggestedWindow *int32 `json:"suggestedWindow,omitempty"`
- // ExpectedValue - Expected value of the latest point.
- ExpectedValue *float64 `json:"expectedValue,omitempty"`
- // UpperMargin - Upper margin of the latest point. UpperMargin is used to calculate upperBoundary, which equals to expectedValue + (100 - sensitivity)*upperMargin. If the value of latest point is between upperBoundary and lowerBoundary, it should be treated as normal value. By adjusting sensitivity value, anomaly status of latest point can be changed.
- UpperMargin *float64 `json:"upperMargin,omitempty"`
- // LowerMargin - Lower margin of the latest point. LowerMargin is used to calculate lowerBoundary, which equals to expectedValue - (100 - sensitivity)*lowerMargin.
- LowerMargin *float64 `json:"lowerMargin,omitempty"`
- // IsAnomaly - Anomaly status of the latest point, true means the latest point is an anomaly either in negative direction or positive direction.
- IsAnomaly *bool `json:"isAnomaly,omitempty"`
- // IsNegativeAnomaly - Anomaly status in negative direction of the latest point. True means the latest point is an anomaly and its real value is smaller than the expected one.
- IsNegativeAnomaly *bool `json:"isNegativeAnomaly,omitempty"`
- // IsPositiveAnomaly - Anomaly status in positive direction of the latest point. True means the latest point is an anomaly and its real value is larger than the expected one.
- IsPositiveAnomaly *bool `json:"isPositiveAnomaly,omitempty"`
-}
-
-// Point ...
-type Point struct {
- // Timestamp - Timestamp of a data point (ISO8601 format).
- Timestamp *date.Time `json:"timestamp,omitempty"`
- // Value - The measurement of that point, should be float.
- Value *float64 `json:"value,omitempty"`
-}
-
-// Request ...
-type Request struct {
- // Series - Time series data points. Points should be sorted by timestamp in ascending order to match the anomaly detection result. If the data is not sorted correctly or there is duplicated timestamp, the API will not work. In such case, an error message will be returned.
- Series *[]Point `json:"series,omitempty"`
- // Granularity - Can only be one of yearly, monthly, weekly, daily, hourly or minutely. Granularity is used for verify whether input series is valid. Possible values include: 'Yearly', 'Monthly', 'Weekly', 'Daily', 'Hourly', 'Minutely'
- Granularity Granularity `json:"granularity,omitempty"`
- // CustomInterval - Custom Interval is used to set non-standard time interval, for example, if the series is 5 minutes, request can be set as {"granularity":"minutely", "customInterval":5}.
- CustomInterval *int32 `json:"customInterval,omitempty"`
- // Period - Optional argument, periodic value of a time series. If the value is null or does not present, the API will determine the period automatically.
- Period *int32 `json:"period,omitempty"`
- // MaxAnomalyRatio - Optional argument, advanced model parameter, max anomaly ratio in a time series.
- MaxAnomalyRatio *float64 `json:"maxAnomalyRatio,omitempty"`
- // Sensitivity - Optional argument, advanced model parameter, between 0-99, the lower the value is, the larger the margin value will be which means less anomalies will be accepted.
- Sensitivity *int32 `json:"sensitivity,omitempty"`
-}
diff --git a/services/cognitiveservices/v2.0/anomalyfinder/version.go b/services/cognitiveservices/v2.0/anomalyfinder/version.go
deleted file mode 100644
index 1d6689bd944f..000000000000
--- a/services/cognitiveservices/v2.0/anomalyfinder/version.go
+++ /dev/null
@@ -1,30 +0,0 @@
-package anomalyfinder
-
-import "github.com/Azure/azure-sdk-for-go/version"
-
-// 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.
-
-// UserAgent returns the UserAgent string to use when sending http.Requests.
-func UserAgent() string {
- return "Azure-SDK-For-Go/" + version.Number + " anomalyfinder/2.0"
-}
-
-// Version returns the semantic version (see http://semver.org) of the client.
-func Version() string {
- return version.Number
-}
diff --git a/services/cognitiveservices/v2.0/luis/programmatic/apps.go b/services/cognitiveservices/v2.0/luis/programmatic/apps.go
deleted file mode 100644
index 335c8200384e..000000000000
--- a/services/cognitiveservices/v2.0/luis/programmatic/apps.go
+++ /dev/null
@@ -1,1165 +0,0 @@
-package programmatic
-
-// 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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// AppsClient is the client for the Apps methods of the Programmatic service.
-type AppsClient struct {
- BaseClient
-}
-
-// NewAppsClient creates an instance of the AppsClient client.
-func NewAppsClient(azureRegion AzureRegions) AppsClient {
- return AppsClient{New(azureRegion)}
-}
-
-// Add creates a new LUIS app.
-// Parameters:
-// applicationCreateObject - a model containing Name, Description (optional), Culture, Usage Scenario
-// (optional), Domain (optional) and initial version ID (optional) of the application. Default value for the
-// version ID is 0.1. Note: the culture cannot be changed after the app is created.
-func (client AppsClient) Add(ctx context.Context, applicationCreateObject ApplicationCreateObject) (result UUID, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: applicationCreateObject,
- Constraints: []validation.Constraint{{Target: "applicationCreateObject.Culture", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "applicationCreateObject.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("programmatic.AppsClient", "Add", err.Error())
- }
-
- req, err := client.AddPreparer(ctx, applicationCreateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Add", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Add", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Add", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPreparer prepares the Add request.
-func (client AppsClient) AddPreparer(ctx context.Context, applicationCreateObject ApplicationCreateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPath("/apps/"),
- autorest.WithJSON(applicationCreateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSender sends the Add request. The method will close the
-// http.Response Body if it receives an error.
-func (client AppsClient) AddSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddResponder handles the response to the Add request. The method always
-// closes the http.Response Body.
-func (client AppsClient) AddResponder(resp *http.Response) (result UUID, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// AddCustomPrebuiltDomain adds a prebuilt domain along with its models as a new application.
-// Parameters:
-// prebuiltDomainCreateObject - a prebuilt domain create object containing the name and culture of the domain.
-func (client AppsClient) AddCustomPrebuiltDomain(ctx context.Context, prebuiltDomainCreateObject PrebuiltDomainCreateObject) (result UUID, err error) {
- req, err := client.AddCustomPrebuiltDomainPreparer(ctx, prebuiltDomainCreateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "AddCustomPrebuiltDomain", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddCustomPrebuiltDomainSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "AddCustomPrebuiltDomain", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddCustomPrebuiltDomainResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "AddCustomPrebuiltDomain", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddCustomPrebuiltDomainPreparer prepares the AddCustomPrebuiltDomain request.
-func (client AppsClient) AddCustomPrebuiltDomainPreparer(ctx context.Context, prebuiltDomainCreateObject PrebuiltDomainCreateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPath("/apps/customprebuiltdomains"),
- autorest.WithJSON(prebuiltDomainCreateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddCustomPrebuiltDomainSender sends the AddCustomPrebuiltDomain request. The method will close the
-// http.Response Body if it receives an error.
-func (client AppsClient) AddCustomPrebuiltDomainSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddCustomPrebuiltDomainResponder handles the response to the AddCustomPrebuiltDomain request. The method always
-// closes the http.Response Body.
-func (client AppsClient) AddCustomPrebuiltDomainResponder(resp *http.Response) (result UUID, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Delete deletes an application.
-// Parameters:
-// appID - the application ID.
-func (client AppsClient) Delete(ctx context.Context, appID uuid.UUID) (result OperationStatus, err error) {
- req, err := client.DeletePreparer(ctx, appID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client AppsClient) DeletePreparer(ctx context.Context, appID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client AppsClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client AppsClient) DeleteResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// DownloadQueryLogs gets the query logs of the past month for the application.
-// Parameters:
-// appID - the application ID.
-func (client AppsClient) DownloadQueryLogs(ctx context.Context, appID uuid.UUID) (result ReadCloser, err error) {
- req, err := client.DownloadQueryLogsPreparer(ctx, appID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "DownloadQueryLogs", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DownloadQueryLogsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "DownloadQueryLogs", resp, "Failure sending request")
- return
- }
-
- result, err = client.DownloadQueryLogsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "DownloadQueryLogs", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DownloadQueryLogsPreparer prepares the DownloadQueryLogs request.
-func (client AppsClient) DownloadQueryLogsPreparer(ctx context.Context, appID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/querylogs", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DownloadQueryLogsSender sends the DownloadQueryLogs request. The method will close the
-// http.Response Body if it receives an error.
-func (client AppsClient) DownloadQueryLogsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DownloadQueryLogsResponder handles the response to the DownloadQueryLogs request. The method always
-// closes the http.Response Body.
-func (client AppsClient) DownloadQueryLogsResponder(resp *http.Response) (result ReadCloser, err error) {
- result.Value = &resp.Body
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK))
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Get gets the application info.
-// Parameters:
-// appID - the application ID.
-func (client AppsClient) Get(ctx context.Context, appID uuid.UUID) (result ApplicationInfoResponse, err error) {
- req, err := client.GetPreparer(ctx, appID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client AppsClient) GetPreparer(ctx context.Context, appID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client AppsClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client AppsClient) GetResponder(resp *http.Response) (result ApplicationInfoResponse, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetSettings get the application settings.
-// Parameters:
-// appID - the application ID.
-func (client AppsClient) GetSettings(ctx context.Context, appID uuid.UUID) (result ApplicationSettings, err error) {
- req, err := client.GetSettingsPreparer(ctx, appID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "GetSettings", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSettingsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "GetSettings", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetSettingsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "GetSettings", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetSettingsPreparer prepares the GetSettings request.
-func (client AppsClient) GetSettingsPreparer(ctx context.Context, appID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/settings", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSettingsSender sends the GetSettings request. The method will close the
-// http.Response Body if it receives an error.
-func (client AppsClient) GetSettingsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetSettingsResponder handles the response to the GetSettings request. The method always
-// closes the http.Response Body.
-func (client AppsClient) GetSettingsResponder(resp *http.Response) (result ApplicationSettings, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Import imports an application to LUIS, the application's structure should be included in in the request body.
-// Parameters:
-// luisApp - a LUIS application structure.
-// appName - the application name to create. If not specified, the application name will be read from the
-// imported object.
-func (client AppsClient) Import(ctx context.Context, luisApp LuisApp, appName string) (result UUID, err error) {
- req, err := client.ImportPreparer(ctx, luisApp, appName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Import", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ImportSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Import", resp, "Failure sending request")
- return
- }
-
- result, err = client.ImportResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Import", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ImportPreparer prepares the Import request.
-func (client AppsClient) ImportPreparer(ctx context.Context, luisApp LuisApp, appName string) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- queryParameters := map[string]interface{}{}
- if len(appName) > 0 {
- queryParameters["appName"] = autorest.Encode("query", appName)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPath("/apps/import"),
- autorest.WithJSON(luisApp),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ImportSender sends the Import request. The method will close the
-// http.Response Body if it receives an error.
-func (client AppsClient) ImportSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ImportResponder handles the response to the Import request. The method always
-// closes the http.Response Body.
-func (client AppsClient) ImportResponder(resp *http.Response) (result UUID, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List lists all of the user applications.
-// Parameters:
-// skip - the number of entries to skip. Default value is 0.
-// take - the number of entries to return. Maximum page size is 500. Default is 100.
-func (client AppsClient) List(ctx context.Context, skip *int32, take *int32) (result ListApplicationInfoResponse, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: skip,
- Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}},
- {TargetValue: take,
- Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil},
- {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("programmatic.AppsClient", "List", err.Error())
- }
-
- req, err := client.ListPreparer(ctx, skip, take)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "List", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client AppsClient) ListPreparer(ctx context.Context, skip *int32, take *int32) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- queryParameters := map[string]interface{}{}
- if skip != nil {
- queryParameters["skip"] = autorest.Encode("query", *skip)
- } else {
- queryParameters["skip"] = autorest.Encode("query", 0)
- }
- if take != nil {
- queryParameters["take"] = autorest.Encode("query", *take)
- } else {
- queryParameters["take"] = autorest.Encode("query", 100)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPath("/apps/"),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client AppsClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client AppsClient) ListResponder(resp *http.Response) (result ListApplicationInfoResponse, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListAvailableCustomPrebuiltDomains gets all the available custom prebuilt domains for all cultures.
-func (client AppsClient) ListAvailableCustomPrebuiltDomains(ctx context.Context) (result ListPrebuiltDomain, err error) {
- req, err := client.ListAvailableCustomPrebuiltDomainsPreparer(ctx)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListAvailableCustomPrebuiltDomains", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListAvailableCustomPrebuiltDomainsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListAvailableCustomPrebuiltDomains", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListAvailableCustomPrebuiltDomainsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListAvailableCustomPrebuiltDomains", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListAvailableCustomPrebuiltDomainsPreparer prepares the ListAvailableCustomPrebuiltDomains request.
-func (client AppsClient) ListAvailableCustomPrebuiltDomainsPreparer(ctx context.Context) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPath("/apps/customprebuiltdomains"))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListAvailableCustomPrebuiltDomainsSender sends the ListAvailableCustomPrebuiltDomains request. The method will close the
-// http.Response Body if it receives an error.
-func (client AppsClient) ListAvailableCustomPrebuiltDomainsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListAvailableCustomPrebuiltDomainsResponder handles the response to the ListAvailableCustomPrebuiltDomains request. The method always
-// closes the http.Response Body.
-func (client AppsClient) ListAvailableCustomPrebuiltDomainsResponder(resp *http.Response) (result ListPrebuiltDomain, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListAvailableCustomPrebuiltDomainsForCulture gets all the available custom prebuilt domains for a specific culture.
-// Parameters:
-// culture - culture.
-func (client AppsClient) ListAvailableCustomPrebuiltDomainsForCulture(ctx context.Context, culture string) (result ListPrebuiltDomain, err error) {
- req, err := client.ListAvailableCustomPrebuiltDomainsForCulturePreparer(ctx, culture)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListAvailableCustomPrebuiltDomainsForCulture", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListAvailableCustomPrebuiltDomainsForCultureSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListAvailableCustomPrebuiltDomainsForCulture", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListAvailableCustomPrebuiltDomainsForCultureResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListAvailableCustomPrebuiltDomainsForCulture", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListAvailableCustomPrebuiltDomainsForCulturePreparer prepares the ListAvailableCustomPrebuiltDomainsForCulture request.
-func (client AppsClient) ListAvailableCustomPrebuiltDomainsForCulturePreparer(ctx context.Context, culture string) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "culture": autorest.Encode("path", culture),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/customprebuiltdomains/{culture}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListAvailableCustomPrebuiltDomainsForCultureSender sends the ListAvailableCustomPrebuiltDomainsForCulture request. The method will close the
-// http.Response Body if it receives an error.
-func (client AppsClient) ListAvailableCustomPrebuiltDomainsForCultureSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListAvailableCustomPrebuiltDomainsForCultureResponder handles the response to the ListAvailableCustomPrebuiltDomainsForCulture request. The method always
-// closes the http.Response Body.
-func (client AppsClient) ListAvailableCustomPrebuiltDomainsForCultureResponder(resp *http.Response) (result ListPrebuiltDomain, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListCortanaEndpoints gets the endpoint URLs for the prebuilt Cortana applications.
-func (client AppsClient) ListCortanaEndpoints(ctx context.Context) (result PersonalAssistantsResponse, err error) {
- req, err := client.ListCortanaEndpointsPreparer(ctx)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListCortanaEndpoints", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListCortanaEndpointsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListCortanaEndpoints", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListCortanaEndpointsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListCortanaEndpoints", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListCortanaEndpointsPreparer prepares the ListCortanaEndpoints request.
-func (client AppsClient) ListCortanaEndpointsPreparer(ctx context.Context) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPath("/apps/assistants"))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListCortanaEndpointsSender sends the ListCortanaEndpoints request. The method will close the
-// http.Response Body if it receives an error.
-func (client AppsClient) ListCortanaEndpointsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListCortanaEndpointsResponder handles the response to the ListCortanaEndpoints request. The method always
-// closes the http.Response Body.
-func (client AppsClient) ListCortanaEndpointsResponder(resp *http.Response) (result PersonalAssistantsResponse, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListDomains gets the available application domains.
-func (client AppsClient) ListDomains(ctx context.Context) (result ListString, err error) {
- req, err := client.ListDomainsPreparer(ctx)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListDomains", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListDomainsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListDomains", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListDomainsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListDomains", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListDomainsPreparer prepares the ListDomains request.
-func (client AppsClient) ListDomainsPreparer(ctx context.Context) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPath("/apps/domains"))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListDomainsSender sends the ListDomains request. The method will close the
-// http.Response Body if it receives an error.
-func (client AppsClient) ListDomainsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListDomainsResponder handles the response to the ListDomains request. The method always
-// closes the http.Response Body.
-func (client AppsClient) ListDomainsResponder(resp *http.Response) (result ListString, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListEndpoints returns the available endpoint deployment regions and URLs.
-// Parameters:
-// appID - the application ID.
-func (client AppsClient) ListEndpoints(ctx context.Context, appID uuid.UUID) (result SetString, err error) {
- req, err := client.ListEndpointsPreparer(ctx, appID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListEndpoints", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListEndpointsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListEndpoints", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListEndpointsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListEndpoints", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListEndpointsPreparer prepares the ListEndpoints request.
-func (client AppsClient) ListEndpointsPreparer(ctx context.Context, appID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/endpoints", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListEndpointsSender sends the ListEndpoints request. The method will close the
-// http.Response Body if it receives an error.
-func (client AppsClient) ListEndpointsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListEndpointsResponder handles the response to the ListEndpoints request. The method always
-// closes the http.Response Body.
-func (client AppsClient) ListEndpointsResponder(resp *http.Response) (result SetString, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListSupportedCultures gets the supported application cultures.
-func (client AppsClient) ListSupportedCultures(ctx context.Context) (result ListAvailableCulture, err error) {
- req, err := client.ListSupportedCulturesPreparer(ctx)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListSupportedCultures", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSupportedCulturesSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListSupportedCultures", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListSupportedCulturesResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListSupportedCultures", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListSupportedCulturesPreparer prepares the ListSupportedCultures request.
-func (client AppsClient) ListSupportedCulturesPreparer(ctx context.Context) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPath("/apps/cultures"))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSupportedCulturesSender sends the ListSupportedCultures request. The method will close the
-// http.Response Body if it receives an error.
-func (client AppsClient) ListSupportedCulturesSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListSupportedCulturesResponder handles the response to the ListSupportedCultures request. The method always
-// closes the http.Response Body.
-func (client AppsClient) ListSupportedCulturesResponder(resp *http.Response) (result ListAvailableCulture, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListUsageScenarios gets the application available usage scenarios.
-func (client AppsClient) ListUsageScenarios(ctx context.Context) (result ListString, err error) {
- req, err := client.ListUsageScenariosPreparer(ctx)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListUsageScenarios", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListUsageScenariosSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListUsageScenarios", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListUsageScenariosResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "ListUsageScenarios", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListUsageScenariosPreparer prepares the ListUsageScenarios request.
-func (client AppsClient) ListUsageScenariosPreparer(ctx context.Context) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPath("/apps/usagescenarios"))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListUsageScenariosSender sends the ListUsageScenarios request. The method will close the
-// http.Response Body if it receives an error.
-func (client AppsClient) ListUsageScenariosSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListUsageScenariosResponder handles the response to the ListUsageScenarios request. The method always
-// closes the http.Response Body.
-func (client AppsClient) ListUsageScenariosResponder(resp *http.Response) (result ListString, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Publish publishes a specific version of the application.
-// Parameters:
-// appID - the application ID.
-// applicationPublishObject - the application publish object. The region is the target region that the
-// application is published to.
-func (client AppsClient) Publish(ctx context.Context, appID uuid.UUID, applicationPublishObject ApplicationPublishObject) (result ProductionOrStagingEndpointInfo, err error) {
- req, err := client.PublishPreparer(ctx, appID, applicationPublishObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Publish", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.PublishSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Publish", resp, "Failure sending request")
- return
- }
-
- result, err = client.PublishResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Publish", resp, "Failure responding to request")
- }
-
- return
-}
-
-// PublishPreparer prepares the Publish request.
-func (client AppsClient) PublishPreparer(ctx context.Context, appID uuid.UUID, applicationPublishObject ApplicationPublishObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/publish", pathParameters),
- autorest.WithJSON(applicationPublishObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// PublishSender sends the Publish request. The method will close the
-// http.Response Body if it receives an error.
-func (client AppsClient) PublishSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// PublishResponder handles the response to the Publish request. The method always
-// closes the http.Response Body.
-func (client AppsClient) PublishResponder(resp *http.Response) (result ProductionOrStagingEndpointInfo, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Update updates the name or description of the application.
-// Parameters:
-// appID - the application ID.
-// applicationUpdateObject - a model containing Name and Description of the application.
-func (client AppsClient) Update(ctx context.Context, appID uuid.UUID, applicationUpdateObject ApplicationUpdateObject) (result OperationStatus, err error) {
- req, err := client.UpdatePreparer(ctx, appID, applicationUpdateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Update", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Update", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "Update", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePreparer prepares the Update request.
-func (client AppsClient) UpdatePreparer(ctx context.Context, appID uuid.UUID, applicationUpdateObject ApplicationUpdateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}", pathParameters),
- autorest.WithJSON(applicationUpdateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSender sends the Update request. The method will close the
-// http.Response Body if it receives an error.
-func (client AppsClient) UpdateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateResponder handles the response to the Update request. The method always
-// closes the http.Response Body.
-func (client AppsClient) UpdateResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// UpdateSettings updates the application settings.
-// Parameters:
-// appID - the application ID.
-// applicationSettingUpdateObject - an object containing the new application settings.
-func (client AppsClient) UpdateSettings(ctx context.Context, appID uuid.UUID, applicationSettingUpdateObject ApplicationSettingUpdateObject) (result OperationStatus, err error) {
- req, err := client.UpdateSettingsPreparer(ctx, appID, applicationSettingUpdateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "UpdateSettings", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateSettingsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "UpdateSettings", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateSettingsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.AppsClient", "UpdateSettings", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdateSettingsPreparer prepares the UpdateSettings request.
-func (client AppsClient) UpdateSettingsPreparer(ctx context.Context, appID uuid.UUID, applicationSettingUpdateObject ApplicationSettingUpdateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/settings", pathParameters),
- autorest.WithJSON(applicationSettingUpdateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSettingsSender sends the UpdateSettings request. The method will close the
-// http.Response Body if it receives an error.
-func (client AppsClient) UpdateSettingsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateSettingsResponder handles the response to the UpdateSettings request. The method always
-// closes the http.Response Body.
-func (client AppsClient) UpdateSettingsResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/services/cognitiveservices/v2.0/luis/programmatic/examples.go b/services/cognitiveservices/v2.0/luis/programmatic/examples.go
deleted file mode 100644
index acd013b03457..000000000000
--- a/services/cognitiveservices/v2.0/luis/programmatic/examples.go
+++ /dev/null
@@ -1,334 +0,0 @@
-package programmatic
-
-// 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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// ExamplesClient is the client for the Examples methods of the Programmatic service.
-type ExamplesClient struct {
- BaseClient
-}
-
-// NewExamplesClient creates an instance of the ExamplesClient client.
-func NewExamplesClient(azureRegion AzureRegions) ExamplesClient {
- return ExamplesClient{New(azureRegion)}
-}
-
-// Add adds a labeled example to the application.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// exampleLabelObject - an example label with the expected intent and entities.
-func (client ExamplesClient) Add(ctx context.Context, appID uuid.UUID, versionID string, exampleLabelObject ExampleLabelObject) (result LabelExampleResponse, err error) {
- req, err := client.AddPreparer(ctx, appID, versionID, exampleLabelObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ExamplesClient", "Add", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ExamplesClient", "Add", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ExamplesClient", "Add", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPreparer prepares the Add request.
-func (client ExamplesClient) AddPreparer(ctx context.Context, appID uuid.UUID, versionID string, exampleLabelObject ExampleLabelObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/example", pathParameters),
- autorest.WithJSON(exampleLabelObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSender sends the Add request. The method will close the
-// http.Response Body if it receives an error.
-func (client ExamplesClient) AddSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddResponder handles the response to the Add request. The method always
-// closes the http.Response Body.
-func (client ExamplesClient) AddResponder(resp *http.Response) (result LabelExampleResponse, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Batch adds a batch of labeled examples to the application.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// exampleLabelObjectArray - array of examples.
-func (client ExamplesClient) Batch(ctx context.Context, appID uuid.UUID, versionID string, exampleLabelObjectArray []ExampleLabelObject) (result ListBatchLabelExample, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: exampleLabelObjectArray,
- Constraints: []validation.Constraint{{Target: "exampleLabelObjectArray", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("programmatic.ExamplesClient", "Batch", err.Error())
- }
-
- req, err := client.BatchPreparer(ctx, appID, versionID, exampleLabelObjectArray)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ExamplesClient", "Batch", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.BatchSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ExamplesClient", "Batch", resp, "Failure sending request")
- return
- }
-
- result, err = client.BatchResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ExamplesClient", "Batch", resp, "Failure responding to request")
- }
-
- return
-}
-
-// BatchPreparer prepares the Batch request.
-func (client ExamplesClient) BatchPreparer(ctx context.Context, appID uuid.UUID, versionID string, exampleLabelObjectArray []ExampleLabelObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/examples", pathParameters),
- autorest.WithJSON(exampleLabelObjectArray))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// BatchSender sends the Batch request. The method will close the
-// http.Response Body if it receives an error.
-func (client ExamplesClient) BatchSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// BatchResponder handles the response to the Batch request. The method always
-// closes the http.Response Body.
-func (client ExamplesClient) BatchResponder(resp *http.Response) (result ListBatchLabelExample, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusMultiStatus),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Delete deletes the labeled example with the specified ID.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// exampleID - the example ID.
-func (client ExamplesClient) Delete(ctx context.Context, appID uuid.UUID, versionID string, exampleID int32) (result OperationStatus, err error) {
- req, err := client.DeletePreparer(ctx, appID, versionID, exampleID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ExamplesClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ExamplesClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ExamplesClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client ExamplesClient) DeletePreparer(ctx context.Context, appID uuid.UUID, versionID string, exampleID int32) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "exampleId": autorest.Encode("path", exampleID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/examples/{exampleId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client ExamplesClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client ExamplesClient) DeleteResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List returns examples to be reviewed.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// skip - the number of entries to skip. Default value is 0.
-// take - the number of entries to return. Maximum page size is 500. Default is 100.
-func (client ExamplesClient) List(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result ListLabeledUtterance, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: skip,
- Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}},
- {TargetValue: take,
- Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil},
- {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("programmatic.ExamplesClient", "List", err.Error())
- }
-
- req, err := client.ListPreparer(ctx, appID, versionID, skip, take)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ExamplesClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ExamplesClient", "List", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ExamplesClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client ExamplesClient) ListPreparer(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- queryParameters := map[string]interface{}{}
- if skip != nil {
- queryParameters["skip"] = autorest.Encode("query", *skip)
- } else {
- queryParameters["skip"] = autorest.Encode("query", 0)
- }
- if take != nil {
- queryParameters["take"] = autorest.Encode("query", *take)
- } else {
- queryParameters["take"] = autorest.Encode("query", 100)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/examples", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client ExamplesClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client ExamplesClient) ListResponder(resp *http.Response) (result ListLabeledUtterance, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/services/cognitiveservices/v2.0/luis/programmatic/features.go b/services/cognitiveservices/v2.0/luis/programmatic/features.go
deleted file mode 100644
index 794806e2c662..000000000000
--- a/services/cognitiveservices/v2.0/luis/programmatic/features.go
+++ /dev/null
@@ -1,492 +0,0 @@
-package programmatic
-
-// 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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// FeaturesClient is the client for the Features methods of the Programmatic service.
-type FeaturesClient struct {
- BaseClient
-}
-
-// NewFeaturesClient creates an instance of the FeaturesClient client.
-func NewFeaturesClient(azureRegion AzureRegions) FeaturesClient {
- return FeaturesClient{New(azureRegion)}
-}
-
-// AddPhraseList creates a new phraselist feature.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// phraselistCreateObject - a Phraselist object containing Name, comma-separated Phrases and the isExchangeable
-// boolean. Default value for isExchangeable is true.
-func (client FeaturesClient) AddPhraseList(ctx context.Context, appID uuid.UUID, versionID string, phraselistCreateObject PhraselistCreateObject) (result Int32, err error) {
- req, err := client.AddPhraseListPreparer(ctx, appID, versionID, phraselistCreateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "AddPhraseList", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddPhraseListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "AddPhraseList", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddPhraseListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "AddPhraseList", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPhraseListPreparer prepares the AddPhraseList request.
-func (client FeaturesClient) AddPhraseListPreparer(ctx context.Context, appID uuid.UUID, versionID string, phraselistCreateObject PhraselistCreateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/phraselists", pathParameters),
- autorest.WithJSON(phraselistCreateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddPhraseListSender sends the AddPhraseList request. The method will close the
-// http.Response Body if it receives an error.
-func (client FeaturesClient) AddPhraseListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddPhraseListResponder handles the response to the AddPhraseList request. The method always
-// closes the http.Response Body.
-func (client FeaturesClient) AddPhraseListResponder(resp *http.Response) (result Int32, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// DeletePhraseList deletes a phraselist feature.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// phraselistID - the ID of the feature to be deleted.
-func (client FeaturesClient) DeletePhraseList(ctx context.Context, appID uuid.UUID, versionID string, phraselistID int32) (result OperationStatus, err error) {
- req, err := client.DeletePhraseListPreparer(ctx, appID, versionID, phraselistID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "DeletePhraseList", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeletePhraseListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "DeletePhraseList", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeletePhraseListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "DeletePhraseList", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePhraseListPreparer prepares the DeletePhraseList request.
-func (client FeaturesClient) DeletePhraseListPreparer(ctx context.Context, appID uuid.UUID, versionID string, phraselistID int32) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "phraselistId": autorest.Encode("path", phraselistID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/phraselists/{phraselistId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeletePhraseListSender sends the DeletePhraseList request. The method will close the
-// http.Response Body if it receives an error.
-func (client FeaturesClient) DeletePhraseListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeletePhraseListResponder handles the response to the DeletePhraseList request. The method always
-// closes the http.Response Body.
-func (client FeaturesClient) DeletePhraseListResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetPhraseList gets phraselist feature info.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// phraselistID - the ID of the feature to be retrieved.
-func (client FeaturesClient) GetPhraseList(ctx context.Context, appID uuid.UUID, versionID string, phraselistID int32) (result PhraseListFeatureInfo, err error) {
- req, err := client.GetPhraseListPreparer(ctx, appID, versionID, phraselistID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "GetPhraseList", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetPhraseListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "GetPhraseList", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetPhraseListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "GetPhraseList", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPhraseListPreparer prepares the GetPhraseList request.
-func (client FeaturesClient) GetPhraseListPreparer(ctx context.Context, appID uuid.UUID, versionID string, phraselistID int32) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "phraselistId": autorest.Encode("path", phraselistID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/phraselists/{phraselistId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetPhraseListSender sends the GetPhraseList request. The method will close the
-// http.Response Body if it receives an error.
-func (client FeaturesClient) GetPhraseListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetPhraseListResponder handles the response to the GetPhraseList request. The method always
-// closes the http.Response Body.
-func (client FeaturesClient) GetPhraseListResponder(resp *http.Response) (result PhraseListFeatureInfo, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List gets all the extraction features for the specified application version.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// skip - the number of entries to skip. Default value is 0.
-// take - the number of entries to return. Maximum page size is 500. Default is 100.
-func (client FeaturesClient) List(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result FeaturesResponseObject, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: skip,
- Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}},
- {TargetValue: take,
- Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil},
- {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("programmatic.FeaturesClient", "List", err.Error())
- }
-
- req, err := client.ListPreparer(ctx, appID, versionID, skip, take)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "List", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client FeaturesClient) ListPreparer(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- queryParameters := map[string]interface{}{}
- if skip != nil {
- queryParameters["skip"] = autorest.Encode("query", *skip)
- } else {
- queryParameters["skip"] = autorest.Encode("query", 0)
- }
- if take != nil {
- queryParameters["take"] = autorest.Encode("query", *take)
- } else {
- queryParameters["take"] = autorest.Encode("query", 100)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/features", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client FeaturesClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client FeaturesClient) ListResponder(resp *http.Response) (result FeaturesResponseObject, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListPhraseLists gets all the phraselist features.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// skip - the number of entries to skip. Default value is 0.
-// take - the number of entries to return. Maximum page size is 500. Default is 100.
-func (client FeaturesClient) ListPhraseLists(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result ListPhraseListFeatureInfo, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: skip,
- Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}},
- {TargetValue: take,
- Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil},
- {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("programmatic.FeaturesClient", "ListPhraseLists", err.Error())
- }
-
- req, err := client.ListPhraseListsPreparer(ctx, appID, versionID, skip, take)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "ListPhraseLists", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListPhraseListsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "ListPhraseLists", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListPhraseListsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "ListPhraseLists", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPhraseListsPreparer prepares the ListPhraseLists request.
-func (client FeaturesClient) ListPhraseListsPreparer(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- queryParameters := map[string]interface{}{}
- if skip != nil {
- queryParameters["skip"] = autorest.Encode("query", *skip)
- } else {
- queryParameters["skip"] = autorest.Encode("query", 0)
- }
- if take != nil {
- queryParameters["take"] = autorest.Encode("query", *take)
- } else {
- queryParameters["take"] = autorest.Encode("query", 100)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/phraselists", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListPhraseListsSender sends the ListPhraseLists request. The method will close the
-// http.Response Body if it receives an error.
-func (client FeaturesClient) ListPhraseListsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListPhraseListsResponder handles the response to the ListPhraseLists request. The method always
-// closes the http.Response Body.
-func (client FeaturesClient) ListPhraseListsResponder(resp *http.Response) (result ListPhraseListFeatureInfo, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// UpdatePhraseList updates the phrases, the state and the name of the phraselist feature.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// phraselistID - the ID of the feature to be updated.
-// phraselistUpdateObject - the new values for: - Just a boolean called IsActive, in which case the status of
-// the feature will be changed. - Name, Pattern, Mode, and a boolean called IsActive to update the feature.
-func (client FeaturesClient) UpdatePhraseList(ctx context.Context, appID uuid.UUID, versionID string, phraselistID int32, phraselistUpdateObject *PhraselistUpdateObject) (result OperationStatus, err error) {
- req, err := client.UpdatePhraseListPreparer(ctx, appID, versionID, phraselistID, phraselistUpdateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "UpdatePhraseList", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdatePhraseListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "UpdatePhraseList", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdatePhraseListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.FeaturesClient", "UpdatePhraseList", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePhraseListPreparer prepares the UpdatePhraseList request.
-func (client FeaturesClient) UpdatePhraseListPreparer(ctx context.Context, appID uuid.UUID, versionID string, phraselistID int32, phraselistUpdateObject *PhraselistUpdateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "phraselistId": autorest.Encode("path", phraselistID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/phraselists/{phraselistId}", pathParameters))
- if phraselistUpdateObject != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(phraselistUpdateObject))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdatePhraseListSender sends the UpdatePhraseList request. The method will close the
-// http.Response Body if it receives an error.
-func (client FeaturesClient) UpdatePhraseListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdatePhraseListResponder handles the response to the UpdatePhraseList request. The method always
-// closes the http.Response Body.
-func (client FeaturesClient) UpdatePhraseListResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/services/cognitiveservices/v2.0/luis/programmatic/model.go b/services/cognitiveservices/v2.0/luis/programmatic/model.go
deleted file mode 100644
index 46e9587d519e..000000000000
--- a/services/cognitiveservices/v2.0/luis/programmatic/model.go
+++ /dev/null
@@ -1,7411 +0,0 @@
-package programmatic
-
-// 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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// ModelClient is the client for the Model methods of the Programmatic service.
-type ModelClient struct {
- BaseClient
-}
-
-// NewModelClient creates an instance of the ModelClient client.
-func NewModelClient(azureRegion AzureRegions) ModelClient {
- return ModelClient{New(azureRegion)}
-}
-
-// AddClosedList adds a closed list model to the application.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// closedListModelCreateObject - a model containing the name and words for the new closed list entity
-// extractor.
-func (client ModelClient) AddClosedList(ctx context.Context, appID uuid.UUID, versionID string, closedListModelCreateObject ClosedListModelCreateObject) (result UUID, err error) {
- req, err := client.AddClosedListPreparer(ctx, appID, versionID, closedListModelCreateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddClosedList", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddClosedListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddClosedList", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddClosedListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddClosedList", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddClosedListPreparer prepares the AddClosedList request.
-func (client ModelClient) AddClosedListPreparer(ctx context.Context, appID uuid.UUID, versionID string, closedListModelCreateObject ClosedListModelCreateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists", pathParameters),
- autorest.WithJSON(closedListModelCreateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddClosedListSender sends the AddClosedList request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) AddClosedListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddClosedListResponder handles the response to the AddClosedList request. The method always
-// closes the http.Response Body.
-func (client ModelClient) AddClosedListResponder(resp *http.Response) (result UUID, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// AddCompositeEntity adds a composite entity extractor to the application.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// compositeModelCreateObject - a model containing the name and children of the new entity extractor.
-func (client ModelClient) AddCompositeEntity(ctx context.Context, appID uuid.UUID, versionID string, compositeModelCreateObject CompositeEntityModel) (result UUID, err error) {
- req, err := client.AddCompositeEntityPreparer(ctx, appID, versionID, compositeModelCreateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddCompositeEntity", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddCompositeEntitySender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddCompositeEntity", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddCompositeEntityResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddCompositeEntity", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddCompositeEntityPreparer prepares the AddCompositeEntity request.
-func (client ModelClient) AddCompositeEntityPreparer(ctx context.Context, appID uuid.UUID, versionID string, compositeModelCreateObject CompositeEntityModel) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities", pathParameters),
- autorest.WithJSON(compositeModelCreateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddCompositeEntitySender sends the AddCompositeEntity request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) AddCompositeEntitySender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddCompositeEntityResponder handles the response to the AddCompositeEntity request. The method always
-// closes the http.Response Body.
-func (client ModelClient) AddCompositeEntityResponder(resp *http.Response) (result UUID, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// AddCompositeEntityChild creates a single child in an existing composite entity model.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// cEntityID - the composite entity extractor ID.
-// compositeChildModelCreateObject - a model object containing the name of the new composite child model.
-func (client ModelClient) AddCompositeEntityChild(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, compositeChildModelCreateObject CompositeChildModelCreateObject) (result UUID, err error) {
- req, err := client.AddCompositeEntityChildPreparer(ctx, appID, versionID, cEntityID, compositeChildModelCreateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddCompositeEntityChild", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddCompositeEntityChildSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddCompositeEntityChild", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddCompositeEntityChildResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddCompositeEntityChild", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddCompositeEntityChildPreparer prepares the AddCompositeEntityChild request.
-func (client ModelClient) AddCompositeEntityChildPreparer(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, compositeChildModelCreateObject CompositeChildModelCreateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "cEntityId": autorest.Encode("path", cEntityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/children", pathParameters),
- autorest.WithJSON(compositeChildModelCreateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddCompositeEntityChildSender sends the AddCompositeEntityChild request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) AddCompositeEntityChildSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddCompositeEntityChildResponder handles the response to the AddCompositeEntityChild request. The method always
-// closes the http.Response Body.
-func (client ModelClient) AddCompositeEntityChildResponder(resp *http.Response) (result UUID, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// AddCustomPrebuiltDomain adds a customizable prebuilt domain along with all of its models to this application.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// prebuiltDomainObject - a prebuilt domain create object containing the name of the domain.
-func (client ModelClient) AddCustomPrebuiltDomain(ctx context.Context, appID uuid.UUID, versionID string, prebuiltDomainObject PrebuiltDomainCreateBaseObject) (result ListUUID, err error) {
- req, err := client.AddCustomPrebuiltDomainPreparer(ctx, appID, versionID, prebuiltDomainObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddCustomPrebuiltDomain", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddCustomPrebuiltDomainSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddCustomPrebuiltDomain", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddCustomPrebuiltDomainResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddCustomPrebuiltDomain", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddCustomPrebuiltDomainPreparer prepares the AddCustomPrebuiltDomain request.
-func (client ModelClient) AddCustomPrebuiltDomainPreparer(ctx context.Context, appID uuid.UUID, versionID string, prebuiltDomainObject PrebuiltDomainCreateBaseObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltdomains", pathParameters),
- autorest.WithJSON(prebuiltDomainObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddCustomPrebuiltDomainSender sends the AddCustomPrebuiltDomain request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) AddCustomPrebuiltDomainSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddCustomPrebuiltDomainResponder handles the response to the AddCustomPrebuiltDomain request. The method always
-// closes the http.Response Body.
-func (client ModelClient) AddCustomPrebuiltDomainResponder(resp *http.Response) (result ListUUID, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// AddCustomPrebuiltEntity adds a custom prebuilt entity model to the application.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// prebuiltDomainModelCreateObject - a model object containing the name of the custom prebuilt entity and the
-// name of the domain to which this model belongs.
-func (client ModelClient) AddCustomPrebuiltEntity(ctx context.Context, appID uuid.UUID, versionID string, prebuiltDomainModelCreateObject PrebuiltDomainModelCreateObject) (result UUID, err error) {
- req, err := client.AddCustomPrebuiltEntityPreparer(ctx, appID, versionID, prebuiltDomainModelCreateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddCustomPrebuiltEntity", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddCustomPrebuiltEntitySender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddCustomPrebuiltEntity", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddCustomPrebuiltEntityResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddCustomPrebuiltEntity", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddCustomPrebuiltEntityPreparer prepares the AddCustomPrebuiltEntity request.
-func (client ModelClient) AddCustomPrebuiltEntityPreparer(ctx context.Context, appID uuid.UUID, versionID string, prebuiltDomainModelCreateObject PrebuiltDomainModelCreateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltentities", pathParameters),
- autorest.WithJSON(prebuiltDomainModelCreateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddCustomPrebuiltEntitySender sends the AddCustomPrebuiltEntity request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) AddCustomPrebuiltEntitySender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddCustomPrebuiltEntityResponder handles the response to the AddCustomPrebuiltEntity request. The method always
-// closes the http.Response Body.
-func (client ModelClient) AddCustomPrebuiltEntityResponder(resp *http.Response) (result UUID, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// AddCustomPrebuiltIntent adds a custom prebuilt intent model to the application.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// prebuiltDomainModelCreateObject - a model object containing the name of the custom prebuilt intent and the
-// name of the domain to which this model belongs.
-func (client ModelClient) AddCustomPrebuiltIntent(ctx context.Context, appID uuid.UUID, versionID string, prebuiltDomainModelCreateObject PrebuiltDomainModelCreateObject) (result UUID, err error) {
- req, err := client.AddCustomPrebuiltIntentPreparer(ctx, appID, versionID, prebuiltDomainModelCreateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddCustomPrebuiltIntent", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddCustomPrebuiltIntentSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddCustomPrebuiltIntent", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddCustomPrebuiltIntentResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddCustomPrebuiltIntent", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddCustomPrebuiltIntentPreparer prepares the AddCustomPrebuiltIntent request.
-func (client ModelClient) AddCustomPrebuiltIntentPreparer(ctx context.Context, appID uuid.UUID, versionID string, prebuiltDomainModelCreateObject PrebuiltDomainModelCreateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltintents", pathParameters),
- autorest.WithJSON(prebuiltDomainModelCreateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddCustomPrebuiltIntentSender sends the AddCustomPrebuiltIntent request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) AddCustomPrebuiltIntentSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddCustomPrebuiltIntentResponder handles the response to the AddCustomPrebuiltIntent request. The method always
-// closes the http.Response Body.
-func (client ModelClient) AddCustomPrebuiltIntentResponder(resp *http.Response) (result UUID, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// AddEntity adds an entity extractor to the application.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// modelCreateObject - a model object containing the name for the new entity extractor.
-func (client ModelClient) AddEntity(ctx context.Context, appID uuid.UUID, versionID string, modelCreateObject ModelCreateObject) (result UUID, err error) {
- req, err := client.AddEntityPreparer(ctx, appID, versionID, modelCreateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddEntity", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddEntitySender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddEntity", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddEntityResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddEntity", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddEntityPreparer prepares the AddEntity request.
-func (client ModelClient) AddEntityPreparer(ctx context.Context, appID uuid.UUID, versionID string, modelCreateObject ModelCreateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities", pathParameters),
- autorest.WithJSON(modelCreateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddEntitySender sends the AddEntity request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) AddEntitySender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddEntityResponder handles the response to the AddEntity request. The method always
-// closes the http.Response Body.
-func (client ModelClient) AddEntityResponder(resp *http.Response) (result UUID, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// AddExplicitListItem sends the add explicit list item request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - the Pattern.Any entity extractor ID.
-// item - the new explicit list item.
-func (client ModelClient) AddExplicitListItem(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, item ExplicitListItemCreateObject) (result Int32, err error) {
- req, err := client.AddExplicitListItemPreparer(ctx, appID, versionID, entityID, item)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddExplicitListItem", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddExplicitListItemSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddExplicitListItem", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddExplicitListItemResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddExplicitListItem", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddExplicitListItemPreparer prepares the AddExplicitListItem request.
-func (client ModelClient) AddExplicitListItemPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, item ExplicitListItemCreateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist", pathParameters),
- autorest.WithJSON(item))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddExplicitListItemSender sends the AddExplicitListItem request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) AddExplicitListItemSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddExplicitListItemResponder handles the response to the AddExplicitListItem request. The method always
-// closes the http.Response Body.
-func (client ModelClient) AddExplicitListItemResponder(resp *http.Response) (result Int32, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// AddHierarchicalEntity adds a hierarchical entity extractor to the application version.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// hierarchicalModelCreateObject - a model containing the name and children of the new entity extractor.
-func (client ModelClient) AddHierarchicalEntity(ctx context.Context, appID uuid.UUID, versionID string, hierarchicalModelCreateObject HierarchicalEntityModel) (result UUID, err error) {
- req, err := client.AddHierarchicalEntityPreparer(ctx, appID, versionID, hierarchicalModelCreateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddHierarchicalEntity", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddHierarchicalEntitySender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddHierarchicalEntity", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddHierarchicalEntityResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddHierarchicalEntity", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddHierarchicalEntityPreparer prepares the AddHierarchicalEntity request.
-func (client ModelClient) AddHierarchicalEntityPreparer(ctx context.Context, appID uuid.UUID, versionID string, hierarchicalModelCreateObject HierarchicalEntityModel) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities", pathParameters),
- autorest.WithJSON(hierarchicalModelCreateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddHierarchicalEntitySender sends the AddHierarchicalEntity request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) AddHierarchicalEntitySender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddHierarchicalEntityResponder handles the response to the AddHierarchicalEntity request. The method always
-// closes the http.Response Body.
-func (client ModelClient) AddHierarchicalEntityResponder(resp *http.Response) (result UUID, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// AddHierarchicalEntityChild creates a single child in an existing hierarchical entity model.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// hEntityID - the hierarchical entity extractor ID.
-// hierarchicalChildModelCreateObject - a model object containing the name of the new hierarchical child model.
-func (client ModelClient) AddHierarchicalEntityChild(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, hierarchicalChildModelCreateObject HierarchicalChildModelCreateObject) (result UUID, err error) {
- req, err := client.AddHierarchicalEntityChildPreparer(ctx, appID, versionID, hEntityID, hierarchicalChildModelCreateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddHierarchicalEntityChild", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddHierarchicalEntityChildSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddHierarchicalEntityChild", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddHierarchicalEntityChildResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddHierarchicalEntityChild", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddHierarchicalEntityChildPreparer prepares the AddHierarchicalEntityChild request.
-func (client ModelClient) AddHierarchicalEntityChildPreparer(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, hierarchicalChildModelCreateObject HierarchicalChildModelCreateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "hEntityId": autorest.Encode("path", hEntityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/children", pathParameters),
- autorest.WithJSON(hierarchicalChildModelCreateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddHierarchicalEntityChildSender sends the AddHierarchicalEntityChild request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) AddHierarchicalEntityChildSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddHierarchicalEntityChildResponder handles the response to the AddHierarchicalEntityChild request. The method always
-// closes the http.Response Body.
-func (client ModelClient) AddHierarchicalEntityChildResponder(resp *http.Response) (result UUID, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// AddIntent adds an intent classifier to the application.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// intentCreateObject - a model object containing the name of the new intent classifier.
-func (client ModelClient) AddIntent(ctx context.Context, appID uuid.UUID, versionID string, intentCreateObject ModelCreateObject) (result UUID, err error) {
- req, err := client.AddIntentPreparer(ctx, appID, versionID, intentCreateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddIntent", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddIntentSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddIntent", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddIntentResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddIntent", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddIntentPreparer prepares the AddIntent request.
-func (client ModelClient) AddIntentPreparer(ctx context.Context, appID uuid.UUID, versionID string, intentCreateObject ModelCreateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/intents", pathParameters),
- autorest.WithJSON(intentCreateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddIntentSender sends the AddIntent request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) AddIntentSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddIntentResponder handles the response to the AddIntent request. The method always
-// closes the http.Response Body.
-func (client ModelClient) AddIntentResponder(resp *http.Response) (result UUID, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// AddPrebuilt adds a list of prebuilt entity extractors to the application.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// prebuiltExtractorNames - an array of prebuilt entity extractor names.
-func (client ModelClient) AddPrebuilt(ctx context.Context, appID uuid.UUID, versionID string, prebuiltExtractorNames []string) (result ListPrebuiltEntityExtractor, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: prebuiltExtractorNames,
- Constraints: []validation.Constraint{{Target: "prebuiltExtractorNames", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("programmatic.ModelClient", "AddPrebuilt", err.Error())
- }
-
- req, err := client.AddPrebuiltPreparer(ctx, appID, versionID, prebuiltExtractorNames)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddPrebuilt", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddPrebuiltSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddPrebuilt", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddPrebuiltResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddPrebuilt", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPrebuiltPreparer prepares the AddPrebuilt request.
-func (client ModelClient) AddPrebuiltPreparer(ctx context.Context, appID uuid.UUID, versionID string, prebuiltExtractorNames []string) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/prebuilts", pathParameters),
- autorest.WithJSON(prebuiltExtractorNames))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddPrebuiltSender sends the AddPrebuilt request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) AddPrebuiltSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddPrebuiltResponder handles the response to the AddPrebuilt request. The method always
-// closes the http.Response Body.
-func (client ModelClient) AddPrebuiltResponder(resp *http.Response) (result ListPrebuiltEntityExtractor, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// AddSubList adds a list to an existing closed list.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// clEntityID - the closed list entity extractor ID.
-// wordListCreateObject - words list.
-func (client ModelClient) AddSubList(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID, wordListCreateObject WordListObject) (result Int32, err error) {
- req, err := client.AddSubListPreparer(ctx, appID, versionID, clEntityID, wordListCreateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddSubList", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSubListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddSubList", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddSubListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "AddSubList", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddSubListPreparer prepares the AddSubList request.
-func (client ModelClient) AddSubListPreparer(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID, wordListCreateObject WordListObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "clEntityId": autorest.Encode("path", clEntityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}/sublists", pathParameters),
- autorest.WithJSON(wordListCreateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSubListSender sends the AddSubList request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) AddSubListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddSubListResponder handles the response to the AddSubList request. The method always
-// closes the http.Response Body.
-func (client ModelClient) AddSubListResponder(resp *http.Response) (result Int32, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// CreateClosedListEntityRole sends the create closed list entity role request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - the entity model ID.
-// entityRoleCreateObject - an entity role object containing the name of role.
-func (client ModelClient) CreateClosedListEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, entityRoleCreateObject EntityRoleCreateObject) (result UUID, err error) {
- req, err := client.CreateClosedListEntityRolePreparer(ctx, appID, versionID, entityID, entityRoleCreateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateClosedListEntityRole", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.CreateClosedListEntityRoleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateClosedListEntityRole", resp, "Failure sending request")
- return
- }
-
- result, err = client.CreateClosedListEntityRoleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateClosedListEntityRole", resp, "Failure responding to request")
- }
-
- return
-}
-
-// CreateClosedListEntityRolePreparer prepares the CreateClosedListEntityRole request.
-func (client ModelClient) CreateClosedListEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, entityRoleCreateObject EntityRoleCreateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles", pathParameters),
- autorest.WithJSON(entityRoleCreateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CreateClosedListEntityRoleSender sends the CreateClosedListEntityRole request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) CreateClosedListEntityRoleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// CreateClosedListEntityRoleResponder handles the response to the CreateClosedListEntityRole request. The method always
-// closes the http.Response Body.
-func (client ModelClient) CreateClosedListEntityRoleResponder(resp *http.Response) (result UUID, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// CreateCompositeEntityRole sends the create composite entity role request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// cEntityID - the composite entity extractor ID.
-// entityRoleCreateObject - an entity role object containing the name of role.
-func (client ModelClient) CreateCompositeEntityRole(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, entityRoleCreateObject EntityRoleCreateObject) (result UUID, err error) {
- req, err := client.CreateCompositeEntityRolePreparer(ctx, appID, versionID, cEntityID, entityRoleCreateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateCompositeEntityRole", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.CreateCompositeEntityRoleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateCompositeEntityRole", resp, "Failure sending request")
- return
- }
-
- result, err = client.CreateCompositeEntityRoleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateCompositeEntityRole", resp, "Failure responding to request")
- }
-
- return
-}
-
-// CreateCompositeEntityRolePreparer prepares the CreateCompositeEntityRole request.
-func (client ModelClient) CreateCompositeEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, entityRoleCreateObject EntityRoleCreateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "cEntityId": autorest.Encode("path", cEntityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles", pathParameters),
- autorest.WithJSON(entityRoleCreateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CreateCompositeEntityRoleSender sends the CreateCompositeEntityRole request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) CreateCompositeEntityRoleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// CreateCompositeEntityRoleResponder handles the response to the CreateCompositeEntityRole request. The method always
-// closes the http.Response Body.
-func (client ModelClient) CreateCompositeEntityRoleResponder(resp *http.Response) (result UUID, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// CreateCustomPrebuiltEntityRole sends the create custom prebuilt entity role request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - the entity model ID.
-// entityRoleCreateObject - an entity role object containing the name of role.
-func (client ModelClient) CreateCustomPrebuiltEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, entityRoleCreateObject EntityRoleCreateObject) (result UUID, err error) {
- req, err := client.CreateCustomPrebuiltEntityRolePreparer(ctx, appID, versionID, entityID, entityRoleCreateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateCustomPrebuiltEntityRole", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.CreateCustomPrebuiltEntityRoleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateCustomPrebuiltEntityRole", resp, "Failure sending request")
- return
- }
-
- result, err = client.CreateCustomPrebuiltEntityRoleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateCustomPrebuiltEntityRole", resp, "Failure responding to request")
- }
-
- return
-}
-
-// CreateCustomPrebuiltEntityRolePreparer prepares the CreateCustomPrebuiltEntityRole request.
-func (client ModelClient) CreateCustomPrebuiltEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, entityRoleCreateObject EntityRoleCreateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles", pathParameters),
- autorest.WithJSON(entityRoleCreateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CreateCustomPrebuiltEntityRoleSender sends the CreateCustomPrebuiltEntityRole request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) CreateCustomPrebuiltEntityRoleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// CreateCustomPrebuiltEntityRoleResponder handles the response to the CreateCustomPrebuiltEntityRole request. The method always
-// closes the http.Response Body.
-func (client ModelClient) CreateCustomPrebuiltEntityRoleResponder(resp *http.Response) (result UUID, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// CreateEntityRole sends the create entity role request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - the entity model ID.
-// entityRoleCreateObject - an entity role object containing the name of role.
-func (client ModelClient) CreateEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, entityRoleCreateObject EntityRoleCreateObject) (result UUID, err error) {
- req, err := client.CreateEntityRolePreparer(ctx, appID, versionID, entityID, entityRoleCreateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateEntityRole", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.CreateEntityRoleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateEntityRole", resp, "Failure sending request")
- return
- }
-
- result, err = client.CreateEntityRoleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateEntityRole", resp, "Failure responding to request")
- }
-
- return
-}
-
-// CreateEntityRolePreparer prepares the CreateEntityRole request.
-func (client ModelClient) CreateEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, entityRoleCreateObject EntityRoleCreateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}/roles", pathParameters),
- autorest.WithJSON(entityRoleCreateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CreateEntityRoleSender sends the CreateEntityRole request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) CreateEntityRoleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// CreateEntityRoleResponder handles the response to the CreateEntityRole request. The method always
-// closes the http.Response Body.
-func (client ModelClient) CreateEntityRoleResponder(resp *http.Response) (result UUID, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// CreateHierarchicalEntityRole sends the create hierarchical entity role request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// hEntityID - the hierarchical entity extractor ID.
-// entityRoleCreateObject - an entity role object containing the name of role.
-func (client ModelClient) CreateHierarchicalEntityRole(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, entityRoleCreateObject EntityRoleCreateObject) (result UUID, err error) {
- req, err := client.CreateHierarchicalEntityRolePreparer(ctx, appID, versionID, hEntityID, entityRoleCreateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateHierarchicalEntityRole", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.CreateHierarchicalEntityRoleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateHierarchicalEntityRole", resp, "Failure sending request")
- return
- }
-
- result, err = client.CreateHierarchicalEntityRoleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateHierarchicalEntityRole", resp, "Failure responding to request")
- }
-
- return
-}
-
-// CreateHierarchicalEntityRolePreparer prepares the CreateHierarchicalEntityRole request.
-func (client ModelClient) CreateHierarchicalEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, entityRoleCreateObject EntityRoleCreateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "hEntityId": autorest.Encode("path", hEntityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles", pathParameters),
- autorest.WithJSON(entityRoleCreateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CreateHierarchicalEntityRoleSender sends the CreateHierarchicalEntityRole request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) CreateHierarchicalEntityRoleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// CreateHierarchicalEntityRoleResponder handles the response to the CreateHierarchicalEntityRole request. The method always
-// closes the http.Response Body.
-func (client ModelClient) CreateHierarchicalEntityRoleResponder(resp *http.Response) (result UUID, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// CreatePatternAnyEntityModel sends the create pattern any entity model request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// extractorCreateObject - a model object containing the name and explicit list for the new Pattern.Any entity
-// extractor.
-func (client ModelClient) CreatePatternAnyEntityModel(ctx context.Context, appID uuid.UUID, versionID string, extractorCreateObject PatternAnyModelCreateObject) (result UUID, err error) {
- req, err := client.CreatePatternAnyEntityModelPreparer(ctx, appID, versionID, extractorCreateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreatePatternAnyEntityModel", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.CreatePatternAnyEntityModelSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreatePatternAnyEntityModel", resp, "Failure sending request")
- return
- }
-
- result, err = client.CreatePatternAnyEntityModelResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreatePatternAnyEntityModel", resp, "Failure responding to request")
- }
-
- return
-}
-
-// CreatePatternAnyEntityModelPreparer prepares the CreatePatternAnyEntityModel request.
-func (client ModelClient) CreatePatternAnyEntityModelPreparer(ctx context.Context, appID uuid.UUID, versionID string, extractorCreateObject PatternAnyModelCreateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities", pathParameters),
- autorest.WithJSON(extractorCreateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CreatePatternAnyEntityModelSender sends the CreatePatternAnyEntityModel request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) CreatePatternAnyEntityModelSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// CreatePatternAnyEntityModelResponder handles the response to the CreatePatternAnyEntityModel request. The method always
-// closes the http.Response Body.
-func (client ModelClient) CreatePatternAnyEntityModelResponder(resp *http.Response) (result UUID, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// CreatePatternAnyEntityRole sends the create pattern any entity role request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - the entity model ID.
-// entityRoleCreateObject - an entity role object containing the name of role.
-func (client ModelClient) CreatePatternAnyEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, entityRoleCreateObject EntityRoleCreateObject) (result UUID, err error) {
- req, err := client.CreatePatternAnyEntityRolePreparer(ctx, appID, versionID, entityID, entityRoleCreateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreatePatternAnyEntityRole", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.CreatePatternAnyEntityRoleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreatePatternAnyEntityRole", resp, "Failure sending request")
- return
- }
-
- result, err = client.CreatePatternAnyEntityRoleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreatePatternAnyEntityRole", resp, "Failure responding to request")
- }
-
- return
-}
-
-// CreatePatternAnyEntityRolePreparer prepares the CreatePatternAnyEntityRole request.
-func (client ModelClient) CreatePatternAnyEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, entityRoleCreateObject EntityRoleCreateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles", pathParameters),
- autorest.WithJSON(entityRoleCreateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CreatePatternAnyEntityRoleSender sends the CreatePatternAnyEntityRole request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) CreatePatternAnyEntityRoleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// CreatePatternAnyEntityRoleResponder handles the response to the CreatePatternAnyEntityRole request. The method always
-// closes the http.Response Body.
-func (client ModelClient) CreatePatternAnyEntityRoleResponder(resp *http.Response) (result UUID, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// CreatePrebuiltEntityRole sends the create prebuilt entity role request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - the entity model ID.
-// entityRoleCreateObject - an entity role object containing the name of role.
-func (client ModelClient) CreatePrebuiltEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, entityRoleCreateObject EntityRoleCreateObject) (result UUID, err error) {
- req, err := client.CreatePrebuiltEntityRolePreparer(ctx, appID, versionID, entityID, entityRoleCreateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreatePrebuiltEntityRole", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.CreatePrebuiltEntityRoleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreatePrebuiltEntityRole", resp, "Failure sending request")
- return
- }
-
- result, err = client.CreatePrebuiltEntityRoleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreatePrebuiltEntityRole", resp, "Failure responding to request")
- }
-
- return
-}
-
-// CreatePrebuiltEntityRolePreparer prepares the CreatePrebuiltEntityRole request.
-func (client ModelClient) CreatePrebuiltEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, entityRoleCreateObject EntityRoleCreateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles", pathParameters),
- autorest.WithJSON(entityRoleCreateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CreatePrebuiltEntityRoleSender sends the CreatePrebuiltEntityRole request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) CreatePrebuiltEntityRoleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// CreatePrebuiltEntityRoleResponder handles the response to the CreatePrebuiltEntityRole request. The method always
-// closes the http.Response Body.
-func (client ModelClient) CreatePrebuiltEntityRoleResponder(resp *http.Response) (result UUID, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// CreateRegexEntityModel sends the create regex entity model request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// regexEntityExtractorCreateObj - a model object containing the name and regex pattern for the new regex
-// entity extractor.
-func (client ModelClient) CreateRegexEntityModel(ctx context.Context, appID uuid.UUID, versionID string, regexEntityExtractorCreateObj RegexModelCreateObject) (result UUID, err error) {
- req, err := client.CreateRegexEntityModelPreparer(ctx, appID, versionID, regexEntityExtractorCreateObj)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateRegexEntityModel", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.CreateRegexEntityModelSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateRegexEntityModel", resp, "Failure sending request")
- return
- }
-
- result, err = client.CreateRegexEntityModelResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateRegexEntityModel", resp, "Failure responding to request")
- }
-
- return
-}
-
-// CreateRegexEntityModelPreparer prepares the CreateRegexEntityModel request.
-func (client ModelClient) CreateRegexEntityModelPreparer(ctx context.Context, appID uuid.UUID, versionID string, regexEntityExtractorCreateObj RegexModelCreateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/regexentities", pathParameters),
- autorest.WithJSON(regexEntityExtractorCreateObj))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CreateRegexEntityModelSender sends the CreateRegexEntityModel request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) CreateRegexEntityModelSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// CreateRegexEntityModelResponder handles the response to the CreateRegexEntityModel request. The method always
-// closes the http.Response Body.
-func (client ModelClient) CreateRegexEntityModelResponder(resp *http.Response) (result UUID, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// CreateRegexEntityRole sends the create regex entity role request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - the entity model ID.
-// entityRoleCreateObject - an entity role object containing the name of role.
-func (client ModelClient) CreateRegexEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, entityRoleCreateObject EntityRoleCreateObject) (result UUID, err error) {
- req, err := client.CreateRegexEntityRolePreparer(ctx, appID, versionID, entityID, entityRoleCreateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateRegexEntityRole", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.CreateRegexEntityRoleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateRegexEntityRole", resp, "Failure sending request")
- return
- }
-
- result, err = client.CreateRegexEntityRoleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "CreateRegexEntityRole", resp, "Failure responding to request")
- }
-
- return
-}
-
-// CreateRegexEntityRolePreparer prepares the CreateRegexEntityRole request.
-func (client ModelClient) CreateRegexEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, entityRoleCreateObject EntityRoleCreateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles", pathParameters),
- autorest.WithJSON(entityRoleCreateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CreateRegexEntityRoleSender sends the CreateRegexEntityRole request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) CreateRegexEntityRoleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// CreateRegexEntityRoleResponder handles the response to the CreateRegexEntityRole request. The method always
-// closes the http.Response Body.
-func (client ModelClient) CreateRegexEntityRoleResponder(resp *http.Response) (result UUID, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// DeleteClosedList deletes a closed list model from the application.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// clEntityID - the closed list model ID.
-func (client ModelClient) DeleteClosedList(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID) (result OperationStatus, err error) {
- req, err := client.DeleteClosedListPreparer(ctx, appID, versionID, clEntityID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteClosedList", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteClosedListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteClosedList", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteClosedListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteClosedList", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteClosedListPreparer prepares the DeleteClosedList request.
-func (client ModelClient) DeleteClosedListPreparer(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "clEntityId": autorest.Encode("path", clEntityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteClosedListSender sends the DeleteClosedList request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) DeleteClosedListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteClosedListResponder handles the response to the DeleteClosedList request. The method always
-// closes the http.Response Body.
-func (client ModelClient) DeleteClosedListResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// DeleteClosedListEntityRole sends the delete closed list entity role request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - the entity ID.
-// roleID - the entity role Id.
-func (client ModelClient) DeleteClosedListEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result OperationStatus, err error) {
- req, err := client.DeleteClosedListEntityRolePreparer(ctx, appID, versionID, entityID, roleID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteClosedListEntityRole", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteClosedListEntityRoleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteClosedListEntityRole", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteClosedListEntityRoleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteClosedListEntityRole", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteClosedListEntityRolePreparer prepares the DeleteClosedListEntityRole request.
-func (client ModelClient) DeleteClosedListEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "roleId": autorest.Encode("path", roleID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles/{roleId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteClosedListEntityRoleSender sends the DeleteClosedListEntityRole request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) DeleteClosedListEntityRoleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteClosedListEntityRoleResponder handles the response to the DeleteClosedListEntityRole request. The method always
-// closes the http.Response Body.
-func (client ModelClient) DeleteClosedListEntityRoleResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// DeleteCompositeEntity deletes a composite entity extractor from the application.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// cEntityID - the composite entity extractor ID.
-func (client ModelClient) DeleteCompositeEntity(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID) (result OperationStatus, err error) {
- req, err := client.DeleteCompositeEntityPreparer(ctx, appID, versionID, cEntityID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteCompositeEntity", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteCompositeEntitySender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteCompositeEntity", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteCompositeEntityResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteCompositeEntity", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteCompositeEntityPreparer prepares the DeleteCompositeEntity request.
-func (client ModelClient) DeleteCompositeEntityPreparer(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "cEntityId": autorest.Encode("path", cEntityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteCompositeEntitySender sends the DeleteCompositeEntity request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) DeleteCompositeEntitySender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteCompositeEntityResponder handles the response to the DeleteCompositeEntity request. The method always
-// closes the http.Response Body.
-func (client ModelClient) DeleteCompositeEntityResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// DeleteCompositeEntityChild deletes a composite entity extractor child from the application.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// cEntityID - the composite entity extractor ID.
-// cChildID - the hierarchical entity extractor child ID.
-func (client ModelClient) DeleteCompositeEntityChild(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, cChildID uuid.UUID) (result OperationStatus, err error) {
- req, err := client.DeleteCompositeEntityChildPreparer(ctx, appID, versionID, cEntityID, cChildID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteCompositeEntityChild", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteCompositeEntityChildSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteCompositeEntityChild", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteCompositeEntityChildResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteCompositeEntityChild", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteCompositeEntityChildPreparer prepares the DeleteCompositeEntityChild request.
-func (client ModelClient) DeleteCompositeEntityChildPreparer(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, cChildID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "cChildId": autorest.Encode("path", cChildID),
- "cEntityId": autorest.Encode("path", cEntityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/children/{cChildId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteCompositeEntityChildSender sends the DeleteCompositeEntityChild request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) DeleteCompositeEntityChildSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteCompositeEntityChildResponder handles the response to the DeleteCompositeEntityChild request. The method always
-// closes the http.Response Body.
-func (client ModelClient) DeleteCompositeEntityChildResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// DeleteCompositeEntityRole sends the delete composite entity role request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// cEntityID - the composite entity extractor ID.
-// roleID - the entity role Id.
-func (client ModelClient) DeleteCompositeEntityRole(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, roleID uuid.UUID) (result OperationStatus, err error) {
- req, err := client.DeleteCompositeEntityRolePreparer(ctx, appID, versionID, cEntityID, roleID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteCompositeEntityRole", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteCompositeEntityRoleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteCompositeEntityRole", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteCompositeEntityRoleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteCompositeEntityRole", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteCompositeEntityRolePreparer prepares the DeleteCompositeEntityRole request.
-func (client ModelClient) DeleteCompositeEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, roleID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "cEntityId": autorest.Encode("path", cEntityID),
- "roleId": autorest.Encode("path", roleID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles/{roleId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteCompositeEntityRoleSender sends the DeleteCompositeEntityRole request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) DeleteCompositeEntityRoleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteCompositeEntityRoleResponder handles the response to the DeleteCompositeEntityRole request. The method always
-// closes the http.Response Body.
-func (client ModelClient) DeleteCompositeEntityRoleResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// DeleteCustomEntityRole sends the delete custom entity role request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - the entity ID.
-// roleID - the entity role Id.
-func (client ModelClient) DeleteCustomEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result OperationStatus, err error) {
- req, err := client.DeleteCustomEntityRolePreparer(ctx, appID, versionID, entityID, roleID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteCustomEntityRole", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteCustomEntityRoleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteCustomEntityRole", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteCustomEntityRoleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteCustomEntityRole", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteCustomEntityRolePreparer prepares the DeleteCustomEntityRole request.
-func (client ModelClient) DeleteCustomEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "roleId": autorest.Encode("path", roleID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles/{roleId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteCustomEntityRoleSender sends the DeleteCustomEntityRole request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) DeleteCustomEntityRoleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteCustomEntityRoleResponder handles the response to the DeleteCustomEntityRole request. The method always
-// closes the http.Response Body.
-func (client ModelClient) DeleteCustomEntityRoleResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// DeleteCustomPrebuiltDomain deletes a prebuilt domain's models from the application.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// domainName - domain name.
-func (client ModelClient) DeleteCustomPrebuiltDomain(ctx context.Context, appID uuid.UUID, versionID string, domainName string) (result OperationStatus, err error) {
- req, err := client.DeleteCustomPrebuiltDomainPreparer(ctx, appID, versionID, domainName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteCustomPrebuiltDomain", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteCustomPrebuiltDomainSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteCustomPrebuiltDomain", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteCustomPrebuiltDomainResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteCustomPrebuiltDomain", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteCustomPrebuiltDomainPreparer prepares the DeleteCustomPrebuiltDomain request.
-func (client ModelClient) DeleteCustomPrebuiltDomainPreparer(ctx context.Context, appID uuid.UUID, versionID string, domainName string) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "domainName": autorest.Encode("path", domainName),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltdomains/{domainName}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteCustomPrebuiltDomainSender sends the DeleteCustomPrebuiltDomain request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) DeleteCustomPrebuiltDomainSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteCustomPrebuiltDomainResponder handles the response to the DeleteCustomPrebuiltDomain request. The method always
-// closes the http.Response Body.
-func (client ModelClient) DeleteCustomPrebuiltDomainResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// DeleteEntity deletes an entity extractor from the application.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - the entity extractor ID.
-func (client ModelClient) DeleteEntity(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result OperationStatus, err error) {
- req, err := client.DeleteEntityPreparer(ctx, appID, versionID, entityID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteEntity", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteEntitySender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteEntity", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteEntityResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteEntity", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteEntityPreparer prepares the DeleteEntity request.
-func (client ModelClient) DeleteEntityPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteEntitySender sends the DeleteEntity request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) DeleteEntitySender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteEntityResponder handles the response to the DeleteEntity request. The method always
-// closes the http.Response Body.
-func (client ModelClient) DeleteEntityResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// DeleteEntityRole sends the delete entity role request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - the entity ID.
-// roleID - the entity role Id.
-func (client ModelClient) DeleteEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result OperationStatus, err error) {
- req, err := client.DeleteEntityRolePreparer(ctx, appID, versionID, entityID, roleID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteEntityRole", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteEntityRoleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteEntityRole", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteEntityRoleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteEntityRole", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteEntityRolePreparer prepares the DeleteEntityRole request.
-func (client ModelClient) DeleteEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "roleId": autorest.Encode("path", roleID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}/roles/{roleId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteEntityRoleSender sends the DeleteEntityRole request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) DeleteEntityRoleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteEntityRoleResponder handles the response to the DeleteEntityRole request. The method always
-// closes the http.Response Body.
-func (client ModelClient) DeleteEntityRoleResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// DeleteExplicitListItem sends the delete explicit list item request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - the pattern.any entity id.
-// itemID - the explicit list item which will be deleted.
-func (client ModelClient) DeleteExplicitListItem(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, itemID int64) (result OperationStatus, err error) {
- req, err := client.DeleteExplicitListItemPreparer(ctx, appID, versionID, entityID, itemID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteExplicitListItem", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteExplicitListItemSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteExplicitListItem", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteExplicitListItemResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteExplicitListItem", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteExplicitListItemPreparer prepares the DeleteExplicitListItem request.
-func (client ModelClient) DeleteExplicitListItemPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, itemID int64) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "itemId": autorest.Encode("path", itemID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist/{itemId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteExplicitListItemSender sends the DeleteExplicitListItem request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) DeleteExplicitListItemSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteExplicitListItemResponder handles the response to the DeleteExplicitListItem request. The method always
-// closes the http.Response Body.
-func (client ModelClient) DeleteExplicitListItemResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// DeleteHierarchicalEntity deletes a hierarchical entity extractor from the application version.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// hEntityID - the hierarchical entity extractor ID.
-func (client ModelClient) DeleteHierarchicalEntity(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID) (result OperationStatus, err error) {
- req, err := client.DeleteHierarchicalEntityPreparer(ctx, appID, versionID, hEntityID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteHierarchicalEntity", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteHierarchicalEntitySender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteHierarchicalEntity", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteHierarchicalEntityResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteHierarchicalEntity", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteHierarchicalEntityPreparer prepares the DeleteHierarchicalEntity request.
-func (client ModelClient) DeleteHierarchicalEntityPreparer(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "hEntityId": autorest.Encode("path", hEntityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteHierarchicalEntitySender sends the DeleteHierarchicalEntity request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) DeleteHierarchicalEntitySender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteHierarchicalEntityResponder handles the response to the DeleteHierarchicalEntity request. The method always
-// closes the http.Response Body.
-func (client ModelClient) DeleteHierarchicalEntityResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// DeleteHierarchicalEntityChild deletes a hierarchical entity extractor child from the application.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// hEntityID - the hierarchical entity extractor ID.
-// hChildID - the hierarchical entity extractor child ID.
-func (client ModelClient) DeleteHierarchicalEntityChild(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, hChildID uuid.UUID) (result OperationStatus, err error) {
- req, err := client.DeleteHierarchicalEntityChildPreparer(ctx, appID, versionID, hEntityID, hChildID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteHierarchicalEntityChild", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteHierarchicalEntityChildSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteHierarchicalEntityChild", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteHierarchicalEntityChildResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteHierarchicalEntityChild", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteHierarchicalEntityChildPreparer prepares the DeleteHierarchicalEntityChild request.
-func (client ModelClient) DeleteHierarchicalEntityChildPreparer(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, hChildID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "hChildId": autorest.Encode("path", hChildID),
- "hEntityId": autorest.Encode("path", hEntityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/children/{hChildId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteHierarchicalEntityChildSender sends the DeleteHierarchicalEntityChild request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) DeleteHierarchicalEntityChildSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteHierarchicalEntityChildResponder handles the response to the DeleteHierarchicalEntityChild request. The method always
-// closes the http.Response Body.
-func (client ModelClient) DeleteHierarchicalEntityChildResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// DeleteHierarchicalEntityRole sends the delete hierarchical entity role request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// hEntityID - the hierarchical entity extractor ID.
-// roleID - the entity role Id.
-func (client ModelClient) DeleteHierarchicalEntityRole(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, roleID uuid.UUID) (result OperationStatus, err error) {
- req, err := client.DeleteHierarchicalEntityRolePreparer(ctx, appID, versionID, hEntityID, roleID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteHierarchicalEntityRole", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteHierarchicalEntityRoleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteHierarchicalEntityRole", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteHierarchicalEntityRoleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteHierarchicalEntityRole", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteHierarchicalEntityRolePreparer prepares the DeleteHierarchicalEntityRole request.
-func (client ModelClient) DeleteHierarchicalEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, roleID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "hEntityId": autorest.Encode("path", hEntityID),
- "roleId": autorest.Encode("path", roleID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles/{roleId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteHierarchicalEntityRoleSender sends the DeleteHierarchicalEntityRole request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) DeleteHierarchicalEntityRoleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteHierarchicalEntityRoleResponder handles the response to the DeleteHierarchicalEntityRole request. The method always
-// closes the http.Response Body.
-func (client ModelClient) DeleteHierarchicalEntityRoleResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// DeleteIntent deletes an intent classifier from the application.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// intentID - the intent classifier ID.
-// deleteUtterances - also delete the intent's utterances (true). Or move the utterances to the None intent
-// (false - the default value).
-func (client ModelClient) DeleteIntent(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, deleteUtterances *bool) (result OperationStatus, err error) {
- req, err := client.DeleteIntentPreparer(ctx, appID, versionID, intentID, deleteUtterances)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteIntent", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteIntentSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteIntent", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteIntentResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteIntent", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteIntentPreparer prepares the DeleteIntent request.
-func (client ModelClient) DeleteIntentPreparer(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, deleteUtterances *bool) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "intentId": autorest.Encode("path", intentID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- queryParameters := map[string]interface{}{}
- if deleteUtterances != nil {
- queryParameters["deleteUtterances"] = autorest.Encode("query", *deleteUtterances)
- } else {
- queryParameters["deleteUtterances"] = autorest.Encode("query", false)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/intents/{intentId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteIntentSender sends the DeleteIntent request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) DeleteIntentSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteIntentResponder handles the response to the DeleteIntent request. The method always
-// closes the http.Response Body.
-func (client ModelClient) DeleteIntentResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// DeletePatternAnyEntityModel sends the delete pattern any entity model request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - the Pattern.Any entity extractor ID.
-func (client ModelClient) DeletePatternAnyEntityModel(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result OperationStatus, err error) {
- req, err := client.DeletePatternAnyEntityModelPreparer(ctx, appID, versionID, entityID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeletePatternAnyEntityModel", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeletePatternAnyEntityModelSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeletePatternAnyEntityModel", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeletePatternAnyEntityModelResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeletePatternAnyEntityModel", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePatternAnyEntityModelPreparer prepares the DeletePatternAnyEntityModel request.
-func (client ModelClient) DeletePatternAnyEntityModelPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeletePatternAnyEntityModelSender sends the DeletePatternAnyEntityModel request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) DeletePatternAnyEntityModelSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeletePatternAnyEntityModelResponder handles the response to the DeletePatternAnyEntityModel request. The method always
-// closes the http.Response Body.
-func (client ModelClient) DeletePatternAnyEntityModelResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// DeletePatternAnyEntityRole sends the delete pattern any entity role request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - the entity ID.
-// roleID - the entity role Id.
-func (client ModelClient) DeletePatternAnyEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result OperationStatus, err error) {
- req, err := client.DeletePatternAnyEntityRolePreparer(ctx, appID, versionID, entityID, roleID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeletePatternAnyEntityRole", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeletePatternAnyEntityRoleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeletePatternAnyEntityRole", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeletePatternAnyEntityRoleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeletePatternAnyEntityRole", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePatternAnyEntityRolePreparer prepares the DeletePatternAnyEntityRole request.
-func (client ModelClient) DeletePatternAnyEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "roleId": autorest.Encode("path", roleID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles/{roleId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeletePatternAnyEntityRoleSender sends the DeletePatternAnyEntityRole request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) DeletePatternAnyEntityRoleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeletePatternAnyEntityRoleResponder handles the response to the DeletePatternAnyEntityRole request. The method always
-// closes the http.Response Body.
-func (client ModelClient) DeletePatternAnyEntityRoleResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// DeletePrebuilt deletes a prebuilt entity extractor from the application.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// prebuiltID - the prebuilt entity extractor ID.
-func (client ModelClient) DeletePrebuilt(ctx context.Context, appID uuid.UUID, versionID string, prebuiltID uuid.UUID) (result OperationStatus, err error) {
- req, err := client.DeletePrebuiltPreparer(ctx, appID, versionID, prebuiltID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeletePrebuilt", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeletePrebuiltSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeletePrebuilt", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeletePrebuiltResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeletePrebuilt", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePrebuiltPreparer prepares the DeletePrebuilt request.
-func (client ModelClient) DeletePrebuiltPreparer(ctx context.Context, appID uuid.UUID, versionID string, prebuiltID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "prebuiltId": autorest.Encode("path", prebuiltID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/prebuilts/{prebuiltId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeletePrebuiltSender sends the DeletePrebuilt request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) DeletePrebuiltSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeletePrebuiltResponder handles the response to the DeletePrebuilt request. The method always
-// closes the http.Response Body.
-func (client ModelClient) DeletePrebuiltResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// DeletePrebuiltEntityRole sends the delete prebuilt entity role request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - the entity ID.
-// roleID - the entity role Id.
-func (client ModelClient) DeletePrebuiltEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result OperationStatus, err error) {
- req, err := client.DeletePrebuiltEntityRolePreparer(ctx, appID, versionID, entityID, roleID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeletePrebuiltEntityRole", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeletePrebuiltEntityRoleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeletePrebuiltEntityRole", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeletePrebuiltEntityRoleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeletePrebuiltEntityRole", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePrebuiltEntityRolePreparer prepares the DeletePrebuiltEntityRole request.
-func (client ModelClient) DeletePrebuiltEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "roleId": autorest.Encode("path", roleID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles/{roleId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeletePrebuiltEntityRoleSender sends the DeletePrebuiltEntityRole request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) DeletePrebuiltEntityRoleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeletePrebuiltEntityRoleResponder handles the response to the DeletePrebuiltEntityRole request. The method always
-// closes the http.Response Body.
-func (client ModelClient) DeletePrebuiltEntityRoleResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// DeleteRegexEntityModel sends the delete regex entity model request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// regexEntityID - the regex entity extractor ID.
-func (client ModelClient) DeleteRegexEntityModel(ctx context.Context, appID uuid.UUID, versionID string, regexEntityID uuid.UUID) (result OperationStatus, err error) {
- req, err := client.DeleteRegexEntityModelPreparer(ctx, appID, versionID, regexEntityID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteRegexEntityModel", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteRegexEntityModelSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteRegexEntityModel", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteRegexEntityModelResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteRegexEntityModel", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteRegexEntityModelPreparer prepares the DeleteRegexEntityModel request.
-func (client ModelClient) DeleteRegexEntityModelPreparer(ctx context.Context, appID uuid.UUID, versionID string, regexEntityID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "regexEntityId": autorest.Encode("path", regexEntityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/regexentities/{regexEntityId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteRegexEntityModelSender sends the DeleteRegexEntityModel request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) DeleteRegexEntityModelSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteRegexEntityModelResponder handles the response to the DeleteRegexEntityModel request. The method always
-// closes the http.Response Body.
-func (client ModelClient) DeleteRegexEntityModelResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// DeleteRegexEntityRole sends the delete regex entity role request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - the entity ID.
-// roleID - the entity role Id.
-func (client ModelClient) DeleteRegexEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result OperationStatus, err error) {
- req, err := client.DeleteRegexEntityRolePreparer(ctx, appID, versionID, entityID, roleID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteRegexEntityRole", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteRegexEntityRoleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteRegexEntityRole", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteRegexEntityRoleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteRegexEntityRole", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteRegexEntityRolePreparer prepares the DeleteRegexEntityRole request.
-func (client ModelClient) DeleteRegexEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "roleId": autorest.Encode("path", roleID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles/{roleId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteRegexEntityRoleSender sends the DeleteRegexEntityRole request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) DeleteRegexEntityRoleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteRegexEntityRoleResponder handles the response to the DeleteRegexEntityRole request. The method always
-// closes the http.Response Body.
-func (client ModelClient) DeleteRegexEntityRoleResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// DeleteSubList deletes a sublist of a specific closed list model.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// clEntityID - the closed list entity extractor ID.
-// subListID - the sublist ID.
-func (client ModelClient) DeleteSubList(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID, subListID int32) (result OperationStatus, err error) {
- req, err := client.DeleteSubListPreparer(ctx, appID, versionID, clEntityID, subListID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteSubList", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSubListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteSubList", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteSubListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "DeleteSubList", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteSubListPreparer prepares the DeleteSubList request.
-func (client ModelClient) DeleteSubListPreparer(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID, subListID int32) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "clEntityId": autorest.Encode("path", clEntityID),
- "subListId": autorest.Encode("path", subListID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}/sublists/{subListId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSubListSender sends the DeleteSubList request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) DeleteSubListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteSubListResponder handles the response to the DeleteSubList request. The method always
-// closes the http.Response Body.
-func (client ModelClient) DeleteSubListResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetClosedList gets information of a closed list model.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// clEntityID - the closed list model ID.
-func (client ModelClient) GetClosedList(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID) (result ClosedListEntityExtractor, err error) {
- req, err := client.GetClosedListPreparer(ctx, appID, versionID, clEntityID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetClosedList", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetClosedListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetClosedList", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetClosedListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetClosedList", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetClosedListPreparer prepares the GetClosedList request.
-func (client ModelClient) GetClosedListPreparer(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "clEntityId": autorest.Encode("path", clEntityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetClosedListSender sends the GetClosedList request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) GetClosedListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetClosedListResponder handles the response to the GetClosedList request. The method always
-// closes the http.Response Body.
-func (client ModelClient) GetClosedListResponder(resp *http.Response) (result ClosedListEntityExtractor, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetClosedListEntityRole sends the get closed list entity role request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - entity ID.
-// roleID - entity role ID.
-func (client ModelClient) GetClosedListEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result EntityRole, err error) {
- req, err := client.GetClosedListEntityRolePreparer(ctx, appID, versionID, entityID, roleID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetClosedListEntityRole", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetClosedListEntityRoleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetClosedListEntityRole", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetClosedListEntityRoleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetClosedListEntityRole", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetClosedListEntityRolePreparer prepares the GetClosedListEntityRole request.
-func (client ModelClient) GetClosedListEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "roleId": autorest.Encode("path", roleID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles/{roleId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetClosedListEntityRoleSender sends the GetClosedListEntityRole request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) GetClosedListEntityRoleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetClosedListEntityRoleResponder handles the response to the GetClosedListEntityRole request. The method always
-// closes the http.Response Body.
-func (client ModelClient) GetClosedListEntityRoleResponder(resp *http.Response) (result EntityRole, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetClosedListEntityRoles sends the get closed list entity roles request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - entity Id
-func (client ModelClient) GetClosedListEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result ListEntityRole, err error) {
- req, err := client.GetClosedListEntityRolesPreparer(ctx, appID, versionID, entityID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetClosedListEntityRoles", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetClosedListEntityRolesSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetClosedListEntityRoles", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetClosedListEntityRolesResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetClosedListEntityRoles", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetClosedListEntityRolesPreparer prepares the GetClosedListEntityRoles request.
-func (client ModelClient) GetClosedListEntityRolesPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetClosedListEntityRolesSender sends the GetClosedListEntityRoles request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) GetClosedListEntityRolesSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetClosedListEntityRolesResponder handles the response to the GetClosedListEntityRoles request. The method always
-// closes the http.Response Body.
-func (client ModelClient) GetClosedListEntityRolesResponder(resp *http.Response) (result ListEntityRole, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetCompositeEntity gets information about the composite entity model.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// cEntityID - the composite entity extractor ID.
-func (client ModelClient) GetCompositeEntity(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID) (result CompositeEntityExtractor, err error) {
- req, err := client.GetCompositeEntityPreparer(ctx, appID, versionID, cEntityID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetCompositeEntity", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetCompositeEntitySender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetCompositeEntity", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetCompositeEntityResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetCompositeEntity", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetCompositeEntityPreparer prepares the GetCompositeEntity request.
-func (client ModelClient) GetCompositeEntityPreparer(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "cEntityId": autorest.Encode("path", cEntityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetCompositeEntitySender sends the GetCompositeEntity request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) GetCompositeEntitySender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetCompositeEntityResponder handles the response to the GetCompositeEntity request. The method always
-// closes the http.Response Body.
-func (client ModelClient) GetCompositeEntityResponder(resp *http.Response) (result CompositeEntityExtractor, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetCompositeEntityRole sends the get composite entity role request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// cEntityID - the composite entity extractor ID.
-// roleID - entity role ID.
-func (client ModelClient) GetCompositeEntityRole(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, roleID uuid.UUID) (result EntityRole, err error) {
- req, err := client.GetCompositeEntityRolePreparer(ctx, appID, versionID, cEntityID, roleID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetCompositeEntityRole", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetCompositeEntityRoleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetCompositeEntityRole", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetCompositeEntityRoleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetCompositeEntityRole", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetCompositeEntityRolePreparer prepares the GetCompositeEntityRole request.
-func (client ModelClient) GetCompositeEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, roleID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "cEntityId": autorest.Encode("path", cEntityID),
- "roleId": autorest.Encode("path", roleID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles/{roleId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetCompositeEntityRoleSender sends the GetCompositeEntityRole request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) GetCompositeEntityRoleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetCompositeEntityRoleResponder handles the response to the GetCompositeEntityRole request. The method always
-// closes the http.Response Body.
-func (client ModelClient) GetCompositeEntityRoleResponder(resp *http.Response) (result EntityRole, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetCompositeEntityRoles sends the get composite entity roles request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// cEntityID - the composite entity extractor ID.
-func (client ModelClient) GetCompositeEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID) (result ListEntityRole, err error) {
- req, err := client.GetCompositeEntityRolesPreparer(ctx, appID, versionID, cEntityID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetCompositeEntityRoles", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetCompositeEntityRolesSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetCompositeEntityRoles", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetCompositeEntityRolesResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetCompositeEntityRoles", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetCompositeEntityRolesPreparer prepares the GetCompositeEntityRoles request.
-func (client ModelClient) GetCompositeEntityRolesPreparer(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "cEntityId": autorest.Encode("path", cEntityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetCompositeEntityRolesSender sends the GetCompositeEntityRoles request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) GetCompositeEntityRolesSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetCompositeEntityRolesResponder handles the response to the GetCompositeEntityRoles request. The method always
-// closes the http.Response Body.
-func (client ModelClient) GetCompositeEntityRolesResponder(resp *http.Response) (result ListEntityRole, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetCustomEntityRole sends the get custom entity role request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - entity ID.
-// roleID - entity role ID.
-func (client ModelClient) GetCustomEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result EntityRole, err error) {
- req, err := client.GetCustomEntityRolePreparer(ctx, appID, versionID, entityID, roleID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetCustomEntityRole", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetCustomEntityRoleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetCustomEntityRole", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetCustomEntityRoleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetCustomEntityRole", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetCustomEntityRolePreparer prepares the GetCustomEntityRole request.
-func (client ModelClient) GetCustomEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "roleId": autorest.Encode("path", roleID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles/{roleId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetCustomEntityRoleSender sends the GetCustomEntityRole request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) GetCustomEntityRoleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetCustomEntityRoleResponder handles the response to the GetCustomEntityRole request. The method always
-// closes the http.Response Body.
-func (client ModelClient) GetCustomEntityRoleResponder(resp *http.Response) (result EntityRole, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetCustomPrebuiltEntityRoles sends the get custom prebuilt entity roles request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - entity Id
-func (client ModelClient) GetCustomPrebuiltEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result ListEntityRole, err error) {
- req, err := client.GetCustomPrebuiltEntityRolesPreparer(ctx, appID, versionID, entityID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetCustomPrebuiltEntityRoles", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetCustomPrebuiltEntityRolesSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetCustomPrebuiltEntityRoles", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetCustomPrebuiltEntityRolesResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetCustomPrebuiltEntityRoles", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetCustomPrebuiltEntityRolesPreparer prepares the GetCustomPrebuiltEntityRoles request.
-func (client ModelClient) GetCustomPrebuiltEntityRolesPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetCustomPrebuiltEntityRolesSender sends the GetCustomPrebuiltEntityRoles request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) GetCustomPrebuiltEntityRolesSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetCustomPrebuiltEntityRolesResponder handles the response to the GetCustomPrebuiltEntityRoles request. The method always
-// closes the http.Response Body.
-func (client ModelClient) GetCustomPrebuiltEntityRolesResponder(resp *http.Response) (result ListEntityRole, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetEntity gets information about the entity model.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - the entity extractor ID.
-func (client ModelClient) GetEntity(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result EntityExtractor, err error) {
- req, err := client.GetEntityPreparer(ctx, appID, versionID, entityID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetEntity", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetEntitySender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetEntity", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetEntityResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetEntity", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetEntityPreparer prepares the GetEntity request.
-func (client ModelClient) GetEntityPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetEntitySender sends the GetEntity request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) GetEntitySender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetEntityResponder handles the response to the GetEntity request. The method always
-// closes the http.Response Body.
-func (client ModelClient) GetEntityResponder(resp *http.Response) (result EntityExtractor, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetEntityRole sends the get entity role request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - entity ID.
-// roleID - entity role ID.
-func (client ModelClient) GetEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result EntityRole, err error) {
- req, err := client.GetEntityRolePreparer(ctx, appID, versionID, entityID, roleID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetEntityRole", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetEntityRoleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetEntityRole", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetEntityRoleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetEntityRole", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetEntityRolePreparer prepares the GetEntityRole request.
-func (client ModelClient) GetEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "roleId": autorest.Encode("path", roleID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}/roles/{roleId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetEntityRoleSender sends the GetEntityRole request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) GetEntityRoleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetEntityRoleResponder handles the response to the GetEntityRole request. The method always
-// closes the http.Response Body.
-func (client ModelClient) GetEntityRoleResponder(resp *http.Response) (result EntityRole, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetEntityRoles sends the get entity roles request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - entity Id
-func (client ModelClient) GetEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result ListEntityRole, err error) {
- req, err := client.GetEntityRolesPreparer(ctx, appID, versionID, entityID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetEntityRoles", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetEntityRolesSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetEntityRoles", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetEntityRolesResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetEntityRoles", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetEntityRolesPreparer prepares the GetEntityRoles request.
-func (client ModelClient) GetEntityRolesPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}/roles", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetEntityRolesSender sends the GetEntityRoles request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) GetEntityRolesSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetEntityRolesResponder handles the response to the GetEntityRoles request. The method always
-// closes the http.Response Body.
-func (client ModelClient) GetEntityRolesResponder(resp *http.Response) (result ListEntityRole, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetEntitySuggestions get suggestion examples that would improve the accuracy of the entity model.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - the target entity extractor model to enhance.
-// take - the number of entries to return. Maximum page size is 500. Default is 100.
-func (client ModelClient) GetEntitySuggestions(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, take *int32) (result ListEntitiesSuggestionExample, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: take,
- Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil},
- {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("programmatic.ModelClient", "GetEntitySuggestions", err.Error())
- }
-
- req, err := client.GetEntitySuggestionsPreparer(ctx, appID, versionID, entityID, take)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetEntitySuggestions", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetEntitySuggestionsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetEntitySuggestions", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetEntitySuggestionsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetEntitySuggestions", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetEntitySuggestionsPreparer prepares the GetEntitySuggestions request.
-func (client ModelClient) GetEntitySuggestionsPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, take *int32) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- queryParameters := map[string]interface{}{}
- if take != nil {
- queryParameters["take"] = autorest.Encode("query", *take)
- } else {
- queryParameters["take"] = autorest.Encode("query", 100)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}/suggest", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetEntitySuggestionsSender sends the GetEntitySuggestions request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) GetEntitySuggestionsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetEntitySuggestionsResponder handles the response to the GetEntitySuggestions request. The method always
-// closes the http.Response Body.
-func (client ModelClient) GetEntitySuggestionsResponder(resp *http.Response) (result ListEntitiesSuggestionExample, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetExplicitList sends the get explicit list request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - the Pattern.Any entity id.
-func (client ModelClient) GetExplicitList(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result ListExplicitListItem, err error) {
- req, err := client.GetExplicitListPreparer(ctx, appID, versionID, entityID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetExplicitList", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetExplicitListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetExplicitList", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetExplicitListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetExplicitList", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetExplicitListPreparer prepares the GetExplicitList request.
-func (client ModelClient) GetExplicitListPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetExplicitListSender sends the GetExplicitList request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) GetExplicitListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetExplicitListResponder handles the response to the GetExplicitList request. The method always
-// closes the http.Response Body.
-func (client ModelClient) GetExplicitListResponder(resp *http.Response) (result ListExplicitListItem, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetExplicitListItem sends the get explicit list item request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - the Pattern.Any entity Id.
-// itemID - the explicit list item Id.
-func (client ModelClient) GetExplicitListItem(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, itemID int64) (result ExplicitListItem, err error) {
- req, err := client.GetExplicitListItemPreparer(ctx, appID, versionID, entityID, itemID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetExplicitListItem", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetExplicitListItemSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetExplicitListItem", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetExplicitListItemResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetExplicitListItem", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetExplicitListItemPreparer prepares the GetExplicitListItem request.
-func (client ModelClient) GetExplicitListItemPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, itemID int64) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "itemId": autorest.Encode("path", itemID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist/{itemId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetExplicitListItemSender sends the GetExplicitListItem request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) GetExplicitListItemSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetExplicitListItemResponder handles the response to the GetExplicitListItem request. The method always
-// closes the http.Response Body.
-func (client ModelClient) GetExplicitListItemResponder(resp *http.Response) (result ExplicitListItem, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetHierarchicalEntity gets information about the hierarchical entity model.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// hEntityID - the hierarchical entity extractor ID.
-func (client ModelClient) GetHierarchicalEntity(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID) (result HierarchicalEntityExtractor, err error) {
- req, err := client.GetHierarchicalEntityPreparer(ctx, appID, versionID, hEntityID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetHierarchicalEntity", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetHierarchicalEntitySender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetHierarchicalEntity", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetHierarchicalEntityResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetHierarchicalEntity", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetHierarchicalEntityPreparer prepares the GetHierarchicalEntity request.
-func (client ModelClient) GetHierarchicalEntityPreparer(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "hEntityId": autorest.Encode("path", hEntityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetHierarchicalEntitySender sends the GetHierarchicalEntity request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) GetHierarchicalEntitySender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetHierarchicalEntityResponder handles the response to the GetHierarchicalEntity request. The method always
-// closes the http.Response Body.
-func (client ModelClient) GetHierarchicalEntityResponder(resp *http.Response) (result HierarchicalEntityExtractor, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetHierarchicalEntityChild gets information about the hierarchical entity child model.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// hEntityID - the hierarchical entity extractor ID.
-// hChildID - the hierarchical entity extractor child ID.
-func (client ModelClient) GetHierarchicalEntityChild(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, hChildID uuid.UUID) (result HierarchicalChildEntity, err error) {
- req, err := client.GetHierarchicalEntityChildPreparer(ctx, appID, versionID, hEntityID, hChildID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetHierarchicalEntityChild", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetHierarchicalEntityChildSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetHierarchicalEntityChild", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetHierarchicalEntityChildResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetHierarchicalEntityChild", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetHierarchicalEntityChildPreparer prepares the GetHierarchicalEntityChild request.
-func (client ModelClient) GetHierarchicalEntityChildPreparer(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, hChildID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "hChildId": autorest.Encode("path", hChildID),
- "hEntityId": autorest.Encode("path", hEntityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/children/{hChildId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetHierarchicalEntityChildSender sends the GetHierarchicalEntityChild request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) GetHierarchicalEntityChildSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetHierarchicalEntityChildResponder handles the response to the GetHierarchicalEntityChild request. The method always
-// closes the http.Response Body.
-func (client ModelClient) GetHierarchicalEntityChildResponder(resp *http.Response) (result HierarchicalChildEntity, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetHierarchicalEntityRole sends the get hierarchical entity role request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// hEntityID - the hierarchical entity extractor ID.
-// roleID - entity role ID.
-func (client ModelClient) GetHierarchicalEntityRole(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, roleID uuid.UUID) (result EntityRole, err error) {
- req, err := client.GetHierarchicalEntityRolePreparer(ctx, appID, versionID, hEntityID, roleID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetHierarchicalEntityRole", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetHierarchicalEntityRoleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetHierarchicalEntityRole", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetHierarchicalEntityRoleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetHierarchicalEntityRole", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetHierarchicalEntityRolePreparer prepares the GetHierarchicalEntityRole request.
-func (client ModelClient) GetHierarchicalEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, roleID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "hEntityId": autorest.Encode("path", hEntityID),
- "roleId": autorest.Encode("path", roleID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles/{roleId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetHierarchicalEntityRoleSender sends the GetHierarchicalEntityRole request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) GetHierarchicalEntityRoleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetHierarchicalEntityRoleResponder handles the response to the GetHierarchicalEntityRole request. The method always
-// closes the http.Response Body.
-func (client ModelClient) GetHierarchicalEntityRoleResponder(resp *http.Response) (result EntityRole, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetHierarchicalEntityRoles sends the get hierarchical entity roles request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// hEntityID - the hierarchical entity extractor ID.
-func (client ModelClient) GetHierarchicalEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID) (result ListEntityRole, err error) {
- req, err := client.GetHierarchicalEntityRolesPreparer(ctx, appID, versionID, hEntityID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetHierarchicalEntityRoles", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetHierarchicalEntityRolesSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetHierarchicalEntityRoles", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetHierarchicalEntityRolesResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetHierarchicalEntityRoles", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetHierarchicalEntityRolesPreparer prepares the GetHierarchicalEntityRoles request.
-func (client ModelClient) GetHierarchicalEntityRolesPreparer(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "hEntityId": autorest.Encode("path", hEntityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetHierarchicalEntityRolesSender sends the GetHierarchicalEntityRoles request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) GetHierarchicalEntityRolesSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetHierarchicalEntityRolesResponder handles the response to the GetHierarchicalEntityRoles request. The method always
-// closes the http.Response Body.
-func (client ModelClient) GetHierarchicalEntityRolesResponder(resp *http.Response) (result ListEntityRole, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetIntent gets information about the intent model.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// intentID - the intent classifier ID.
-func (client ModelClient) GetIntent(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID) (result IntentClassifier, err error) {
- req, err := client.GetIntentPreparer(ctx, appID, versionID, intentID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetIntent", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetIntentSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetIntent", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetIntentResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetIntent", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetIntentPreparer prepares the GetIntent request.
-func (client ModelClient) GetIntentPreparer(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "intentId": autorest.Encode("path", intentID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/intents/{intentId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetIntentSender sends the GetIntent request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) GetIntentSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetIntentResponder handles the response to the GetIntent request. The method always
-// closes the http.Response Body.
-func (client ModelClient) GetIntentResponder(resp *http.Response) (result IntentClassifier, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetIntentSuggestions suggests examples that would improve the accuracy of the intent model.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// intentID - the intent classifier ID.
-// take - the number of entries to return. Maximum page size is 500. Default is 100.
-func (client ModelClient) GetIntentSuggestions(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, take *int32) (result ListIntentsSuggestionExample, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: take,
- Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil},
- {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("programmatic.ModelClient", "GetIntentSuggestions", err.Error())
- }
-
- req, err := client.GetIntentSuggestionsPreparer(ctx, appID, versionID, intentID, take)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetIntentSuggestions", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetIntentSuggestionsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetIntentSuggestions", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetIntentSuggestionsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetIntentSuggestions", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetIntentSuggestionsPreparer prepares the GetIntentSuggestions request.
-func (client ModelClient) GetIntentSuggestionsPreparer(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, take *int32) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "intentId": autorest.Encode("path", intentID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- queryParameters := map[string]interface{}{}
- if take != nil {
- queryParameters["take"] = autorest.Encode("query", *take)
- } else {
- queryParameters["take"] = autorest.Encode("query", 100)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/intents/{intentId}/suggest", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetIntentSuggestionsSender sends the GetIntentSuggestions request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) GetIntentSuggestionsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetIntentSuggestionsResponder handles the response to the GetIntentSuggestions request. The method always
-// closes the http.Response Body.
-func (client ModelClient) GetIntentSuggestionsResponder(resp *http.Response) (result ListIntentsSuggestionExample, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetPatternAnyEntityInfo sends the get pattern any entity info request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - the entity extractor ID.
-func (client ModelClient) GetPatternAnyEntityInfo(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result PatternAnyEntityExtractor, err error) {
- req, err := client.GetPatternAnyEntityInfoPreparer(ctx, appID, versionID, entityID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPatternAnyEntityInfo", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetPatternAnyEntityInfoSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPatternAnyEntityInfo", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetPatternAnyEntityInfoResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPatternAnyEntityInfo", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPatternAnyEntityInfoPreparer prepares the GetPatternAnyEntityInfo request.
-func (client ModelClient) GetPatternAnyEntityInfoPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetPatternAnyEntityInfoSender sends the GetPatternAnyEntityInfo request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) GetPatternAnyEntityInfoSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetPatternAnyEntityInfoResponder handles the response to the GetPatternAnyEntityInfo request. The method always
-// closes the http.Response Body.
-func (client ModelClient) GetPatternAnyEntityInfoResponder(resp *http.Response) (result PatternAnyEntityExtractor, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetPatternAnyEntityInfos sends the get pattern any entity infos request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// skip - the number of entries to skip. Default value is 0.
-// take - the number of entries to return. Maximum page size is 500. Default is 100.
-func (client ModelClient) GetPatternAnyEntityInfos(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result ListPatternAnyEntityExtractor, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: skip,
- Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}},
- {TargetValue: take,
- Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil},
- {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("programmatic.ModelClient", "GetPatternAnyEntityInfos", err.Error())
- }
-
- req, err := client.GetPatternAnyEntityInfosPreparer(ctx, appID, versionID, skip, take)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPatternAnyEntityInfos", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetPatternAnyEntityInfosSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPatternAnyEntityInfos", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetPatternAnyEntityInfosResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPatternAnyEntityInfos", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPatternAnyEntityInfosPreparer prepares the GetPatternAnyEntityInfos request.
-func (client ModelClient) GetPatternAnyEntityInfosPreparer(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- queryParameters := map[string]interface{}{}
- if skip != nil {
- queryParameters["skip"] = autorest.Encode("query", *skip)
- } else {
- queryParameters["skip"] = autorest.Encode("query", 0)
- }
- if take != nil {
- queryParameters["take"] = autorest.Encode("query", *take)
- } else {
- queryParameters["take"] = autorest.Encode("query", 100)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetPatternAnyEntityInfosSender sends the GetPatternAnyEntityInfos request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) GetPatternAnyEntityInfosSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetPatternAnyEntityInfosResponder handles the response to the GetPatternAnyEntityInfos request. The method always
-// closes the http.Response Body.
-func (client ModelClient) GetPatternAnyEntityInfosResponder(resp *http.Response) (result ListPatternAnyEntityExtractor, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetPatternAnyEntityRole sends the get pattern any entity role request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - entity ID.
-// roleID - entity role ID.
-func (client ModelClient) GetPatternAnyEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result EntityRole, err error) {
- req, err := client.GetPatternAnyEntityRolePreparer(ctx, appID, versionID, entityID, roleID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPatternAnyEntityRole", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetPatternAnyEntityRoleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPatternAnyEntityRole", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetPatternAnyEntityRoleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPatternAnyEntityRole", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPatternAnyEntityRolePreparer prepares the GetPatternAnyEntityRole request.
-func (client ModelClient) GetPatternAnyEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "roleId": autorest.Encode("path", roleID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles/{roleId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetPatternAnyEntityRoleSender sends the GetPatternAnyEntityRole request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) GetPatternAnyEntityRoleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetPatternAnyEntityRoleResponder handles the response to the GetPatternAnyEntityRole request. The method always
-// closes the http.Response Body.
-func (client ModelClient) GetPatternAnyEntityRoleResponder(resp *http.Response) (result EntityRole, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetPatternAnyEntityRoles sends the get pattern any entity roles request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - entity Id
-func (client ModelClient) GetPatternAnyEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result ListEntityRole, err error) {
- req, err := client.GetPatternAnyEntityRolesPreparer(ctx, appID, versionID, entityID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPatternAnyEntityRoles", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetPatternAnyEntityRolesSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPatternAnyEntityRoles", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetPatternAnyEntityRolesResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPatternAnyEntityRoles", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPatternAnyEntityRolesPreparer prepares the GetPatternAnyEntityRoles request.
-func (client ModelClient) GetPatternAnyEntityRolesPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetPatternAnyEntityRolesSender sends the GetPatternAnyEntityRoles request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) GetPatternAnyEntityRolesSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetPatternAnyEntityRolesResponder handles the response to the GetPatternAnyEntityRoles request. The method always
-// closes the http.Response Body.
-func (client ModelClient) GetPatternAnyEntityRolesResponder(resp *http.Response) (result ListEntityRole, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetPrebuilt gets information about the prebuilt entity model.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// prebuiltID - the prebuilt entity extractor ID.
-func (client ModelClient) GetPrebuilt(ctx context.Context, appID uuid.UUID, versionID string, prebuiltID uuid.UUID) (result PrebuiltEntityExtractor, err error) {
- req, err := client.GetPrebuiltPreparer(ctx, appID, versionID, prebuiltID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPrebuilt", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetPrebuiltSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPrebuilt", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetPrebuiltResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPrebuilt", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPrebuiltPreparer prepares the GetPrebuilt request.
-func (client ModelClient) GetPrebuiltPreparer(ctx context.Context, appID uuid.UUID, versionID string, prebuiltID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "prebuiltId": autorest.Encode("path", prebuiltID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/prebuilts/{prebuiltId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetPrebuiltSender sends the GetPrebuilt request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) GetPrebuiltSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetPrebuiltResponder handles the response to the GetPrebuilt request. The method always
-// closes the http.Response Body.
-func (client ModelClient) GetPrebuiltResponder(resp *http.Response) (result PrebuiltEntityExtractor, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetPrebuiltEntityRole sends the get prebuilt entity role request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - entity ID.
-// roleID - entity role ID.
-func (client ModelClient) GetPrebuiltEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result EntityRole, err error) {
- req, err := client.GetPrebuiltEntityRolePreparer(ctx, appID, versionID, entityID, roleID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPrebuiltEntityRole", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetPrebuiltEntityRoleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPrebuiltEntityRole", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetPrebuiltEntityRoleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPrebuiltEntityRole", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPrebuiltEntityRolePreparer prepares the GetPrebuiltEntityRole request.
-func (client ModelClient) GetPrebuiltEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "roleId": autorest.Encode("path", roleID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles/{roleId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetPrebuiltEntityRoleSender sends the GetPrebuiltEntityRole request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) GetPrebuiltEntityRoleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetPrebuiltEntityRoleResponder handles the response to the GetPrebuiltEntityRole request. The method always
-// closes the http.Response Body.
-func (client ModelClient) GetPrebuiltEntityRoleResponder(resp *http.Response) (result EntityRole, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetPrebuiltEntityRoles sends the get prebuilt entity roles request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - entity Id
-func (client ModelClient) GetPrebuiltEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result ListEntityRole, err error) {
- req, err := client.GetPrebuiltEntityRolesPreparer(ctx, appID, versionID, entityID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPrebuiltEntityRoles", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetPrebuiltEntityRolesSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPrebuiltEntityRoles", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetPrebuiltEntityRolesResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetPrebuiltEntityRoles", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPrebuiltEntityRolesPreparer prepares the GetPrebuiltEntityRoles request.
-func (client ModelClient) GetPrebuiltEntityRolesPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetPrebuiltEntityRolesSender sends the GetPrebuiltEntityRoles request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) GetPrebuiltEntityRolesSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetPrebuiltEntityRolesResponder handles the response to the GetPrebuiltEntityRoles request. The method always
-// closes the http.Response Body.
-func (client ModelClient) GetPrebuiltEntityRolesResponder(resp *http.Response) (result ListEntityRole, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetRegexEntityEntityInfo sends the get regex entity entity info request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// regexEntityID - the regex entity model ID.
-func (client ModelClient) GetRegexEntityEntityInfo(ctx context.Context, appID uuid.UUID, versionID string, regexEntityID uuid.UUID) (result RegexEntityExtractor, err error) {
- req, err := client.GetRegexEntityEntityInfoPreparer(ctx, appID, versionID, regexEntityID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetRegexEntityEntityInfo", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetRegexEntityEntityInfoSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetRegexEntityEntityInfo", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetRegexEntityEntityInfoResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetRegexEntityEntityInfo", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetRegexEntityEntityInfoPreparer prepares the GetRegexEntityEntityInfo request.
-func (client ModelClient) GetRegexEntityEntityInfoPreparer(ctx context.Context, appID uuid.UUID, versionID string, regexEntityID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "regexEntityId": autorest.Encode("path", regexEntityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/regexentities/{regexEntityId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetRegexEntityEntityInfoSender sends the GetRegexEntityEntityInfo request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) GetRegexEntityEntityInfoSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetRegexEntityEntityInfoResponder handles the response to the GetRegexEntityEntityInfo request. The method always
-// closes the http.Response Body.
-func (client ModelClient) GetRegexEntityEntityInfoResponder(resp *http.Response) (result RegexEntityExtractor, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetRegexEntityInfos sends the get regex entity infos request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// skip - the number of entries to skip. Default value is 0.
-// take - the number of entries to return. Maximum page size is 500. Default is 100.
-func (client ModelClient) GetRegexEntityInfos(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result ListRegexEntityExtractor, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: skip,
- Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}},
- {TargetValue: take,
- Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil},
- {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("programmatic.ModelClient", "GetRegexEntityInfos", err.Error())
- }
-
- req, err := client.GetRegexEntityInfosPreparer(ctx, appID, versionID, skip, take)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetRegexEntityInfos", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetRegexEntityInfosSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetRegexEntityInfos", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetRegexEntityInfosResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetRegexEntityInfos", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetRegexEntityInfosPreparer prepares the GetRegexEntityInfos request.
-func (client ModelClient) GetRegexEntityInfosPreparer(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- queryParameters := map[string]interface{}{}
- if skip != nil {
- queryParameters["skip"] = autorest.Encode("query", *skip)
- } else {
- queryParameters["skip"] = autorest.Encode("query", 0)
- }
- if take != nil {
- queryParameters["take"] = autorest.Encode("query", *take)
- } else {
- queryParameters["take"] = autorest.Encode("query", 100)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/regexentities", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetRegexEntityInfosSender sends the GetRegexEntityInfos request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) GetRegexEntityInfosSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetRegexEntityInfosResponder handles the response to the GetRegexEntityInfos request. The method always
-// closes the http.Response Body.
-func (client ModelClient) GetRegexEntityInfosResponder(resp *http.Response) (result ListRegexEntityExtractor, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetRegexEntityRole sends the get regex entity role request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - entity ID.
-// roleID - entity role ID.
-func (client ModelClient) GetRegexEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (result EntityRole, err error) {
- req, err := client.GetRegexEntityRolePreparer(ctx, appID, versionID, entityID, roleID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetRegexEntityRole", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetRegexEntityRoleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetRegexEntityRole", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetRegexEntityRoleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetRegexEntityRole", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetRegexEntityRolePreparer prepares the GetRegexEntityRole request.
-func (client ModelClient) GetRegexEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "roleId": autorest.Encode("path", roleID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles/{roleId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetRegexEntityRoleSender sends the GetRegexEntityRole request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) GetRegexEntityRoleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetRegexEntityRoleResponder handles the response to the GetRegexEntityRole request. The method always
-// closes the http.Response Body.
-func (client ModelClient) GetRegexEntityRoleResponder(resp *http.Response) (result EntityRole, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetRegexEntityRoles sends the get regex entity roles request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - entity Id
-func (client ModelClient) GetRegexEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result ListEntityRole, err error) {
- req, err := client.GetRegexEntityRolesPreparer(ctx, appID, versionID, entityID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetRegexEntityRoles", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetRegexEntityRolesSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetRegexEntityRoles", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetRegexEntityRolesResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "GetRegexEntityRoles", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetRegexEntityRolesPreparer prepares the GetRegexEntityRoles request.
-func (client ModelClient) GetRegexEntityRolesPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetRegexEntityRolesSender sends the GetRegexEntityRoles request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) GetRegexEntityRolesSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetRegexEntityRolesResponder handles the response to the GetRegexEntityRoles request. The method always
-// closes the http.Response Body.
-func (client ModelClient) GetRegexEntityRolesResponder(resp *http.Response) (result ListEntityRole, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListClosedLists gets information about the closedlist models.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// skip - the number of entries to skip. Default value is 0.
-// take - the number of entries to return. Maximum page size is 500. Default is 100.
-func (client ModelClient) ListClosedLists(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result ListClosedListEntityExtractor, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: skip,
- Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}},
- {TargetValue: take,
- Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil},
- {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("programmatic.ModelClient", "ListClosedLists", err.Error())
- }
-
- req, err := client.ListClosedListsPreparer(ctx, appID, versionID, skip, take)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListClosedLists", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListClosedListsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListClosedLists", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListClosedListsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListClosedLists", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListClosedListsPreparer prepares the ListClosedLists request.
-func (client ModelClient) ListClosedListsPreparer(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- queryParameters := map[string]interface{}{}
- if skip != nil {
- queryParameters["skip"] = autorest.Encode("query", *skip)
- } else {
- queryParameters["skip"] = autorest.Encode("query", 0)
- }
- if take != nil {
- queryParameters["take"] = autorest.Encode("query", *take)
- } else {
- queryParameters["take"] = autorest.Encode("query", 100)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListClosedListsSender sends the ListClosedLists request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) ListClosedListsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListClosedListsResponder handles the response to the ListClosedLists request. The method always
-// closes the http.Response Body.
-func (client ModelClient) ListClosedListsResponder(resp *http.Response) (result ListClosedListEntityExtractor, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListCompositeEntities gets information about the composite entity models.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// skip - the number of entries to skip. Default value is 0.
-// take - the number of entries to return. Maximum page size is 500. Default is 100.
-func (client ModelClient) ListCompositeEntities(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result ListCompositeEntityExtractor, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: skip,
- Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}},
- {TargetValue: take,
- Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil},
- {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("programmatic.ModelClient", "ListCompositeEntities", err.Error())
- }
-
- req, err := client.ListCompositeEntitiesPreparer(ctx, appID, versionID, skip, take)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListCompositeEntities", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListCompositeEntitiesSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListCompositeEntities", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListCompositeEntitiesResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListCompositeEntities", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListCompositeEntitiesPreparer prepares the ListCompositeEntities request.
-func (client ModelClient) ListCompositeEntitiesPreparer(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- queryParameters := map[string]interface{}{}
- if skip != nil {
- queryParameters["skip"] = autorest.Encode("query", *skip)
- } else {
- queryParameters["skip"] = autorest.Encode("query", 0)
- }
- if take != nil {
- queryParameters["take"] = autorest.Encode("query", *take)
- } else {
- queryParameters["take"] = autorest.Encode("query", 100)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListCompositeEntitiesSender sends the ListCompositeEntities request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) ListCompositeEntitiesSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListCompositeEntitiesResponder handles the response to the ListCompositeEntities request. The method always
-// closes the http.Response Body.
-func (client ModelClient) ListCompositeEntitiesResponder(resp *http.Response) (result ListCompositeEntityExtractor, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListCustomPrebuiltEntities gets all custom prebuilt entities information of this application.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-func (client ModelClient) ListCustomPrebuiltEntities(ctx context.Context, appID uuid.UUID, versionID string) (result ListEntityExtractor, err error) {
- req, err := client.ListCustomPrebuiltEntitiesPreparer(ctx, appID, versionID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListCustomPrebuiltEntities", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListCustomPrebuiltEntitiesSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListCustomPrebuiltEntities", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListCustomPrebuiltEntitiesResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListCustomPrebuiltEntities", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListCustomPrebuiltEntitiesPreparer prepares the ListCustomPrebuiltEntities request.
-func (client ModelClient) ListCustomPrebuiltEntitiesPreparer(ctx context.Context, appID uuid.UUID, versionID string) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltentities", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListCustomPrebuiltEntitiesSender sends the ListCustomPrebuiltEntities request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) ListCustomPrebuiltEntitiesSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListCustomPrebuiltEntitiesResponder handles the response to the ListCustomPrebuiltEntities request. The method always
-// closes the http.Response Body.
-func (client ModelClient) ListCustomPrebuiltEntitiesResponder(resp *http.Response) (result ListEntityExtractor, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListCustomPrebuiltIntents gets custom prebuilt intents information of this application.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-func (client ModelClient) ListCustomPrebuiltIntents(ctx context.Context, appID uuid.UUID, versionID string) (result ListIntentClassifier, err error) {
- req, err := client.ListCustomPrebuiltIntentsPreparer(ctx, appID, versionID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListCustomPrebuiltIntents", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListCustomPrebuiltIntentsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListCustomPrebuiltIntents", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListCustomPrebuiltIntentsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListCustomPrebuiltIntents", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListCustomPrebuiltIntentsPreparer prepares the ListCustomPrebuiltIntents request.
-func (client ModelClient) ListCustomPrebuiltIntentsPreparer(ctx context.Context, appID uuid.UUID, versionID string) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltintents", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListCustomPrebuiltIntentsSender sends the ListCustomPrebuiltIntents request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) ListCustomPrebuiltIntentsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListCustomPrebuiltIntentsResponder handles the response to the ListCustomPrebuiltIntents request. The method always
-// closes the http.Response Body.
-func (client ModelClient) ListCustomPrebuiltIntentsResponder(resp *http.Response) (result ListIntentClassifier, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListCustomPrebuiltModels gets all custom prebuilt models information of this application.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-func (client ModelClient) ListCustomPrebuiltModels(ctx context.Context, appID uuid.UUID, versionID string) (result ListCustomPrebuiltModel, err error) {
- req, err := client.ListCustomPrebuiltModelsPreparer(ctx, appID, versionID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListCustomPrebuiltModels", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListCustomPrebuiltModelsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListCustomPrebuiltModels", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListCustomPrebuiltModelsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListCustomPrebuiltModels", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListCustomPrebuiltModelsPreparer prepares the ListCustomPrebuiltModels request.
-func (client ModelClient) ListCustomPrebuiltModelsPreparer(ctx context.Context, appID uuid.UUID, versionID string) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltmodels", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListCustomPrebuiltModelsSender sends the ListCustomPrebuiltModels request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) ListCustomPrebuiltModelsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListCustomPrebuiltModelsResponder handles the response to the ListCustomPrebuiltModels request. The method always
-// closes the http.Response Body.
-func (client ModelClient) ListCustomPrebuiltModelsResponder(resp *http.Response) (result ListCustomPrebuiltModel, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListEntities gets information about the entity models.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// skip - the number of entries to skip. Default value is 0.
-// take - the number of entries to return. Maximum page size is 500. Default is 100.
-func (client ModelClient) ListEntities(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result ListEntityExtractor, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: skip,
- Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}},
- {TargetValue: take,
- Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil},
- {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("programmatic.ModelClient", "ListEntities", err.Error())
- }
-
- req, err := client.ListEntitiesPreparer(ctx, appID, versionID, skip, take)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListEntities", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListEntitiesSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListEntities", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListEntitiesResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListEntities", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListEntitiesPreparer prepares the ListEntities request.
-func (client ModelClient) ListEntitiesPreparer(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- queryParameters := map[string]interface{}{}
- if skip != nil {
- queryParameters["skip"] = autorest.Encode("query", *skip)
- } else {
- queryParameters["skip"] = autorest.Encode("query", 0)
- }
- if take != nil {
- queryParameters["take"] = autorest.Encode("query", *take)
- } else {
- queryParameters["take"] = autorest.Encode("query", 100)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListEntitiesSender sends the ListEntities request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) ListEntitiesSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListEntitiesResponder handles the response to the ListEntities request. The method always
-// closes the http.Response Body.
-func (client ModelClient) ListEntitiesResponder(resp *http.Response) (result ListEntityExtractor, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListHierarchicalEntities gets information about the hierarchical entity models.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// skip - the number of entries to skip. Default value is 0.
-// take - the number of entries to return. Maximum page size is 500. Default is 100.
-func (client ModelClient) ListHierarchicalEntities(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result ListHierarchicalEntityExtractor, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: skip,
- Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}},
- {TargetValue: take,
- Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil},
- {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("programmatic.ModelClient", "ListHierarchicalEntities", err.Error())
- }
-
- req, err := client.ListHierarchicalEntitiesPreparer(ctx, appID, versionID, skip, take)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListHierarchicalEntities", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListHierarchicalEntitiesSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListHierarchicalEntities", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListHierarchicalEntitiesResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListHierarchicalEntities", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListHierarchicalEntitiesPreparer prepares the ListHierarchicalEntities request.
-func (client ModelClient) ListHierarchicalEntitiesPreparer(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- queryParameters := map[string]interface{}{}
- if skip != nil {
- queryParameters["skip"] = autorest.Encode("query", *skip)
- } else {
- queryParameters["skip"] = autorest.Encode("query", 0)
- }
- if take != nil {
- queryParameters["take"] = autorest.Encode("query", *take)
- } else {
- queryParameters["take"] = autorest.Encode("query", 100)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListHierarchicalEntitiesSender sends the ListHierarchicalEntities request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) ListHierarchicalEntitiesSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListHierarchicalEntitiesResponder handles the response to the ListHierarchicalEntities request. The method always
-// closes the http.Response Body.
-func (client ModelClient) ListHierarchicalEntitiesResponder(resp *http.Response) (result ListHierarchicalEntityExtractor, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListIntents gets information about the intent models.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// skip - the number of entries to skip. Default value is 0.
-// take - the number of entries to return. Maximum page size is 500. Default is 100.
-func (client ModelClient) ListIntents(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result ListIntentClassifier, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: skip,
- Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}},
- {TargetValue: take,
- Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil},
- {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("programmatic.ModelClient", "ListIntents", err.Error())
- }
-
- req, err := client.ListIntentsPreparer(ctx, appID, versionID, skip, take)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListIntents", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListIntentsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListIntents", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListIntentsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListIntents", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListIntentsPreparer prepares the ListIntents request.
-func (client ModelClient) ListIntentsPreparer(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- queryParameters := map[string]interface{}{}
- if skip != nil {
- queryParameters["skip"] = autorest.Encode("query", *skip)
- } else {
- queryParameters["skip"] = autorest.Encode("query", 0)
- }
- if take != nil {
- queryParameters["take"] = autorest.Encode("query", *take)
- } else {
- queryParameters["take"] = autorest.Encode("query", 100)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/intents", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListIntentsSender sends the ListIntents request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) ListIntentsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListIntentsResponder handles the response to the ListIntents request. The method always
-// closes the http.Response Body.
-func (client ModelClient) ListIntentsResponder(resp *http.Response) (result ListIntentClassifier, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListModels gets information about the application version models.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// skip - the number of entries to skip. Default value is 0.
-// take - the number of entries to return. Maximum page size is 500. Default is 100.
-func (client ModelClient) ListModels(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result ListModelInfoResponse, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: skip,
- Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}},
- {TargetValue: take,
- Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil},
- {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("programmatic.ModelClient", "ListModels", err.Error())
- }
-
- req, err := client.ListModelsPreparer(ctx, appID, versionID, skip, take)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListModels", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListModelsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListModels", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListModelsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListModels", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListModelsPreparer prepares the ListModels request.
-func (client ModelClient) ListModelsPreparer(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- queryParameters := map[string]interface{}{}
- if skip != nil {
- queryParameters["skip"] = autorest.Encode("query", *skip)
- } else {
- queryParameters["skip"] = autorest.Encode("query", 0)
- }
- if take != nil {
- queryParameters["take"] = autorest.Encode("query", *take)
- } else {
- queryParameters["take"] = autorest.Encode("query", 100)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/models", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListModelsSender sends the ListModels request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) ListModelsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListModelsResponder handles the response to the ListModels request. The method always
-// closes the http.Response Body.
-func (client ModelClient) ListModelsResponder(resp *http.Response) (result ListModelInfoResponse, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListPrebuiltEntities gets all the available prebuilt entity extractors for the application.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-func (client ModelClient) ListPrebuiltEntities(ctx context.Context, appID uuid.UUID, versionID string) (result ListAvailablePrebuiltEntityModel, err error) {
- req, err := client.ListPrebuiltEntitiesPreparer(ctx, appID, versionID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListPrebuiltEntities", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListPrebuiltEntitiesSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListPrebuiltEntities", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListPrebuiltEntitiesResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListPrebuiltEntities", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPrebuiltEntitiesPreparer prepares the ListPrebuiltEntities request.
-func (client ModelClient) ListPrebuiltEntitiesPreparer(ctx context.Context, appID uuid.UUID, versionID string) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/listprebuilts", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListPrebuiltEntitiesSender sends the ListPrebuiltEntities request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) ListPrebuiltEntitiesSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListPrebuiltEntitiesResponder handles the response to the ListPrebuiltEntities request. The method always
-// closes the http.Response Body.
-func (client ModelClient) ListPrebuiltEntitiesResponder(resp *http.Response) (result ListAvailablePrebuiltEntityModel, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListPrebuilts gets information about the prebuilt entity models.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// skip - the number of entries to skip. Default value is 0.
-// take - the number of entries to return. Maximum page size is 500. Default is 100.
-func (client ModelClient) ListPrebuilts(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result ListPrebuiltEntityExtractor, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: skip,
- Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}},
- {TargetValue: take,
- Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil},
- {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("programmatic.ModelClient", "ListPrebuilts", err.Error())
- }
-
- req, err := client.ListPrebuiltsPreparer(ctx, appID, versionID, skip, take)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListPrebuilts", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListPrebuiltsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListPrebuilts", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListPrebuiltsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "ListPrebuilts", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPrebuiltsPreparer prepares the ListPrebuilts request.
-func (client ModelClient) ListPrebuiltsPreparer(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- queryParameters := map[string]interface{}{}
- if skip != nil {
- queryParameters["skip"] = autorest.Encode("query", *skip)
- } else {
- queryParameters["skip"] = autorest.Encode("query", 0)
- }
- if take != nil {
- queryParameters["take"] = autorest.Encode("query", *take)
- } else {
- queryParameters["take"] = autorest.Encode("query", 100)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/prebuilts", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListPrebuiltsSender sends the ListPrebuilts request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) ListPrebuiltsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListPrebuiltsResponder handles the response to the ListPrebuilts request. The method always
-// closes the http.Response Body.
-func (client ModelClient) ListPrebuiltsResponder(resp *http.Response) (result ListPrebuiltEntityExtractor, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// PatchClosedList adds a batch of sublists to an existing closedlist.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// clEntityID - the closed list model ID.
-// closedListModelPatchObject - a words list batch.
-func (client ModelClient) PatchClosedList(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID, closedListModelPatchObject ClosedListModelPatchObject) (result OperationStatus, err error) {
- req, err := client.PatchClosedListPreparer(ctx, appID, versionID, clEntityID, closedListModelPatchObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "PatchClosedList", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.PatchClosedListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "PatchClosedList", resp, "Failure sending request")
- return
- }
-
- result, err = client.PatchClosedListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "PatchClosedList", resp, "Failure responding to request")
- }
-
- return
-}
-
-// PatchClosedListPreparer prepares the PatchClosedList request.
-func (client ModelClient) PatchClosedListPreparer(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID, closedListModelPatchObject ClosedListModelPatchObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "clEntityId": autorest.Encode("path", clEntityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPatch(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}", pathParameters),
- autorest.WithJSON(closedListModelPatchObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// PatchClosedListSender sends the PatchClosedList request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) PatchClosedListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// PatchClosedListResponder handles the response to the PatchClosedList request. The method always
-// closes the http.Response Body.
-func (client ModelClient) PatchClosedListResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// UpdateClosedList updates the closed list model.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// clEntityID - the closed list model ID.
-// closedListModelUpdateObject - the new entity name and words list.
-func (client ModelClient) UpdateClosedList(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID, closedListModelUpdateObject ClosedListModelUpdateObject) (result OperationStatus, err error) {
- req, err := client.UpdateClosedListPreparer(ctx, appID, versionID, clEntityID, closedListModelUpdateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateClosedList", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateClosedListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateClosedList", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateClosedListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateClosedList", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdateClosedListPreparer prepares the UpdateClosedList request.
-func (client ModelClient) UpdateClosedListPreparer(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID, closedListModelUpdateObject ClosedListModelUpdateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "clEntityId": autorest.Encode("path", clEntityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}", pathParameters),
- autorest.WithJSON(closedListModelUpdateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateClosedListSender sends the UpdateClosedList request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) UpdateClosedListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateClosedListResponder handles the response to the UpdateClosedList request. The method always
-// closes the http.Response Body.
-func (client ModelClient) UpdateClosedListResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// UpdateClosedListEntityRole sends the update closed list entity role request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - the entity ID.
-// roleID - the entity role ID.
-// entityRoleUpdateObject - the new entity role.
-func (client ModelClient) UpdateClosedListEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject EntityRoleUpdateObject) (result OperationStatus, err error) {
- req, err := client.UpdateClosedListEntityRolePreparer(ctx, appID, versionID, entityID, roleID, entityRoleUpdateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateClosedListEntityRole", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateClosedListEntityRoleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateClosedListEntityRole", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateClosedListEntityRoleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateClosedListEntityRole", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdateClosedListEntityRolePreparer prepares the UpdateClosedListEntityRole request.
-func (client ModelClient) UpdateClosedListEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject EntityRoleUpdateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "roleId": autorest.Encode("path", roleID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles/{roleId}", pathParameters),
- autorest.WithJSON(entityRoleUpdateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateClosedListEntityRoleSender sends the UpdateClosedListEntityRole request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) UpdateClosedListEntityRoleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateClosedListEntityRoleResponder handles the response to the UpdateClosedListEntityRole request. The method always
-// closes the http.Response Body.
-func (client ModelClient) UpdateClosedListEntityRoleResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// UpdateCompositeEntity updates the composite entity extractor.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// cEntityID - the composite entity extractor ID.
-// compositeModelUpdateObject - a model object containing the new entity extractor name and children.
-func (client ModelClient) UpdateCompositeEntity(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, compositeModelUpdateObject CompositeEntityModel) (result OperationStatus, err error) {
- req, err := client.UpdateCompositeEntityPreparer(ctx, appID, versionID, cEntityID, compositeModelUpdateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateCompositeEntity", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateCompositeEntitySender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateCompositeEntity", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateCompositeEntityResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateCompositeEntity", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdateCompositeEntityPreparer prepares the UpdateCompositeEntity request.
-func (client ModelClient) UpdateCompositeEntityPreparer(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, compositeModelUpdateObject CompositeEntityModel) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "cEntityId": autorest.Encode("path", cEntityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}", pathParameters),
- autorest.WithJSON(compositeModelUpdateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateCompositeEntitySender sends the UpdateCompositeEntity request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) UpdateCompositeEntitySender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateCompositeEntityResponder handles the response to the UpdateCompositeEntity request. The method always
-// closes the http.Response Body.
-func (client ModelClient) UpdateCompositeEntityResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// UpdateCompositeEntityRole sends the update composite entity role request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// cEntityID - the composite entity extractor ID.
-// roleID - the entity role ID.
-// entityRoleUpdateObject - the new entity role.
-func (client ModelClient) UpdateCompositeEntityRole(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject EntityRoleUpdateObject) (result OperationStatus, err error) {
- req, err := client.UpdateCompositeEntityRolePreparer(ctx, appID, versionID, cEntityID, roleID, entityRoleUpdateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateCompositeEntityRole", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateCompositeEntityRoleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateCompositeEntityRole", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateCompositeEntityRoleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateCompositeEntityRole", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdateCompositeEntityRolePreparer prepares the UpdateCompositeEntityRole request.
-func (client ModelClient) UpdateCompositeEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, cEntityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject EntityRoleUpdateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "cEntityId": autorest.Encode("path", cEntityID),
- "roleId": autorest.Encode("path", roleID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles/{roleId}", pathParameters),
- autorest.WithJSON(entityRoleUpdateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateCompositeEntityRoleSender sends the UpdateCompositeEntityRole request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) UpdateCompositeEntityRoleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateCompositeEntityRoleResponder handles the response to the UpdateCompositeEntityRole request. The method always
-// closes the http.Response Body.
-func (client ModelClient) UpdateCompositeEntityRoleResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// UpdateCustomPrebuiltEntityRole sends the update custom prebuilt entity role request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - the entity ID.
-// roleID - the entity role ID.
-// entityRoleUpdateObject - the new entity role.
-func (client ModelClient) UpdateCustomPrebuiltEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject EntityRoleUpdateObject) (result OperationStatus, err error) {
- req, err := client.UpdateCustomPrebuiltEntityRolePreparer(ctx, appID, versionID, entityID, roleID, entityRoleUpdateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateCustomPrebuiltEntityRole", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateCustomPrebuiltEntityRoleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateCustomPrebuiltEntityRole", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateCustomPrebuiltEntityRoleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateCustomPrebuiltEntityRole", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdateCustomPrebuiltEntityRolePreparer prepares the UpdateCustomPrebuiltEntityRole request.
-func (client ModelClient) UpdateCustomPrebuiltEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject EntityRoleUpdateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "roleId": autorest.Encode("path", roleID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles/{roleId}", pathParameters),
- autorest.WithJSON(entityRoleUpdateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateCustomPrebuiltEntityRoleSender sends the UpdateCustomPrebuiltEntityRole request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) UpdateCustomPrebuiltEntityRoleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateCustomPrebuiltEntityRoleResponder handles the response to the UpdateCustomPrebuiltEntityRole request. The method always
-// closes the http.Response Body.
-func (client ModelClient) UpdateCustomPrebuiltEntityRoleResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// UpdateEntity updates the name of an entity extractor.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - the entity extractor ID.
-// modelUpdateObject - a model object containing the new entity extractor name.
-func (client ModelClient) UpdateEntity(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, modelUpdateObject ModelUpdateObject) (result OperationStatus, err error) {
- req, err := client.UpdateEntityPreparer(ctx, appID, versionID, entityID, modelUpdateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateEntity", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateEntitySender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateEntity", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateEntityResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateEntity", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdateEntityPreparer prepares the UpdateEntity request.
-func (client ModelClient) UpdateEntityPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, modelUpdateObject ModelUpdateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}", pathParameters),
- autorest.WithJSON(modelUpdateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateEntitySender sends the UpdateEntity request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) UpdateEntitySender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateEntityResponder handles the response to the UpdateEntity request. The method always
-// closes the http.Response Body.
-func (client ModelClient) UpdateEntityResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// UpdateEntityRole sends the update entity role request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - the entity ID.
-// roleID - the entity role ID.
-// entityRoleUpdateObject - the new entity role.
-func (client ModelClient) UpdateEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject EntityRoleUpdateObject) (result OperationStatus, err error) {
- req, err := client.UpdateEntityRolePreparer(ctx, appID, versionID, entityID, roleID, entityRoleUpdateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateEntityRole", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateEntityRoleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateEntityRole", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateEntityRoleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateEntityRole", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdateEntityRolePreparer prepares the UpdateEntityRole request.
-func (client ModelClient) UpdateEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject EntityRoleUpdateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "roleId": autorest.Encode("path", roleID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}/roles/{roleId}", pathParameters),
- autorest.WithJSON(entityRoleUpdateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateEntityRoleSender sends the UpdateEntityRole request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) UpdateEntityRoleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateEntityRoleResponder handles the response to the UpdateEntityRole request. The method always
-// closes the http.Response Body.
-func (client ModelClient) UpdateEntityRoleResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// UpdateExplicitListItem sends the update explicit list item request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - the Pattern.Any entity extractor ID.
-// itemID - the explicit list item ID.
-// item - the new explicit list item.
-func (client ModelClient) UpdateExplicitListItem(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, itemID int64, item ExplicitListItemUpdateObject) (result OperationStatus, err error) {
- req, err := client.UpdateExplicitListItemPreparer(ctx, appID, versionID, entityID, itemID, item)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateExplicitListItem", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateExplicitListItemSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateExplicitListItem", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateExplicitListItemResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateExplicitListItem", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdateExplicitListItemPreparer prepares the UpdateExplicitListItem request.
-func (client ModelClient) UpdateExplicitListItemPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, itemID int64, item ExplicitListItemUpdateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "itemId": autorest.Encode("path", itemID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist/{itemId}", pathParameters),
- autorest.WithJSON(item))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateExplicitListItemSender sends the UpdateExplicitListItem request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) UpdateExplicitListItemSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateExplicitListItemResponder handles the response to the UpdateExplicitListItem request. The method always
-// closes the http.Response Body.
-func (client ModelClient) UpdateExplicitListItemResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// UpdateHierarchicalEntity updates the name and children of a hierarchical entity model.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// hEntityID - the hierarchical entity extractor ID.
-// hierarchicalModelUpdateObject - model containing names of the children of the hierarchical entity.
-func (client ModelClient) UpdateHierarchicalEntity(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, hierarchicalModelUpdateObject HierarchicalEntityModel) (result OperationStatus, err error) {
- req, err := client.UpdateHierarchicalEntityPreparer(ctx, appID, versionID, hEntityID, hierarchicalModelUpdateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateHierarchicalEntity", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateHierarchicalEntitySender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateHierarchicalEntity", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateHierarchicalEntityResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateHierarchicalEntity", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdateHierarchicalEntityPreparer prepares the UpdateHierarchicalEntity request.
-func (client ModelClient) UpdateHierarchicalEntityPreparer(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, hierarchicalModelUpdateObject HierarchicalEntityModel) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "hEntityId": autorest.Encode("path", hEntityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}", pathParameters),
- autorest.WithJSON(hierarchicalModelUpdateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateHierarchicalEntitySender sends the UpdateHierarchicalEntity request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) UpdateHierarchicalEntitySender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateHierarchicalEntityResponder handles the response to the UpdateHierarchicalEntity request. The method always
-// closes the http.Response Body.
-func (client ModelClient) UpdateHierarchicalEntityResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// UpdateHierarchicalEntityChild renames a single child in an existing hierarchical entity model.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// hEntityID - the hierarchical entity extractor ID.
-// hChildID - the hierarchical entity extractor child ID.
-// hierarchicalChildModelUpdateObject - model object containing new name of the hierarchical entity child.
-func (client ModelClient) UpdateHierarchicalEntityChild(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, hChildID uuid.UUID, hierarchicalChildModelUpdateObject HierarchicalChildModelUpdateObject) (result OperationStatus, err error) {
- req, err := client.UpdateHierarchicalEntityChildPreparer(ctx, appID, versionID, hEntityID, hChildID, hierarchicalChildModelUpdateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateHierarchicalEntityChild", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateHierarchicalEntityChildSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateHierarchicalEntityChild", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateHierarchicalEntityChildResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateHierarchicalEntityChild", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdateHierarchicalEntityChildPreparer prepares the UpdateHierarchicalEntityChild request.
-func (client ModelClient) UpdateHierarchicalEntityChildPreparer(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, hChildID uuid.UUID, hierarchicalChildModelUpdateObject HierarchicalChildModelUpdateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "hChildId": autorest.Encode("path", hChildID),
- "hEntityId": autorest.Encode("path", hEntityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/children/{hChildId}", pathParameters),
- autorest.WithJSON(hierarchicalChildModelUpdateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateHierarchicalEntityChildSender sends the UpdateHierarchicalEntityChild request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) UpdateHierarchicalEntityChildSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateHierarchicalEntityChildResponder handles the response to the UpdateHierarchicalEntityChild request. The method always
-// closes the http.Response Body.
-func (client ModelClient) UpdateHierarchicalEntityChildResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// UpdateHierarchicalEntityRole sends the update hierarchical entity role request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// hEntityID - the hierarchical entity extractor ID.
-// roleID - the entity role ID.
-// entityRoleUpdateObject - the new entity role.
-func (client ModelClient) UpdateHierarchicalEntityRole(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject EntityRoleUpdateObject) (result OperationStatus, err error) {
- req, err := client.UpdateHierarchicalEntityRolePreparer(ctx, appID, versionID, hEntityID, roleID, entityRoleUpdateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateHierarchicalEntityRole", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateHierarchicalEntityRoleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateHierarchicalEntityRole", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateHierarchicalEntityRoleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateHierarchicalEntityRole", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdateHierarchicalEntityRolePreparer prepares the UpdateHierarchicalEntityRole request.
-func (client ModelClient) UpdateHierarchicalEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject EntityRoleUpdateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "hEntityId": autorest.Encode("path", hEntityID),
- "roleId": autorest.Encode("path", roleID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles/{roleId}", pathParameters),
- autorest.WithJSON(entityRoleUpdateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateHierarchicalEntityRoleSender sends the UpdateHierarchicalEntityRole request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) UpdateHierarchicalEntityRoleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateHierarchicalEntityRoleResponder handles the response to the UpdateHierarchicalEntityRole request. The method always
-// closes the http.Response Body.
-func (client ModelClient) UpdateHierarchicalEntityRoleResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// UpdateIntent updates the name of an intent classifier.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// intentID - the intent classifier ID.
-// modelUpdateObject - a model object containing the new intent classifier name.
-func (client ModelClient) UpdateIntent(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, modelUpdateObject ModelUpdateObject) (result OperationStatus, err error) {
- req, err := client.UpdateIntentPreparer(ctx, appID, versionID, intentID, modelUpdateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateIntent", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateIntentSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateIntent", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateIntentResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateIntent", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdateIntentPreparer prepares the UpdateIntent request.
-func (client ModelClient) UpdateIntentPreparer(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, modelUpdateObject ModelUpdateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "intentId": autorest.Encode("path", intentID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/intents/{intentId}", pathParameters),
- autorest.WithJSON(modelUpdateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateIntentSender sends the UpdateIntent request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) UpdateIntentSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateIntentResponder handles the response to the UpdateIntent request. The method always
-// closes the http.Response Body.
-func (client ModelClient) UpdateIntentResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// UpdatePatternAnyEntityModel sends the update pattern any entity model request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - the Pattern.Any entity extractor ID.
-// patternAnyUpdateObject - an object containing the explicit list of the Pattern.Any entity.
-func (client ModelClient) UpdatePatternAnyEntityModel(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, patternAnyUpdateObject PatternAnyModelUpdateObject) (result OperationStatus, err error) {
- req, err := client.UpdatePatternAnyEntityModelPreparer(ctx, appID, versionID, entityID, patternAnyUpdateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdatePatternAnyEntityModel", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdatePatternAnyEntityModelSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdatePatternAnyEntityModel", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdatePatternAnyEntityModelResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdatePatternAnyEntityModel", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePatternAnyEntityModelPreparer prepares the UpdatePatternAnyEntityModel request.
-func (client ModelClient) UpdatePatternAnyEntityModelPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, patternAnyUpdateObject PatternAnyModelUpdateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}", pathParameters),
- autorest.WithJSON(patternAnyUpdateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdatePatternAnyEntityModelSender sends the UpdatePatternAnyEntityModel request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) UpdatePatternAnyEntityModelSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdatePatternAnyEntityModelResponder handles the response to the UpdatePatternAnyEntityModel request. The method always
-// closes the http.Response Body.
-func (client ModelClient) UpdatePatternAnyEntityModelResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// UpdatePatternAnyEntityRole sends the update pattern any entity role request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - the entity ID.
-// roleID - the entity role ID.
-// entityRoleUpdateObject - the new entity role.
-func (client ModelClient) UpdatePatternAnyEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject EntityRoleUpdateObject) (result OperationStatus, err error) {
- req, err := client.UpdatePatternAnyEntityRolePreparer(ctx, appID, versionID, entityID, roleID, entityRoleUpdateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdatePatternAnyEntityRole", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdatePatternAnyEntityRoleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdatePatternAnyEntityRole", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdatePatternAnyEntityRoleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdatePatternAnyEntityRole", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePatternAnyEntityRolePreparer prepares the UpdatePatternAnyEntityRole request.
-func (client ModelClient) UpdatePatternAnyEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject EntityRoleUpdateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "roleId": autorest.Encode("path", roleID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles/{roleId}", pathParameters),
- autorest.WithJSON(entityRoleUpdateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdatePatternAnyEntityRoleSender sends the UpdatePatternAnyEntityRole request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) UpdatePatternAnyEntityRoleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdatePatternAnyEntityRoleResponder handles the response to the UpdatePatternAnyEntityRole request. The method always
-// closes the http.Response Body.
-func (client ModelClient) UpdatePatternAnyEntityRoleResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// UpdatePrebuiltEntityRole sends the update prebuilt entity role request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - the entity ID.
-// roleID - the entity role ID.
-// entityRoleUpdateObject - the new entity role.
-func (client ModelClient) UpdatePrebuiltEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject EntityRoleUpdateObject) (result OperationStatus, err error) {
- req, err := client.UpdatePrebuiltEntityRolePreparer(ctx, appID, versionID, entityID, roleID, entityRoleUpdateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdatePrebuiltEntityRole", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdatePrebuiltEntityRoleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdatePrebuiltEntityRole", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdatePrebuiltEntityRoleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdatePrebuiltEntityRole", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePrebuiltEntityRolePreparer prepares the UpdatePrebuiltEntityRole request.
-func (client ModelClient) UpdatePrebuiltEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject EntityRoleUpdateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "roleId": autorest.Encode("path", roleID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles/{roleId}", pathParameters),
- autorest.WithJSON(entityRoleUpdateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdatePrebuiltEntityRoleSender sends the UpdatePrebuiltEntityRole request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) UpdatePrebuiltEntityRoleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdatePrebuiltEntityRoleResponder handles the response to the UpdatePrebuiltEntityRole request. The method always
-// closes the http.Response Body.
-func (client ModelClient) UpdatePrebuiltEntityRoleResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// UpdateRegexEntityModel sends the update regex entity model request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// regexEntityID - the regex entity extractor ID.
-// regexEntityUpdateObject - an object containing the new entity name and regex pattern.
-func (client ModelClient) UpdateRegexEntityModel(ctx context.Context, appID uuid.UUID, versionID string, regexEntityID uuid.UUID, regexEntityUpdateObject RegexModelUpdateObject) (result OperationStatus, err error) {
- req, err := client.UpdateRegexEntityModelPreparer(ctx, appID, versionID, regexEntityID, regexEntityUpdateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateRegexEntityModel", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateRegexEntityModelSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateRegexEntityModel", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateRegexEntityModelResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateRegexEntityModel", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdateRegexEntityModelPreparer prepares the UpdateRegexEntityModel request.
-func (client ModelClient) UpdateRegexEntityModelPreparer(ctx context.Context, appID uuid.UUID, versionID string, regexEntityID uuid.UUID, regexEntityUpdateObject RegexModelUpdateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "regexEntityId": autorest.Encode("path", regexEntityID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/regexentities/{regexEntityId}", pathParameters),
- autorest.WithJSON(regexEntityUpdateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateRegexEntityModelSender sends the UpdateRegexEntityModel request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) UpdateRegexEntityModelSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateRegexEntityModelResponder handles the response to the UpdateRegexEntityModel request. The method always
-// closes the http.Response Body.
-func (client ModelClient) UpdateRegexEntityModelResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// UpdateRegexEntityRole sends the update regex entity role request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// entityID - the entity ID.
-// roleID - the entity role ID.
-// entityRoleUpdateObject - the new entity role.
-func (client ModelClient) UpdateRegexEntityRole(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject EntityRoleUpdateObject) (result OperationStatus, err error) {
- req, err := client.UpdateRegexEntityRolePreparer(ctx, appID, versionID, entityID, roleID, entityRoleUpdateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateRegexEntityRole", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateRegexEntityRoleSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateRegexEntityRole", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateRegexEntityRoleResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateRegexEntityRole", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdateRegexEntityRolePreparer prepares the UpdateRegexEntityRole request.
-func (client ModelClient) UpdateRegexEntityRolePreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, roleID uuid.UUID, entityRoleUpdateObject EntityRoleUpdateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "entityId": autorest.Encode("path", entityID),
- "roleId": autorest.Encode("path", roleID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles/{roleId}", pathParameters),
- autorest.WithJSON(entityRoleUpdateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateRegexEntityRoleSender sends the UpdateRegexEntityRole request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) UpdateRegexEntityRoleSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateRegexEntityRoleResponder handles the response to the UpdateRegexEntityRole request. The method always
-// closes the http.Response Body.
-func (client ModelClient) UpdateRegexEntityRoleResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// UpdateSubList updates one of the closed list's sublists.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// clEntityID - the closed list entity extractor ID.
-// subListID - the sublist ID.
-// wordListBaseUpdateObject - a sublist update object containing the new canonical form and the list of words.
-func (client ModelClient) UpdateSubList(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID, subListID int32, wordListBaseUpdateObject WordListBaseUpdateObject) (result OperationStatus, err error) {
- req, err := client.UpdateSubListPreparer(ctx, appID, versionID, clEntityID, subListID, wordListBaseUpdateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateSubList", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateSubListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateSubList", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateSubListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.ModelClient", "UpdateSubList", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdateSubListPreparer prepares the UpdateSubList request.
-func (client ModelClient) UpdateSubListPreparer(ctx context.Context, appID uuid.UUID, versionID string, clEntityID uuid.UUID, subListID int32, wordListBaseUpdateObject WordListBaseUpdateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "clEntityId": autorest.Encode("path", clEntityID),
- "subListId": autorest.Encode("path", subListID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}/sublists/{subListId}", pathParameters),
- autorest.WithJSON(wordListBaseUpdateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSubListSender sends the UpdateSubList request. The method will close the
-// http.Response Body if it receives an error.
-func (client ModelClient) UpdateSubListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateSubListResponder handles the response to the UpdateSubList request. The method always
-// closes the http.Response Body.
-func (client ModelClient) UpdateSubListResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/services/cognitiveservices/v2.0/luis/programmatic/models.go b/services/cognitiveservices/v2.0/luis/programmatic/models.go
deleted file mode 100644
index 20baf248cec5..000000000000
--- a/services/cognitiveservices/v2.0/luis/programmatic/models.go
+++ /dev/null
@@ -1,1795 +0,0 @@
-package programmatic
-
-// 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 (
- "encoding/json"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/satori/go.uuid"
- "io"
-)
-
-// AzureRegions enumerates the values for azure regions.
-type AzureRegions string
-
-const (
- // Australiaeast ...
- Australiaeast AzureRegions = "australiaeast"
- // Brazilsouth ...
- Brazilsouth AzureRegions = "brazilsouth"
- // Eastasia ...
- Eastasia AzureRegions = "eastasia"
- // Eastus ...
- Eastus AzureRegions = "eastus"
- // Eastus2 ...
- Eastus2 AzureRegions = "eastus2"
- // Northeurope ...
- Northeurope AzureRegions = "northeurope"
- // Southcentralus ...
- Southcentralus AzureRegions = "southcentralus"
- // Southeastasia ...
- Southeastasia AzureRegions = "southeastasia"
- // Westcentralus ...
- Westcentralus AzureRegions = "westcentralus"
- // Westeurope ...
- Westeurope AzureRegions = "westeurope"
- // Westus ...
- Westus AzureRegions = "westus"
- // Westus2 ...
- Westus2 AzureRegions = "westus2"
-)
-
-// PossibleAzureRegionsValues returns an array of possible values for the AzureRegions const type.
-func PossibleAzureRegionsValues() []AzureRegions {
- return []AzureRegions{Australiaeast, Brazilsouth, Eastasia, Eastus, Eastus2, Northeurope, Southcentralus, Southeastasia, Westcentralus, Westeurope, Westus, Westus2}
-}
-
-// OperationStatusType enumerates the values for operation status type.
-type OperationStatusType string
-
-const (
- // Failed ...
- Failed OperationStatusType = "Failed"
- // FAILED ...
- FAILED OperationStatusType = "FAILED"
- // Success ...
- Success OperationStatusType = "Success"
-)
-
-// PossibleOperationStatusTypeValues returns an array of possible values for the OperationStatusType const type.
-func PossibleOperationStatusTypeValues() []OperationStatusType {
- return []OperationStatusType{Failed, FAILED, Success}
-}
-
-// ReadableType enumerates the values for readable type.
-type ReadableType string
-
-const (
- // ReadableTypeClosedListEntityExtractor ...
- ReadableTypeClosedListEntityExtractor ReadableType = "Closed List Entity Extractor"
- // ReadableTypeCompositeEntityExtractor ...
- ReadableTypeCompositeEntityExtractor ReadableType = "Composite Entity Extractor"
- // ReadableTypeEntityExtractor ...
- ReadableTypeEntityExtractor ReadableType = "Entity Extractor"
- // ReadableTypeHierarchicalChildEntityExtractor ...
- ReadableTypeHierarchicalChildEntityExtractor ReadableType = "Hierarchical Child Entity Extractor"
- // ReadableTypeHierarchicalEntityExtractor ...
- ReadableTypeHierarchicalEntityExtractor ReadableType = "Hierarchical Entity Extractor"
- // ReadableTypeIntentClassifier ...
- ReadableTypeIntentClassifier ReadableType = "Intent Classifier"
- // ReadableTypePatternAnyEntityExtractor ...
- ReadableTypePatternAnyEntityExtractor ReadableType = "Pattern.Any Entity Extractor"
- // ReadableTypePrebuiltEntityExtractor ...
- ReadableTypePrebuiltEntityExtractor ReadableType = "Prebuilt Entity Extractor"
- // ReadableTypeRegexEntityExtractor ...
- ReadableTypeRegexEntityExtractor ReadableType = "Regex Entity Extractor"
-)
-
-// PossibleReadableTypeValues returns an array of possible values for the ReadableType const type.
-func PossibleReadableTypeValues() []ReadableType {
- return []ReadableType{ReadableTypeClosedListEntityExtractor, ReadableTypeCompositeEntityExtractor, ReadableTypeEntityExtractor, ReadableTypeHierarchicalChildEntityExtractor, ReadableTypeHierarchicalEntityExtractor, ReadableTypeIntentClassifier, ReadableTypePatternAnyEntityExtractor, ReadableTypePrebuiltEntityExtractor, ReadableTypeRegexEntityExtractor}
-}
-
-// ReadableType1 enumerates the values for readable type 1.
-type ReadableType1 string
-
-const (
- // ReadableType1ClosedListEntityExtractor ...
- ReadableType1ClosedListEntityExtractor ReadableType1 = "Closed List Entity Extractor"
- // ReadableType1CompositeEntityExtractor ...
- ReadableType1CompositeEntityExtractor ReadableType1 = "Composite Entity Extractor"
- // ReadableType1EntityExtractor ...
- ReadableType1EntityExtractor ReadableType1 = "Entity Extractor"
- // ReadableType1HierarchicalChildEntityExtractor ...
- ReadableType1HierarchicalChildEntityExtractor ReadableType1 = "Hierarchical Child Entity Extractor"
- // ReadableType1HierarchicalEntityExtractor ...
- ReadableType1HierarchicalEntityExtractor ReadableType1 = "Hierarchical Entity Extractor"
- // ReadableType1IntentClassifier ...
- ReadableType1IntentClassifier ReadableType1 = "Intent Classifier"
- // ReadableType1PatternAnyEntityExtractor ...
- ReadableType1PatternAnyEntityExtractor ReadableType1 = "Pattern.Any Entity Extractor"
- // ReadableType1PrebuiltEntityExtractor ...
- ReadableType1PrebuiltEntityExtractor ReadableType1 = "Prebuilt Entity Extractor"
- // ReadableType1RegexEntityExtractor ...
- ReadableType1RegexEntityExtractor ReadableType1 = "Regex Entity Extractor"
-)
-
-// PossibleReadableType1Values returns an array of possible values for the ReadableType1 const type.
-func PossibleReadableType1Values() []ReadableType1 {
- return []ReadableType1{ReadableType1ClosedListEntityExtractor, ReadableType1CompositeEntityExtractor, ReadableType1EntityExtractor, ReadableType1HierarchicalChildEntityExtractor, ReadableType1HierarchicalEntityExtractor, ReadableType1IntentClassifier, ReadableType1PatternAnyEntityExtractor, ReadableType1PrebuiltEntityExtractor, ReadableType1RegexEntityExtractor}
-}
-
-// ReadableType10 enumerates the values for readable type 10.
-type ReadableType10 string
-
-const (
- // ReadableType10ClosedListEntityExtractor ...
- ReadableType10ClosedListEntityExtractor ReadableType10 = "Closed List Entity Extractor"
- // ReadableType10CompositeEntityExtractor ...
- ReadableType10CompositeEntityExtractor ReadableType10 = "Composite Entity Extractor"
- // ReadableType10EntityExtractor ...
- ReadableType10EntityExtractor ReadableType10 = "Entity Extractor"
- // ReadableType10HierarchicalChildEntityExtractor ...
- ReadableType10HierarchicalChildEntityExtractor ReadableType10 = "Hierarchical Child Entity Extractor"
- // ReadableType10HierarchicalEntityExtractor ...
- ReadableType10HierarchicalEntityExtractor ReadableType10 = "Hierarchical Entity Extractor"
- // ReadableType10IntentClassifier ...
- ReadableType10IntentClassifier ReadableType10 = "Intent Classifier"
- // ReadableType10PatternAnyEntityExtractor ...
- ReadableType10PatternAnyEntityExtractor ReadableType10 = "Pattern.Any Entity Extractor"
- // ReadableType10PrebuiltEntityExtractor ...
- ReadableType10PrebuiltEntityExtractor ReadableType10 = "Prebuilt Entity Extractor"
- // ReadableType10RegexEntityExtractor ...
- ReadableType10RegexEntityExtractor ReadableType10 = "Regex Entity Extractor"
-)
-
-// PossibleReadableType10Values returns an array of possible values for the ReadableType10 const type.
-func PossibleReadableType10Values() []ReadableType10 {
- return []ReadableType10{ReadableType10ClosedListEntityExtractor, ReadableType10CompositeEntityExtractor, ReadableType10EntityExtractor, ReadableType10HierarchicalChildEntityExtractor, ReadableType10HierarchicalEntityExtractor, ReadableType10IntentClassifier, ReadableType10PatternAnyEntityExtractor, ReadableType10PrebuiltEntityExtractor, ReadableType10RegexEntityExtractor}
-}
-
-// ReadableType2 enumerates the values for readable type 2.
-type ReadableType2 string
-
-const (
- // ReadableType2ClosedListEntityExtractor ...
- ReadableType2ClosedListEntityExtractor ReadableType2 = "Closed List Entity Extractor"
- // ReadableType2CompositeEntityExtractor ...
- ReadableType2CompositeEntityExtractor ReadableType2 = "Composite Entity Extractor"
- // ReadableType2EntityExtractor ...
- ReadableType2EntityExtractor ReadableType2 = "Entity Extractor"
- // ReadableType2HierarchicalChildEntityExtractor ...
- ReadableType2HierarchicalChildEntityExtractor ReadableType2 = "Hierarchical Child Entity Extractor"
- // ReadableType2HierarchicalEntityExtractor ...
- ReadableType2HierarchicalEntityExtractor ReadableType2 = "Hierarchical Entity Extractor"
- // ReadableType2IntentClassifier ...
- ReadableType2IntentClassifier ReadableType2 = "Intent Classifier"
- // ReadableType2PatternAnyEntityExtractor ...
- ReadableType2PatternAnyEntityExtractor ReadableType2 = "Pattern.Any Entity Extractor"
- // ReadableType2PrebuiltEntityExtractor ...
- ReadableType2PrebuiltEntityExtractor ReadableType2 = "Prebuilt Entity Extractor"
- // ReadableType2RegexEntityExtractor ...
- ReadableType2RegexEntityExtractor ReadableType2 = "Regex Entity Extractor"
-)
-
-// PossibleReadableType2Values returns an array of possible values for the ReadableType2 const type.
-func PossibleReadableType2Values() []ReadableType2 {
- return []ReadableType2{ReadableType2ClosedListEntityExtractor, ReadableType2CompositeEntityExtractor, ReadableType2EntityExtractor, ReadableType2HierarchicalChildEntityExtractor, ReadableType2HierarchicalEntityExtractor, ReadableType2IntentClassifier, ReadableType2PatternAnyEntityExtractor, ReadableType2PrebuiltEntityExtractor, ReadableType2RegexEntityExtractor}
-}
-
-// ReadableType3 enumerates the values for readable type 3.
-type ReadableType3 string
-
-const (
- // ReadableType3ClosedListEntityExtractor ...
- ReadableType3ClosedListEntityExtractor ReadableType3 = "Closed List Entity Extractor"
- // ReadableType3CompositeEntityExtractor ...
- ReadableType3CompositeEntityExtractor ReadableType3 = "Composite Entity Extractor"
- // ReadableType3EntityExtractor ...
- ReadableType3EntityExtractor ReadableType3 = "Entity Extractor"
- // ReadableType3HierarchicalChildEntityExtractor ...
- ReadableType3HierarchicalChildEntityExtractor ReadableType3 = "Hierarchical Child Entity Extractor"
- // ReadableType3HierarchicalEntityExtractor ...
- ReadableType3HierarchicalEntityExtractor ReadableType3 = "Hierarchical Entity Extractor"
- // ReadableType3IntentClassifier ...
- ReadableType3IntentClassifier ReadableType3 = "Intent Classifier"
- // ReadableType3PatternAnyEntityExtractor ...
- ReadableType3PatternAnyEntityExtractor ReadableType3 = "Pattern.Any Entity Extractor"
- // ReadableType3PrebuiltEntityExtractor ...
- ReadableType3PrebuiltEntityExtractor ReadableType3 = "Prebuilt Entity Extractor"
- // ReadableType3RegexEntityExtractor ...
- ReadableType3RegexEntityExtractor ReadableType3 = "Regex Entity Extractor"
-)
-
-// PossibleReadableType3Values returns an array of possible values for the ReadableType3 const type.
-func PossibleReadableType3Values() []ReadableType3 {
- return []ReadableType3{ReadableType3ClosedListEntityExtractor, ReadableType3CompositeEntityExtractor, ReadableType3EntityExtractor, ReadableType3HierarchicalChildEntityExtractor, ReadableType3HierarchicalEntityExtractor, ReadableType3IntentClassifier, ReadableType3PatternAnyEntityExtractor, ReadableType3PrebuiltEntityExtractor, ReadableType3RegexEntityExtractor}
-}
-
-// ReadableType4 enumerates the values for readable type 4.
-type ReadableType4 string
-
-const (
- // ReadableType4ClosedListEntityExtractor ...
- ReadableType4ClosedListEntityExtractor ReadableType4 = "Closed List Entity Extractor"
- // ReadableType4CompositeEntityExtractor ...
- ReadableType4CompositeEntityExtractor ReadableType4 = "Composite Entity Extractor"
- // ReadableType4EntityExtractor ...
- ReadableType4EntityExtractor ReadableType4 = "Entity Extractor"
- // ReadableType4HierarchicalChildEntityExtractor ...
- ReadableType4HierarchicalChildEntityExtractor ReadableType4 = "Hierarchical Child Entity Extractor"
- // ReadableType4HierarchicalEntityExtractor ...
- ReadableType4HierarchicalEntityExtractor ReadableType4 = "Hierarchical Entity Extractor"
- // ReadableType4IntentClassifier ...
- ReadableType4IntentClassifier ReadableType4 = "Intent Classifier"
- // ReadableType4PatternAnyEntityExtractor ...
- ReadableType4PatternAnyEntityExtractor ReadableType4 = "Pattern.Any Entity Extractor"
- // ReadableType4PrebuiltEntityExtractor ...
- ReadableType4PrebuiltEntityExtractor ReadableType4 = "Prebuilt Entity Extractor"
- // ReadableType4RegexEntityExtractor ...
- ReadableType4RegexEntityExtractor ReadableType4 = "Regex Entity Extractor"
-)
-
-// PossibleReadableType4Values returns an array of possible values for the ReadableType4 const type.
-func PossibleReadableType4Values() []ReadableType4 {
- return []ReadableType4{ReadableType4ClosedListEntityExtractor, ReadableType4CompositeEntityExtractor, ReadableType4EntityExtractor, ReadableType4HierarchicalChildEntityExtractor, ReadableType4HierarchicalEntityExtractor, ReadableType4IntentClassifier, ReadableType4PatternAnyEntityExtractor, ReadableType4PrebuiltEntityExtractor, ReadableType4RegexEntityExtractor}
-}
-
-// ReadableType5 enumerates the values for readable type 5.
-type ReadableType5 string
-
-const (
- // ReadableType5ClosedListEntityExtractor ...
- ReadableType5ClosedListEntityExtractor ReadableType5 = "Closed List Entity Extractor"
- // ReadableType5CompositeEntityExtractor ...
- ReadableType5CompositeEntityExtractor ReadableType5 = "Composite Entity Extractor"
- // ReadableType5EntityExtractor ...
- ReadableType5EntityExtractor ReadableType5 = "Entity Extractor"
- // ReadableType5HierarchicalChildEntityExtractor ...
- ReadableType5HierarchicalChildEntityExtractor ReadableType5 = "Hierarchical Child Entity Extractor"
- // ReadableType5HierarchicalEntityExtractor ...
- ReadableType5HierarchicalEntityExtractor ReadableType5 = "Hierarchical Entity Extractor"
- // ReadableType5IntentClassifier ...
- ReadableType5IntentClassifier ReadableType5 = "Intent Classifier"
- // ReadableType5PatternAnyEntityExtractor ...
- ReadableType5PatternAnyEntityExtractor ReadableType5 = "Pattern.Any Entity Extractor"
- // ReadableType5PrebuiltEntityExtractor ...
- ReadableType5PrebuiltEntityExtractor ReadableType5 = "Prebuilt Entity Extractor"
- // ReadableType5RegexEntityExtractor ...
- ReadableType5RegexEntityExtractor ReadableType5 = "Regex Entity Extractor"
-)
-
-// PossibleReadableType5Values returns an array of possible values for the ReadableType5 const type.
-func PossibleReadableType5Values() []ReadableType5 {
- return []ReadableType5{ReadableType5ClosedListEntityExtractor, ReadableType5CompositeEntityExtractor, ReadableType5EntityExtractor, ReadableType5HierarchicalChildEntityExtractor, ReadableType5HierarchicalEntityExtractor, ReadableType5IntentClassifier, ReadableType5PatternAnyEntityExtractor, ReadableType5PrebuiltEntityExtractor, ReadableType5RegexEntityExtractor}
-}
-
-// ReadableType6 enumerates the values for readable type 6.
-type ReadableType6 string
-
-const (
- // ReadableType6ClosedListEntityExtractor ...
- ReadableType6ClosedListEntityExtractor ReadableType6 = "Closed List Entity Extractor"
- // ReadableType6CompositeEntityExtractor ...
- ReadableType6CompositeEntityExtractor ReadableType6 = "Composite Entity Extractor"
- // ReadableType6EntityExtractor ...
- ReadableType6EntityExtractor ReadableType6 = "Entity Extractor"
- // ReadableType6HierarchicalChildEntityExtractor ...
- ReadableType6HierarchicalChildEntityExtractor ReadableType6 = "Hierarchical Child Entity Extractor"
- // ReadableType6HierarchicalEntityExtractor ...
- ReadableType6HierarchicalEntityExtractor ReadableType6 = "Hierarchical Entity Extractor"
- // ReadableType6IntentClassifier ...
- ReadableType6IntentClassifier ReadableType6 = "Intent Classifier"
- // ReadableType6PatternAnyEntityExtractor ...
- ReadableType6PatternAnyEntityExtractor ReadableType6 = "Pattern.Any Entity Extractor"
- // ReadableType6PrebuiltEntityExtractor ...
- ReadableType6PrebuiltEntityExtractor ReadableType6 = "Prebuilt Entity Extractor"
- // ReadableType6RegexEntityExtractor ...
- ReadableType6RegexEntityExtractor ReadableType6 = "Regex Entity Extractor"
-)
-
-// PossibleReadableType6Values returns an array of possible values for the ReadableType6 const type.
-func PossibleReadableType6Values() []ReadableType6 {
- return []ReadableType6{ReadableType6ClosedListEntityExtractor, ReadableType6CompositeEntityExtractor, ReadableType6EntityExtractor, ReadableType6HierarchicalChildEntityExtractor, ReadableType6HierarchicalEntityExtractor, ReadableType6IntentClassifier, ReadableType6PatternAnyEntityExtractor, ReadableType6PrebuiltEntityExtractor, ReadableType6RegexEntityExtractor}
-}
-
-// ReadableType7 enumerates the values for readable type 7.
-type ReadableType7 string
-
-const (
- // ReadableType7ClosedListEntityExtractor ...
- ReadableType7ClosedListEntityExtractor ReadableType7 = "Closed List Entity Extractor"
- // ReadableType7CompositeEntityExtractor ...
- ReadableType7CompositeEntityExtractor ReadableType7 = "Composite Entity Extractor"
- // ReadableType7EntityExtractor ...
- ReadableType7EntityExtractor ReadableType7 = "Entity Extractor"
- // ReadableType7HierarchicalChildEntityExtractor ...
- ReadableType7HierarchicalChildEntityExtractor ReadableType7 = "Hierarchical Child Entity Extractor"
- // ReadableType7HierarchicalEntityExtractor ...
- ReadableType7HierarchicalEntityExtractor ReadableType7 = "Hierarchical Entity Extractor"
- // ReadableType7IntentClassifier ...
- ReadableType7IntentClassifier ReadableType7 = "Intent Classifier"
- // ReadableType7PatternAnyEntityExtractor ...
- ReadableType7PatternAnyEntityExtractor ReadableType7 = "Pattern.Any Entity Extractor"
- // ReadableType7PrebuiltEntityExtractor ...
- ReadableType7PrebuiltEntityExtractor ReadableType7 = "Prebuilt Entity Extractor"
- // ReadableType7RegexEntityExtractor ...
- ReadableType7RegexEntityExtractor ReadableType7 = "Regex Entity Extractor"
-)
-
-// PossibleReadableType7Values returns an array of possible values for the ReadableType7 const type.
-func PossibleReadableType7Values() []ReadableType7 {
- return []ReadableType7{ReadableType7ClosedListEntityExtractor, ReadableType7CompositeEntityExtractor, ReadableType7EntityExtractor, ReadableType7HierarchicalChildEntityExtractor, ReadableType7HierarchicalEntityExtractor, ReadableType7IntentClassifier, ReadableType7PatternAnyEntityExtractor, ReadableType7PrebuiltEntityExtractor, ReadableType7RegexEntityExtractor}
-}
-
-// ReadableType8 enumerates the values for readable type 8.
-type ReadableType8 string
-
-const (
- // ReadableType8ClosedListEntityExtractor ...
- ReadableType8ClosedListEntityExtractor ReadableType8 = "Closed List Entity Extractor"
- // ReadableType8CompositeEntityExtractor ...
- ReadableType8CompositeEntityExtractor ReadableType8 = "Composite Entity Extractor"
- // ReadableType8EntityExtractor ...
- ReadableType8EntityExtractor ReadableType8 = "Entity Extractor"
- // ReadableType8HierarchicalChildEntityExtractor ...
- ReadableType8HierarchicalChildEntityExtractor ReadableType8 = "Hierarchical Child Entity Extractor"
- // ReadableType8HierarchicalEntityExtractor ...
- ReadableType8HierarchicalEntityExtractor ReadableType8 = "Hierarchical Entity Extractor"
- // ReadableType8IntentClassifier ...
- ReadableType8IntentClassifier ReadableType8 = "Intent Classifier"
- // ReadableType8PatternAnyEntityExtractor ...
- ReadableType8PatternAnyEntityExtractor ReadableType8 = "Pattern.Any Entity Extractor"
- // ReadableType8PrebuiltEntityExtractor ...
- ReadableType8PrebuiltEntityExtractor ReadableType8 = "Prebuilt Entity Extractor"
- // ReadableType8RegexEntityExtractor ...
- ReadableType8RegexEntityExtractor ReadableType8 = "Regex Entity Extractor"
-)
-
-// PossibleReadableType8Values returns an array of possible values for the ReadableType8 const type.
-func PossibleReadableType8Values() []ReadableType8 {
- return []ReadableType8{ReadableType8ClosedListEntityExtractor, ReadableType8CompositeEntityExtractor, ReadableType8EntityExtractor, ReadableType8HierarchicalChildEntityExtractor, ReadableType8HierarchicalEntityExtractor, ReadableType8IntentClassifier, ReadableType8PatternAnyEntityExtractor, ReadableType8PrebuiltEntityExtractor, ReadableType8RegexEntityExtractor}
-}
-
-// ReadableType9 enumerates the values for readable type 9.
-type ReadableType9 string
-
-const (
- // ReadableType9ClosedListEntityExtractor ...
- ReadableType9ClosedListEntityExtractor ReadableType9 = "Closed List Entity Extractor"
- // ReadableType9CompositeEntityExtractor ...
- ReadableType9CompositeEntityExtractor ReadableType9 = "Composite Entity Extractor"
- // ReadableType9EntityExtractor ...
- ReadableType9EntityExtractor ReadableType9 = "Entity Extractor"
- // ReadableType9HierarchicalChildEntityExtractor ...
- ReadableType9HierarchicalChildEntityExtractor ReadableType9 = "Hierarchical Child Entity Extractor"
- // ReadableType9HierarchicalEntityExtractor ...
- ReadableType9HierarchicalEntityExtractor ReadableType9 = "Hierarchical Entity Extractor"
- // ReadableType9IntentClassifier ...
- ReadableType9IntentClassifier ReadableType9 = "Intent Classifier"
- // ReadableType9PatternAnyEntityExtractor ...
- ReadableType9PatternAnyEntityExtractor ReadableType9 = "Pattern.Any Entity Extractor"
- // ReadableType9PrebuiltEntityExtractor ...
- ReadableType9PrebuiltEntityExtractor ReadableType9 = "Prebuilt Entity Extractor"
- // ReadableType9RegexEntityExtractor ...
- ReadableType9RegexEntityExtractor ReadableType9 = "Regex Entity Extractor"
-)
-
-// PossibleReadableType9Values returns an array of possible values for the ReadableType9 const type.
-func PossibleReadableType9Values() []ReadableType9 {
- return []ReadableType9{ReadableType9ClosedListEntityExtractor, ReadableType9CompositeEntityExtractor, ReadableType9EntityExtractor, ReadableType9HierarchicalChildEntityExtractor, ReadableType9HierarchicalEntityExtractor, ReadableType9IntentClassifier, ReadableType9PatternAnyEntityExtractor, ReadableType9PrebuiltEntityExtractor, ReadableType9RegexEntityExtractor}
-}
-
-// Status enumerates the values for status.
-type Status string
-
-const (
- // StatusFail ...
- StatusFail Status = "Fail"
- // StatusInProgress ...
- StatusInProgress Status = "InProgress"
- // StatusQueued ...
- StatusQueued Status = "Queued"
- // StatusSuccess ...
- StatusSuccess Status = "Success"
- // StatusUpToDate ...
- StatusUpToDate Status = "UpToDate"
-)
-
-// PossibleStatusValues returns an array of possible values for the Status const type.
-func PossibleStatusValues() []Status {
- return []Status{StatusFail, StatusInProgress, StatusQueued, StatusSuccess, StatusUpToDate}
-}
-
-// Status1 enumerates the values for status 1.
-type Status1 string
-
-const (
- // Status1Fail ...
- Status1Fail Status1 = "Fail"
- // Status1InProgress ...
- Status1InProgress Status1 = "InProgress"
- // Status1Queued ...
- Status1Queued Status1 = "Queued"
- // Status1Success ...
- Status1Success Status1 = "Success"
- // Status1UpToDate ...
- Status1UpToDate Status1 = "UpToDate"
-)
-
-// PossibleStatus1Values returns an array of possible values for the Status1 const type.
-func PossibleStatus1Values() []Status1 {
- return []Status1{Status1Fail, Status1InProgress, Status1Queued, Status1Success, Status1UpToDate}
-}
-
-// TrainingStatus enumerates the values for training status.
-type TrainingStatus string
-
-const (
- // InProgress ...
- InProgress TrainingStatus = "InProgress"
- // NeedsTraining ...
- NeedsTraining TrainingStatus = "NeedsTraining"
- // Trained ...
- Trained TrainingStatus = "Trained"
-)
-
-// PossibleTrainingStatusValues returns an array of possible values for the TrainingStatus const type.
-func PossibleTrainingStatusValues() []TrainingStatus {
- return []TrainingStatus{InProgress, NeedsTraining, Trained}
-}
-
-// ApplicationCreateObject properties for creating a new LUIS Application
-type ApplicationCreateObject struct {
- // Culture - The culture for the new application. It is the language that your app understands and speaks. E.g.: "en-us". Note: the culture cannot be changed after the app is created.
- Culture *string `json:"culture,omitempty"`
- // Domain - The domain for the new application. Optional. E.g.: Comics.
- Domain *string `json:"domain,omitempty"`
- // Description - Description of the new application. Optional.
- Description *string `json:"description,omitempty"`
- // InitialVersionID - The initial version ID. Optional. Default value is: "0.1"
- InitialVersionID *string `json:"initialVersionId,omitempty"`
- // UsageScenario - Defines the scenario for the new application. Optional. E.g.: IoT.
- UsageScenario *string `json:"usageScenario,omitempty"`
- // Name - The name for the new application.
- Name *string `json:"name,omitempty"`
-}
-
-// ApplicationInfoResponse response containing the Application Info.
-type ApplicationInfoResponse struct {
- autorest.Response `json:"-"`
- // ID - The ID (GUID) of the application.
- ID *uuid.UUID `json:"id,omitempty"`
- // Name - The name of the application.
- Name *string `json:"name,omitempty"`
- // Description - The description of the application.
- Description *string `json:"description,omitempty"`
- // Culture - The culture of the application. E.g.: en-us.
- Culture *string `json:"culture,omitempty"`
- // UsageScenario - Defines the scenario for the new application. Optional. E.g.: IoT.
- UsageScenario *string `json:"usageScenario,omitempty"`
- // Domain - The domain for the new application. Optional. E.g.: Comics.
- Domain *string `json:"domain,omitempty"`
- // VersionsCount - Amount of model versions within the application.
- VersionsCount *int32 `json:"versionsCount,omitempty"`
- // CreatedDateTime - The version's creation timestamp.
- CreatedDateTime *string `json:"createdDateTime,omitempty"`
- // Endpoints - The Runtime endpoint URL for this model version.
- Endpoints interface{} `json:"endpoints,omitempty"`
- // EndpointHitsCount - Number of calls made to this endpoint.
- EndpointHitsCount *int32 `json:"endpointHitsCount,omitempty"`
- // ActiveVersion - The version ID currently marked as active.
- ActiveVersion *string `json:"activeVersion,omitempty"`
-}
-
-// ApplicationPublishObject object model for publishing a specific application version.
-type ApplicationPublishObject struct {
- // VersionID - The version ID to publish.
- VersionID *string `json:"versionId,omitempty"`
- // IsStaging - Indicates if the staging slot should be used, instead of the Production one.
- IsStaging *bool `json:"isStaging,omitempty"`
- // Region - The target region that the application is published to.
- Region *string `json:"region,omitempty"`
-}
-
-// ApplicationSettings the application settings.
-type ApplicationSettings struct {
- autorest.Response `json:"-"`
- // ID - The application ID.
- ID *uuid.UUID `json:"id,omitempty"`
- // IsPublic - Setting your application as public allows other people to use your application's endpoint using their own keys.
- IsPublic *bool `json:"public,omitempty"`
-}
-
-// ApplicationSettingUpdateObject object model for updating an application's settings.
-type ApplicationSettingUpdateObject struct {
- // Public - Setting your application as public allows other people to use your application's endpoint using their own keys.
- Public *bool `json:"public,omitempty"`
-}
-
-// ApplicationUpdateObject object model for updating the name or description of an application.
-type ApplicationUpdateObject struct {
- // Name - The application's new name.
- Name *string `json:"name,omitempty"`
- // Description - The application's new description.
- Description *string `json:"description,omitempty"`
-}
-
-// AvailableCulture available culture for using in a new application.
-type AvailableCulture struct {
- // Name - The language name.
- Name *string `json:"name,omitempty"`
- // Code - The ISO value for the language.
- Code *string `json:"code,omitempty"`
-}
-
-// AvailablePrebuiltEntityModel available Prebuilt entity model for using in an application.
-type AvailablePrebuiltEntityModel struct {
- // Name - The entity name.
- Name *string `json:"name,omitempty"`
- // Description - The entity description and usage information.
- Description *string `json:"description,omitempty"`
- // Examples - Usage examples.
- Examples *string `json:"examples,omitempty"`
-}
-
-// BatchLabelExample response when adding a batch of labeled examples.
-type BatchLabelExample struct {
- Value *LabelExampleResponse `json:"value,omitempty"`
- HasError *bool `json:"hasError,omitempty"`
- Error *OperationStatus `json:"error,omitempty"`
-}
-
-// ChildEntity the base child entity type.
-type ChildEntity struct {
- // ID - The ID (GUID) belonging to a child entity.
- ID *uuid.UUID `json:"id,omitempty"`
- // Name - The name of a child entity.
- Name *string `json:"name,omitempty"`
-}
-
-// ClosedList exported Model - A Closed List.
-type ClosedList struct {
- // Name - Name of the closed list feature.
- Name *string `json:"name,omitempty"`
- // SubLists - Sublists for the feature.
- SubLists *[]SubClosedList `json:"subLists,omitempty"`
- Roles *[]string `json:"roles,omitempty"`
-}
-
-// ClosedListEntityExtractor closed List Entity Extractor.
-type ClosedListEntityExtractor struct {
- autorest.Response `json:"-"`
- // ID - The ID of the Entity Model.
- ID *uuid.UUID `json:"id,omitempty"`
- // Name - Name of the Entity Model.
- Name *string `json:"name,omitempty"`
- // TypeID - The type ID of the Entity Model.
- TypeID *int32 `json:"typeId,omitempty"`
- // ReadableType - Possible values include: 'ReadableType4EntityExtractor', 'ReadableType4HierarchicalEntityExtractor', 'ReadableType4HierarchicalChildEntityExtractor', 'ReadableType4CompositeEntityExtractor', 'ReadableType4ClosedListEntityExtractor', 'ReadableType4PrebuiltEntityExtractor', 'ReadableType4IntentClassifier', 'ReadableType4PatternAnyEntityExtractor', 'ReadableType4RegexEntityExtractor'
- ReadableType ReadableType4 `json:"readableType,omitempty"`
- Roles *[]EntityRole `json:"roles,omitempty"`
- // SubLists - List of sub-lists.
- SubLists *[]SubClosedListResponse `json:"subLists,omitempty"`
-}
-
-// ClosedListModelCreateObject object model for creating a closed list.
-type ClosedListModelCreateObject struct {
- // SubLists - Sublists for the feature.
- SubLists *[]WordListObject `json:"subLists,omitempty"`
- // Name - Name of the closed list feature.
- Name *string `json:"name,omitempty"`
-}
-
-// ClosedListModelPatchObject object model for adding a batch of sublists to an existing closedlist.
-type ClosedListModelPatchObject struct {
- // SubLists - Sublists to add.
- SubLists *[]WordListObject `json:"subLists,omitempty"`
-}
-
-// ClosedListModelUpdateObject object model for updating a closed list.
-type ClosedListModelUpdateObject struct {
- // SubLists - The new sublists for the feature.
- SubLists *[]WordListObject `json:"subLists,omitempty"`
- // Name - The new name of the closed list feature.
- Name *string `json:"name,omitempty"`
-}
-
-// CollaboratorsArray ...
-type CollaboratorsArray struct {
- // Emails - The email address of the users.
- Emails *[]string `json:"emails,omitempty"`
-}
-
-// CompositeChildModelCreateObject ...
-type CompositeChildModelCreateObject struct {
- Name *string `json:"name,omitempty"`
-}
-
-// CompositeEntityExtractor a Composite Entity Extractor.
-type CompositeEntityExtractor struct {
- autorest.Response `json:"-"`
- // ID - The ID of the Entity Model.
- ID *uuid.UUID `json:"id,omitempty"`
- // Name - Name of the Entity Model.
- Name *string `json:"name,omitempty"`
- // TypeID - The type ID of the Entity Model.
- TypeID *int32 `json:"typeId,omitempty"`
- // ReadableType - Possible values include: 'ReadableType3EntityExtractor', 'ReadableType3HierarchicalEntityExtractor', 'ReadableType3HierarchicalChildEntityExtractor', 'ReadableType3CompositeEntityExtractor', 'ReadableType3ClosedListEntityExtractor', 'ReadableType3PrebuiltEntityExtractor', 'ReadableType3IntentClassifier', 'ReadableType3PatternAnyEntityExtractor', 'ReadableType3RegexEntityExtractor'
- ReadableType ReadableType3 `json:"readableType,omitempty"`
- Roles *[]EntityRole `json:"roles,omitempty"`
- // Children - List of child entities.
- Children *[]ChildEntity `json:"children,omitempty"`
-}
-
-// CompositeEntityModel a composite entity.
-type CompositeEntityModel struct {
- // Children - Child entities.
- Children *[]string `json:"children,omitempty"`
- // Name - Entity name.
- Name *string `json:"name,omitempty"`
-}
-
-// CustomPrebuiltModel a Custom Prebuilt model.
-type CustomPrebuiltModel struct {
- // ID - The ID of the Entity Model.
- ID *uuid.UUID `json:"id,omitempty"`
- // Name - Name of the Entity Model.
- Name *string `json:"name,omitempty"`
- // TypeID - The type ID of the Entity Model.
- TypeID *int32 `json:"typeId,omitempty"`
- // ReadableType - Possible values include: 'ReadableType7EntityExtractor', 'ReadableType7HierarchicalEntityExtractor', 'ReadableType7HierarchicalChildEntityExtractor', 'ReadableType7CompositeEntityExtractor', 'ReadableType7ClosedListEntityExtractor', 'ReadableType7PrebuiltEntityExtractor', 'ReadableType7IntentClassifier', 'ReadableType7PatternAnyEntityExtractor', 'ReadableType7RegexEntityExtractor'
- ReadableType ReadableType7 `json:"readableType,omitempty"`
- // CustomPrebuiltDomainName - The domain name.
- CustomPrebuiltDomainName *string `json:"customPrebuiltDomainName,omitempty"`
- // CustomPrebuiltModelName - The intent name or entity name.
- CustomPrebuiltModelName *string `json:"customPrebuiltModelName,omitempty"`
- Roles *[]EntityRole `json:"roles,omitempty"`
-}
-
-// EndpointInfo the base class "ProductionOrStagingEndpointInfo" inherits from.
-type EndpointInfo struct {
- // VersionID - The version ID to publish.
- VersionID *string `json:"versionId,omitempty"`
- // IsStaging - Indicates if the staging slot should be used, instead of the Production one.
- IsStaging *bool `json:"isStaging,omitempty"`
- // EndpointURL - The Runtime endpoint URL for this model version.
- EndpointURL *string `json:"endpointUrl,omitempty"`
- // Region - The target region that the application is published to.
- Region *string `json:"region,omitempty"`
- // AssignedEndpointKey - The endpoint key.
- AssignedEndpointKey *string `json:"assignedEndpointKey,omitempty"`
- // EndpointRegion - The endpoint's region.
- EndpointRegion *string `json:"endpointRegion,omitempty"`
- // PublishedDateTime - Timestamp when was last published.
- PublishedDateTime *string `json:"publishedDateTime,omitempty"`
-}
-
-// EnqueueTrainingResponse response model when requesting to train the model.
-type EnqueueTrainingResponse struct {
- autorest.Response `json:"-"`
- // StatusID - The train request status ID.
- StatusID *int32 `json:"statusId,omitempty"`
- // Status - Possible values include: 'StatusQueued', 'StatusInProgress', 'StatusUpToDate', 'StatusFail', 'StatusSuccess'
- Status Status `json:"status,omitempty"`
-}
-
-// EntitiesSuggestionExample predicted/suggested entity.
-type EntitiesSuggestionExample struct {
- // Text - The utterance. E.g.: what's the weather like in seattle?
- Text *string `json:"text,omitempty"`
- // TokenizedText - The utterance tokenized.
- TokenizedText *[]string `json:"tokenizedText,omitempty"`
- // IntentPredictions - Predicted/suggested intents.
- IntentPredictions *[]IntentPrediction `json:"intentPredictions,omitempty"`
- // EntityPredictions - Predicted/suggested entities.
- EntityPredictions *[]EntityPrediction `json:"entityPredictions,omitempty"`
-}
-
-// EntityExtractor entity Extractor.
-type EntityExtractor struct {
- autorest.Response `json:"-"`
- // ID - The ID of the Entity Model.
- ID *uuid.UUID `json:"id,omitempty"`
- // Name - Name of the Entity Model.
- Name *string `json:"name,omitempty"`
- // TypeID - The type ID of the Entity Model.
- TypeID *int32 `json:"typeId,omitempty"`
- // ReadableType - Possible values include: 'ReadableType8EntityExtractor', 'ReadableType8HierarchicalEntityExtractor', 'ReadableType8HierarchicalChildEntityExtractor', 'ReadableType8CompositeEntityExtractor', 'ReadableType8ClosedListEntityExtractor', 'ReadableType8PrebuiltEntityExtractor', 'ReadableType8IntentClassifier', 'ReadableType8PatternAnyEntityExtractor', 'ReadableType8RegexEntityExtractor'
- ReadableType ReadableType8 `json:"readableType,omitempty"`
- Roles *[]EntityRole `json:"roles,omitempty"`
- // CustomPrebuiltDomainName - The domain name.
- CustomPrebuiltDomainName *string `json:"customPrebuiltDomainName,omitempty"`
- // CustomPrebuiltModelName - The intent name or entity name.
- CustomPrebuiltModelName *string `json:"customPrebuiltModelName,omitempty"`
-}
-
-// EntityLabel defines the entity type and position of the extracted entity within the example.
-type EntityLabel struct {
- // EntityName - The entity type.
- EntityName *string `json:"entityName,omitempty"`
- // StartTokenIndex - The index within the utterance where the extracted entity starts.
- StartTokenIndex *int32 `json:"startTokenIndex,omitempty"`
- // EndTokenIndex - The index within the utterance where the extracted entity ends.
- EndTokenIndex *int32 `json:"endTokenIndex,omitempty"`
-}
-
-// EntityLabelObject defines the entity type and position of the extracted entity within the example.
-type EntityLabelObject struct {
- // EntityName - The entity type.
- EntityName *string `json:"entityName,omitempty"`
- // StartCharIndex - The index within the utterance where the extracted entity starts.
- StartCharIndex *int32 `json:"startCharIndex,omitempty"`
- // EndCharIndex - The index within the utterance where the extracted entity ends.
- EndCharIndex *int32 `json:"endCharIndex,omitempty"`
-}
-
-// EntityModelInfo an Entity Extractor model info.
-type EntityModelInfo struct {
- Roles *[]EntityRole `json:"roles,omitempty"`
- // ID - The ID of the Entity Model.
- ID *uuid.UUID `json:"id,omitempty"`
- // Name - Name of the Entity Model.
- Name *string `json:"name,omitempty"`
- // TypeID - The type ID of the Entity Model.
- TypeID *int32 `json:"typeId,omitempty"`
- // ReadableType - Possible values include: 'ReadableTypeEntityExtractor', 'ReadableTypeHierarchicalEntityExtractor', 'ReadableTypeHierarchicalChildEntityExtractor', 'ReadableTypeCompositeEntityExtractor', 'ReadableTypeClosedListEntityExtractor', 'ReadableTypePrebuiltEntityExtractor', 'ReadableTypeIntentClassifier', 'ReadableTypePatternAnyEntityExtractor', 'ReadableTypeRegexEntityExtractor'
- ReadableType ReadableType `json:"readableType,omitempty"`
-}
-
-// EntityPrediction a suggested entity.
-type EntityPrediction struct {
- // EntityName - The entity's name
- EntityName *string `json:"entityName,omitempty"`
- // StartTokenIndex - The index within the utterance where the extracted entity starts.
- StartTokenIndex *int32 `json:"startTokenIndex,omitempty"`
- // EndTokenIndex - The index within the utterance where the extracted entity ends.
- EndTokenIndex *int32 `json:"endTokenIndex,omitempty"`
- // Phrase - The actual token(s) that comprise the entity.
- Phrase *string `json:"phrase,omitempty"`
-}
-
-// EntityRole entity extractor role
-type EntityRole struct {
- autorest.Response `json:"-"`
- // ID - The entity role ID.
- ID *uuid.UUID `json:"id,omitempty"`
- // Name - The entity role name.
- Name *string `json:"name,omitempty"`
-}
-
-// EntityRoleCreateObject object model for creating an entity role.
-type EntityRoleCreateObject struct {
- // Name - The entity role name.
- Name *string `json:"name,omitempty"`
-}
-
-// EntityRoleUpdateObject object model for updating an entity role.
-type EntityRoleUpdateObject struct {
- // Name - The entity role name.
- Name *string `json:"name,omitempty"`
-}
-
-// ErrorResponse error response when invoking an operation on the API.
-type ErrorResponse struct {
- // AdditionalProperties - Unmatched properties from the message are deserialized this collection
- AdditionalProperties map[string]interface{} `json:""`
- ErrorType *string `json:"errorType,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for ErrorResponse.
-func (er ErrorResponse) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if er.ErrorType != nil {
- objectMap["errorType"] = er.ErrorType
- }
- for k, v := range er.AdditionalProperties {
- objectMap[k] = v
- }
- return json.Marshal(objectMap)
-}
-
-// ExampleLabelObject a labeled example.
-type ExampleLabelObject struct {
- // Text - The sample's utterance.
- Text *string `json:"text,omitempty"`
- // EntityLabels - The idenfied entities within the utterance.
- EntityLabels *[]EntityLabelObject `json:"entityLabels,omitempty"`
- // IntentName - The idenfitied intent representing the utterance.
- IntentName *string `json:"intentName,omitempty"`
-}
-
-// ExplicitListItem explicit list item
-type ExplicitListItem struct {
- autorest.Response `json:"-"`
- // ID - The explicit list item ID.
- ID *int64 `json:"id,omitempty"`
- // ExplicitListItem - The explicit list item value.
- ExplicitListItem *string `json:"explicitListItem,omitempty"`
-}
-
-// ExplicitListItemCreateObject object model for creating an explicit list item.
-type ExplicitListItemCreateObject struct {
- // ExplicitListItem - The explicit list item.
- ExplicitListItem *string `json:"explicitListItem,omitempty"`
-}
-
-// ExplicitListItemUpdateObject model object for updating an explicit list item.
-type ExplicitListItemUpdateObject struct {
- // ExplicitListItem - The explicit list item.
- ExplicitListItem *string `json:"explicitListItem,omitempty"`
-}
-
-// FeatureInfoObject the base class Features-related response objects inherit from.
-type FeatureInfoObject struct {
- // ID - A six-digit ID used for Features.
- ID *int32 `json:"id,omitempty"`
- // Name - The name of the Feature.
- Name *string `json:"name,omitempty"`
- // IsActive - Indicates if the feature is enabled.
- IsActive *bool `json:"isActive,omitempty"`
-}
-
-// FeaturesResponseObject model Features, including Patterns and Phraselists.
-type FeaturesResponseObject struct {
- autorest.Response `json:"-"`
- PhraselistFeatures *[]PhraseListFeatureInfo `json:"phraselistFeatures,omitempty"`
- PatternFeatures *[]PatternFeatureInfo `json:"patternFeatures,omitempty"`
-}
-
-// HierarchicalChildEntity a Hierarchical Child Entity.
-type HierarchicalChildEntity struct {
- autorest.Response `json:"-"`
- // TypeID - The type ID of the Entity Model.
- TypeID *int32 `json:"typeId,omitempty"`
- // ReadableType - Possible values include: 'ReadableType6EntityExtractor', 'ReadableType6HierarchicalEntityExtractor', 'ReadableType6HierarchicalChildEntityExtractor', 'ReadableType6CompositeEntityExtractor', 'ReadableType6ClosedListEntityExtractor', 'ReadableType6PrebuiltEntityExtractor', 'ReadableType6IntentClassifier', 'ReadableType6PatternAnyEntityExtractor', 'ReadableType6RegexEntityExtractor'
- ReadableType ReadableType6 `json:"readableType,omitempty"`
- // ID - The ID (GUID) belonging to a child entity.
- ID *uuid.UUID `json:"id,omitempty"`
- // Name - The name of a child entity.
- Name *string `json:"name,omitempty"`
-}
-
-// HierarchicalChildModelCreateObject ...
-type HierarchicalChildModelCreateObject struct {
- Name *string `json:"name,omitempty"`
-}
-
-// HierarchicalChildModelUpdateObject ...
-type HierarchicalChildModelUpdateObject struct {
- Name *string `json:"name,omitempty"`
-}
-
-// HierarchicalEntityExtractor hierarchical Entity Extractor.
-type HierarchicalEntityExtractor struct {
- autorest.Response `json:"-"`
- // ID - The ID of the Entity Model.
- ID *uuid.UUID `json:"id,omitempty"`
- // Name - Name of the Entity Model.
- Name *string `json:"name,omitempty"`
- // TypeID - The type ID of the Entity Model.
- TypeID *int32 `json:"typeId,omitempty"`
- // ReadableType - Possible values include: 'ReadableType2EntityExtractor', 'ReadableType2HierarchicalEntityExtractor', 'ReadableType2HierarchicalChildEntityExtractor', 'ReadableType2CompositeEntityExtractor', 'ReadableType2ClosedListEntityExtractor', 'ReadableType2PrebuiltEntityExtractor', 'ReadableType2IntentClassifier', 'ReadableType2PatternAnyEntityExtractor', 'ReadableType2RegexEntityExtractor'
- ReadableType ReadableType2 `json:"readableType,omitempty"`
- Roles *[]EntityRole `json:"roles,omitempty"`
- // Children - List of child entities.
- Children *[]ChildEntity `json:"children,omitempty"`
-}
-
-// HierarchicalEntityModel a Hierarchical Entity Extractor.
-type HierarchicalEntityModel struct {
- // Children - Child entities.
- Children *[]string `json:"children,omitempty"`
- // Name - Entity name.
- Name *string `json:"name,omitempty"`
-}
-
-// HierarchicalModel ...
-type HierarchicalModel struct {
- Name *string `json:"name,omitempty"`
- Children *[]string `json:"children,omitempty"`
- Inherits *PrebuiltDomainObject `json:"inherits,omitempty"`
- Roles *[]string `json:"roles,omitempty"`
-}
-
-// Int32 ...
-type Int32 struct {
- autorest.Response `json:"-"`
- Value *int32 `json:"value,omitempty"`
-}
-
-// IntentClassifier intent Classifier.
-type IntentClassifier struct {
- autorest.Response `json:"-"`
- // CustomPrebuiltDomainName - The domain name.
- CustomPrebuiltDomainName *string `json:"customPrebuiltDomainName,omitempty"`
- // CustomPrebuiltModelName - The intent name or entity name.
- CustomPrebuiltModelName *string `json:"customPrebuiltModelName,omitempty"`
- // ID - The ID of the Entity Model.
- ID *uuid.UUID `json:"id,omitempty"`
- // Name - Name of the Entity Model.
- Name *string `json:"name,omitempty"`
- // TypeID - The type ID of the Entity Model.
- TypeID *int32 `json:"typeId,omitempty"`
- // ReadableType - Possible values include: 'ReadableTypeEntityExtractor', 'ReadableTypeHierarchicalEntityExtractor', 'ReadableTypeHierarchicalChildEntityExtractor', 'ReadableTypeCompositeEntityExtractor', 'ReadableTypeClosedListEntityExtractor', 'ReadableTypePrebuiltEntityExtractor', 'ReadableTypeIntentClassifier', 'ReadableTypePatternAnyEntityExtractor', 'ReadableTypeRegexEntityExtractor'
- ReadableType ReadableType `json:"readableType,omitempty"`
-}
-
-// IntentPrediction a suggested intent.
-type IntentPrediction struct {
- // Name - The intent's name
- Name *string `json:"name,omitempty"`
- // Score - The intent's score, based on the prediction model.
- Score *float64 `json:"score,omitempty"`
-}
-
-// IntentsSuggestionExample predicted/suggested intent.
-type IntentsSuggestionExample struct {
- // Text - The utterance. E.g.: what's the weather like in seattle?
- Text *string `json:"text,omitempty"`
- // TokenizedText - The utterance tokenized.
- TokenizedText *[]string `json:"tokenizedText,omitempty"`
- // IntentPredictions - Predicted/suggested intents.
- IntentPredictions *[]IntentPrediction `json:"intentPredictions,omitempty"`
- // EntityPredictions - Predicted/suggested entities.
- EntityPredictions *[]EntityPrediction `json:"entityPredictions,omitempty"`
-}
-
-// JSONEntity exported Model - Extracted Entity from utterance.
-type JSONEntity struct {
- // StartPos - The index within the utterance where the extracted entity starts.
- StartPos *int32 `json:"startPos,omitempty"`
- // EndPos - The index within the utterance where the extracted entity ends.
- EndPos *int32 `json:"endPos,omitempty"`
- // Entity - The entity name.
- Entity *string `json:"entity,omitempty"`
-}
-
-// JSONModelFeature exported Model - Phraselist Model Feature.
-type JSONModelFeature struct {
- // Activated - Indicates if the feature is enabled.
- Activated *bool `json:"activated,omitempty"`
- // Name - The Phraselist name.
- Name *string `json:"name,omitempty"`
- // Words - List of comma-separated phrases that represent the Phraselist.
- Words *string `json:"words,omitempty"`
- // Mode - An exchangeable phrase list feature are serves as single feature to the LUIS underlying training algorithm. It is used as a lexicon lookup feature where its value is 1 if the lexicon contains a given word or 0 if it doesn’t. Think of an exchangeable as a synonyms list. A non-exchangeable phrase list feature has all the phrases in the list serve as separate features to the underlying training algorithm. So, if you your phrase list feature contains 5 phrases, they will be mapped to 5 separate features. You can think of the non-exchangeable phrase list feature as an additional bag of words that you are willing to add to LUIS existing vocabulary features. Think of a non-exchangeable as set of different words. Default value is true.
- Mode *bool `json:"mode,omitempty"`
-}
-
-// JSONRegexFeature exported Model - A Pattern feature.
-type JSONRegexFeature struct {
- // Pattern - The Regular Expression to match.
- Pattern *string `json:"pattern,omitempty"`
- // Activated - Indicates if the Pattern feature is enabled.
- Activated *bool `json:"activated,omitempty"`
- // Name - Name of the feature.
- Name *string `json:"name,omitempty"`
-}
-
-// JSONUtterance exported Model - Utterance that was used to train the model.
-type JSONUtterance struct {
- // Text - The utterance.
- Text *string `json:"text,omitempty"`
- // Intent - The matched intent.
- Intent *string `json:"intent,omitempty"`
- // Entities - The matched entities.
- Entities *[]JSONEntity `json:"entities,omitempty"`
-}
-
-// LabeledUtterance a prediction and label pair of an example.
-type LabeledUtterance struct {
- // ID - ID of Labeled Utterance.
- ID *int32 `json:"id,omitempty"`
- // Text - The utterance. E.g.: what's the weather like in seattle?
- Text *string `json:"text,omitempty"`
- // TokenizedText - The utterance tokenized.
- TokenizedText *[]string `json:"tokenizedText,omitempty"`
- // IntentLabel - The intent matching the example.
- IntentLabel *string `json:"intentLabel,omitempty"`
- // EntityLabels - The entities matching the example.
- EntityLabels *[]EntityLabel `json:"entityLabels,omitempty"`
- // IntentPredictions - List of suggested intents.
- IntentPredictions *[]IntentPrediction `json:"intentPredictions,omitempty"`
- // EntityPredictions - List of suggested entities.
- EntityPredictions *[]EntityPrediction `json:"entityPredictions,omitempty"`
-}
-
-// LabelExampleResponse response when adding a labeled example.
-type LabelExampleResponse struct {
- autorest.Response `json:"-"`
- // UtteranceText - The sample's utterance.
- UtteranceText *string `json:"UtteranceText,omitempty"`
- // ExampleID - The newly created sample ID.
- ExampleID *int32 `json:"ExampleId,omitempty"`
-}
-
-// ListApplicationInfoResponse ...
-type ListApplicationInfoResponse struct {
- autorest.Response `json:"-"`
- Value *[]ApplicationInfoResponse `json:"value,omitempty"`
-}
-
-// ListAvailableCulture ...
-type ListAvailableCulture struct {
- autorest.Response `json:"-"`
- Value *[]AvailableCulture `json:"value,omitempty"`
-}
-
-// ListAvailablePrebuiltEntityModel ...
-type ListAvailablePrebuiltEntityModel struct {
- autorest.Response `json:"-"`
- Value *[]AvailablePrebuiltEntityModel `json:"value,omitempty"`
-}
-
-// ListBatchLabelExample ...
-type ListBatchLabelExample struct {
- autorest.Response `json:"-"`
- Value *[]BatchLabelExample `json:"value,omitempty"`
-}
-
-// ListClosedListEntityExtractor ...
-type ListClosedListEntityExtractor struct {
- autorest.Response `json:"-"`
- Value *[]ClosedListEntityExtractor `json:"value,omitempty"`
-}
-
-// ListCompositeEntityExtractor ...
-type ListCompositeEntityExtractor struct {
- autorest.Response `json:"-"`
- Value *[]CompositeEntityExtractor `json:"value,omitempty"`
-}
-
-// ListCustomPrebuiltModel ...
-type ListCustomPrebuiltModel struct {
- autorest.Response `json:"-"`
- Value *[]CustomPrebuiltModel `json:"value,omitempty"`
-}
-
-// ListEntitiesSuggestionExample ...
-type ListEntitiesSuggestionExample struct {
- autorest.Response `json:"-"`
- Value *[]EntitiesSuggestionExample `json:"value,omitempty"`
-}
-
-// ListEntityExtractor ...
-type ListEntityExtractor struct {
- autorest.Response `json:"-"`
- Value *[]EntityExtractor `json:"value,omitempty"`
-}
-
-// ListEntityRole ...
-type ListEntityRole struct {
- autorest.Response `json:"-"`
- Value *[]EntityRole `json:"value,omitempty"`
-}
-
-// ListExplicitListItem ...
-type ListExplicitListItem struct {
- autorest.Response `json:"-"`
- Value *[]ExplicitListItem `json:"value,omitempty"`
-}
-
-// ListHierarchicalEntityExtractor ...
-type ListHierarchicalEntityExtractor struct {
- autorest.Response `json:"-"`
- Value *[]HierarchicalEntityExtractor `json:"value,omitempty"`
-}
-
-// ListIntentClassifier ...
-type ListIntentClassifier struct {
- autorest.Response `json:"-"`
- Value *[]IntentClassifier `json:"value,omitempty"`
-}
-
-// ListIntentsSuggestionExample ...
-type ListIntentsSuggestionExample struct {
- autorest.Response `json:"-"`
- Value *[]IntentsSuggestionExample `json:"value,omitempty"`
-}
-
-// ListLabeledUtterance ...
-type ListLabeledUtterance struct {
- autorest.Response `json:"-"`
- Value *[]LabeledUtterance `json:"value,omitempty"`
-}
-
-// ListModelInfoResponse ...
-type ListModelInfoResponse struct {
- autorest.Response `json:"-"`
- Value *[]ModelInfoResponse `json:"value,omitempty"`
-}
-
-// ListModelTrainingInfo ...
-type ListModelTrainingInfo struct {
- autorest.Response `json:"-"`
- Value *[]ModelTrainingInfo `json:"value,omitempty"`
-}
-
-// ListPatternAnyEntityExtractor ...
-type ListPatternAnyEntityExtractor struct {
- autorest.Response `json:"-"`
- Value *[]PatternAnyEntityExtractor `json:"value,omitempty"`
-}
-
-// ListPatternRuleInfo ...
-type ListPatternRuleInfo struct {
- autorest.Response `json:"-"`
- Value *[]PatternRuleInfo `json:"value,omitempty"`
-}
-
-// ListPhraseListFeatureInfo ...
-type ListPhraseListFeatureInfo struct {
- autorest.Response `json:"-"`
- Value *[]PhraseListFeatureInfo `json:"value,omitempty"`
-}
-
-// ListPrebuiltDomain ...
-type ListPrebuiltDomain struct {
- autorest.Response `json:"-"`
- Value *[]PrebuiltDomain `json:"value,omitempty"`
-}
-
-// ListPrebuiltEntityExtractor ...
-type ListPrebuiltEntityExtractor struct {
- autorest.Response `json:"-"`
- Value *[]PrebuiltEntityExtractor `json:"value,omitempty"`
-}
-
-// ListRegexEntityExtractor ...
-type ListRegexEntityExtractor struct {
- autorest.Response `json:"-"`
- Value *[]RegexEntityExtractor `json:"value,omitempty"`
-}
-
-// ListString ...
-type ListString struct {
- autorest.Response `json:"-"`
- Value *[]string `json:"value,omitempty"`
-}
-
-// ListUUID ...
-type ListUUID struct {
- autorest.Response `json:"-"`
- Value *[]uuid.UUID `json:"value,omitempty"`
-}
-
-// ListVersionInfo ...
-type ListVersionInfo struct {
- autorest.Response `json:"-"`
- Value *[]VersionInfo `json:"value,omitempty"`
-}
-
-// LuisApp exported Model - An exported LUIS Application.
-type LuisApp struct {
- autorest.Response `json:"-"`
- // AdditionalProperties - Unmatched properties from the message are deserialized this collection
- AdditionalProperties map[string]interface{} `json:""`
- // Name - The name of the application.
- Name *string `json:"name,omitempty"`
- // VersionID - The version ID of the application that was exported.
- VersionID *string `json:"versionId,omitempty"`
- // Desc - The description of the application.
- Desc *string `json:"desc,omitempty"`
- // Culture - The culture of the application. E.g.: en-us.
- Culture *string `json:"culture,omitempty"`
- // Intents - List of intents.
- Intents *[]HierarchicalModel `json:"intents,omitempty"`
- // Entities - List of entities.
- Entities *[]HierarchicalModel `json:"entities,omitempty"`
- // ClosedLists - List of closed lists.
- ClosedLists *[]ClosedList `json:"closedLists,omitempty"`
- // Composites - List of composite entities.
- Composites *[]HierarchicalModel `json:"composites,omitempty"`
- // PatternAnyEntities - List of Pattern.Any entities.
- PatternAnyEntities *[]PatternAny `json:"patternAnyEntities,omitempty"`
- // RegexEntities - List of regular expression entities.
- RegexEntities *[]RegexEntity `json:"regex_entities,omitempty"`
- // PrebuiltEntities - List of prebuilt entities.
- PrebuiltEntities *[]PrebuiltEntity `json:"prebuiltEntities,omitempty"`
- // RegexFeatures - List of pattern features.
- RegexFeatures *[]JSONRegexFeature `json:"regex_features,omitempty"`
- // ModelFeatures - List of model features.
- ModelFeatures *[]JSONModelFeature `json:"model_features,omitempty"`
- // Patterns - List of patterns.
- Patterns *[]PatternRule `json:"patterns,omitempty"`
- // Utterances - List of sample utterances.
- Utterances *[]JSONUtterance `json:"utterances,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for LuisApp.
-func (la LuisApp) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if la.Name != nil {
- objectMap["name"] = la.Name
- }
- if la.VersionID != nil {
- objectMap["versionId"] = la.VersionID
- }
- if la.Desc != nil {
- objectMap["desc"] = la.Desc
- }
- if la.Culture != nil {
- objectMap["culture"] = la.Culture
- }
- if la.Intents != nil {
- objectMap["intents"] = la.Intents
- }
- if la.Entities != nil {
- objectMap["entities"] = la.Entities
- }
- if la.ClosedLists != nil {
- objectMap["closedLists"] = la.ClosedLists
- }
- if la.Composites != nil {
- objectMap["composites"] = la.Composites
- }
- if la.PatternAnyEntities != nil {
- objectMap["patternAnyEntities"] = la.PatternAnyEntities
- }
- if la.RegexEntities != nil {
- objectMap["regex_entities"] = la.RegexEntities
- }
- if la.PrebuiltEntities != nil {
- objectMap["prebuiltEntities"] = la.PrebuiltEntities
- }
- if la.RegexFeatures != nil {
- objectMap["regex_features"] = la.RegexFeatures
- }
- if la.ModelFeatures != nil {
- objectMap["model_features"] = la.ModelFeatures
- }
- if la.Patterns != nil {
- objectMap["patterns"] = la.Patterns
- }
- if la.Utterances != nil {
- objectMap["utterances"] = la.Utterances
- }
- for k, v := range la.AdditionalProperties {
- objectMap[k] = v
- }
- return json.Marshal(objectMap)
-}
-
-// ModelCreateObject object model for creating a new entity extractor.
-type ModelCreateObject struct {
- // Name - Name of the new entity extractor.
- Name *string `json:"name,omitempty"`
-}
-
-// ModelInfo base type used in entity types.
-type ModelInfo struct {
- // ID - The ID of the Entity Model.
- ID *uuid.UUID `json:"id,omitempty"`
- // Name - Name of the Entity Model.
- Name *string `json:"name,omitempty"`
- // TypeID - The type ID of the Entity Model.
- TypeID *int32 `json:"typeId,omitempty"`
- // ReadableType - Possible values include: 'ReadableTypeEntityExtractor', 'ReadableTypeHierarchicalEntityExtractor', 'ReadableTypeHierarchicalChildEntityExtractor', 'ReadableTypeCompositeEntityExtractor', 'ReadableTypeClosedListEntityExtractor', 'ReadableTypePrebuiltEntityExtractor', 'ReadableTypeIntentClassifier', 'ReadableTypePatternAnyEntityExtractor', 'ReadableTypeRegexEntityExtractor'
- ReadableType ReadableType `json:"readableType,omitempty"`
-}
-
-// ModelInfoResponse an application model info.
-type ModelInfoResponse struct {
- // ID - The ID of the Entity Model.
- ID *uuid.UUID `json:"id,omitempty"`
- // Name - Name of the Entity Model.
- Name *string `json:"name,omitempty"`
- // TypeID - The type ID of the Entity Model.
- TypeID *int32 `json:"typeId,omitempty"`
- // ReadableType - Possible values include: 'ReadableType1EntityExtractor', 'ReadableType1HierarchicalEntityExtractor', 'ReadableType1HierarchicalChildEntityExtractor', 'ReadableType1CompositeEntityExtractor', 'ReadableType1ClosedListEntityExtractor', 'ReadableType1PrebuiltEntityExtractor', 'ReadableType1IntentClassifier', 'ReadableType1PatternAnyEntityExtractor', 'ReadableType1RegexEntityExtractor'
- ReadableType ReadableType1 `json:"readableType,omitempty"`
- Roles *[]EntityRole `json:"roles,omitempty"`
- // Children - List of child entities.
- Children *[]ChildEntity `json:"children,omitempty"`
- // SubLists - List of sub-lists.
- SubLists *[]SubClosedListResponse `json:"subLists,omitempty"`
- // CustomPrebuiltDomainName - The domain name.
- CustomPrebuiltDomainName *string `json:"customPrebuiltDomainName,omitempty"`
- // CustomPrebuiltModelName - The intent name or entity name.
- CustomPrebuiltModelName *string `json:"customPrebuiltModelName,omitempty"`
- // RegexPattern - The Regex entity pattern.
- RegexPattern *string `json:"regexPattern,omitempty"`
- ExplicitList *[]ExplicitListItem `json:"explicitList,omitempty"`
-}
-
-// ModelTrainingDetails model Training Details.
-type ModelTrainingDetails struct {
- // StatusID - The train request status ID.
- StatusID *int32 `json:"statusId,omitempty"`
- // Status - Possible values include: 'Status1Queued', 'Status1InProgress', 'Status1UpToDate', 'Status1Fail', 'Status1Success'
- Status Status1 `json:"status,omitempty"`
- // ExampleCount - The count of examples used to train the model.
- ExampleCount *int32 `json:"exampleCount,omitempty"`
- // TrainingDateTime - When the model was trained.
- TrainingDateTime *date.Time `json:"trainingDateTime,omitempty"`
- // FailureReason - Reason for the training failure.
- FailureReason *string `json:"failureReason,omitempty"`
-}
-
-// ModelTrainingInfo model Training Info.
-type ModelTrainingInfo struct {
- // ModelID - The ID (GUID) of the model.
- ModelID *uuid.UUID `json:"modelId,omitempty"`
- Details *ModelTrainingDetails `json:"details,omitempty"`
-}
-
-// ModelUpdateObject object model for updating an intent classifier.
-type ModelUpdateObject struct {
- // Name - The entity's new name.
- Name *string `json:"name,omitempty"`
-}
-
-// OperationError operation error details when invoking an operation on the API.
-type OperationError struct {
- Code *string `json:"code,omitempty"`
- Message *string `json:"message,omitempty"`
-}
-
-// OperationStatus response of an Operation status.
-type OperationStatus struct {
- autorest.Response `json:"-"`
- // Code - Status Code. Possible values include: 'Failed', 'FAILED', 'Success'
- Code OperationStatusType `json:"code,omitempty"`
- // Message - Status details.
- Message *string `json:"message,omitempty"`
-}
-
-// PatternAny pattern.Any Entity Extractor.
-type PatternAny struct {
- Name *string `json:"name,omitempty"`
- ExplicitList *[]string `json:"explicitList,omitempty"`
- Roles *[]string `json:"roles,omitempty"`
-}
-
-// PatternAnyEntityExtractor pattern.Any Entity Extractor.
-type PatternAnyEntityExtractor struct {
- autorest.Response `json:"-"`
- // ID - The ID of the Entity Model.
- ID *uuid.UUID `json:"id,omitempty"`
- // Name - Name of the Entity Model.
- Name *string `json:"name,omitempty"`
- // TypeID - The type ID of the Entity Model.
- TypeID *int32 `json:"typeId,omitempty"`
- // ReadableType - Possible values include: 'ReadableType10EntityExtractor', 'ReadableType10HierarchicalEntityExtractor', 'ReadableType10HierarchicalChildEntityExtractor', 'ReadableType10CompositeEntityExtractor', 'ReadableType10ClosedListEntityExtractor', 'ReadableType10PrebuiltEntityExtractor', 'ReadableType10IntentClassifier', 'ReadableType10PatternAnyEntityExtractor', 'ReadableType10RegexEntityExtractor'
- ReadableType ReadableType10 `json:"readableType,omitempty"`
- Roles *[]EntityRole `json:"roles,omitempty"`
- ExplicitList *[]ExplicitListItem `json:"explicitList,omitempty"`
-}
-
-// PatternAnyModelCreateObject model object for creating a Pattern.Any entity model.
-type PatternAnyModelCreateObject struct {
- // Name - The model name.
- Name *string `json:"name,omitempty"`
- // ExplicitList - The Pattern.Any explicit list.
- ExplicitList *[]string `json:"explicitList,omitempty"`
-}
-
-// PatternAnyModelUpdateObject model object for updating a Pattern.Any entity model.
-type PatternAnyModelUpdateObject struct {
- // Name - The model name.
- Name *string `json:"name,omitempty"`
- // ExplicitList - The Pattern.Any explicit list.
- ExplicitList *[]string `json:"explicitList,omitempty"`
-}
-
-// PatternCreateObject object model for creating a Pattern feature.
-type PatternCreateObject struct {
- // Pattern - The Regular Expression to match.
- Pattern *string `json:"pattern,omitempty"`
- // Name - Name of the feature.
- Name *string `json:"name,omitempty"`
-}
-
-// PatternFeatureInfo pattern feature.
-type PatternFeatureInfo struct {
- // Pattern - The Regular Expression to match.
- Pattern *string `json:"pattern,omitempty"`
- // ID - A six-digit ID used for Features.
- ID *int32 `json:"id,omitempty"`
- // Name - The name of the Feature.
- Name *string `json:"name,omitempty"`
- // IsActive - Indicates if the feature is enabled.
- IsActive *bool `json:"isActive,omitempty"`
-}
-
-// PatternRule pattern
-type PatternRule struct {
- // Pattern - The pattern text.
- Pattern *string `json:"pattern,omitempty"`
- // Intent - The intent's name where the pattern belongs to.
- Intent *string `json:"intent,omitempty"`
-}
-
-// PatternRuleCreateObject object model for creating a pattern
-type PatternRuleCreateObject struct {
- // Pattern - The pattern text.
- Pattern *string `json:"pattern,omitempty"`
- // Intent - The intent's name which the pattern belongs to.
- Intent *string `json:"intent,omitempty"`
-}
-
-// PatternRuleInfo pattern rule
-type PatternRuleInfo struct {
- autorest.Response `json:"-"`
- // ID - The pattern ID.
- ID *uuid.UUID `json:"id,omitempty"`
- // Pattern - The pattern text.
- Pattern *string `json:"pattern,omitempty"`
- // Intent - The intent's name where the pattern belongs to.
- Intent *string `json:"intent,omitempty"`
-}
-
-// PatternRuleUpdateObject object model for updating a pattern.
-type PatternRuleUpdateObject struct {
- // ID - The pattern ID.
- ID *uuid.UUID `json:"id,omitempty"`
- // Pattern - The pattern text.
- Pattern *string `json:"pattern,omitempty"`
- // Intent - The intent's name which the pattern belongs to.
- Intent *string `json:"intent,omitempty"`
-}
-
-// PatternUpdateObject object model for updating an existing Pattern feature.
-type PatternUpdateObject struct {
- // Pattern - The Regular Expression to match.
- Pattern *string `json:"pattern,omitempty"`
- // Name - Name of the feature.
- Name *string `json:"name,omitempty"`
- // IsActive - Indicates if the Pattern feature is enabled.
- IsActive *bool `json:"isActive,omitempty"`
-}
-
-// PersonalAssistantsResponse response containing user's endpoint keys and the endpoint URLs of the prebuilt
-// Cortana applications.
-type PersonalAssistantsResponse struct {
- autorest.Response `json:"-"`
- EndpointKeys *[]uuid.UUID `json:"endpointKeys,omitempty"`
- EndpointUrls map[string]*string `json:"endpointUrls"`
-}
-
-// MarshalJSON is the custom marshaler for PersonalAssistantsResponse.
-func (par PersonalAssistantsResponse) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if par.EndpointKeys != nil {
- objectMap["endpointKeys"] = par.EndpointKeys
- }
- if par.EndpointUrls != nil {
- objectMap["endpointUrls"] = par.EndpointUrls
- }
- return json.Marshal(objectMap)
-}
-
-// PhraselistCreateObject object model for creating a phraselist model.
-type PhraselistCreateObject struct {
- // Phrases - List of comma-separated phrases that represent the Phraselist.
- Phrases *string `json:"phrases,omitempty"`
- // Name - The Phraselist name.
- Name *string `json:"name,omitempty"`
- // IsExchangeable - An exchangeable phrase list feature are serves as single feature to the LUIS underlying training algorithm. It is used as a lexicon lookup feature where its value is 1 if the lexicon contains a given word or 0 if it doesn’t. Think of an exchangeable as a synonyms list. A non-exchangeable phrase list feature has all the phrases in the list serve as separate features to the underlying training algorithm. So, if you your phrase list feature contains 5 phrases, they will be mapped to 5 separate features. You can think of the non-exchangeable phrase list feature as an additional bag of words that you are willing to add to LUIS existing vocabulary features. Think of a non-exchangeable as set of different words. Default value is true.
- IsExchangeable *bool `json:"isExchangeable,omitempty"`
-}
-
-// PhraseListFeatureInfo phraselist Feature.
-type PhraseListFeatureInfo struct {
- autorest.Response `json:"-"`
- // Phrases - A list of comma-separated values.
- Phrases *string `json:"phrases,omitempty"`
- // IsExchangeable - An exchangeable phrase list feature are serves as single feature to the LUIS underlying training algorithm. It is used as a lexicon lookup feature where its value is 1 if the lexicon contains a given word or 0 if it doesn’t. Think of an exchangeable as a synonyms list. A non-exchangeable phrase list feature has all the phrases in the list serve as separate features to the underlying training algorithm. So, if you your phrase list feature contains 5 phrases, they will be mapped to 5 separate features. You can think of the non-exchangeable phrase list feature as an additional bag of words that you are willing to add to LUIS existing vocabulary features. Think of a non-exchangeable as set of different words. Default value is true.
- IsExchangeable *bool `json:"isExchangeable,omitempty"`
- // ID - A six-digit ID used for Features.
- ID *int32 `json:"id,omitempty"`
- // Name - The name of the Feature.
- Name *string `json:"name,omitempty"`
- // IsActive - Indicates if the feature is enabled.
- IsActive *bool `json:"isActive,omitempty"`
-}
-
-// PhraselistUpdateObject object model for updating a Phraselist.
-type PhraselistUpdateObject struct {
- // Phrases - List of comma-separated phrases that represent the Phraselist.
- Phrases *string `json:"phrases,omitempty"`
- // Name - The Phraselist name.
- Name *string `json:"name,omitempty"`
- // IsActive - Indicates if the Phraselist is enabled.
- IsActive *bool `json:"isActive,omitempty"`
- // IsExchangeable - An exchangeable phrase list feature are serves as single feature to the LUIS underlying training algorithm. It is used as a lexicon lookup feature where its value is 1 if the lexicon contains a given word or 0 if it doesn’t. Think of an exchangeable as a synonyms list. A non-exchangeable phrase list feature has all the phrases in the list serve as separate features to the underlying training algorithm. So, if you your phrase list feature contains 5 phrases, they will be mapped to 5 separate features. You can think of the non-exchangeable phrase list feature as an additional bag of words that you are willing to add to LUIS existing vocabulary features. Think of a non-exchangeable as set of different words. Default value is true.
- IsExchangeable *bool `json:"isExchangeable,omitempty"`
-}
-
-// PrebuiltDomain prebuilt Domain.
-type PrebuiltDomain struct {
- Name *string `json:"name,omitempty"`
- Culture *string `json:"culture,omitempty"`
- Description *string `json:"description,omitempty"`
- Examples *string `json:"examples,omitempty"`
- Intents *[]PrebuiltDomainItem `json:"intents,omitempty"`
- Entities *[]PrebuiltDomainItem `json:"entities,omitempty"`
-}
-
-// PrebuiltDomainCreateBaseObject a model object containing the name of the custom prebuilt entity and the name of
-// the domain to which this model belongs.
-type PrebuiltDomainCreateBaseObject struct {
- // DomainName - The domain name.
- DomainName *string `json:"domainName,omitempty"`
-}
-
-// PrebuiltDomainCreateObject a prebuilt domain create object containing the name and culture of the domain.
-type PrebuiltDomainCreateObject struct {
- // DomainName - The domain name.
- DomainName *string `json:"domainName,omitempty"`
- // Culture - The culture of the new domain.
- Culture *string `json:"culture,omitempty"`
-}
-
-// PrebuiltDomainItem ...
-type PrebuiltDomainItem struct {
- Name *string `json:"name,omitempty"`
- Description *string `json:"description,omitempty"`
- Examples *string `json:"examples,omitempty"`
-}
-
-// PrebuiltDomainModelCreateObject a model object containing the name of the custom prebuilt intent or entity and
-// the name of the domain to which this model belongs.
-type PrebuiltDomainModelCreateObject struct {
- // DomainName - The domain name.
- DomainName *string `json:"domainName,omitempty"`
- // ModelName - The intent name or entity name.
- ModelName *string `json:"modelName,omitempty"`
-}
-
-// PrebuiltDomainObject ...
-type PrebuiltDomainObject struct {
- DomainName *string `json:"domain_name,omitempty"`
- ModelName *string `json:"model_name,omitempty"`
-}
-
-// PrebuiltEntity prebuilt Entity Extractor.
-type PrebuiltEntity struct {
- Name *string `json:"name,omitempty"`
- Roles *[]string `json:"roles,omitempty"`
-}
-
-// PrebuiltEntityExtractor prebuilt Entity Extractor.
-type PrebuiltEntityExtractor struct {
- autorest.Response `json:"-"`
- // ID - The ID of the Entity Model.
- ID *uuid.UUID `json:"id,omitempty"`
- // Name - Name of the Entity Model.
- Name *string `json:"name,omitempty"`
- // TypeID - The type ID of the Entity Model.
- TypeID *int32 `json:"typeId,omitempty"`
- // ReadableType - Possible values include: 'ReadableType5EntityExtractor', 'ReadableType5HierarchicalEntityExtractor', 'ReadableType5HierarchicalChildEntityExtractor', 'ReadableType5CompositeEntityExtractor', 'ReadableType5ClosedListEntityExtractor', 'ReadableType5PrebuiltEntityExtractor', 'ReadableType5IntentClassifier', 'ReadableType5PatternAnyEntityExtractor', 'ReadableType5RegexEntityExtractor'
- ReadableType ReadableType5 `json:"readableType,omitempty"`
- Roles *[]EntityRole `json:"roles,omitempty"`
-}
-
-// ProductionOrStagingEndpointInfo ...
-type ProductionOrStagingEndpointInfo struct {
- autorest.Response `json:"-"`
- // VersionID - The version ID to publish.
- VersionID *string `json:"versionId,omitempty"`
- // IsStaging - Indicates if the staging slot should be used, instead of the Production one.
- IsStaging *bool `json:"isStaging,omitempty"`
- // EndpointURL - The Runtime endpoint URL for this model version.
- EndpointURL *string `json:"endpointUrl,omitempty"`
- // Region - The target region that the application is published to.
- Region *string `json:"region,omitempty"`
- // AssignedEndpointKey - The endpoint key.
- AssignedEndpointKey *string `json:"assignedEndpointKey,omitempty"`
- // EndpointRegion - The endpoint's region.
- EndpointRegion *string `json:"endpointRegion,omitempty"`
- // PublishedDateTime - Timestamp when was last published.
- PublishedDateTime *string `json:"publishedDateTime,omitempty"`
-}
-
-// ReadCloser ...
-type ReadCloser struct {
- autorest.Response `json:"-"`
- Value *io.ReadCloser `json:"value,omitempty"`
-}
-
-// RegexEntity regular Expression Entity Extractor.
-type RegexEntity struct {
- Name *string `json:"name,omitempty"`
- RegexPattern *string `json:"regexPattern,omitempty"`
- Roles *[]string `json:"roles,omitempty"`
-}
-
-// RegexEntityExtractor regex Entity Extractor.
-type RegexEntityExtractor struct {
- autorest.Response `json:"-"`
- // ID - The ID of the Entity Model.
- ID *uuid.UUID `json:"id,omitempty"`
- // Name - Name of the Entity Model.
- Name *string `json:"name,omitempty"`
- // TypeID - The type ID of the Entity Model.
- TypeID *int32 `json:"typeId,omitempty"`
- // ReadableType - Possible values include: 'ReadableType9EntityExtractor', 'ReadableType9HierarchicalEntityExtractor', 'ReadableType9HierarchicalChildEntityExtractor', 'ReadableType9CompositeEntityExtractor', 'ReadableType9ClosedListEntityExtractor', 'ReadableType9PrebuiltEntityExtractor', 'ReadableType9IntentClassifier', 'ReadableType9PatternAnyEntityExtractor', 'ReadableType9RegexEntityExtractor'
- ReadableType ReadableType9 `json:"readableType,omitempty"`
- Roles *[]EntityRole `json:"roles,omitempty"`
- // RegexPattern - The Regex entity pattern.
- RegexPattern *string `json:"regexPattern,omitempty"`
-}
-
-// RegexModelCreateObject model object for creating a regex entity model.
-type RegexModelCreateObject struct {
- // RegexPattern - The regex entity pattern.
- RegexPattern *string `json:"regexPattern,omitempty"`
- // Name - The model name.
- Name *string `json:"name,omitempty"`
-}
-
-// RegexModelUpdateObject model object for updating a regex entity model.
-type RegexModelUpdateObject struct {
- // RegexPattern - The regex entity pattern.
- RegexPattern *string `json:"regexPattern,omitempty"`
- // Name - The model name.
- Name *string `json:"name,omitempty"`
-}
-
-// SetString ...
-type SetString struct {
- autorest.Response `json:"-"`
- Value map[string]*string `json:"value"`
-}
-
-// MarshalJSON is the custom marshaler for SetString.
-func (ss SetString) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if ss.Value != nil {
- objectMap["value"] = ss.Value
- }
- return json.Marshal(objectMap)
-}
-
-// String ...
-type String struct {
- autorest.Response `json:"-"`
- Value *string `json:"value,omitempty"`
-}
-
-// SubClosedList sublist of items for a Closed list.
-type SubClosedList struct {
- // CanonicalForm - The standard form that the list represents.
- CanonicalForm *string `json:"canonicalForm,omitempty"`
- // List - List of synonym words.
- List *[]string `json:"list,omitempty"`
-}
-
-// SubClosedListResponse sublist of items for a Closed list.
-type SubClosedListResponse struct {
- // ID - The sublist ID
- ID *int32 `json:"id,omitempty"`
- // CanonicalForm - The standard form that the list represents.
- CanonicalForm *string `json:"canonicalForm,omitempty"`
- // List - List of synonym words.
- List *[]string `json:"list,omitempty"`
-}
-
-// TaskUpdateObject object model for cloning an application's version.
-type TaskUpdateObject struct {
- // Version - The new version for the cloned model.
- Version *string `json:"version,omitempty"`
-}
-
-// UserAccessList list of user permissions.
-type UserAccessList struct {
- autorest.Response `json:"-"`
- // Owner - The email address of owner of the application.
- Owner *string `json:"owner,omitempty"`
- Emails *[]string `json:"emails,omitempty"`
-}
-
-// UserCollaborator ...
-type UserCollaborator struct {
- // Email - The email address of the user.
- Email *string `json:"email,omitempty"`
-}
-
-// UUID ...
-type UUID struct {
- autorest.Response `json:"-"`
- Value *uuid.UUID `json:"value,omitempty"`
-}
-
-// VersionInfo object model of an application version.
-type VersionInfo struct {
- autorest.Response `json:"-"`
- // Version - The version ID. E.g.: "0.1"
- Version *string `json:"version,omitempty"`
- // CreatedDateTime - The version's creation timestamp.
- CreatedDateTime *date.Time `json:"createdDateTime,omitempty"`
- // LastModifiedDateTime - Timestamp of the last update.
- LastModifiedDateTime *date.Time `json:"lastModifiedDateTime,omitempty"`
- // LastTrainedDateTime - Timestamp of the last time the model was trained.
- LastTrainedDateTime *date.Time `json:"lastTrainedDateTime,omitempty"`
- // LastPublishedDateTime - Timestamp when was last published.
- LastPublishedDateTime *date.Time `json:"lastPublishedDateTime,omitempty"`
- // EndpointURL - The Runtime endpoint URL for this model version.
- EndpointURL *string `json:"endpointUrl,omitempty"`
- // AssignedEndpointKey - The endpoint key.
- AssignedEndpointKey map[string]*string `json:"assignedEndpointKey"`
- // ExternalAPIKeys - External keys.
- ExternalAPIKeys interface{} `json:"externalApiKeys,omitempty"`
- // IntentsCount - Number of intents in this model.
- IntentsCount *int32 `json:"intentsCount,omitempty"`
- // EntitiesCount - Number of entities in this model.
- EntitiesCount *int32 `json:"entitiesCount,omitempty"`
- // EndpointHitsCount - Number of calls made to this endpoint.
- EndpointHitsCount *int32 `json:"endpointHitsCount,omitempty"`
- // TrainingStatus - The current training status. Possible values include: 'NeedsTraining', 'InProgress', 'Trained'
- TrainingStatus TrainingStatus `json:"trainingStatus,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for VersionInfo.
-func (vi VersionInfo) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if vi.Version != nil {
- objectMap["version"] = vi.Version
- }
- if vi.CreatedDateTime != nil {
- objectMap["createdDateTime"] = vi.CreatedDateTime
- }
- if vi.LastModifiedDateTime != nil {
- objectMap["lastModifiedDateTime"] = vi.LastModifiedDateTime
- }
- if vi.LastTrainedDateTime != nil {
- objectMap["lastTrainedDateTime"] = vi.LastTrainedDateTime
- }
- if vi.LastPublishedDateTime != nil {
- objectMap["lastPublishedDateTime"] = vi.LastPublishedDateTime
- }
- if vi.EndpointURL != nil {
- objectMap["endpointUrl"] = vi.EndpointURL
- }
- if vi.AssignedEndpointKey != nil {
- objectMap["assignedEndpointKey"] = vi.AssignedEndpointKey
- }
- objectMap["externalApiKeys"] = vi.ExternalAPIKeys
- if vi.IntentsCount != nil {
- objectMap["intentsCount"] = vi.IntentsCount
- }
- if vi.EntitiesCount != nil {
- objectMap["entitiesCount"] = vi.EntitiesCount
- }
- if vi.EndpointHitsCount != nil {
- objectMap["endpointHitsCount"] = vi.EndpointHitsCount
- }
- if vi.TrainingStatus != "" {
- objectMap["trainingStatus"] = vi.TrainingStatus
- }
- return json.Marshal(objectMap)
-}
-
-// WordListBaseUpdateObject object model for updating one of the closed list's sublists.
-type WordListBaseUpdateObject struct {
- // CanonicalForm - The standard form that the list represents.
- CanonicalForm *string `json:"canonicalForm,omitempty"`
- // List - List of synonym words.
- List *[]string `json:"list,omitempty"`
-}
-
-// WordListObject sublist of items for a Closed list.
-type WordListObject struct {
- // CanonicalForm - The standard form that the list represents.
- CanonicalForm *string `json:"canonicalForm,omitempty"`
- // List - List of synonym words.
- List *[]string `json:"list,omitempty"`
-}
diff --git a/services/cognitiveservices/v2.0/luis/programmatic/pattern.go b/services/cognitiveservices/v2.0/luis/programmatic/pattern.go
deleted file mode 100644
index fc6e4a7d934c..000000000000
--- a/services/cognitiveservices/v2.0/luis/programmatic/pattern.go
+++ /dev/null
@@ -1,642 +0,0 @@
-package programmatic
-
-// 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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// PatternClient is the client for the Pattern methods of the Programmatic service.
-type PatternClient struct {
- BaseClient
-}
-
-// NewPatternClient creates an instance of the PatternClient client.
-func NewPatternClient(azureRegion AzureRegions) PatternClient {
- return PatternClient{New(azureRegion)}
-}
-
-// AddPattern sends the add pattern request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// pattern - the input pattern.
-func (client PatternClient) AddPattern(ctx context.Context, appID uuid.UUID, versionID string, pattern PatternRuleCreateObject) (result PatternRuleInfo, err error) {
- req, err := client.AddPatternPreparer(ctx, appID, versionID, pattern)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "AddPattern", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddPatternSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "AddPattern", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddPatternResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "AddPattern", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPatternPreparer prepares the AddPattern request.
-func (client PatternClient) AddPatternPreparer(ctx context.Context, appID uuid.UUID, versionID string, pattern PatternRuleCreateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternrule", pathParameters),
- autorest.WithJSON(pattern))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddPatternSender sends the AddPattern request. The method will close the
-// http.Response Body if it receives an error.
-func (client PatternClient) AddPatternSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddPatternResponder handles the response to the AddPattern request. The method always
-// closes the http.Response Body.
-func (client PatternClient) AddPatternResponder(resp *http.Response) (result PatternRuleInfo, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// BatchAddPatterns sends the batch add patterns request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// patterns - a JSON array containing patterns.
-func (client PatternClient) BatchAddPatterns(ctx context.Context, appID uuid.UUID, versionID string, patterns []PatternRuleCreateObject) (result ListPatternRuleInfo, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: patterns,
- Constraints: []validation.Constraint{{Target: "patterns", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("programmatic.PatternClient", "BatchAddPatterns", err.Error())
- }
-
- req, err := client.BatchAddPatternsPreparer(ctx, appID, versionID, patterns)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "BatchAddPatterns", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.BatchAddPatternsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "BatchAddPatterns", resp, "Failure sending request")
- return
- }
-
- result, err = client.BatchAddPatternsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "BatchAddPatterns", resp, "Failure responding to request")
- }
-
- return
-}
-
-// BatchAddPatternsPreparer prepares the BatchAddPatterns request.
-func (client PatternClient) BatchAddPatternsPreparer(ctx context.Context, appID uuid.UUID, versionID string, patterns []PatternRuleCreateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternrules", pathParameters),
- autorest.WithJSON(patterns))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// BatchAddPatternsSender sends the BatchAddPatterns request. The method will close the
-// http.Response Body if it receives an error.
-func (client PatternClient) BatchAddPatternsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// BatchAddPatternsResponder handles the response to the BatchAddPatterns request. The method always
-// closes the http.Response Body.
-func (client PatternClient) BatchAddPatternsResponder(resp *http.Response) (result ListPatternRuleInfo, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// DeletePattern sends the delete pattern request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// patternID - the pattern ID.
-func (client PatternClient) DeletePattern(ctx context.Context, appID uuid.UUID, versionID string, patternID uuid.UUID) (result OperationStatus, err error) {
- req, err := client.DeletePatternPreparer(ctx, appID, versionID, patternID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "DeletePattern", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeletePatternSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "DeletePattern", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeletePatternResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "DeletePattern", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePatternPreparer prepares the DeletePattern request.
-func (client PatternClient) DeletePatternPreparer(ctx context.Context, appID uuid.UUID, versionID string, patternID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "patternId": autorest.Encode("path", patternID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternrules/{patternId}", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeletePatternSender sends the DeletePattern request. The method will close the
-// http.Response Body if it receives an error.
-func (client PatternClient) DeletePatternSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeletePatternResponder handles the response to the DeletePattern request. The method always
-// closes the http.Response Body.
-func (client PatternClient) DeletePatternResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// DeletePatterns sends the delete patterns request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// patternIds - the patterns IDs.
-func (client PatternClient) DeletePatterns(ctx context.Context, appID uuid.UUID, versionID string, patternIds []uuid.UUID) (result OperationStatus, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: patternIds,
- Constraints: []validation.Constraint{{Target: "patternIds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("programmatic.PatternClient", "DeletePatterns", err.Error())
- }
-
- req, err := client.DeletePatternsPreparer(ctx, appID, versionID, patternIds)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "DeletePatterns", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeletePatternsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "DeletePatterns", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeletePatternsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "DeletePatterns", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePatternsPreparer prepares the DeletePatterns request.
-func (client PatternClient) DeletePatternsPreparer(ctx context.Context, appID uuid.UUID, versionID string, patternIds []uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsDelete(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternrules", pathParameters),
- autorest.WithJSON(patternIds))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeletePatternsSender sends the DeletePatterns request. The method will close the
-// http.Response Body if it receives an error.
-func (client PatternClient) DeletePatternsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeletePatternsResponder handles the response to the DeletePatterns request. The method always
-// closes the http.Response Body.
-func (client PatternClient) DeletePatternsResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetIntentPatterns sends the get intent patterns request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// intentID - the intent classifier ID.
-// skip - the number of entries to skip. Default value is 0.
-// take - the number of entries to return. Maximum page size is 500. Default is 100.
-func (client PatternClient) GetIntentPatterns(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, skip *int32, take *int32) (result ListPatternRuleInfo, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: skip,
- Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}},
- {TargetValue: take,
- Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil},
- {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("programmatic.PatternClient", "GetIntentPatterns", err.Error())
- }
-
- req, err := client.GetIntentPatternsPreparer(ctx, appID, versionID, intentID, skip, take)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "GetIntentPatterns", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetIntentPatternsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "GetIntentPatterns", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetIntentPatternsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "GetIntentPatterns", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetIntentPatternsPreparer prepares the GetIntentPatterns request.
-func (client PatternClient) GetIntentPatternsPreparer(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, skip *int32, take *int32) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "intentId": autorest.Encode("path", intentID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- queryParameters := map[string]interface{}{}
- if skip != nil {
- queryParameters["skip"] = autorest.Encode("query", *skip)
- } else {
- queryParameters["skip"] = autorest.Encode("query", 0)
- }
- if take != nil {
- queryParameters["take"] = autorest.Encode("query", *take)
- } else {
- queryParameters["take"] = autorest.Encode("query", 100)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/intents/{intentId}/patternrules", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetIntentPatternsSender sends the GetIntentPatterns request. The method will close the
-// http.Response Body if it receives an error.
-func (client PatternClient) GetIntentPatternsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetIntentPatternsResponder handles the response to the GetIntentPatterns request. The method always
-// closes the http.Response Body.
-func (client PatternClient) GetIntentPatternsResponder(resp *http.Response) (result ListPatternRuleInfo, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetPatterns sends the get patterns request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// skip - the number of entries to skip. Default value is 0.
-// take - the number of entries to return. Maximum page size is 500. Default is 100.
-func (client PatternClient) GetPatterns(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result ListPatternRuleInfo, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: skip,
- Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}},
- {TargetValue: take,
- Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil},
- {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("programmatic.PatternClient", "GetPatterns", err.Error())
- }
-
- req, err := client.GetPatternsPreparer(ctx, appID, versionID, skip, take)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "GetPatterns", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetPatternsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "GetPatterns", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetPatternsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "GetPatterns", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPatternsPreparer prepares the GetPatterns request.
-func (client PatternClient) GetPatternsPreparer(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- queryParameters := map[string]interface{}{}
- if skip != nil {
- queryParameters["skip"] = autorest.Encode("query", *skip)
- } else {
- queryParameters["skip"] = autorest.Encode("query", 0)
- }
- if take != nil {
- queryParameters["take"] = autorest.Encode("query", *take)
- } else {
- queryParameters["take"] = autorest.Encode("query", 100)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternrules", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetPatternsSender sends the GetPatterns request. The method will close the
-// http.Response Body if it receives an error.
-func (client PatternClient) GetPatternsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetPatternsResponder handles the response to the GetPatterns request. The method always
-// closes the http.Response Body.
-func (client PatternClient) GetPatternsResponder(resp *http.Response) (result ListPatternRuleInfo, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// UpdatePattern sends the update pattern request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// patternID - the pattern ID.
-// pattern - an object representing a pattern.
-func (client PatternClient) UpdatePattern(ctx context.Context, appID uuid.UUID, versionID string, patternID uuid.UUID, pattern PatternRuleUpdateObject) (result PatternRuleInfo, err error) {
- req, err := client.UpdatePatternPreparer(ctx, appID, versionID, patternID, pattern)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "UpdatePattern", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdatePatternSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "UpdatePattern", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdatePatternResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "UpdatePattern", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePatternPreparer prepares the UpdatePattern request.
-func (client PatternClient) UpdatePatternPreparer(ctx context.Context, appID uuid.UUID, versionID string, patternID uuid.UUID, pattern PatternRuleUpdateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "patternId": autorest.Encode("path", patternID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternrules/{patternId}", pathParameters),
- autorest.WithJSON(pattern))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdatePatternSender sends the UpdatePattern request. The method will close the
-// http.Response Body if it receives an error.
-func (client PatternClient) UpdatePatternSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdatePatternResponder handles the response to the UpdatePattern request. The method always
-// closes the http.Response Body.
-func (client PatternClient) UpdatePatternResponder(resp *http.Response) (result PatternRuleInfo, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// UpdatePatterns sends the update patterns request.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// patterns - an array represents the patterns.
-func (client PatternClient) UpdatePatterns(ctx context.Context, appID uuid.UUID, versionID string, patterns []PatternRuleUpdateObject) (result ListPatternRuleInfo, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: patterns,
- Constraints: []validation.Constraint{{Target: "patterns", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("programmatic.PatternClient", "UpdatePatterns", err.Error())
- }
-
- req, err := client.UpdatePatternsPreparer(ctx, appID, versionID, patterns)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "UpdatePatterns", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdatePatternsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "UpdatePatterns", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdatePatternsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.PatternClient", "UpdatePatterns", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePatternsPreparer prepares the UpdatePatterns request.
-func (client PatternClient) UpdatePatternsPreparer(ctx context.Context, appID uuid.UUID, versionID string, patterns []PatternRuleUpdateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternrules", pathParameters),
- autorest.WithJSON(patterns))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdatePatternsSender sends the UpdatePatterns request. The method will close the
-// http.Response Body if it receives an error.
-func (client PatternClient) UpdatePatternsSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdatePatternsResponder handles the response to the UpdatePatterns request. The method always
-// closes the http.Response Body.
-func (client PatternClient) UpdatePatternsResponder(resp *http.Response) (result ListPatternRuleInfo, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/services/cognitiveservices/v2.0/luis/programmatic/permissions.go b/services/cognitiveservices/v2.0/luis/programmatic/permissions.go
deleted file mode 100644
index 75c658467f4a..000000000000
--- a/services/cognitiveservices/v2.0/luis/programmatic/permissions.go
+++ /dev/null
@@ -1,296 +0,0 @@
-package programmatic
-
-// 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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// PermissionsClient is the client for the Permissions methods of the Programmatic service.
-type PermissionsClient struct {
- BaseClient
-}
-
-// NewPermissionsClient creates an instance of the PermissionsClient client.
-func NewPermissionsClient(azureRegion AzureRegions) PermissionsClient {
- return PermissionsClient{New(azureRegion)}
-}
-
-// Add adds a user to the allowed list of users to access this LUIS application. Users are added using their email
-// address.
-// Parameters:
-// appID - the application ID.
-// userToAdd - a model containing the user's email address.
-func (client PermissionsClient) Add(ctx context.Context, appID uuid.UUID, userToAdd UserCollaborator) (result OperationStatus, err error) {
- req, err := client.AddPreparer(ctx, appID, userToAdd)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.PermissionsClient", "Add", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.AddSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.PermissionsClient", "Add", resp, "Failure sending request")
- return
- }
-
- result, err = client.AddResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.PermissionsClient", "Add", resp, "Failure responding to request")
- }
-
- return
-}
-
-// AddPreparer prepares the Add request.
-func (client PermissionsClient) AddPreparer(ctx context.Context, appID uuid.UUID, userToAdd UserCollaborator) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/permissions", pathParameters),
- autorest.WithJSON(userToAdd))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// AddSender sends the Add request. The method will close the
-// http.Response Body if it receives an error.
-func (client PermissionsClient) AddSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// AddResponder handles the response to the Add request. The method always
-// closes the http.Response Body.
-func (client PermissionsClient) AddResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Delete removes a user from the allowed list of users to access this LUIS application. Users are removed using their
-// email address.
-// Parameters:
-// appID - the application ID.
-// userToDelete - a model containing the user's email address.
-func (client PermissionsClient) Delete(ctx context.Context, appID uuid.UUID, userToDelete UserCollaborator) (result OperationStatus, err error) {
- req, err := client.DeletePreparer(ctx, appID, userToDelete)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.PermissionsClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.PermissionsClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.PermissionsClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client PermissionsClient) DeletePreparer(ctx context.Context, appID uuid.UUID, userToDelete UserCollaborator) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsDelete(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/permissions", pathParameters),
- autorest.WithJSON(userToDelete))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client PermissionsClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client PermissionsClient) DeleteResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List gets the list of user emails that have permissions to access your application.
-// Parameters:
-// appID - the application ID.
-func (client PermissionsClient) List(ctx context.Context, appID uuid.UUID) (result UserAccessList, err error) {
- req, err := client.ListPreparer(ctx, appID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.PermissionsClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.PermissionsClient", "List", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.PermissionsClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client PermissionsClient) ListPreparer(ctx context.Context, appID uuid.UUID) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/permissions", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client PermissionsClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client PermissionsClient) ListResponder(resp *http.Response) (result UserAccessList, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Update replaces the current users access list with the one sent in the body. If an empty list is sent, all access to
-// other users will be removed.
-// Parameters:
-// appID - the application ID.
-// collaborators - a model containing a list of user's email addresses.
-func (client PermissionsClient) Update(ctx context.Context, appID uuid.UUID, collaborators CollaboratorsArray) (result OperationStatus, err error) {
- req, err := client.UpdatePreparer(ctx, appID, collaborators)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.PermissionsClient", "Update", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.PermissionsClient", "Update", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.PermissionsClient", "Update", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePreparer prepares the Update request.
-func (client PermissionsClient) UpdatePreparer(ctx context.Context, appID uuid.UUID, collaborators CollaboratorsArray) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/permissions", pathParameters),
- autorest.WithJSON(collaborators))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSender sends the Update request. The method will close the
-// http.Response Body if it receives an error.
-func (client PermissionsClient) UpdateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateResponder handles the response to the Update request. The method always
-// closes the http.Response Body.
-func (client PermissionsClient) UpdateResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/services/cognitiveservices/v2.0/luis/programmatic/train.go b/services/cognitiveservices/v2.0/luis/programmatic/train.go
deleted file mode 100644
index 4ae82bd0d9c5..000000000000
--- a/services/cognitiveservices/v2.0/luis/programmatic/train.go
+++ /dev/null
@@ -1,170 +0,0 @@
-package programmatic
-
-// 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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// TrainClient is the client for the Train methods of the Programmatic service.
-type TrainClient struct {
- BaseClient
-}
-
-// NewTrainClient creates an instance of the TrainClient client.
-func NewTrainClient(azureRegion AzureRegions) TrainClient {
- return TrainClient{New(azureRegion)}
-}
-
-// GetStatus gets the training status of all models (intents and entities) for the specified LUIS app. You must call
-// the train API to train the LUIS app before you call this API to get training status. "appID" specifies the LUIS app
-// ID. "versionId" specifies the version number of the LUIS app. For example, "0.1".
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-func (client TrainClient) GetStatus(ctx context.Context, appID uuid.UUID, versionID string) (result ListModelTrainingInfo, err error) {
- req, err := client.GetStatusPreparer(ctx, appID, versionID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.TrainClient", "GetStatus", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetStatusSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.TrainClient", "GetStatus", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetStatusResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.TrainClient", "GetStatus", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetStatusPreparer prepares the GetStatus request.
-func (client TrainClient) GetStatusPreparer(ctx context.Context, appID uuid.UUID, versionID string) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/train", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetStatusSender sends the GetStatus request. The method will close the
-// http.Response Body if it receives an error.
-func (client TrainClient) GetStatusSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetStatusResponder handles the response to the GetStatus request. The method always
-// closes the http.Response Body.
-func (client TrainClient) GetStatusResponder(resp *http.Response) (result ListModelTrainingInfo, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// TrainVersion sends a training request for a version of a specified LUIS app. This POST request initiates a request
-// asynchronously. To determine whether the training request is successful, submit a GET request to get training
-// status. Note: The application version is not fully trained unless all the models (intents and entities) are trained
-// successfully or are up to date. To verify training success, get the training status at least once after training is
-// complete.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-func (client TrainClient) TrainVersion(ctx context.Context, appID uuid.UUID, versionID string) (result EnqueueTrainingResponse, err error) {
- req, err := client.TrainVersionPreparer(ctx, appID, versionID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.TrainClient", "TrainVersion", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.TrainVersionSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.TrainClient", "TrainVersion", resp, "Failure sending request")
- return
- }
-
- result, err = client.TrainVersionResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.TrainClient", "TrainVersion", resp, "Failure responding to request")
- }
-
- return
-}
-
-// TrainVersionPreparer prepares the TrainVersion request.
-func (client TrainClient) TrainVersionPreparer(ctx context.Context, appID uuid.UUID, versionID string) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/train", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// TrainVersionSender sends the TrainVersion request. The method will close the
-// http.Response Body if it receives an error.
-func (client TrainClient) TrainVersionSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// TrainVersionResponder handles the response to the TrainVersion request. The method always
-// closes the http.Response Body.
-func (client TrainClient) TrainVersionResponder(resp *http.Response) (result EnqueueTrainingResponse, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/services/cognitiveservices/v2.0/luis/programmatic/version.go b/services/cognitiveservices/v2.0/luis/programmatic/version.go
deleted file mode 100644
index 5531b718a2f7..000000000000
--- a/services/cognitiveservices/v2.0/luis/programmatic/version.go
+++ /dev/null
@@ -1,30 +0,0 @@
-package programmatic
-
-import "github.com/Azure/azure-sdk-for-go/version"
-
-// 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.
-
-// UserAgent returns the UserAgent string to use when sending http.Requests.
-func UserAgent() string {
- return "Azure-SDK-For-Go/" + version.Number + " programmatic/v2.0 preview"
-}
-
-// Version returns the semantic version (see http://semver.org) of the client.
-func Version() string {
- return version.Number
-}
diff --git a/services/cognitiveservices/v2.0/luis/programmatic/versions.go b/services/cognitiveservices/v2.0/luis/programmatic/versions.go
deleted file mode 100644
index c6c67c093977..000000000000
--- a/services/cognitiveservices/v2.0/luis/programmatic/versions.go
+++ /dev/null
@@ -1,595 +0,0 @@
-package programmatic
-
-// 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 (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/satori/go.uuid"
- "net/http"
-)
-
-// VersionsClient is the client for the Versions methods of the Programmatic service.
-type VersionsClient struct {
- BaseClient
-}
-
-// NewVersionsClient creates an instance of the VersionsClient client.
-func NewVersionsClient(azureRegion AzureRegions) VersionsClient {
- return VersionsClient{New(azureRegion)}
-}
-
-// Clone creates a new version using the current snapshot of the selected application version.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// versionCloneObject - a model containing the new version ID.
-func (client VersionsClient) Clone(ctx context.Context, appID uuid.UUID, versionID string, versionCloneObject *TaskUpdateObject) (result String, err error) {
- req, err := client.ClonePreparer(ctx, appID, versionID, versionCloneObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Clone", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.CloneSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Clone", resp, "Failure sending request")
- return
- }
-
- result, err = client.CloneResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Clone", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ClonePreparer prepares the Clone request.
-func (client VersionsClient) ClonePreparer(ctx context.Context, appID uuid.UUID, versionID string, versionCloneObject *TaskUpdateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/clone", pathParameters))
- if versionCloneObject != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(versionCloneObject))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CloneSender sends the Clone request. The method will close the
-// http.Response Body if it receives an error.
-func (client VersionsClient) CloneSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// CloneResponder handles the response to the Clone request. The method always
-// closes the http.Response Body.
-func (client VersionsClient) CloneResponder(resp *http.Response) (result String, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Delete deletes an application version.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-func (client VersionsClient) Delete(ctx context.Context, appID uuid.UUID, versionID string) (result OperationStatus, err error) {
- req, err := client.DeletePreparer(ctx, appID, versionID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Delete", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client VersionsClient) DeletePreparer(ctx context.Context, appID uuid.UUID, versionID string) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client VersionsClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client VersionsClient) DeleteResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// DeleteUnlabelledUtterance deleted an unlabelled utterance.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// utterance - the utterance text to delete.
-func (client VersionsClient) DeleteUnlabelledUtterance(ctx context.Context, appID uuid.UUID, versionID string, utterance string) (result OperationStatus, err error) {
- req, err := client.DeleteUnlabelledUtterancePreparer(ctx, appID, versionID, utterance)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "DeleteUnlabelledUtterance", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteUnlabelledUtteranceSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "DeleteUnlabelledUtterance", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteUnlabelledUtteranceResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "DeleteUnlabelledUtterance", resp, "Failure responding to request")
- }
-
- return
-}
-
-// DeleteUnlabelledUtterancePreparer prepares the DeleteUnlabelledUtterance request.
-func (client VersionsClient) DeleteUnlabelledUtterancePreparer(ctx context.Context, appID uuid.UUID, versionID string, utterance string) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsDelete(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/suggest", pathParameters),
- autorest.WithJSON(utterance))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteUnlabelledUtteranceSender sends the DeleteUnlabelledUtterance request. The method will close the
-// http.Response Body if it receives an error.
-func (client VersionsClient) DeleteUnlabelledUtteranceSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// DeleteUnlabelledUtteranceResponder handles the response to the DeleteUnlabelledUtterance request. The method always
-// closes the http.Response Body.
-func (client VersionsClient) DeleteUnlabelledUtteranceResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Export exports a LUIS application to JSON format.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-func (client VersionsClient) Export(ctx context.Context, appID uuid.UUID, versionID string) (result LuisApp, err error) {
- req, err := client.ExportPreparer(ctx, appID, versionID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Export", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ExportSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Export", resp, "Failure sending request")
- return
- }
-
- result, err = client.ExportResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Export", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ExportPreparer prepares the Export request.
-func (client VersionsClient) ExportPreparer(ctx context.Context, appID uuid.UUID, versionID string) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/export", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ExportSender sends the Export request. The method will close the
-// http.Response Body if it receives an error.
-func (client VersionsClient) ExportSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ExportResponder handles the response to the Export request. The method always
-// closes the http.Response Body.
-func (client VersionsClient) ExportResponder(resp *http.Response) (result LuisApp, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Get gets the version info.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-func (client VersionsClient) Get(ctx context.Context, appID uuid.UUID, versionID string) (result VersionInfo, err error) {
- req, err := client.GetPreparer(ctx, appID, versionID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Get", resp, "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client VersionsClient) GetPreparer(ctx context.Context, appID uuid.UUID, versionID string) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/", pathParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client VersionsClient) GetSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client VersionsClient) GetResponder(resp *http.Response) (result VersionInfo, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Import imports a new version into a LUIS application.
-// Parameters:
-// appID - the application ID.
-// luisApp - a LUIS application structure.
-// versionID - the new versionId to import. If not specified, the versionId will be read from the imported
-// object.
-func (client VersionsClient) Import(ctx context.Context, appID uuid.UUID, luisApp LuisApp, versionID string) (result String, err error) {
- req, err := client.ImportPreparer(ctx, appID, luisApp, versionID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Import", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ImportSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Import", resp, "Failure sending request")
- return
- }
-
- result, err = client.ImportResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Import", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ImportPreparer prepares the Import request.
-func (client VersionsClient) ImportPreparer(ctx context.Context, appID uuid.UUID, luisApp LuisApp, versionID string) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- }
-
- queryParameters := map[string]interface{}{}
- if len(versionID) > 0 {
- queryParameters["versionId"] = autorest.Encode("query", versionID)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/import", pathParameters),
- autorest.WithJSON(luisApp),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ImportSender sends the Import request. The method will close the
-// http.Response Body if it receives an error.
-func (client VersionsClient) ImportSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ImportResponder handles the response to the Import request. The method always
-// closes the http.Response Body.
-func (client VersionsClient) ImportResponder(resp *http.Response) (result String, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List gets the application versions info.
-// Parameters:
-// appID - the application ID.
-// skip - the number of entries to skip. Default value is 0.
-// take - the number of entries to return. Maximum page size is 500. Default is 100.
-func (client VersionsClient) List(ctx context.Context, appID uuid.UUID, skip *int32, take *int32) (result ListVersionInfo, err error) {
- if err := validation.Validate([]validation.Validation{
- {TargetValue: skip,
- Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}},
- {TargetValue: take,
- Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: 500, Chain: nil},
- {Target: "take", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil},
- }}}}}); err != nil {
- return result, validation.NewError("programmatic.VersionsClient", "List", err.Error())
- }
-
- req, err := client.ListPreparer(ctx, appID, skip, take)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "List", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "List", resp, "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client VersionsClient) ListPreparer(ctx context.Context, appID uuid.UUID, skip *int32, take *int32) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- }
-
- queryParameters := map[string]interface{}{}
- if skip != nil {
- queryParameters["skip"] = autorest.Encode("query", *skip)
- } else {
- queryParameters["skip"] = autorest.Encode("query", 0)
- }
- if take != nil {
- queryParameters["take"] = autorest.Encode("query", *take)
- } else {
- queryParameters["take"] = autorest.Encode("query", 100)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client VersionsClient) ListSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client VersionsClient) ListResponder(resp *http.Response) (result ListVersionInfo, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Update updates the name or description of the application version.
-// Parameters:
-// appID - the application ID.
-// versionID - the version ID.
-// versionUpdateObject - a model containing Name and Description of the application.
-func (client VersionsClient) Update(ctx context.Context, appID uuid.UUID, versionID string, versionUpdateObject TaskUpdateObject) (result OperationStatus, err error) {
- req, err := client.UpdatePreparer(ctx, appID, versionID, versionUpdateObject)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Update", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Update", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "programmatic.VersionsClient", "Update", resp, "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePreparer prepares the Update request.
-func (client VersionsClient) UpdatePreparer(ctx context.Context, appID uuid.UUID, versionID string, versionUpdateObject TaskUpdateObject) (*http.Request, error) {
- urlParameters := map[string]interface{}{
- "AzureRegion": client.AzureRegion,
- }
-
- pathParameters := map[string]interface{}{
- "appId": autorest.Encode("path", appID),
- "versionId": autorest.Encode("path", versionID),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0", urlParameters),
- autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/", pathParameters),
- autorest.WithJSON(versionUpdateObject))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSender sends the Update request. The method will close the
-// http.Response Body if it receives an error.
-func (client VersionsClient) UpdateSender(req *http.Request) (*http.Response, error) {
- return autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// UpdateResponder handles the response to the Update request. The method always
-// closes the http.Response Body.
-func (client VersionsClient) UpdateResponder(resp *http.Response) (result OperationStatus, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/services/compute/mgmt/2016-03-30/compute/availabilitysets.go b/services/compute/mgmt/2016-03-30/compute/availabilitysets.go
index 39084c30026d..031e9a021fef 100644
--- a/services/compute/mgmt/2016-03-30/compute/availabilitysets.go
+++ b/services/compute/mgmt/2016-03-30/compute/availabilitysets.go
@@ -466,7 +466,9 @@ func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Resp
}
// ListBySubscription lists all availability sets in a subscription.
-func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (result AvailabilitySetListResultPage, err error) {
+// Parameters:
+// expand - the expand expression to apply to the operation.
+func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context, expand string) (result AvailabilitySetListResultPage, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription")
defer func() {
@@ -478,7 +480,7 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (re
}()
}
result.fn = client.listBySubscriptionNextResults
- req, err := client.ListBySubscriptionPreparer(ctx)
+ req, err := client.ListBySubscriptionPreparer(ctx, expand)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", nil, "Failure preparing request")
return
@@ -500,7 +502,7 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (re
}
// ListBySubscriptionPreparer prepares the ListBySubscription request.
-func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) {
+func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
@@ -509,6 +511,9 @@ func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Cont
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
+ if len(expand) > 0 {
+ queryParameters["$expand"] = autorest.Encode("query", expand)
+ }
preparer := autorest.CreatePreparer(
autorest.AsGet(),
@@ -560,7 +565,7 @@ func (client AvailabilitySetsClient) listBySubscriptionNextResults(ctx context.C
}
// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required.
-func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context) (result AvailabilitySetListResultIterator, err error) {
+func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context, expand string) (result AvailabilitySetListResultIterator, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription")
defer func() {
@@ -571,6 +576,6 @@ func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Cont
tracing.EndSpan(ctx, sc, err)
}()
}
- result.page, err = client.ListBySubscription(ctx)
+ result.page, err = client.ListBySubscription(ctx, expand)
return
}
diff --git a/services/compute/mgmt/2016-03-30/compute/computeapi/interfaces.go b/services/compute/mgmt/2016-03-30/compute/computeapi/interfaces.go
index e7c54a8d1607..f5203bf82a83 100644
--- a/services/compute/mgmt/2016-03-30/compute/computeapi/interfaces.go
+++ b/services/compute/mgmt/2016-03-30/compute/computeapi/interfaces.go
@@ -29,7 +29,7 @@ type AvailabilitySetsClientAPI interface {
Get(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.AvailabilitySet, err error)
List(ctx context.Context, resourceGroupName string) (result compute.AvailabilitySetListResultPage, err error)
ListAvailableSizes(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.VirtualMachineSizeListResult, err error)
- ListBySubscription(ctx context.Context) (result compute.AvailabilitySetListResultPage, err error)
+ ListBySubscription(ctx context.Context, expand string) (result compute.AvailabilitySetListResultPage, err error)
}
var _ AvailabilitySetsClientAPI = (*compute.AvailabilitySetsClient)(nil)
diff --git a/services/compute/mgmt/2017-03-30/compute/availabilitysets.go b/services/compute/mgmt/2017-03-30/compute/availabilitysets.go
index 573ffd10687b..f5a559caa404 100644
--- a/services/compute/mgmt/2017-03-30/compute/availabilitysets.go
+++ b/services/compute/mgmt/2017-03-30/compute/availabilitysets.go
@@ -466,7 +466,9 @@ func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Resp
}
// ListBySubscription lists all availability sets in a subscription.
-func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (result AvailabilitySetListResultPage, err error) {
+// Parameters:
+// expand - the expand expression to apply to the operation.
+func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context, expand string) (result AvailabilitySetListResultPage, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription")
defer func() {
@@ -478,7 +480,7 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (re
}()
}
result.fn = client.listBySubscriptionNextResults
- req, err := client.ListBySubscriptionPreparer(ctx)
+ req, err := client.ListBySubscriptionPreparer(ctx, expand)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", nil, "Failure preparing request")
return
@@ -500,7 +502,7 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (re
}
// ListBySubscriptionPreparer prepares the ListBySubscription request.
-func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) {
+func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
@@ -509,6 +511,9 @@ func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Cont
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
+ if len(expand) > 0 {
+ queryParameters["$expand"] = autorest.Encode("query", expand)
+ }
preparer := autorest.CreatePreparer(
autorest.AsGet(),
@@ -560,7 +565,7 @@ func (client AvailabilitySetsClient) listBySubscriptionNextResults(ctx context.C
}
// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required.
-func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context) (result AvailabilitySetListResultIterator, err error) {
+func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context, expand string) (result AvailabilitySetListResultIterator, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription")
defer func() {
@@ -571,6 +576,6 @@ func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Cont
tracing.EndSpan(ctx, sc, err)
}()
}
- result.page, err = client.ListBySubscription(ctx)
+ result.page, err = client.ListBySubscription(ctx, expand)
return
}
diff --git a/services/compute/mgmt/2017-03-30/compute/computeapi/interfaces.go b/services/compute/mgmt/2017-03-30/compute/computeapi/interfaces.go
index 74509248f485..ffd16dcf7368 100644
--- a/services/compute/mgmt/2017-03-30/compute/computeapi/interfaces.go
+++ b/services/compute/mgmt/2017-03-30/compute/computeapi/interfaces.go
@@ -29,7 +29,7 @@ type AvailabilitySetsClientAPI interface {
Get(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.AvailabilitySet, err error)
List(ctx context.Context, resourceGroupName string) (result compute.AvailabilitySetListResultPage, err error)
ListAvailableSizes(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.VirtualMachineSizeListResult, err error)
- ListBySubscription(ctx context.Context) (result compute.AvailabilitySetListResultPage, err error)
+ ListBySubscription(ctx context.Context, expand string) (result compute.AvailabilitySetListResultPage, err error)
}
var _ AvailabilitySetsClientAPI = (*compute.AvailabilitySetsClient)(nil)
diff --git a/services/compute/mgmt/2017-12-01/compute/availabilitysets.go b/services/compute/mgmt/2017-12-01/compute/availabilitysets.go
index d46ad7a984a6..e849b7225857 100644
--- a/services/compute/mgmt/2017-12-01/compute/availabilitysets.go
+++ b/services/compute/mgmt/2017-12-01/compute/availabilitysets.go
@@ -466,7 +466,9 @@ func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Resp
}
// ListBySubscription lists all availability sets in a subscription.
-func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (result AvailabilitySetListResultPage, err error) {
+// Parameters:
+// expand - the expand expression to apply to the operation.
+func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context, expand string) (result AvailabilitySetListResultPage, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription")
defer func() {
@@ -478,7 +480,7 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (re
}()
}
result.fn = client.listBySubscriptionNextResults
- req, err := client.ListBySubscriptionPreparer(ctx)
+ req, err := client.ListBySubscriptionPreparer(ctx, expand)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", nil, "Failure preparing request")
return
@@ -500,7 +502,7 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (re
}
// ListBySubscriptionPreparer prepares the ListBySubscription request.
-func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) {
+func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
@@ -509,6 +511,9 @@ func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Cont
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
+ if len(expand) > 0 {
+ queryParameters["$expand"] = autorest.Encode("query", expand)
+ }
preparer := autorest.CreatePreparer(
autorest.AsGet(),
@@ -560,7 +565,7 @@ func (client AvailabilitySetsClient) listBySubscriptionNextResults(ctx context.C
}
// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required.
-func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context) (result AvailabilitySetListResultIterator, err error) {
+func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context, expand string) (result AvailabilitySetListResultIterator, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription")
defer func() {
@@ -571,7 +576,7 @@ func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Cont
tracing.EndSpan(ctx, sc, err)
}()
}
- result.page, err = client.ListBySubscription(ctx)
+ result.page, err = client.ListBySubscription(ctx, expand)
return
}
diff --git a/services/compute/mgmt/2017-12-01/compute/computeapi/interfaces.go b/services/compute/mgmt/2017-12-01/compute/computeapi/interfaces.go
index 1c71e948ee6a..7f26ac6fec7d 100644
--- a/services/compute/mgmt/2017-12-01/compute/computeapi/interfaces.go
+++ b/services/compute/mgmt/2017-12-01/compute/computeapi/interfaces.go
@@ -36,7 +36,7 @@ type AvailabilitySetsClientAPI interface {
Get(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.AvailabilitySet, err error)
List(ctx context.Context, resourceGroupName string) (result compute.AvailabilitySetListResultPage, err error)
ListAvailableSizes(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.VirtualMachineSizeListResult, err error)
- ListBySubscription(ctx context.Context) (result compute.AvailabilitySetListResultPage, err error)
+ ListBySubscription(ctx context.Context, expand string) (result compute.AvailabilitySetListResultPage, err error)
Update(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters compute.AvailabilitySetUpdate) (result compute.AvailabilitySet, err error)
}
diff --git a/services/compute/mgmt/2018-04-01/compute/availabilitysets.go b/services/compute/mgmt/2018-04-01/compute/availabilitysets.go
index 59e0e4e9e637..a5c179497f06 100644
--- a/services/compute/mgmt/2018-04-01/compute/availabilitysets.go
+++ b/services/compute/mgmt/2018-04-01/compute/availabilitysets.go
@@ -465,7 +465,9 @@ func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Resp
}
// ListBySubscription lists all availability sets in a subscription.
-func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (result AvailabilitySetListResultPage, err error) {
+// Parameters:
+// expand - the expand expression to apply to the operation.
+func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context, expand string) (result AvailabilitySetListResultPage, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription")
defer func() {
@@ -477,7 +479,7 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (re
}()
}
result.fn = client.listBySubscriptionNextResults
- req, err := client.ListBySubscriptionPreparer(ctx)
+ req, err := client.ListBySubscriptionPreparer(ctx, expand)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", nil, "Failure preparing request")
return
@@ -499,7 +501,7 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (re
}
// ListBySubscriptionPreparer prepares the ListBySubscription request.
-func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) {
+func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
@@ -508,6 +510,9 @@ func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Cont
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
+ if len(expand) > 0 {
+ queryParameters["$expand"] = autorest.Encode("query", expand)
+ }
preparer := autorest.CreatePreparer(
autorest.AsGet(),
@@ -559,7 +564,7 @@ func (client AvailabilitySetsClient) listBySubscriptionNextResults(ctx context.C
}
// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required.
-func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context) (result AvailabilitySetListResultIterator, err error) {
+func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context, expand string) (result AvailabilitySetListResultIterator, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription")
defer func() {
@@ -570,7 +575,7 @@ func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Cont
tracing.EndSpan(ctx, sc, err)
}()
}
- result.page, err = client.ListBySubscription(ctx)
+ result.page, err = client.ListBySubscription(ctx, expand)
return
}
diff --git a/services/compute/mgmt/2018-04-01/compute/computeapi/interfaces.go b/services/compute/mgmt/2018-04-01/compute/computeapi/interfaces.go
index cd7eec093716..22f6cd41b575 100644
--- a/services/compute/mgmt/2018-04-01/compute/computeapi/interfaces.go
+++ b/services/compute/mgmt/2018-04-01/compute/computeapi/interfaces.go
@@ -37,7 +37,7 @@ type AvailabilitySetsClientAPI interface {
Get(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.AvailabilitySet, err error)
List(ctx context.Context, resourceGroupName string) (result compute.AvailabilitySetListResultPage, err error)
ListAvailableSizes(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.VirtualMachineSizeListResult, err error)
- ListBySubscription(ctx context.Context) (result compute.AvailabilitySetListResultPage, err error)
+ ListBySubscription(ctx context.Context, expand string) (result compute.AvailabilitySetListResultPage, err error)
Update(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters compute.AvailabilitySetUpdate) (result compute.AvailabilitySet, err error)
}
diff --git a/services/compute/mgmt/2018-06-01/compute/availabilitysets.go b/services/compute/mgmt/2018-06-01/compute/availabilitysets.go
index c9acfdd39b65..e5ba6c3c6832 100644
--- a/services/compute/mgmt/2018-06-01/compute/availabilitysets.go
+++ b/services/compute/mgmt/2018-06-01/compute/availabilitysets.go
@@ -465,7 +465,9 @@ func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Resp
}
// ListBySubscription lists all availability sets in a subscription.
-func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (result AvailabilitySetListResultPage, err error) {
+// Parameters:
+// expand - the expand expression to apply to the operation.
+func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context, expand string) (result AvailabilitySetListResultPage, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription")
defer func() {
@@ -477,7 +479,7 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (re
}()
}
result.fn = client.listBySubscriptionNextResults
- req, err := client.ListBySubscriptionPreparer(ctx)
+ req, err := client.ListBySubscriptionPreparer(ctx, expand)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", nil, "Failure preparing request")
return
@@ -499,7 +501,7 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (re
}
// ListBySubscriptionPreparer prepares the ListBySubscription request.
-func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) {
+func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
@@ -508,6 +510,9 @@ func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Cont
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
+ if len(expand) > 0 {
+ queryParameters["$expand"] = autorest.Encode("query", expand)
+ }
preparer := autorest.CreatePreparer(
autorest.AsGet(),
@@ -559,7 +564,7 @@ func (client AvailabilitySetsClient) listBySubscriptionNextResults(ctx context.C
}
// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required.
-func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context) (result AvailabilitySetListResultIterator, err error) {
+func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context, expand string) (result AvailabilitySetListResultIterator, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription")
defer func() {
@@ -570,7 +575,7 @@ func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Cont
tracing.EndSpan(ctx, sc, err)
}()
}
- result.page, err = client.ListBySubscription(ctx)
+ result.page, err = client.ListBySubscription(ctx, expand)
return
}
diff --git a/services/compute/mgmt/2018-06-01/compute/computeapi/interfaces.go b/services/compute/mgmt/2018-06-01/compute/computeapi/interfaces.go
index 2e9ac9575fd3..2e815c1740a8 100644
--- a/services/compute/mgmt/2018-06-01/compute/computeapi/interfaces.go
+++ b/services/compute/mgmt/2018-06-01/compute/computeapi/interfaces.go
@@ -37,7 +37,7 @@ type AvailabilitySetsClientAPI interface {
Get(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.AvailabilitySet, err error)
List(ctx context.Context, resourceGroupName string) (result compute.AvailabilitySetListResultPage, err error)
ListAvailableSizes(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.VirtualMachineSizeListResult, err error)
- ListBySubscription(ctx context.Context) (result compute.AvailabilitySetListResultPage, err error)
+ ListBySubscription(ctx context.Context, expand string) (result compute.AvailabilitySetListResultPage, err error)
Update(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters compute.AvailabilitySetUpdate) (result compute.AvailabilitySet, err error)
}
diff --git a/services/compute/mgmt/2018-10-01/compute/availabilitysets.go b/services/compute/mgmt/2018-10-01/compute/availabilitysets.go
index 008185e15961..d8e9208e34d2 100644
--- a/services/compute/mgmt/2018-10-01/compute/availabilitysets.go
+++ b/services/compute/mgmt/2018-10-01/compute/availabilitysets.go
@@ -465,7 +465,9 @@ func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Resp
}
// ListBySubscription lists all availability sets in a subscription.
-func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (result AvailabilitySetListResultPage, err error) {
+// Parameters:
+// expand - the expand expression to apply to the operation.
+func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context, expand string) (result AvailabilitySetListResultPage, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription")
defer func() {
@@ -477,7 +479,7 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (re
}()
}
result.fn = client.listBySubscriptionNextResults
- req, err := client.ListBySubscriptionPreparer(ctx)
+ req, err := client.ListBySubscriptionPreparer(ctx, expand)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", nil, "Failure preparing request")
return
@@ -499,7 +501,7 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (re
}
// ListBySubscriptionPreparer prepares the ListBySubscription request.
-func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) {
+func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
@@ -508,6 +510,9 @@ func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Cont
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
+ if len(expand) > 0 {
+ queryParameters["$expand"] = autorest.Encode("query", expand)
+ }
preparer := autorest.CreatePreparer(
autorest.AsGet(),
@@ -559,7 +564,7 @@ func (client AvailabilitySetsClient) listBySubscriptionNextResults(ctx context.C
}
// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required.
-func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context) (result AvailabilitySetListResultIterator, err error) {
+func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context, expand string) (result AvailabilitySetListResultIterator, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription")
defer func() {
@@ -570,7 +575,7 @@ func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Cont
tracing.EndSpan(ctx, sc, err)
}()
}
- result.page, err = client.ListBySubscription(ctx)
+ result.page, err = client.ListBySubscription(ctx, expand)
return
}
diff --git a/services/compute/mgmt/2018-10-01/compute/computeapi/interfaces.go b/services/compute/mgmt/2018-10-01/compute/computeapi/interfaces.go
index 3ddbabda869a..790c917d8016 100644
--- a/services/compute/mgmt/2018-10-01/compute/computeapi/interfaces.go
+++ b/services/compute/mgmt/2018-10-01/compute/computeapi/interfaces.go
@@ -37,7 +37,7 @@ type AvailabilitySetsClientAPI interface {
Get(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.AvailabilitySet, err error)
List(ctx context.Context, resourceGroupName string) (result compute.AvailabilitySetListResultPage, err error)
ListAvailableSizes(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.VirtualMachineSizeListResult, err error)
- ListBySubscription(ctx context.Context) (result compute.AvailabilitySetListResultPage, err error)
+ ListBySubscription(ctx context.Context, expand string) (result compute.AvailabilitySetListResultPage, err error)
Update(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters compute.AvailabilitySetUpdate) (result compute.AvailabilitySet, err error)
}
diff --git a/services/compute/mgmt/2019-03-01/compute/availabilitysets.go b/services/compute/mgmt/2019-03-01/compute/availabilitysets.go
index 8a6bbaa4a195..853abfc1c95c 100644
--- a/services/compute/mgmt/2019-03-01/compute/availabilitysets.go
+++ b/services/compute/mgmt/2019-03-01/compute/availabilitysets.go
@@ -465,7 +465,9 @@ func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Resp
}
// ListBySubscription lists all availability sets in a subscription.
-func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (result AvailabilitySetListResultPage, err error) {
+// Parameters:
+// expand - the expand expression to apply to the operation.
+func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context, expand string) (result AvailabilitySetListResultPage, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription")
defer func() {
@@ -477,7 +479,7 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (re
}()
}
result.fn = client.listBySubscriptionNextResults
- req, err := client.ListBySubscriptionPreparer(ctx)
+ req, err := client.ListBySubscriptionPreparer(ctx, expand)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", nil, "Failure preparing request")
return
@@ -499,7 +501,7 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (re
}
// ListBySubscriptionPreparer prepares the ListBySubscription request.
-func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) {
+func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
@@ -508,6 +510,9 @@ func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Cont
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
+ if len(expand) > 0 {
+ queryParameters["$expand"] = autorest.Encode("query", expand)
+ }
preparer := autorest.CreatePreparer(
autorest.AsGet(),
@@ -559,7 +564,7 @@ func (client AvailabilitySetsClient) listBySubscriptionNextResults(ctx context.C
}
// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required.
-func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context) (result AvailabilitySetListResultIterator, err error) {
+func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context, expand string) (result AvailabilitySetListResultIterator, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription")
defer func() {
@@ -570,7 +575,7 @@ func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Cont
tracing.EndSpan(ctx, sc, err)
}()
}
- result.page, err = client.ListBySubscription(ctx)
+ result.page, err = client.ListBySubscription(ctx, expand)
return
}
diff --git a/services/compute/mgmt/2019-03-01/compute/computeapi/interfaces.go b/services/compute/mgmt/2019-03-01/compute/computeapi/interfaces.go
index 9dd226f0493a..b9cb016a868d 100644
--- a/services/compute/mgmt/2019-03-01/compute/computeapi/interfaces.go
+++ b/services/compute/mgmt/2019-03-01/compute/computeapi/interfaces.go
@@ -37,7 +37,7 @@ type AvailabilitySetsClientAPI interface {
Get(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.AvailabilitySet, err error)
List(ctx context.Context, resourceGroupName string) (result compute.AvailabilitySetListResultPage, err error)
ListAvailableSizes(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.VirtualMachineSizeListResult, err error)
- ListBySubscription(ctx context.Context) (result compute.AvailabilitySetListResultPage, err error)
+ ListBySubscription(ctx context.Context, expand string) (result compute.AvailabilitySetListResultPage, err error)
Update(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters compute.AvailabilitySetUpdate) (result compute.AvailabilitySet, err error)
}
diff --git a/services/compute/mgmt/2019-03-01/compute/models.go b/services/compute/mgmt/2019-03-01/compute/models.go
index e5166f2e83e8..debff09eee2e 100644
--- a/services/compute/mgmt/2019-03-01/compute/models.go
+++ b/services/compute/mgmt/2019-03-01/compute/models.go
@@ -948,6 +948,23 @@ func PossibleVirtualMachinePriorityTypesValues() []VirtualMachinePriorityTypes {
return []VirtualMachinePriorityTypes{Low, Regular}
}
+// VirtualMachineScaleSetScaleInRules enumerates the values for virtual machine scale set scale in rules.
+type VirtualMachineScaleSetScaleInRules string
+
+const (
+ // Default ...
+ Default VirtualMachineScaleSetScaleInRules = "Default"
+ // NewestVM ...
+ NewestVM VirtualMachineScaleSetScaleInRules = "NewestVM"
+ // OldestVM ...
+ OldestVM VirtualMachineScaleSetScaleInRules = "OldestVM"
+)
+
+// PossibleVirtualMachineScaleSetScaleInRulesValues returns an array of possible values for the VirtualMachineScaleSetScaleInRules const type.
+func PossibleVirtualMachineScaleSetScaleInRulesValues() []VirtualMachineScaleSetScaleInRules {
+ return []VirtualMachineScaleSetScaleInRules{Default, NewestVM, OldestVM}
+}
+
// VirtualMachineScaleSetSkuScaleType enumerates the values for virtual machine scale set sku scale type.
type VirtualMachineScaleSetSkuScaleType string
@@ -7291,6 +7308,12 @@ type RunCommandResult struct {
Value *[]InstanceViewStatus `json:"value,omitempty"`
}
+// ScaleInPolicy describes a scale-in policy for a virtual machine scale set.
+type ScaleInPolicy struct {
+ // Rules - The rules to be followed when scaling-in a virtual machine scale set.
Possible values are:
**Default** When a virtual machine scale set is scaled in, the scale set will first be balanced across zones if it is a zonal scale set. Then, it will be balanced across Fault Domains as far as possible. Within each Fault Domain, the virtual machines chosen for removal will be the newest ones that are not protected from scale-in.
**OldestVM** When a virtual machine scale set is being scaled-in, the oldest virtual machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across zones. Within each zone, the oldest virtual machines that are not protected will be chosen for removal.
**NewestVM** When a virtual machine scale set is being scaled-in, the newest virtual machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across zones. Within each zone, the newest virtual machines that are not protected will be chosen for removal.
+ Rules *[]VirtualMachineScaleSetScaleInRules `json:"rules,omitempty"`
+}
+
// ScheduledEventsProfile ...
type ScheduledEventsProfile struct {
// TerminateNotificationProfile - Specifies Terminate Scheduled Event related configurations.
@@ -10382,6 +10405,8 @@ type VirtualMachineScaleSetProperties struct {
ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"`
// AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to support attaching managed data disks with UltraSSD_LRS storage account type.
AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"`
+ // ScaleInPolicy - Specifies the scale-in policy that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled-in.
+ ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"`
}
// VirtualMachineScaleSetPublicIPAddressConfiguration describes a virtual machines scale set IP
@@ -11191,6 +11216,8 @@ type VirtualMachineScaleSetUpdateProperties struct {
SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"`
// AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to support attaching managed data disks with UltraSSD_LRS storage account type.
AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"`
+ // ScaleInPolicy - Specifies the scale-in policy that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled-in.
+ ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"`
}
// VirtualMachineScaleSetUpdatePublicIPAddressConfiguration describes a virtual machines scale set IP
diff --git a/services/compute/mgmt/2019-07-01/compute/availabilitysets.go b/services/compute/mgmt/2019-07-01/compute/availabilitysets.go
index 8a6bbaa4a195..853abfc1c95c 100644
--- a/services/compute/mgmt/2019-07-01/compute/availabilitysets.go
+++ b/services/compute/mgmt/2019-07-01/compute/availabilitysets.go
@@ -465,7 +465,9 @@ func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Resp
}
// ListBySubscription lists all availability sets in a subscription.
-func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (result AvailabilitySetListResultPage, err error) {
+// Parameters:
+// expand - the expand expression to apply to the operation.
+func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context, expand string) (result AvailabilitySetListResultPage, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription")
defer func() {
@@ -477,7 +479,7 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (re
}()
}
result.fn = client.listBySubscriptionNextResults
- req, err := client.ListBySubscriptionPreparer(ctx)
+ req, err := client.ListBySubscriptionPreparer(ctx, expand)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", nil, "Failure preparing request")
return
@@ -499,7 +501,7 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (re
}
// ListBySubscriptionPreparer prepares the ListBySubscription request.
-func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) {
+func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
@@ -508,6 +510,9 @@ func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Cont
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
+ if len(expand) > 0 {
+ queryParameters["$expand"] = autorest.Encode("query", expand)
+ }
preparer := autorest.CreatePreparer(
autorest.AsGet(),
@@ -559,7 +564,7 @@ func (client AvailabilitySetsClient) listBySubscriptionNextResults(ctx context.C
}
// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required.
-func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context) (result AvailabilitySetListResultIterator, err error) {
+func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context, expand string) (result AvailabilitySetListResultIterator, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription")
defer func() {
@@ -570,7 +575,7 @@ func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Cont
tracing.EndSpan(ctx, sc, err)
}()
}
- result.page, err = client.ListBySubscription(ctx)
+ result.page, err = client.ListBySubscription(ctx, expand)
return
}
diff --git a/services/compute/mgmt/2019-07-01/compute/computeapi/interfaces.go b/services/compute/mgmt/2019-07-01/compute/computeapi/interfaces.go
index f4658b1dfc43..1a3fc7f1d25a 100644
--- a/services/compute/mgmt/2019-07-01/compute/computeapi/interfaces.go
+++ b/services/compute/mgmt/2019-07-01/compute/computeapi/interfaces.go
@@ -37,7 +37,7 @@ type AvailabilitySetsClientAPI interface {
Get(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.AvailabilitySet, err error)
List(ctx context.Context, resourceGroupName string) (result compute.AvailabilitySetListResultPage, err error)
ListAvailableSizes(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.VirtualMachineSizeListResult, err error)
- ListBySubscription(ctx context.Context) (result compute.AvailabilitySetListResultPage, err error)
+ ListBySubscription(ctx context.Context, expand string) (result compute.AvailabilitySetListResultPage, err error)
Update(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters compute.AvailabilitySetUpdate) (result compute.AvailabilitySet, err error)
}
diff --git a/services/compute/mgmt/2019-07-01/compute/models.go b/services/compute/mgmt/2019-07-01/compute/models.go
index 4ec2778a534e..7851df4347d1 100644
--- a/services/compute/mgmt/2019-07-01/compute/models.go
+++ b/services/compute/mgmt/2019-07-01/compute/models.go
@@ -948,6 +948,23 @@ func PossibleVirtualMachinePriorityTypesValues() []VirtualMachinePriorityTypes {
return []VirtualMachinePriorityTypes{Low, Regular}
}
+// VirtualMachineScaleSetScaleInRules enumerates the values for virtual machine scale set scale in rules.
+type VirtualMachineScaleSetScaleInRules string
+
+const (
+ // Default ...
+ Default VirtualMachineScaleSetScaleInRules = "Default"
+ // NewestVM ...
+ NewestVM VirtualMachineScaleSetScaleInRules = "NewestVM"
+ // OldestVM ...
+ OldestVM VirtualMachineScaleSetScaleInRules = "OldestVM"
+)
+
+// PossibleVirtualMachineScaleSetScaleInRulesValues returns an array of possible values for the VirtualMachineScaleSetScaleInRules const type.
+func PossibleVirtualMachineScaleSetScaleInRulesValues() []VirtualMachineScaleSetScaleInRules {
+ return []VirtualMachineScaleSetScaleInRules{Default, NewestVM, OldestVM}
+}
+
// VirtualMachineScaleSetSkuScaleType enumerates the values for virtual machine scale set sku scale type.
type VirtualMachineScaleSetSkuScaleType string
@@ -7300,6 +7317,12 @@ type RunCommandResult struct {
Value *[]InstanceViewStatus `json:"value,omitempty"`
}
+// ScaleInPolicy describes a scale-in policy for a virtual machine scale set.
+type ScaleInPolicy struct {
+ // Rules - The rules to be followed when scaling-in a virtual machine scale set.
Possible values are:
**Default** When a virtual machine scale set is scaled in, the scale set will first be balanced across zones if it is a zonal scale set. Then, it will be balanced across Fault Domains as far as possible. Within each Fault Domain, the virtual machines chosen for removal will be the newest ones that are not protected from scale-in.
**OldestVM** When a virtual machine scale set is being scaled-in, the oldest virtual machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across zones. Within each zone, the oldest virtual machines that are not protected will be chosen for removal.
**NewestVM** When a virtual machine scale set is being scaled-in, the newest virtual machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across zones. Within each zone, the newest virtual machines that are not protected will be chosen for removal.