diff --git a/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/appplatformapi/interfaces.go b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/appplatformapi/interfaces.go index 6e2a0a6252de..09b0d0d994db 100644 --- a/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/appplatformapi/interfaces.go +++ b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/appplatformapi/interfaces.go @@ -117,6 +117,13 @@ type OperationsClientAPI interface { var _ OperationsClientAPI = (*appplatform.OperationsClient)(nil) +// RuntimeVersionsClientAPI contains the set of methods on the RuntimeVersionsClient type. +type RuntimeVersionsClientAPI interface { + ListRuntimeVersions(ctx context.Context) (result appplatform.AvailableRuntimeVersions, err error) +} + +var _ RuntimeVersionsClientAPI = (*appplatform.RuntimeVersionsClient)(nil) + // SkuClientAPI contains the set of methods on the SkuClient type. type SkuClientAPI interface { List(ctx context.Context) (result appplatform.ResourceSkuCollectionPage, err error) diff --git a/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/enums.go b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/enums.go index 6af67441d29a..79e1729da818 100644 --- a/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/enums.go +++ b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/enums.go @@ -187,11 +187,13 @@ const ( Java11 RuntimeVersion = "Java_11" // Java8 ... Java8 RuntimeVersion = "Java_8" + // NetCore31 ... + NetCore31 RuntimeVersion = "NetCore_31" ) // PossibleRuntimeVersionValues returns an array of possible values for the RuntimeVersion const type. func PossibleRuntimeVersionValues() []RuntimeVersion { - return []RuntimeVersion{Java11, Java8} + return []RuntimeVersion{Java11, Java8, NetCore31} } // SkuScaleType enumerates the values for sku scale type. @@ -211,6 +213,38 @@ func PossibleSkuScaleTypeValues() []SkuScaleType { return []SkuScaleType{SkuScaleTypeAutomatic, SkuScaleTypeManual, SkuScaleTypeNone} } +// SupportedRuntimePlatform enumerates the values for supported runtime platform. +type SupportedRuntimePlatform string + +const ( + // Java ... + Java SupportedRuntimePlatform = "Java" + // NETCore ... + NETCore SupportedRuntimePlatform = ".NET Core" +) + +// PossibleSupportedRuntimePlatformValues returns an array of possible values for the SupportedRuntimePlatform const type. +func PossibleSupportedRuntimePlatformValues() []SupportedRuntimePlatform { + return []SupportedRuntimePlatform{Java, NETCore} +} + +// SupportedRuntimeVersion enumerates the values for supported runtime version. +type SupportedRuntimeVersion string + +const ( + // SupportedRuntimeVersionJava11 ... + SupportedRuntimeVersionJava11 SupportedRuntimeVersion = "Java_11" + // SupportedRuntimeVersionJava8 ... + SupportedRuntimeVersionJava8 SupportedRuntimeVersion = "Java_8" + // SupportedRuntimeVersionNetCore31 ... + SupportedRuntimeVersionNetCore31 SupportedRuntimeVersion = "NetCore_31" +) + +// PossibleSupportedRuntimeVersionValues returns an array of possible values for the SupportedRuntimeVersion const type. +func PossibleSupportedRuntimeVersionValues() []SupportedRuntimeVersion { + return []SupportedRuntimeVersion{SupportedRuntimeVersionJava11, SupportedRuntimeVersionJava8, SupportedRuntimeVersionNetCore31} +} + // TestKeyType enumerates the values for test key type. type TestKeyType string @@ -251,11 +285,13 @@ type UserSourceType string const ( // Jar ... Jar UserSourceType = "Jar" + // NetCoreZip ... + NetCoreZip UserSourceType = "NetCoreZip" // Source ... Source UserSourceType = "Source" ) // PossibleUserSourceTypeValues returns an array of possible values for the UserSourceType const type. func PossibleUserSourceTypeValues() []UserSourceType { - return []UserSourceType{Jar, Source} + return []UserSourceType{Jar, NetCoreZip, Source} } diff --git a/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/models.go b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/models.go index 691a503f6c8e..0de9666d5f8e 100644 --- a/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/models.go +++ b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/models.go @@ -480,6 +480,13 @@ func NewAvailableOperationsPage(getNextPage func(context.Context, AvailableOpera return AvailableOperationsPage{fn: getNextPage} } +// AvailableRuntimeVersions ... +type AvailableRuntimeVersions struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; A list of all supported runtime versions. + Value *[]SupportedRuntimeVersion1 `json:"value,omitempty"` +} + // BindingResource binding resource payload type BindingResource struct { autorest.Response `json:"-"` @@ -1239,6 +1246,8 @@ type DeploymentInstance struct { Reason *string `json:"reason,omitempty"` // DiscoveryStatus - READ-ONLY; Discovery status of the deployment instance DiscoveryStatus *string `json:"discoveryStatus,omitempty"` + // StartTime - READ-ONLY; Start time of the deployment instance + StartTime *string `json:"startTime,omitempty"` } // DeploymentResource deployment resource payload @@ -1489,11 +1498,13 @@ type DeploymentSettings struct { MemoryInGB *int32 `json:"memoryInGB,omitempty"` // JvmOptions - JVM parameter JvmOptions *string `json:"jvmOptions,omitempty"` + // NetCoreMainEntryPath - The path to the .NET executable relative to zip root + NetCoreMainEntryPath *string `json:"netCoreMainEntryPath,omitempty"` // InstanceCount - Instance count, basic tier should be in range (1, 25), standard tier should be in range (1, 500) InstanceCount *int32 `json:"instanceCount,omitempty"` // EnvironmentVariables - Collection of environment variables EnvironmentVariables map[string]*string `json:"environmentVariables"` - // RuntimeVersion - Runtime version. Possible values include: 'Java8', 'Java11' + // RuntimeVersion - Runtime version. Possible values include: 'Java8', 'Java11', 'NetCore31' RuntimeVersion RuntimeVersion `json:"runtimeVersion,omitempty"` } @@ -1509,6 +1520,9 @@ func (ds DeploymentSettings) MarshalJSON() ([]byte, error) { if ds.JvmOptions != nil { objectMap["jvmOptions"] = ds.JvmOptions } + if ds.NetCoreMainEntryPath != nil { + objectMap["netCoreMainEntryPath"] = ds.NetCoreMainEntryPath + } if ds.InstanceCount != nil { objectMap["instanceCount"] = ds.InstanceCount } @@ -2359,6 +2373,16 @@ type SkuCapacity struct { ScaleType SkuScaleType `json:"scaleType,omitempty"` } +// SupportedRuntimeVersion1 supported deployment runtime version descriptor. +type SupportedRuntimeVersion1 struct { + // Value - The raw value which could be passed to deployment CRUD operations. Possible values include: 'SupportedRuntimeVersionJava8', 'SupportedRuntimeVersionJava11', 'SupportedRuntimeVersionNetCore31' + Value SupportedRuntimeVersion `json:"value,omitempty"` + // Platform - The platform of this runtime version (possible values: "Java" or ".NET"). Possible values include: 'Java', 'NETCore' + Platform SupportedRuntimePlatform `json:"platform,omitempty"` + // Version - The detailed version (major.minor) of the platform. + Version *string `json:"version,omitempty"` +} + // TemporaryDisk temporary disk payload type TemporaryDisk struct { // SizeInGB - Size of the temporary disk in GB @@ -2437,7 +2461,7 @@ func (tr TrackedResource) MarshalJSON() ([]byte, error) { // UserSourceInfo source information for a deployment type UserSourceInfo struct { - // Type - Type of the source uploaded. Possible values include: 'Jar', 'Source' + // Type - Type of the source uploaded. Possible values include: 'Jar', 'NetCoreZip', 'Source' Type UserSourceType `json:"type,omitempty"` // RelativePath - Relative path of the storage which stores the source RelativePath *string `json:"relativePath,omitempty"` diff --git a/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/runtimeversions.go b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/runtimeversions.go new file mode 100644 index 000000000000..8d8c0ef03916 --- /dev/null +++ b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/runtimeversions.go @@ -0,0 +1,108 @@ +package appplatform + +// 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" +) + +// RuntimeVersionsClient is the REST API for Azure Spring Cloud +type RuntimeVersionsClient struct { + BaseClient +} + +// NewRuntimeVersionsClient creates an instance of the RuntimeVersionsClient client. +func NewRuntimeVersionsClient(subscriptionID string) RuntimeVersionsClient { + return NewRuntimeVersionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRuntimeVersionsClientWithBaseURI creates an instance of the RuntimeVersionsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewRuntimeVersionsClientWithBaseURI(baseURI string, subscriptionID string) RuntimeVersionsClient { + return RuntimeVersionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListRuntimeVersions lists all of the available runtime versions supported by Microsoft.AppPlatform provider. +func (client RuntimeVersionsClient) ListRuntimeVersions(ctx context.Context) (result AvailableRuntimeVersions, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RuntimeVersionsClient.ListRuntimeVersions") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListRuntimeVersionsPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "appplatform.RuntimeVersionsClient", "ListRuntimeVersions", nil, "Failure preparing request") + return + } + + resp, err := client.ListRuntimeVersionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "appplatform.RuntimeVersionsClient", "ListRuntimeVersions", resp, "Failure sending request") + return + } + + result, err = client.ListRuntimeVersionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "appplatform.RuntimeVersionsClient", "ListRuntimeVersions", resp, "Failure responding to request") + } + + return +} + +// ListRuntimeVersionsPreparer prepares the ListRuntimeVersions request. +func (client RuntimeVersionsClient) ListRuntimeVersionsPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2019-05-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.AppPlatform/runtimeVersions"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListRuntimeVersionsSender sends the ListRuntimeVersions request. The method will close the +// http.Response Body if it receives an error. +func (client RuntimeVersionsClient) ListRuntimeVersionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListRuntimeVersionsResponder handles the response to the ListRuntimeVersions request. The method always +// closes the http.Response Body. +func (client RuntimeVersionsClient) ListRuntimeVersionsResponder(resp *http.Response) (result AvailableRuntimeVersions, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +}