diff --git a/packages/@azure/arm-signalr/LICENSE.txt b/packages/@azure/arm-signalr/LICENSE.txt index 5431ba98b936..8f3d856145c5 100644 --- a/packages/@azure/arm-signalr/LICENSE.txt +++ b/packages/@azure/arm-signalr/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Microsoft +Copyright (c) 2019 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/packages/@azure/arm-signalr/lib/models/index.ts b/packages/@azure/arm-signalr/lib/models/index.ts index be50bd0edeb0..6db0e8df6612 100644 --- a/packages/@azure/arm-signalr/lib/models/index.ts +++ b/packages/@azure/arm-signalr/lib/models/index.ts @@ -235,8 +235,8 @@ export interface ResourceSku { name: string; /** * @member {SignalRSkuTier} [tier] Optional tier of this particular SKU. - * `Basic` is deprecated, use `Standard` instead for Basic tier. Possible - * values include: 'Free', 'Basic', 'Standard', 'Premium' + * `Basic` is deprecated, use `Standard` instead. Possible values include: + * 'Free', 'Basic', 'Standard', 'Premium' */ tier?: SignalRSkuTier; /** @@ -350,14 +350,14 @@ export interface SignalRResource extends TrackedResource { */ readonly hostName?: string; /** - * @member {number} [publicPort] The publicly accessibly port of the SignalR + * @member {number} [publicPort] The publicly accessible port of the SignalR * service which is designed for browser/client side usage. * **NOTE: This property will not be serialized. It can only be populated by * the server.** */ readonly publicPort?: number; /** - * @member {number} [serverPort] The publicly accessibly port of the SignalR + * @member {number} [serverPort] The publicly accessible port of the SignalR * service which is designed for customer server side usage. * **NOTE: This property will not be serialized. It can only be populated by * the server.** @@ -471,6 +471,68 @@ export interface SignalRCreateParameters extends SignalRUpdateParameters { location: string; } +/** + * @interface + * An interface representing SignalRFeature. + * Feature of a SignalR resource, which controls the SignalR runtime behavior. + * + */ +export interface SignalRFeature { + /** + * @member {string} value Value of the feature flag. See Azure SignalR + * service document https://docs.microsoft.com/en-us/azure/azure-signalr/ for + * allowed values. + */ + value: string; + /** + * @member {{ [propertyName: string]: string }} [properties] Optional + * properties related to this feature. + */ + properties?: { [propertyName: string]: string }; +} + +/** + * @interface + * An interface representing SignalRFeaturesParameters. + * Parameters for SignalR service instance features management opreations. + * + */ +export interface SignalRFeaturesParameters { + /** + * @member {SignalRFeature[]} features List of features. + * + * If certain feature is not present, SignalR service will remain it + * unchanged or use the global default value. + * Note that, default value doesn't mean "false". It varies in terms of + * different FeatureFlags. + */ + features: SignalRFeature[]; +} + +/** + * @interface + * An interface representing SignalRFeatureList. + * A class that represents a list of SignalRFeatures related to SignalR + * resource. + * + */ +export interface SignalRFeatureList { + /** + * @member {SignalRFeature[]} [value] List of features. + * Note that, if a feature is not included in the list, which only means user + * never set it explicitly rather than 'false'. + * In this case, SignalR service will use a globally default value which + * might be 'true' or 'false'. + */ + value?: SignalRFeature[]; + /** + * @member {string} [nextLink] The URL the client should use to fetch the + * next page (per server side paging). + * It's null for now, added for future use. + */ + nextLink?: string; +} + /** * @interface * An interface representing SignalRUsageName. @@ -581,6 +643,21 @@ export interface SignalRUpdateOptionalParams extends msRest.RequestOptionsBase { parameters?: SignalRUpdateParameters; } +/** + * @interface + * An interface representing SignalRSwitchFeaturesOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface SignalRSwitchFeaturesOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {SignalRFeaturesParameters} [parameters] Parameters that describes + * the SignalR resource features opreation. + */ + parameters?: SignalRFeaturesParameters; +} + /** * @interface * An interface representing SignalRBeginRegenerateKeyOptionalParams. @@ -626,6 +703,21 @@ export interface SignalRBeginUpdateOptionalParams extends msRest.RequestOptionsB parameters?: SignalRUpdateParameters; } +/** + * @interface + * An interface representing SignalRBeginSwitchFeaturesOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface SignalRBeginSwitchFeaturesOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {SignalRFeaturesParameters} [parameters] Parameters that describes + * the SignalR resource features opreation. + */ + parameters?: SignalRFeaturesParameters; +} + /** * @interface * An interface representing SignalRManagementClientOptions. @@ -803,6 +895,30 @@ export type ApiVersion9 = '2018-03-01-preview' | '2018-10-01'; */ export type ApiVersion10 = '2018-03-01-preview' | '2018-10-01'; +/** + * Defines values for ApiVersion11. + * Possible values include: '2018-03-01-preview', '2018-10-01' + * @readonly + * @enum {string} + */ +export type ApiVersion11 = '2018-03-01-preview' | '2018-10-01'; + +/** + * Defines values for ApiVersion12. + * Possible values include: '2018-03-01-preview', '2018-10-01' + * @readonly + * @enum {string} + */ +export type ApiVersion12 = '2018-03-01-preview' | '2018-10-01'; + +/** + * Defines values for ApiVersion13. + * Possible values include: '2018-03-01-preview', '2018-10-01' + * @readonly + * @enum {string} + */ +export type ApiVersion13 = '2018-03-01-preview' | '2018-10-01'; + /** * Contains response data for the list operation. */ @@ -993,6 +1109,44 @@ export type SignalRUpdateResponse = SignalRResource & { }; }; +/** + * Contains response data for the switchFeatures operation. + */ +export type SignalRSwitchFeaturesResponse = SignalRFeatureList & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: SignalRFeatureList; + }; +}; + +/** + * Contains response data for the listFeatures operation. + */ +export type SignalRListFeaturesResponse = SignalRFeatureList & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: SignalRFeatureList; + }; +}; + /** * Contains response data for the beginRegenerateKey operation. */ @@ -1050,6 +1204,25 @@ export type SignalRBeginUpdateResponse = SignalRResource & { }; }; +/** + * Contains response data for the beginSwitchFeatures operation. + */ +export type SignalRBeginSwitchFeaturesResponse = SignalRFeatureList & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: SignalRFeatureList; + }; +}; + /** * Contains response data for the listBySubscriptionNext operation. */ diff --git a/packages/@azure/arm-signalr/lib/models/mappers.ts b/packages/@azure/arm-signalr/lib/models/mappers.ts index 98a28ec8463a..2dff7b7d95d3 100644 --- a/packages/@azure/arm-signalr/lib/models/mappers.ts +++ b/packages/@azure/arm-signalr/lib/models/mappers.ts @@ -557,6 +557,98 @@ export const SignalRCreateParameters: msRest.CompositeMapper = { } }; +export const SignalRFeature: msRest.CompositeMapper = { + serializedName: "SignalRFeature", + type: { + name: "Composite", + className: "SignalRFeature", + modelProperties: { + flag: { + required: true, + isConstant: true, + serializedName: "flag", + defaultValue: 'ServiceMode', + type: { + name: "String" + } + }, + value: { + required: true, + serializedName: "value", + constraints: { + MaxLength: 128, + MinLength: 1 + }, + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const SignalRFeaturesParameters: msRest.CompositeMapper = { + serializedName: "SignalRFeaturesParameters", + type: { + name: "Composite", + className: "SignalRFeaturesParameters", + modelProperties: { + features: { + required: true, + serializedName: "features", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SignalRFeature" + } + } + } + } + } + } +}; + +export const SignalRFeatureList: msRest.CompositeMapper = { + serializedName: "SignalRFeatureList", + type: { + name: "Composite", + className: "SignalRFeatureList", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SignalRFeature" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + export const SignalRUsageName: msRest.CompositeMapper = { serializedName: "SignalRUsageName", type: { diff --git a/packages/@azure/arm-signalr/lib/models/signalRMappers.ts b/packages/@azure/arm-signalr/lib/models/signalRMappers.ts index 0696fbf4de7c..9eb6b6b20409 100644 --- a/packages/@azure/arm-signalr/lib/models/signalRMappers.ts +++ b/packages/@azure/arm-signalr/lib/models/signalRMappers.ts @@ -22,6 +22,9 @@ export { RegenerateKeyParameters, SignalRCreateParameters, SignalRUpdateParameters, - SignalRCreateOrUpdateProperties + SignalRCreateOrUpdateProperties, + SignalRFeaturesParameters, + SignalRFeature, + SignalRFeatureList } from "../models/mappers"; diff --git a/packages/@azure/arm-signalr/lib/operations/signalR.ts b/packages/@azure/arm-signalr/lib/operations/signalR.ts index b8c1f6b334ca..6d0154b94c50 100644 --- a/packages/@azure/arm-signalr/lib/operations/signalR.ts +++ b/packages/@azure/arm-signalr/lib/operations/signalR.ts @@ -233,6 +233,67 @@ export class SignalR { .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; } + /** + * Operation to restart a SignalR service. + * @param 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. + * @param resourceName The name of the SignalR resource. + * @param [options] The optional parameters + * @returns Promise + */ + restart(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginRestart(resourceGroupName,resourceName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Switch on/off SignalR resource features. + * @param 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. + * @param resourceName The name of the SignalR resource. + * @param [options] The optional parameters + * @returns Promise + */ + switchFeatures(resourceGroupName: string, resourceName: string, options?: Models.SignalRSwitchFeaturesOptionalParams): Promise { + return this.beginSwitchFeatures(resourceGroupName,resourceName,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * List SignalR resource features. + * @param 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. + * @param resourceName The name of the SignalR resource. + * @param [options] The optional parameters + * @returns Promise + */ + listFeatures(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param 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. + * @param resourceName The name of the SignalR resource. + * @param callback The callback + */ + listFeatures(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; + /** + * @param 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. + * @param resourceName The name of the SignalR resource. + * @param options The optional parameters + * @param callback The callback + */ + listFeatures(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listFeatures(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + resourceName, + options + }, + listFeaturesOperationSpec, + callback) as Promise; + } + /** * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the * same time. @@ -310,6 +371,44 @@ export class SignalR { options); } + /** + * Operation to restart a SignalR service. + * @param 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. + * @param resourceName The name of the SignalR resource. + * @param [options] The optional parameters + * @returns Promise + */ + beginRestart(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + resourceName, + options + }, + beginRestartOperationSpec, + options); + } + + /** + * Switch on/off SignalR resource features. + * @param 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. + * @param resourceName The name of the SignalR resource. + * @param [options] The optional parameters + * @returns Promise + */ + beginSwitchFeatures(resourceGroupName: string, resourceName: string, options?: Models.SignalRBeginSwitchFeaturesOptionalParams): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + resourceName, + options + }, + beginSwitchFeaturesOperationSpec, + options); + } + /** * Handles requests to list all resources in a subscription. * @param nextPageLink The NextLink from the previous successful call to List operation. @@ -497,6 +596,31 @@ const getOperationSpec: msRest.OperationSpec = { serializer }; +const listFeaturesOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/SignalR/{resourceName}/listFeatures", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SignalRFeatureList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + const beginRegenerateKeyOperationSpec: msRest.OperationSpec = { httpMethod: "POST", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/SignalR/{resourceName}/regenerateKey", @@ -619,6 +743,62 @@ const beginUpdateOperationSpec: msRest.OperationSpec = { serializer }; +const beginRestartOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/SignalR/{resourceName}/restart", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginSwitchFeaturesOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/SignalR/{resourceName}/switchFeatures", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: [ + "options", + "parameters" + ], + mapper: Mappers.SignalRFeaturesParameters + }, + responses: { + 200: { + bodyMapper: Mappers.SignalRFeatureList + }, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { httpMethod: "GET", baseUrl: "https://management.azure.com",