diff --git a/profiles/preview/preview/hdinsight/mgmt/hdinsight/models.go b/profiles/preview/preview/hdinsight/mgmt/hdinsight/models.go index 926044b77826..88db56d34baf 100644 --- a/profiles/preview/preview/hdinsight/mgmt/hdinsight/models.go +++ b/profiles/preview/preview/hdinsight/mgmt/hdinsight/models.go @@ -122,6 +122,7 @@ type BaseClient = original.BaseClient type BillingMeters = original.BillingMeters type BillingResources = original.BillingResources type BillingResponseListResult = original.BillingResponseListResult +type CapabilitiesResult = original.CapabilitiesResult type Cluster = original.Cluster type ClusterConfigurations = original.ClusterConfigurations type ClusterCreateParametersExtended = original.ClusterCreateParametersExtended @@ -177,7 +178,10 @@ type OperationResource = original.OperationResource type OperationsClient = original.OperationsClient type OsProfile = original.OsProfile type ProxyResource = original.ProxyResource +type QuotaCapability = original.QuotaCapability type QuotaInfo = original.QuotaInfo +type RegionalQuotaCapability = original.RegionalQuotaCapability +type RegionsCapability = original.RegionsCapability type Resource = original.Resource type Role = original.Role type RuntimeScriptAction = original.RuntimeScriptAction @@ -203,7 +207,11 @@ type TrackedResource = original.TrackedResource type UpdateGatewaySettingsParameters = original.UpdateGatewaySettingsParameters type Usage = original.Usage type UsagesListResult = original.UsagesListResult +type VMSizeCompatibilityFilter = original.VMSizeCompatibilityFilter type VMSizeCompatibilityFilterV2 = original.VMSizeCompatibilityFilterV2 +type VMSizesCapability = original.VMSizesCapability +type VersionSpec = original.VersionSpec +type VersionsCapability = original.VersionsCapability type VirtualNetworkProfile = original.VirtualNetworkProfile func New(subscriptionID string) BaseClient { diff --git a/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/models.go b/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/models.go index bde17fe23cb1..d4cc4f5a350d 100644 --- a/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/models.go +++ b/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/models.go @@ -239,6 +239,10 @@ type ApplicationGetHTTPSEndpoint struct { DestinationPort *int32 `json:"destinationPort,omitempty"` // PublicPort - The public port to connect to. PublicPort *int32 `json:"publicPort,omitempty"` + // SubDomainSuffix - The subdomain suffix of the application. + SubDomainSuffix *string `json:"subDomainSuffix,omitempty"` + // DisableGatewayAuth - Disable gateway authentication. + DisableGatewayAuth *bool `json:"disableGatewayAuth,omitempty"` } // ApplicationListResult result of the request to list cluster Applications. It contains a list of @@ -1517,6 +1521,10 @@ type ProxyResource struct { // QuotaCapability the regional quota capability. type QuotaCapability struct { + // CoresUsed - The number of cores used in the subscription. + CoresUsed *int64 `json:"cores_used,omitempty"` + // MaxCoresAllowed - The number of cores that the subscription allowed. + MaxCoresAllowed *int64 `json:"max_cores_allowed,omitempty"` // RegionalQuotas - The list of region quota capabilities. RegionalQuotas *[]RegionalQuotaCapability `json:"regionalQuotas,omitempty"` } @@ -1533,7 +1541,7 @@ type RegionalQuotaCapability struct { RegionName *string `json:"region_name,omitempty"` // CoresUsed - The number of cores used in the region. CoresUsed *int64 `json:"cores_used,omitempty"` - // CoresAvailable - The number of courses available in the region. + // CoresAvailable - The number of cores available in the region. CoresAvailable *int64 `json:"cores_available,omitempty"` } diff --git a/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/hdinsightapi/interfaces.go b/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/hdinsightapi/interfaces.go index 789b47636a5d..473f035bab0b 100644 --- a/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/hdinsightapi/interfaces.go +++ b/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/hdinsightapi/interfaces.go @@ -52,6 +52,7 @@ var _ ApplicationsClientAPI = (*hdinsight.ApplicationsClient)(nil) // LocationsClientAPI contains the set of methods on the LocationsClient type. type LocationsClientAPI interface { + GetCapabilities(ctx context.Context, location string) (result hdinsight.CapabilitiesResult, err error) ListBillingSpecs(ctx context.Context, location string) (result hdinsight.BillingResponseListResult, err error) ListUsages(ctx context.Context, location string) (result hdinsight.UsagesListResult, err error) } diff --git a/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/locations.go b/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/locations.go index a5c657ce7205..4ad0c4ccaef8 100644 --- a/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/locations.go +++ b/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/locations.go @@ -40,6 +40,81 @@ func NewLocationsClientWithBaseURI(baseURI string, subscriptionID string) Locati return LocationsClient{NewWithBaseURI(baseURI, subscriptionID)} } +// GetCapabilities gets the capabilities for the specified location. +// Parameters: +// location - the Azure location (region) for which to make the request. +func (client LocationsClient) GetCapabilities(ctx context.Context, location string) (result CapabilitiesResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LocationsClient.GetCapabilities") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetCapabilitiesPreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.LocationsClient", "GetCapabilities", nil, "Failure preparing request") + return + } + + resp, err := client.GetCapabilitiesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "hdinsight.LocationsClient", "GetCapabilities", resp, "Failure sending request") + return + } + + result, err = client.GetCapabilitiesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.LocationsClient", "GetCapabilities", resp, "Failure responding to request") + } + + return +} + +// GetCapabilitiesPreparer prepares the GetCapabilities request. +func (client LocationsClient) GetCapabilitiesPreparer(ctx context.Context, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/capabilities", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetCapabilitiesSender sends the GetCapabilities request. The method will close the +// http.Response Body if it receives an error. +func (client LocationsClient) GetCapabilitiesSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetCapabilitiesResponder handles the response to the GetCapabilities request. The method always +// closes the http.Response Body. +func (client LocationsClient) GetCapabilitiesResponder(resp *http.Response) (result CapabilitiesResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // ListBillingSpecs lists the billingSpecs for the specified subscription and location. // Parameters: // location - the Azure location (region) for which to make the request. diff --git a/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/models.go b/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/models.go index 2757f1da6100..ec244d5e7a5c 100644 --- a/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/models.go +++ b/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/models.go @@ -239,7 +239,7 @@ type ApplicationGetHTTPSEndpoint struct { DestinationPort *int32 `json:"destinationPort,omitempty"` // PublicPort - The public port to connect to. PublicPort *int32 `json:"publicPort,omitempty"` - // SubDomainSuffix - The subDomainSuffix of the application. + // SubDomainSuffix - The subdomain suffix of the application. SubDomainSuffix *string `json:"subDomainSuffix,omitempty"` // DisableGatewayAuth - The value indicates whether to disable GatewayAuth. DisableGatewayAuth *bool `json:"disableGatewayAuth,omitempty"` @@ -545,6 +545,47 @@ type BillingResponseListResult struct { BillingResources *[]BillingResources `json:"billingResources,omitempty"` } +// CapabilitiesResult the Get Capabilities operation response. +type CapabilitiesResult struct { + autorest.Response `json:"-"` + // Versions - The version capability. + Versions map[string]*VersionsCapability `json:"versions"` + // Regions - The virtual machine size compatibility features. + Regions map[string]*RegionsCapability `json:"regions"` + // VMSizes - The virtual machine sizes. + VMSizes map[string]*VMSizesCapability `json:"vmSizes"` + // VMSizeFilters - The virtual machine size compatibility filters. + VMSizeFilters *[]VMSizeCompatibilityFilter `json:"vmSize_filters,omitempty"` + // Features - The capability features. + Features *[]string `json:"features,omitempty"` + // Quota - The quota capability. + Quota *QuotaCapability `json:"quota,omitempty"` +} + +// MarshalJSON is the custom marshaler for CapabilitiesResult. +func (cr CapabilitiesResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cr.Versions != nil { + objectMap["versions"] = cr.Versions + } + if cr.Regions != nil { + objectMap["regions"] = cr.Regions + } + if cr.VMSizes != nil { + objectMap["vmSizes"] = cr.VMSizes + } + if cr.VMSizeFilters != nil { + objectMap["vmSize_filters"] = cr.VMSizeFilters + } + if cr.Features != nil { + objectMap["features"] = cr.Features + } + if cr.Quota != nil { + objectMap["quota"] = cr.Quota + } + return json.Marshal(objectMap) +} + // Cluster the HDInsight cluster. type Cluster struct { autorest.Response `json:"-"` @@ -1524,12 +1565,38 @@ type ProxyResource struct { Type *string `json:"type,omitempty"` } +// QuotaCapability the regional quota capability. +type QuotaCapability struct { + // CoresUsed - The number of cores used in the subscription. + CoresUsed *int64 `json:"cores_used,omitempty"` + // MaxCoresAllowed - The number of cores that the subscription allowed. + MaxCoresAllowed *int64 `json:"max_cores_allowed,omitempty"` + // RegionalQuotas - The list of region quota capabilities. + RegionalQuotas *[]RegionalQuotaCapability `json:"regionalQuotas,omitempty"` +} + // QuotaInfo the quota properties for the cluster. type QuotaInfo struct { // CoresUsed - The cores used by the cluster. CoresUsed *int32 `json:"coresUsed,omitempty"` } +// RegionalQuotaCapability the regional quota capacity. +type RegionalQuotaCapability struct { + // RegionName - The region name. + RegionName *string `json:"region_name,omitempty"` + // CoresUsed - The number of cores used in the region. + CoresUsed *int64 `json:"cores_used,omitempty"` + // CoresAvailable - The number of cores available in the region. + CoresAvailable *int64 `json:"cores_available,omitempty"` +} + +// RegionsCapability the regions capability. +type RegionsCapability struct { + // Available - The list of region capabilities. + Available *[]string `json:"available,omitempty"` +} + // Resource the core properties of ARM resources type Resource struct { // ID - READ-ONLY; Fully qualified resource Id for the resource. @@ -2058,6 +2125,42 @@ type UsagesListResult struct { Value *[]Usage `json:"value,omitempty"` } +// VersionsCapability the version capability. +type VersionsCapability struct { + // Available - The list of version capabilities. + Available *[]VersionSpec `json:"available,omitempty"` +} + +// VersionSpec the version properties. +type VersionSpec struct { + // FriendlyName - The friendly name + FriendlyName *string `json:"friendlyName,omitempty"` + // DisplayName - The display name + DisplayName *string `json:"displayName,omitempty"` + // IsDefault - Whether or not the version is the default version. + IsDefault *string `json:"isDefault,omitempty"` + // ComponentVersions - The component version property. + ComponentVersions map[string]*string `json:"componentVersions"` +} + +// MarshalJSON is the custom marshaler for VersionSpec. +func (vs VersionSpec) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vs.FriendlyName != nil { + objectMap["friendlyName"] = vs.FriendlyName + } + if vs.DisplayName != nil { + objectMap["displayName"] = vs.DisplayName + } + if vs.IsDefault != nil { + objectMap["isDefault"] = vs.IsDefault + } + if vs.ComponentVersions != nil { + objectMap["componentVersions"] = vs.ComponentVersions + } + return json.Marshal(objectMap) +} + // VirtualNetworkProfile the virtual network properties. type VirtualNetworkProfile struct { // ID - The ID of the virtual network. @@ -2066,6 +2169,22 @@ type VirtualNetworkProfile struct { Subnet *string `json:"subnet,omitempty"` } +// VMSizeCompatibilityFilter the virtual machine type compatibility filter. +type VMSizeCompatibilityFilter struct { + // FilterMode - The mode for the filter. + FilterMode *string `json:"FilterMode,omitempty"` + // Regions - The list of regions. + Regions *[]string `json:"Regions,omitempty"` + // ClusterFlavors - The list of cluster types available. + ClusterFlavors *[]string `json:"ClusterFlavors,omitempty"` + // NodeTypes - The list of node types. + NodeTypes *[]string `json:"NodeTypes,omitempty"` + // ClusterVersions - The list of cluster versions. + ClusterVersions *[]string `json:"ClusterVersions,omitempty"` + // Vmsizes - The list of virtual machine sizes. + Vmsizes *[]string `json:"vmsizes,omitempty"` +} + // VMSizeCompatibilityFilterV2 this class represent a single filter object that defines a multidimensional // set. The dimensions of this set are Regions, ClusterFlavors, NodeTypes and ClusterVersions. The // constraint should be defined based on the following: FilterMode (Exclude vs Include), VMSizes (the vm @@ -2087,3 +2206,9 @@ type VMSizeCompatibilityFilterV2 struct { // VMSizes - The list of virtual machine sizes to include or exclude. VMSizes *[]string `json:"vmSizes,omitempty"` } + +// VMSizesCapability the virtual machine sizes capability. +type VMSizesCapability struct { + // Available - The list of virtual machine size capabilities. + Available *[]string `json:"available,omitempty"` +}