diff --git a/services/appplatform/mgmt/2020-07-01/appplatform/appplatformapi/interfaces.go b/services/appplatform/mgmt/2020-07-01/appplatform/appplatformapi/interfaces.go index 89339f30940a..16c6bb99a962 100644 --- a/services/appplatform/mgmt/2020-07-01/appplatform/appplatformapi/interfaces.go +++ b/services/appplatform/mgmt/2020-07-01/appplatform/appplatformapi/interfaces.go @@ -135,6 +135,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) + // SkusClientAPI contains the set of methods on the SkusClient type. type SkusClientAPI interface { List(ctx context.Context) (result appplatform.ResourceSkuCollectionPage, err error) diff --git a/services/appplatform/mgmt/2020-07-01/appplatform/enums.go b/services/appplatform/mgmt/2020-07-01/appplatform/enums.go index ba9834fe3fd9..39b6e8bdaea7 100644 --- a/services/appplatform/mgmt/2020-07-01/appplatform/enums.go +++ b/services/appplatform/mgmt/2020-07-01/appplatform/enums.go @@ -206,11 +206,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. @@ -230,6 +232,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/appplatform/mgmt/2020-07-01/appplatform/models.go b/services/appplatform/mgmt/2020-07-01/appplatform/models.go index dc98b754465d..e9fae0093cce 100644 --- a/services/appplatform/mgmt/2020-07-01/appplatform/models.go +++ b/services/appplatform/mgmt/2020-07-01/appplatform/models.go @@ -502,6 +502,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:"-"` @@ -1544,6 +1551,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 @@ -1822,9 +1831,11 @@ 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"` // 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"` } @@ -1840,6 +1851,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.EnvironmentVariables != nil { objectMap["environmentVariables"] = ds.EnvironmentVariables } @@ -2797,6 +2811,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 @@ -2848,7 +2872,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/appplatform/mgmt/2020-07-01/appplatform/runtimeversions.go b/services/appplatform/mgmt/2020-07-01/appplatform/runtimeversions.go new file mode 100644 index 000000000000..7e0fc2e2e294 --- /dev/null +++ b/services/appplatform/mgmt/2020-07-01/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 = "2020-07-01" + 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 +}