From d162c2f2f5c7d0334df62dc38e48d593cafa74c5 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Mon, 4 May 2020 23:27:38 +0000 Subject: [PATCH] Generated from 58373fef21591b872a0755f61d6b27e1a27aab74 updated tag --- sdk/servicefabric/servicefabric/LICENSE.txt | 2 +- sdk/servicefabric/servicefabric/README.md | 55 ++++--- .../servicefabric/src/models/index.ts | 139 ++++++++++++------ .../servicefabric/src/models/mappers.ts | 81 ++++++++-- .../src/models/meshApplicationMappers.ts | 1 + .../src/models/meshServiceMappers.ts | 1 + .../servicefabric/src/serviceFabricClient.ts | 2 +- 7 files changed, 193 insertions(+), 88 deletions(-) diff --git a/sdk/servicefabric/servicefabric/LICENSE.txt b/sdk/servicefabric/servicefabric/LICENSE.txt index b73b4a1293c3..ea8fb1516028 100644 --- a/sdk/servicefabric/servicefabric/LICENSE.txt +++ b/sdk/servicefabric/servicefabric/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2019 Microsoft +Copyright (c) 2020 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/sdk/servicefabric/servicefabric/README.md b/sdk/servicefabric/servicefabric/README.md index 6f87405556c3..0395ae361b66 100644 --- a/sdk/servicefabric/servicefabric/README.md +++ b/sdk/servicefabric/servicefabric/README.md @@ -15,35 +15,36 @@ npm install @azure/servicefabric ### How to use -#### nodejs - Authentication, client creation and getClusterManifest as an example written in TypeScript. +#### nodejs - Authentication, client creation and getClusterManifest as an example written in TypeScript. ##### Install @azure/ms-rest-nodeauth - Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`. - ```bash npm install @azure/ms-rest-nodeauth@"^3.0.0" ``` ##### Sample code -[Service Fabric cluster security scenarios](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-security) - ```typescript -import { ServiceFabricClient } from "@azure/servicefabric"; -const baseUri = ":"; -const client = new ServiceFabricClient({ - baseUri +import * as msRest from "@azure/ms-rest-js"; +import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; +import { ServiceFabricClient, ServiceFabricModels, ServiceFabricMappers } from "@azure/servicefabric"; +const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; + +msRestNodeAuth.interactiveLogin().then((creds) => { + const client = new ServiceFabricClient(creds, subscriptionId); + const timeout = 1; + client.getClusterManifest(timeout).then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.error(err); }); -client - .getClusterManifest() - .then((result) => { - console.log(result.manifest); - }) - .catch(console.error); ``` -#### browser - Authentication, client creation and getClusterManifest as an example written in JavaScript. +#### browser - Authentication, client creation and getClusterManifest as an example written in JavaScript. ##### Install @azure/ms-rest-browserauth @@ -56,29 +57,35 @@ npm install @azure/ms-rest-browserauth See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. - index.html - ```html @azure/servicefabric sample + diff --git a/sdk/servicefabric/servicefabric/src/models/index.ts b/sdk/servicefabric/servicefabric/src/models/index.ts index fa1cfb12eb3d..fed7bf43aa8b 100644 --- a/sdk/servicefabric/servicefabric/src/models/index.ts +++ b/sdk/servicefabric/servicefabric/src/models/index.ts @@ -1219,45 +1219,30 @@ export interface ApplicationInfo { } /** - * Describes capacity information for a custom resource balancing metric. This can be used to limit - * the total consumption of this metric by the services of this application. + * Describes load information for a custom resource balancing metric. This can be used to limit the + * total consumption of this metric by the services of this application. */ -export interface ApplicationMetricDescription { +export interface ApplicationLoadMetricInformation { /** * The name of the metric. */ name?: string; /** - * The maximum node capacity for Service Fabric application. - * This is the maximum Load for an instance of this application on a single node. Even if the - * capacity of node is greater than this value, Service Fabric will limit the total load of - * services within the application on each node to this value. - * If set to zero, capacity for this metric is unlimited on each node. - * When creating a new application with application capacity defined, the product of MaximumNodes - * and this value must always be smaller than or equal to TotalApplicationCapacity. - * When updating existing application with application capacity, the product of MaximumNodes and - * this value must always be smaller than or equal to TotalApplicationCapacity. - */ - maximumCapacity?: number; - /** - * The node reservation capacity for Service Fabric application. - * This is the amount of load which is reserved on nodes which have instances of this - * application. - * If MinimumNodes is specified, then the product of these values will be the capacity reserved - * in the cluster for the application. + * This is the capacity reserved in the cluster for the application. + * It's the product of NodeReservationCapacity and MinimumNodes. * If set to zero, no capacity is reserved for this metric. - * When setting application capacity or when updating application capacity; this value must be + * When setting application capacity or when updating application capacity this value must be * smaller than or equal to MaximumCapacity for each metric. */ reservationCapacity?: number; /** - * The total metric capacity for Service Fabric application. - * This is the total metric capacity for this application in the cluster. Service Fabric will try - * to limit the sum of loads of services within the application to this value. - * When creating a new application with application capacity defined, the product of MaximumNodes - * and MaximumCapacity must always be smaller than or equal to this value. + * Total capacity for this metric in this application instance. */ - totalApplicationCapacity?: number; + applicationCapacity?: number; + /** + * Current load for this metric in this application instance. + */ + applicationLoad?: number; } /** @@ -1291,9 +1276,9 @@ export interface ApplicationLoadInfo { */ nodeCount?: number; /** - * List of application capacity metric description. + * List of application load metric information. */ - applicationLoadMetricInformation?: ApplicationMetricDescription[]; + applicationLoadMetricInformation?: ApplicationLoadMetricInformation[]; } /** @@ -6597,6 +6582,48 @@ export interface WaitingChaosEvent { reason?: string; } +/** + * Describes capacity information for a custom resource balancing metric. This can be used to limit + * the total consumption of this metric by the services of this application. + */ +export interface ApplicationMetricDescription { + /** + * The name of the metric. + */ + name?: string; + /** + * The maximum node capacity for Service Fabric application. + * This is the maximum Load for an instance of this application on a single node. Even if the + * capacity of node is greater than this value, Service Fabric will limit the total load of + * services within the application on each node to this value. + * If set to zero, capacity for this metric is unlimited on each node. + * When creating a new application with application capacity defined, the product of MaximumNodes + * and this value must always be smaller than or equal to TotalApplicationCapacity. + * When updating existing application with application capacity, the product of MaximumNodes and + * this value must always be smaller than or equal to TotalApplicationCapacity. + */ + maximumCapacity?: number; + /** + * The node reservation capacity for Service Fabric application. + * This is the amount of load which is reserved on nodes which have instances of this + * application. + * If MinimumNodes is specified, then the product of these values will be the capacity reserved + * in the cluster for the application. + * If set to zero, no capacity is reserved for this metric. + * When setting application capacity or when updating application capacity; this value must be + * smaller than or equal to MaximumCapacity for each metric. + */ + reservationCapacity?: number; + /** + * The total metric capacity for Service Fabric application. + * This is the total metric capacity for this application in the cluster. Service Fabric will try + * to limit the sum of loads of services within the application to this value. + * When creating a new application with application capacity defined, the product of MaximumNodes + * and MaximumCapacity must always be smaller than or equal to this value. + */ + totalApplicationCapacity?: number; +} + /** * Describes capacity information for services of this application. This description can be used * for describing the following. @@ -7393,7 +7420,7 @@ export interface StatelessServiceDescription { * The endpoint exposed on this instance is removed prior to starting the delay, which prevents * new connections to this instance. * In addition, clients that have subscribed to service endpoint change - * events(https://docs.microsoft.com/en-us/dotnet/api/system.fabric.fabricclient.servicemanagementclient.registerservicenotificationfilterasync), + * events(https://docs.microsoft.com/dotnet/api/system.fabric.fabricclient.servicemanagementclient.registerservicenotificationfilterasync), * can do * the following upon receiving the endpoint removal notification: * - Stop sending new requests to this instance. @@ -8202,7 +8229,7 @@ export interface StatelessServiceUpdateDescription { * The endpoint exposed on this instance is removed prior to starting the delay, which prevents * new connections to this instance. * In addition, clients that have subscribed to service endpoint change - * events(https://docs.microsoft.com/en-us/dotnet/api/system.fabric.fabricclient.servicemanagementclient.registerservicenotificationfilterasync), + * events(https://docs.microsoft.com/dotnet/api/system.fabric.fabricclient.servicemanagementclient.registerservicenotificationfilterasync), * can do * the following upon receiving the endpoint removal notification: * - Stop sending new requests to this instance. @@ -8372,15 +8399,15 @@ export interface ImageStoreInfo { /** * the ImageStore's file system usage for copied application and cluster packages. [Removing * application and cluster - * packages](https://docs.microsoft.com/en-us/rest/api/servicefabric/sfclient-api-deleteimagestorecontent) + * packages](https://docs.microsoft.com/rest/api/servicefabric/sfclient-api-deleteimagestorecontent) * will free up this space. */ usedByCopy?: UsageInfo; /** * the ImageStore's file system usage for registered and cluster packages. [Unregistering - * application](https://docs.microsoft.com/en-us/rest/api/servicefabric/sfclient-api-unprovisionapplicationtype) + * application](https://docs.microsoft.com/rest/api/servicefabric/sfclient-api-unprovisionapplicationtype) * and [cluster - * packages](https://docs.microsoft.com/en-us/rest/api/servicefabric/sfclient-api-unprovisionapplicationtype) + * packages](https://docs.microsoft.com/rest/api/servicefabric/sfclient-api-unprovisionapplicationtype) * will free up this space. */ usedByRegister?: UsageInfo; @@ -14519,23 +14546,26 @@ export interface ProbeTcpSocket { */ export interface Probe { /** - * The initial delay in seconds to start executing probe once code package has started. + * The initial delay in seconds to start executing probe once codepackage has started. Default + * value: 0. */ initialDelaySeconds?: number; /** - * Periodic seconds to execute probe. + * Periodic seconds to execute probe. Default value: 10. */ periodSeconds?: number; /** - * Period after which probe is considered as failed if it hasn't completed successfully. + * Period after which probe is considered as failed if it hasn't completed successfully. Default + * value: 1. */ timeoutSeconds?: number; /** - * The count of successful probe executions after which probe is considered success. + * The count of successful probe executions after which probe is considered success. Default + * value: 1. */ successThreshold?: number; /** - * The count of failures after which probe is considered failed. + * The count of failures after which probe is considered failed. Default value: 3. */ failureThreshold?: number; /** @@ -14571,7 +14601,7 @@ export interface ContainerCodePackageProperties { /** * Override for the default entry point in the container. */ - entrypoint?: string; + entryPoint?: string; /** * Command array to execute within the container in exec form. */ @@ -14635,7 +14665,7 @@ export interface ContainerCodePackageProperties { /** * Contains the possible cases for ExecutionPolicy. */ -export type ExecutionPolicyUnion = ExecutionPolicy | RunToCompletionExecutionPolicy; +export type ExecutionPolicyUnion = ExecutionPolicy | DefaultExecutionPolicy | RunToCompletionExecutionPolicy; /** * The execution policy of the service @@ -15040,16 +15070,29 @@ export interface AutoScalingResourceMetric { } /** - * The run to completion execution policy + * The default execution policy. Always restart the service if an exit occurs. + */ +export interface DefaultExecutionPolicy { + /** + * Polymorphic Discriminator + */ + type: "Default"; +} + +/** + * The run to completion execution policy, the service will perform its desired operation and + * complete successfully. If the service encounters failure, it will restarted based on restart + * policy specified. If the service completes its operation successfully, it will not be restarted + * again. */ export interface RunToCompletionExecutionPolicy { /** * Polymorphic Discriminator */ - type: "runToCompletion"; + type: "RunToCompletion"; /** * Enumerates the restart policy for RunToCompletionExecutionPolicy. Possible values include: - * 'onFailure', 'never' + * 'OnFailure', 'Never' */ restart: RestartPolicy; } @@ -20400,19 +20443,19 @@ export type AutoScalingTriggerKind = 'AverageLoad'; /** * Defines values for ExecutionPolicyType. - * Possible values include: 'runToCompletion' + * Possible values include: 'Default', 'RunToCompletion' * @readonly * @enum {string} */ -export type ExecutionPolicyType = 'runToCompletion'; +export type ExecutionPolicyType = 'Default' | 'RunToCompletion'; /** * Defines values for RestartPolicy. - * Possible values include: 'onFailure', 'never' + * Possible values include: 'OnFailure', 'Never' * @readonly * @enum {string} */ -export type RestartPolicy = 'onFailure' | 'never'; +export type RestartPolicy = 'OnFailure' | 'Never'; /** * Defines values for NodeStatusFilter. diff --git a/sdk/servicefabric/servicefabric/src/models/mappers.ts b/sdk/servicefabric/servicefabric/src/models/mappers.ts index 566215cfd85f..361e06a2d497 100644 --- a/sdk/servicefabric/servicefabric/src/models/mappers.ts +++ b/sdk/servicefabric/servicefabric/src/models/mappers.ts @@ -1226,11 +1226,11 @@ export const ApplicationInfo: msRest.CompositeMapper = { } }; -export const ApplicationMetricDescription: msRest.CompositeMapper = { - serializedName: "ApplicationMetricDescription", +export const ApplicationLoadMetricInformation: msRest.CompositeMapper = { + serializedName: "ApplicationLoadMetricInformation", type: { name: "Composite", - className: "ApplicationMetricDescription", + className: "ApplicationLoadMetricInformation", modelProperties: { name: { serializedName: "Name", @@ -1238,20 +1238,20 @@ export const ApplicationMetricDescription: msRest.CompositeMapper = { name: "String" } }, - maximumCapacity: { - serializedName: "MaximumCapacity", + reservationCapacity: { + serializedName: "ReservationCapacity", type: { name: "Number" } }, - reservationCapacity: { - serializedName: "ReservationCapacity", + applicationCapacity: { + serializedName: "ApplicationCapacity", type: { name: "Number" } }, - totalApplicationCapacity: { - serializedName: "TotalApplicationCapacity", + applicationLoad: { + serializedName: "ApplicationLoad", type: { name: "Number" } @@ -1297,7 +1297,7 @@ export const ApplicationLoadInfo: msRest.CompositeMapper = { element: { type: { name: "Composite", - className: "ApplicationMetricDescription" + className: "ApplicationLoadMetricInformation" } } } @@ -7326,6 +7326,40 @@ export const WaitingChaosEvent: msRest.CompositeMapper = { } }; +export const ApplicationMetricDescription: msRest.CompositeMapper = { + serializedName: "ApplicationMetricDescription", + type: { + name: "Composite", + className: "ApplicationMetricDescription", + modelProperties: { + name: { + serializedName: "Name", + type: { + name: "String" + } + }, + maximumCapacity: { + serializedName: "MaximumCapacity", + type: { + name: "Number" + } + }, + reservationCapacity: { + serializedName: "ReservationCapacity", + type: { + name: "Number" + } + }, + totalApplicationCapacity: { + serializedName: "TotalApplicationCapacity", + type: { + name: "Number" + } + } + } + } +}; + export const ApplicationCapacityDescription: msRest.CompositeMapper = { serializedName: "ApplicationCapacityDescription", type: { @@ -16720,30 +16754,35 @@ export const Probe: msRest.CompositeMapper = { modelProperties: { initialDelaySeconds: { serializedName: "initialDelaySeconds", + defaultValue: 0, type: { name: "Number" } }, periodSeconds: { serializedName: "periodSeconds", + defaultValue: 10, type: { name: "Number" } }, timeoutSeconds: { serializedName: "timeoutSeconds", + defaultValue: 1, type: { name: "Number" } }, successThreshold: { serializedName: "successThreshold", + defaultValue: 1, type: { name: "Number" } }, failureThreshold: { serializedName: "failureThreshold", + defaultValue: 3, type: { name: "Number" } @@ -16800,8 +16839,8 @@ export const ContainerCodePackageProperties: msRest.CompositeMapper = { className: "ImageRegistryCredential" } }, - entrypoint: { - serializedName: "entrypoint", + entryPoint: { + serializedName: "entryPoint", type: { name: "String" } @@ -17580,8 +17619,21 @@ export const AutoScalingResourceMetric: msRest.CompositeMapper = { } }; +export const DefaultExecutionPolicy: msRest.CompositeMapper = { + serializedName: "Default", + type: { + name: "Composite", + polymorphicDiscriminator: ExecutionPolicy.type.polymorphicDiscriminator, + uberParent: "ExecutionPolicy", + className: "DefaultExecutionPolicy", + modelProperties: { + ...ExecutionPolicy.type.modelProperties + } + } +}; + export const RunToCompletionExecutionPolicy: msRest.CompositeMapper = { - serializedName: "runToCompletion", + serializedName: "RunToCompletion", type: { name: "Composite", polymorphicDiscriminator: ExecutionPolicy.type.polymorphicDiscriminator, @@ -18191,7 +18243,8 @@ export const discriminators = { 'AutoScalingMechanism.AddRemoveReplica' : AddRemoveReplicaScalingMechanism, 'AutoScalingMetric' : AutoScalingMetric, 'AutoScalingMetric.Resource' : AutoScalingResourceMetric, - 'ExecutionPolicy.runToCompletion' : RunToCompletionExecutionPolicy, + 'ExecutionPolicy.Default' : DefaultExecutionPolicy, + 'ExecutionPolicy.RunToCompletion' : RunToCompletionExecutionPolicy, 'AutoScalingTrigger.AverageLoad' : AverageLoadScalingTrigger }; diff --git a/sdk/servicefabric/servicefabric/src/models/meshApplicationMappers.ts b/sdk/servicefabric/servicefabric/src/models/meshApplicationMappers.ts index cdbbd872531a..080bfb40338c 100644 --- a/sdk/servicefabric/servicefabric/src/models/meshApplicationMappers.ts +++ b/sdk/servicefabric/servicefabric/src/models/meshApplicationMappers.ts @@ -26,6 +26,7 @@ export { ContainerInstanceView, ContainerLabel, ContainerState, + DefaultExecutionPolicy, DiagnosticsDescription, DiagnosticsRef, DiagnosticsSinkProperties, diff --git a/sdk/servicefabric/servicefabric/src/models/meshServiceMappers.ts b/sdk/servicefabric/servicefabric/src/models/meshServiceMappers.ts index 2e4c06f514a4..8bcd16fad096 100644 --- a/sdk/servicefabric/servicefabric/src/models/meshServiceMappers.ts +++ b/sdk/servicefabric/servicefabric/src/models/meshServiceMappers.ts @@ -23,6 +23,7 @@ export { ContainerInstanceView, ContainerLabel, ContainerState, + DefaultExecutionPolicy, DiagnosticsRef, EndpointProperties, EndpointRef, diff --git a/sdk/servicefabric/servicefabric/src/serviceFabricClient.ts b/sdk/servicefabric/servicefabric/src/serviceFabricClient.ts index db80ae7558f5..2c9afb6f6d11 100644 --- a/sdk/servicefabric/servicefabric/src/serviceFabricClient.ts +++ b/sdk/servicefabric/servicefabric/src/serviceFabricClient.ts @@ -1024,7 +1024,7 @@ class ServiceFabricClient extends ServiceFabricClientContext { * number of Down seed nodes. If necessary, add more nodes to the primary node type to achieve * this. For standalone cluster, if the Down seed node is not expected to come back up with its * state intact, please remove the node from the cluster, see - * https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-windows-server-add-remove-nodes + * https://docs.microsoft.com/azure/service-fabric/service-fabric-cluster-windows-server-add-remove-nodes * @summary Notifies Service Fabric that the persisted state on a node has been permanently removed * or lost. * @param nodeName The name of the node.