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..038daef61acd 100644 --- a/services/appplatform/mgmt/2020-07-01/appplatform/appplatformapi/interfaces.go +++ b/services/appplatform/mgmt/2020-07-01/appplatform/appplatformapi/interfaces.go @@ -47,6 +47,7 @@ type ConfigServersClientAPI interface { Get(ctx context.Context, resourceGroupName string, serviceName string) (result appplatform.ConfigServerResource, err error) UpdatePatch(ctx context.Context, resourceGroupName string, serviceName string, configServerResource appplatform.ConfigServerResource) (result appplatform.ConfigServersUpdatePatchFuture, err error) UpdatePut(ctx context.Context, resourceGroupName string, serviceName string, configServerResource appplatform.ConfigServerResource) (result appplatform.ConfigServersUpdatePutFuture, err error) + Validate(ctx context.Context, resourceGroupName string, serviceName string, configServerSettings appplatform.ConfigServerSettings) (result appplatform.ConfigServersValidateFuture, err error) } var _ ConfigServersClientAPI = (*appplatform.ConfigServersClient)(nil) @@ -135,6 +136,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/configservers.go b/services/appplatform/mgmt/2020-07-01/appplatform/configservers.go index a4daa5266497..94c4daf58232 100644 --- a/services/appplatform/mgmt/2020-07-01/appplatform/configservers.go +++ b/services/appplatform/mgmt/2020-07-01/appplatform/configservers.go @@ -286,3 +286,89 @@ func (client ConfigServersClient) UpdatePutResponder(resp *http.Response) (resul result.Response = autorest.Response{Response: resp} return } + +// Validate check if the config server settings are valid. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// serviceName - the name of the Service resource. +// configServerSettings - config server settings to be validated +func (client ConfigServersClient) Validate(ctx context.Context, resourceGroupName string, serviceName string, configServerSettings ConfigServerSettings) (result ConfigServersValidateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigServersClient.Validate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: configServerSettings, + Constraints: []validation.Constraint{{Target: "configServerSettings.GitProperty", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "configServerSettings.GitProperty.URI", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("appplatform.ConfigServersClient", "Validate", err.Error()) + } + + req, err := client.ValidatePreparer(ctx, resourceGroupName, serviceName, configServerSettings) + if err != nil { + err = autorest.NewErrorWithError(err, "appplatform.ConfigServersClient", "Validate", nil, "Failure preparing request") + return + } + + result, err = client.ValidateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "appplatform.ConfigServersClient", "Validate", result.Response(), "Failure sending request") + return + } + + return +} + +// ValidatePreparer prepares the Validate request. +func (client ConfigServersClient) ValidatePreparer(ctx context.Context, resourceGroupName string, serviceName string, configServerSettings ConfigServerSettings) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate", pathParameters), + autorest.WithJSON(configServerSettings), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ValidateSender sends the Validate request. The method will close the +// http.Response Body if it receives an error. +func (client ConfigServersClient) ValidateSender(req *http.Request) (future ConfigServersValidateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// ValidateResponder handles the response to the Validate request. The method always +// closes the http.Response Body. +func (client ConfigServersClient) ValidateResponder(resp *http.Response) (result ConfigServerSettingsValidateResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/appplatform/mgmt/2020-07-01/appplatform/enums.go b/services/appplatform/mgmt/2020-07-01/appplatform/enums.go index ba9834fe3fd9..a1033f8ddcf0 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} +} + +// SupportedRuntimeValue enumerates the values for supported runtime value. +type SupportedRuntimeValue string + +const ( + // SupportedRuntimeValueJava11 ... + SupportedRuntimeValueJava11 SupportedRuntimeValue = "Java_11" + // SupportedRuntimeValueJava8 ... + SupportedRuntimeValueJava8 SupportedRuntimeValue = "Java_8" + // SupportedRuntimeValueNetCore31 ... + SupportedRuntimeValueNetCore31 SupportedRuntimeValue = "NetCore_31" +) + +// PossibleSupportedRuntimeValueValues returns an array of possible values for the SupportedRuntimeValue const type. +func PossibleSupportedRuntimeValueValues() []SupportedRuntimeValue { + return []SupportedRuntimeValue{SupportedRuntimeValueJava11, SupportedRuntimeValueJava8, SupportedRuntimeValueNetCore31} +} + // 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..1c8f85239f31 100644 --- a/services/appplatform/mgmt/2020-07-01/appplatform/models.go +++ b/services/appplatform/mgmt/2020-07-01/appplatform/models.go @@ -216,8 +216,11 @@ func (page AppResourceCollectionPage) Values() []AppResource { } // Creates a new instance of the AppResourceCollectionPage type. -func NewAppResourceCollectionPage(getNextPage func(context.Context, AppResourceCollection) (AppResourceCollection, error)) AppResourceCollectionPage { - return AppResourceCollectionPage{fn: getNextPage} +func NewAppResourceCollectionPage(cur AppResourceCollection, getNextPage func(context.Context, AppResourceCollection) (AppResourceCollection, error)) AppResourceCollectionPage { + return AppResourceCollectionPage{ + fn: getNextPage, + arc: cur, + } } // AppResourceProperties app resource properties payload @@ -498,8 +501,18 @@ func (page AvailableOperationsPage) Values() []OperationDetail { } // Creates a new instance of the AvailableOperationsPage type. -func NewAvailableOperationsPage(getNextPage func(context.Context, AvailableOperations) (AvailableOperations, error)) AvailableOperationsPage { - return AvailableOperationsPage{fn: getNextPage} +func NewAvailableOperationsPage(cur AvailableOperations, getNextPage func(context.Context, AvailableOperations) (AvailableOperations, error)) AvailableOperationsPage { + return AvailableOperationsPage{ + fn: getNextPage, + ao: cur, + } +} + +// AvailableRuntimeVersions ... +type AvailableRuntimeVersions struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; A list of all supported runtime versions. + Value *[]SupportedRuntimeVersion `json:"value,omitempty"` } // BindingResource binding resource payload @@ -524,8 +537,8 @@ func (br BindingResource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// BindingResourceCollection object that includes an array of Binding resources and a possible link for next -// set +// BindingResourceCollection object that includes an array of Binding resources and a possible link for +// next set type BindingResourceCollection struct { autorest.Response `json:"-"` // Value - Collection of Binding resources @@ -678,8 +691,11 @@ func (page BindingResourceCollectionPage) Values() []BindingResource { } // Creates a new instance of the BindingResourceCollectionPage type. -func NewBindingResourceCollectionPage(getNextPage func(context.Context, BindingResourceCollection) (BindingResourceCollection, error)) BindingResourceCollectionPage { - return BindingResourceCollectionPage{fn: getNextPage} +func NewBindingResourceCollectionPage(cur BindingResourceCollection, getNextPage func(context.Context, BindingResourceCollection) (BindingResourceCollection, error)) BindingResourceCollectionPage { + return BindingResourceCollectionPage{ + fn: getNextPage, + brc: cur, + } } // BindingResourceProperties binding resource properties payload @@ -746,7 +762,8 @@ func (future *BindingsCreateOrUpdateFuture) Result(client BindingsClient) (br Bi return } -// BindingsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// BindingsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type BindingsDeleteFuture struct { azure.Future } @@ -768,7 +785,8 @@ func (future *BindingsDeleteFuture) Result(client BindingsClient) (ar autorest.R return } -// BindingsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// BindingsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type BindingsUpdateFuture struct { azure.Future } @@ -857,8 +875,8 @@ func (cr CertificateResource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// CertificateResourceCollection collection compose of certificate resources list and a possible link for next -// page. +// CertificateResourceCollection collection compose of certificate resources list and a possible link for +// next page. type CertificateResourceCollection struct { autorest.Response `json:"-"` // Value - The certificate resources list. @@ -867,7 +885,8 @@ type CertificateResourceCollection struct { NextLink *string `json:"nextLink,omitempty"` } -// CertificateResourceCollectionIterator provides access to a complete listing of CertificateResource values. +// CertificateResourceCollectionIterator provides access to a complete listing of CertificateResource +// values. type CertificateResourceCollectionIterator struct { i int page CertificateResourceCollectionPage @@ -1010,12 +1029,15 @@ func (page CertificateResourceCollectionPage) Values() []CertificateResource { } // Creates a new instance of the CertificateResourceCollectionPage type. -func NewCertificateResourceCollectionPage(getNextPage func(context.Context, CertificateResourceCollection) (CertificateResourceCollection, error)) CertificateResourceCollectionPage { - return CertificateResourceCollectionPage{fn: getNextPage} +func NewCertificateResourceCollectionPage(cur CertificateResourceCollection, getNextPage func(context.Context, CertificateResourceCollection) (CertificateResourceCollection, error)) CertificateResourceCollectionPage { + return CertificateResourceCollectionPage{ + fn: getNextPage, + crc: cur, + } } -// CertificatesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// CertificatesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type CertificatesCreateOrUpdateFuture struct { azure.Future } @@ -1179,8 +1201,27 @@ type ConfigServerSettings struct { GitProperty *ConfigServerGitProperty `json:"gitProperty,omitempty"` } -// ConfigServersUpdatePatchFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// ConfigServerSettingsErrorRecord error record of the config server settings +type ConfigServerSettingsErrorRecord struct { + // Name - The name of the config server settings error record + Name *string `json:"name,omitempty"` + // URI - The uri of the config server settings error record + URI *string `json:"uri,omitempty"` + // Messages - The detail error messages of the record + Messages *[]string `json:"messages,omitempty"` +} + +// ConfigServerSettingsValidateResult validation result for config server settings +type ConfigServerSettingsValidateResult struct { + autorest.Response `json:"-"` + // IsValid - Indicate if the config server settings are valid + IsValid *bool `json:"isValid,omitempty"` + // Details - The detail validation results + Details *[]ConfigServerSettingsErrorRecord `json:"details,omitempty"` +} + +// ConfigServersUpdatePatchFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type ConfigServersUpdatePatchFuture struct { azure.Future } @@ -1237,6 +1278,35 @@ func (future *ConfigServersUpdatePutFuture) Result(client ConfigServersClient) ( return } +// ConfigServersValidateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ConfigServersValidateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ConfigServersValidateFuture) Result(client ConfigServersClient) (cssvr ConfigServerSettingsValidateResult, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "appplatform.ConfigServersValidateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("appplatform.ConfigServersValidateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cssvr.Response.Response, err = future.GetResult(sender); err == nil && cssvr.Response.Response.StatusCode != http.StatusNoContent { + cssvr, err = client.ValidateResponder(cssvr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "appplatform.ConfigServersValidateFuture", "Result", cssvr.Response.Response, "Failure responding to request") + } + } + return +} + // CustomDomainProperties custom domain of app resource payload. type CustomDomainProperties struct { // Thumbprint - The thumbprint of bound certificate. @@ -1281,8 +1351,8 @@ func (cdr CustomDomainResource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// CustomDomainResourceCollection collection compose of a custom domain resources list and a possible link for -// next page. +// CustomDomainResourceCollection collection compose of a custom domain resources list and a possible link +// for next page. type CustomDomainResourceCollection struct { autorest.Response `json:"-"` // Value - The custom domain resources list. @@ -1291,7 +1361,8 @@ type CustomDomainResourceCollection struct { NextLink *string `json:"nextLink,omitempty"` } -// CustomDomainResourceCollectionIterator provides access to a complete listing of CustomDomainResource values. +// CustomDomainResourceCollectionIterator provides access to a complete listing of CustomDomainResource +// values. type CustomDomainResourceCollectionIterator struct { i int page CustomDomainResourceCollectionPage @@ -1434,12 +1505,15 @@ func (page CustomDomainResourceCollectionPage) Values() []CustomDomainResource { } // Creates a new instance of the CustomDomainResourceCollectionPage type. -func NewCustomDomainResourceCollectionPage(getNextPage func(context.Context, CustomDomainResourceCollection) (CustomDomainResourceCollection, error)) CustomDomainResourceCollectionPage { - return CustomDomainResourceCollectionPage{fn: getNextPage} +func NewCustomDomainResourceCollectionPage(cur CustomDomainResourceCollection, getNextPage func(context.Context, CustomDomainResourceCollection) (CustomDomainResourceCollection, error)) CustomDomainResourceCollectionPage { + return CustomDomainResourceCollectionPage{ + fn: getNextPage, + cdrc: cur, + } } -// CustomDomainsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// CustomDomainsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type CustomDomainsCreateOrUpdateFuture struct { azure.Future } @@ -1544,6 +1618,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 @@ -1573,7 +1649,8 @@ func (dr DeploymentResource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// DeploymentResourceCollection object that includes an array of App resources and a possible link for next set +// DeploymentResourceCollection object that includes an array of App resources and a possible link for next +// set type DeploymentResourceCollection struct { autorest.Response `json:"-"` // Value - Collection of Deployment resources @@ -1726,8 +1803,11 @@ func (page DeploymentResourceCollectionPage) Values() []DeploymentResource { } // Creates a new instance of the DeploymentResourceCollectionPage type. -func NewDeploymentResourceCollectionPage(getNextPage func(context.Context, DeploymentResourceCollection) (DeploymentResourceCollection, error)) DeploymentResourceCollectionPage { - return DeploymentResourceCollectionPage{fn: getNextPage} +func NewDeploymentResourceCollectionPage(cur DeploymentResourceCollection, getNextPage func(context.Context, DeploymentResourceCollection) (DeploymentResourceCollection, error)) DeploymentResourceCollectionPage { + return DeploymentResourceCollectionPage{ + fn: getNextPage, + drc: cur, + } } // DeploymentResourceProperties deployment resource properties payload @@ -1762,8 +1842,8 @@ func (drp DeploymentResourceProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// DeploymentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// DeploymentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type DeploymentsCreateOrUpdateFuture struct { azure.Future } @@ -1822,9 +1902,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 +1922,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 } @@ -1872,7 +1957,8 @@ func (future *DeploymentsRestartFuture) Result(client DeploymentsClient) (ar aut return } -// DeploymentsStartFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// DeploymentsStartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type DeploymentsStartFuture struct { azure.Future } @@ -1894,7 +1980,8 @@ func (future *DeploymentsStartFuture) Result(client DeploymentsClient) (ar autor return } -// DeploymentsStopFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// DeploymentsStopFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type DeploymentsStopFuture struct { azure.Future } @@ -2116,8 +2203,8 @@ func (future *MonitoringSettingsUpdatePatchFuture) Result(client MonitoringSetti return } -// MonitoringSettingsUpdatePutFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// MonitoringSettingsUpdatePutFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type MonitoringSettingsUpdatePutFuture struct { azure.Future } @@ -2176,6 +2263,35 @@ type NetworkProfile struct { ServiceRuntimeNetworkResourceGroup *string `json:"serviceRuntimeNetworkResourceGroup,omitempty"` // AppNetworkResourceGroup - Name of the resource group containing network resources of Azure Spring Cloud Apps AppNetworkResourceGroup *string `json:"appNetworkResourceGroup,omitempty"` + // OutboundIPs - READ-ONLY; Desired outbound IP resources for Azure Spring Cloud instance. + OutboundIPs *NetworkProfileOutboundIPs `json:"outboundIPs,omitempty"` +} + +// MarshalJSON is the custom marshaler for NetworkProfile. +func (np NetworkProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if np.ServiceRuntimeSubnetID != nil { + objectMap["serviceRuntimeSubnetId"] = np.ServiceRuntimeSubnetID + } + if np.AppSubnetID != nil { + objectMap["appSubnetId"] = np.AppSubnetID + } + if np.ServiceCidr != nil { + objectMap["serviceCidr"] = np.ServiceCidr + } + if np.ServiceRuntimeNetworkResourceGroup != nil { + objectMap["serviceRuntimeNetworkResourceGroup"] = np.ServiceRuntimeNetworkResourceGroup + } + if np.AppNetworkResourceGroup != nil { + objectMap["appNetworkResourceGroup"] = np.AppNetworkResourceGroup + } + return json.Marshal(objectMap) +} + +// NetworkProfileOutboundIPs desired outbound IP resources for Azure Spring Cloud instance. +type NetworkProfileOutboundIPs struct { + // PublicIPs - READ-ONLY; A list of public IP addresses. + PublicIPs *[]string `json:"publicIPs,omitempty"` } // OperationDetail operation detail payload @@ -2286,8 +2402,8 @@ type ResourceSkuCapabilities struct { Value *string `json:"value,omitempty"` } -// ResourceSkuCollection object that includes an array of Azure Spring Cloud SKU and a possible link for next -// set +// ResourceSkuCollection object that includes an array of Azure Spring Cloud SKU and a possible link for +// next set type ResourceSkuCollection struct { autorest.Response `json:"-"` // Value - Collection of resource SKU @@ -2440,8 +2556,11 @@ func (page ResourceSkuCollectionPage) Values() []ResourceSku { } // Creates a new instance of the ResourceSkuCollectionPage type. -func NewResourceSkuCollectionPage(getNextPage func(context.Context, ResourceSkuCollection) (ResourceSkuCollection, error)) ResourceSkuCollectionPage { - return ResourceSkuCollectionPage{fn: getNextPage} +func NewResourceSkuCollectionPage(cur ResourceSkuCollection, getNextPage func(context.Context, ResourceSkuCollection) (ResourceSkuCollection, error)) ResourceSkuCollectionPage { + return ResourceSkuCollectionPage{ + fn: getNextPage, + rsc: cur, + } } // ResourceSkuLocationInfo locations and availability zones where the SKU is available @@ -2684,8 +2803,11 @@ func (page ServiceResourceListPage) Values() []ServiceResource { } // Creates a new instance of the ServiceResourceListPage type. -func NewServiceResourceListPage(getNextPage func(context.Context, ServiceResourceList) (ServiceResourceList, error)) ServiceResourceListPage { - return ServiceResourceListPage{fn: getNextPage} +func NewServiceResourceListPage(cur ServiceResourceList, getNextPage func(context.Context, ServiceResourceList) (ServiceResourceList, error)) ServiceResourceListPage { + return ServiceResourceListPage{ + fn: getNextPage, + srl: cur, + } } // ServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running @@ -2717,7 +2839,8 @@ func (future *ServicesCreateOrUpdateFuture) Result(client ServicesClient) (sr Se return } -// ServicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// ServicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type ServicesDeleteFuture struct { azure.Future } @@ -2747,7 +2870,8 @@ type ServiceSpecification struct { MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"` } -// ServicesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// ServicesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type ServicesUpdateFuture struct { azure.Future } @@ -2797,6 +2921,16 @@ type SkuCapacity struct { ScaleType SkuScaleType `json:"scaleType,omitempty"` } +// SupportedRuntimeVersion supported deployment runtime version descriptor. +type SupportedRuntimeVersion struct { + // Value - The raw value which could be passed to deployment CRUD operations. Possible values include: 'SupportedRuntimeValueJava8', 'SupportedRuntimeValueJava11', 'SupportedRuntimeValueNetCore31' + Value SupportedRuntimeValue `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 +2982,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 +}