Skip to content
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
6 changes: 3 additions & 3 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 13 additions & 10 deletions sdk/chaos/arm-chaos/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# Release History

## 1.0.0-beta.2 (2022-09-30)

**Features**

## 1.0.0-beta.2 (Unreleased)

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes

- Added Interface Filter
- Added Interface SimpleFilter
- Added Interface SimpleFilterParameters
- Added Type Alias FilterType
- Added Type Alias FilterUnion
- Interface Selector has a new optional parameter filter
- Added Enum KnownFilterType


## 1.0.0-beta.1 (2022-09-13)

The package of @azure/arm-chaos is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart).
2 changes: 1 addition & 1 deletion sdk/chaos/arm-chaos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Chaos Management Client

### Currently supported environments

- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule)
- [LTS versions of Node.js](https://nodejs.org/about/releases/)
- Latest versions of Safari, Chrome, Edge and Firefox.

See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
Expand Down
8 changes: 4 additions & 4 deletions sdk/chaos/arm-chaos/_meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"commit": "2acf276d94cf6a8767aaa21b3b6038685eadf20b",
"commit": "001f57e8c17b508a5de551697ccc18e81bb0d93e",
"readme": "specification/chaos/resource-manager/readme.md",
"autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\chaos\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.1.20220727.1 --generate-sample=true",
"autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/chaos/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.1",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"release_tool": "@azure-tools/js-sdk-release-tools@2.4.2",
"use": "@autorest/typescript@6.0.0-rc.1.20220727.1"
"release_tool": "@azure-tools/js-sdk-release-tools@2.4.3",
"use": "@autorest/typescript@6.0.0-rc.1"
}
19 changes: 5 additions & 14 deletions sdk/chaos/arm-chaos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
"module": "./dist-esm/src/index.js",
"types": "./types/arm-chaos.d.ts",
"devDependencies": {
"@microsoft/api-extractor": "^7.31.1",
"@microsoft/api-extractor": "7.18.11",
"@rollup/plugin-commonjs": "^21.0.1",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-multi-entry": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.1.3",
"mkdirp": "^1.0.4",
"rollup": "^2.66.1",
"rollup-plugin-sourcemaps": "^0.6.3",
"typescript": "~4.6.0",
"typescript": "~4.2.0",
"uglify-js": "^3.4.9",
"rimraf": "^3.0.0",
"@azure/identity": "^2.0.1",
Expand All @@ -44,8 +44,7 @@
"@types/chai": "^4.2.8",
"chai": "^4.2.0",
"cross-env": "^7.0.2",
"@azure/dev-tool": "^1.0.0",
"@azure/arm-cosmosdb": "^15.2.0"
"@azure/dev-tool": "^1.0.0"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/chaos/arm-chaos",
"repository": {
Expand Down Expand Up @@ -108,13 +107,5 @@
}
]
},
"autoPublish": true,
"//sampleConfiguration": {
"productName": "",
"productSlugs": [
"azure"
],
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-chaos?view=azure-node-preview"
}
}
"autoPublish": true
}
28 changes: 28 additions & 0 deletions sdk/chaos/arm-chaos/review/arm-chaos.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,17 @@ export interface ExperimentStatusListResult {
readonly value?: ExperimentStatus[];
}

// @public
export interface Filter {
type: "Simple";
}

// @public
export type FilterType = string;

// @public (undocumented)
export type FilterUnion = Filter | SimpleFilter;

// @public
export interface KeyValuePair {
key: string;
Expand All @@ -458,6 +469,11 @@ export enum KnownCreatedByType {
User = "User"
}

// @public
export enum KnownFilterType {
Simple = "Simple"
}

// @public
export enum KnownOrigin {
System = "system",
Expand Down Expand Up @@ -529,6 +545,7 @@ export type ResourceIdentityType = "None" | "SystemAssigned";

// @public
export interface Selector {
filter?: FilterUnion;
id: string;
targets: TargetReference[];
type: SelectorType;
Expand All @@ -537,6 +554,17 @@ export interface Selector {
// @public
export type SelectorType = "Percent" | "Random" | "Tag" | "List";

// @public
export interface SimpleFilter extends Filter {
parameters?: SimpleFilterParameters;
type: "Simple";
}

// @public
export interface SimpleFilterParameters {
zones?: string[];
}

// @public
export interface Step {
branches: Branch[];
Expand Down
55 changes: 24 additions & 31 deletions sdk/chaos/arm-chaos/src/chaosManagementClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ import {
import * as coreAuth from "@azure/core-auth";
import {
CapabilitiesImpl,
CapabilityTypesImpl,
ExperimentsImpl,
OperationsImpl,
TargetsImpl,
TargetTypesImpl,
CapabilityTypesImpl
TargetsImpl
} from "./operations";
import {
Capabilities,
CapabilityTypes,
Experiments,
Operations,
Targets,
TargetTypes,
CapabilityTypes
Targets
} from "./operationsInterfaces";
import { ChaosManagementClientOptionalParams } from "./models";

Expand Down Expand Up @@ -84,47 +84,40 @@ export class ChaosManagementClient extends coreClient.ServiceClient {
};
super(optionsWithDefaults);

let bearerTokenAuthenticationPolicyFound: boolean = false;
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
(pipelinePolicy) =>
pipelinePolicy.name ===
coreRestPipeline.bearerTokenAuthenticationPolicyName
);
}
if (
!options ||
!options.pipeline ||
options.pipeline.getOrderedPolicies().length == 0 ||
!bearerTokenAuthenticationPolicyFound
) {
this.pipeline.removePolicy({
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
});
this.pipeline.addPolicy(
coreRestPipeline.bearerTokenAuthenticationPolicy({
credential: credentials,
scopes: `${optionsWithDefaults.credentialScopes}`,
challengeCallbacks: {
authorizeRequestOnChallenge:
coreClient.authorizeRequestOnClaimChallenge
}
})
);
if (!bearerTokenAuthenticationPolicyFound) {
this.pipeline.removePolicy({
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
});
this.pipeline.addPolicy(
coreRestPipeline.bearerTokenAuthenticationPolicy({
scopes: `${optionsWithDefaults.baseUri}/.default`,
challengeCallbacks: {
authorizeRequestOnChallenge:
coreClient.authorizeRequestOnClaimChallenge
}
})
);
}
}
// Parameter assignments
this.subscriptionId = subscriptionId;

// Assigning values to Constant parameters
this.$host = options.$host || "https://management.azure.com";
this.apiVersion = options.apiVersion || "2022-07-01-preview";
this.apiVersion = options.apiVersion || "2022-10-01-preview";
this.capabilities = new CapabilitiesImpl(this);
this.capabilityTypes = new CapabilityTypesImpl(this);
this.experiments = new ExperimentsImpl(this);
this.operations = new OperationsImpl(this);
this.targets = new TargetsImpl(this);
this.targetTypes = new TargetTypesImpl(this);
this.capabilityTypes = new CapabilityTypesImpl(this);
this.targets = new TargetsImpl(this);
this.addCustomApiVersionPolicy(options.apiVersion);
}

Expand Down Expand Up @@ -157,9 +150,9 @@ export class ChaosManagementClient extends coreClient.ServiceClient {
}

capabilities: Capabilities;
capabilityTypes: CapabilityTypes;
experiments: Experiments;
operations: Operations;
targets: Targets;
targetTypes: TargetTypes;
capabilityTypes: CapabilityTypes;
targets: Targets;
}
Loading