Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ReleasePR @azure/servicefabric] service Fabric 7.1 #8740

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk/servicefabric/servicefabric/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
55 changes: 31 additions & 24 deletions sdk/servicefabric/servicefabric/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<ServiceFabricURL>:<connection-port>";
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

Expand All @@ -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
<!DOCTYPE html>
<html lang="en">
<head>
<title>@azure/servicefabric sample</title>
<script src="node_modules/@azure/ms-rest-js/dist/msRest.browser.js"></script>
<script src="node_modules/@azure/ms-rest-browserauth/dist/msAuth.js"></script>
<script src="node_modules/@azure/servicefabric/dist/servicefabric.js"></script>
<script type="text/javascript">
var baseUri = "<ServiceFabricURL>:<connection-port>";
var client = new Azure.Servicefabric.ServiceFabricClient({
baseUri
const subscriptionId = "<Subscription_Id>";
const authManager = new msAuth.AuthManager({
clientId: "<client id for your Azure AD app>",
tenant: "<optional tenant for your organization>"
});
client
.getClusterManifest()
.then((result) => {
authManager.finalizeLogin().then((res) => {
if (!res.isLoggedIn) {
// may cause redirects
authManager.login();
}
const client = new Azure.Servicefabric.ServiceFabricClient(res.creds, subscriptionId);
const timeout = 1;
client.getClusterManifest(timeout).then((result) => {
console.log("The result is:");
console.log(result);
})
.catch((err) => {
}).catch((err) => {
console.log("An error occurred:");
console.error(err);
});
});
</script>
</head>
<body></body>
Expand Down
139 changes: 91 additions & 48 deletions sdk/servicefabric/servicefabric/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down Expand Up @@ -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[];
}

/**
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
/**
Expand Down Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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.
Expand Down
Loading