Skip to content

Commit

Permalink
[mgmt] quantum release (#28880)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazrael2119 authored Mar 18, 2024
1 parent d738efb commit e8109d6
Show file tree
Hide file tree
Showing 57 changed files with 1,804 additions and 1,161 deletions.
763 changes: 382 additions & 381 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

34 changes: 26 additions & 8 deletions sdk/quantum/arm-quantum/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,33 @@
# Release History

## 1.0.0-beta.2 (2024-03-12)

**Features**

## 1.0.0-beta.2 (Unreleased)
- Added operation Workspace.listKeys
- Added operation Workspace.regenerateKeys
- Added Interface ApiKey
- Added Interface APIKeys
- Added Interface ListKeysResult
- Added Interface WorkspaceListKeysOptionalParams
- Added Interface WorkspaceRegenerateKeysOptionalParams
- Added Interface WorkspaceResourceProperties
- Added Type Alias KeyType_2
- Added Type Alias WorkspaceListKeysResponse
- Interface QuantumWorkspace has a new optional parameter properties
- Interface Resource has a new optional parameter systemData
- Added Enum KnownKeyType

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes
**Breaking Changes**

- Interface QuantumWorkspace no longer has parameter endpointUri
- Interface QuantumWorkspace no longer has parameter providers
- Interface QuantumWorkspace no longer has parameter provisioningState
- Interface QuantumWorkspace no longer has parameter storageAccount
- Interface QuantumWorkspace no longer has parameter systemData
- Interface QuantumWorkspace no longer has parameter usable


## 1.0.0-beta.1 (2023-07-10)

The package of @azure/arm-quantum is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ).
2 changes: 1 addition & 1 deletion sdk/quantum/arm-quantum/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2023 Microsoft
Copyright (c) 2024 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
8 changes: 4 additions & 4 deletions sdk/quantum/arm-quantum/_meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"commit": "0f39a2d56070d2bc4251494525cb8af88583a938",
"commit": "c45a7f47c1901149828eb8a33c74898c554659c0",
"readme": "specification/quantum/resource-manager/readme.md",
"autorest_command": "autorest --version=3.9.3 --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\\quantum\\resource-manager\\readme.md --use=@autorest/[email protected].5 --generate-sample=true",
"autorest_command": "autorest --version=3.9.7 --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\\quantum\\resource-manager\\readme.md --use=@autorest/[email protected].17 --generate-sample=true",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"release_tool": "@azure-tools/[email protected].0",
"use": "@autorest/[email protected].5"
"release_tool": "@azure-tools/[email protected].4",
"use": "@autorest/[email protected].17"
}
2 changes: 1 addition & 1 deletion sdk/quantum/arm-quantum/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "js",
"TagPrefix": "js/quantum/arm-quantum",
"Tag": "js/quantum/arm-quantum_7d980c2b33"
"Tag": "js/quantum/arm-quantum_722240f12d"
}
18 changes: 9 additions & 9 deletions sdk/quantum/arm-quantum/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
"node": ">=18.0.0"
},
"dependencies": {
"@azure/core-lro": "^2.5.3",
"@azure/core-lro": "^2.5.4",
"@azure/abort-controller": "^1.0.0",
"@azure/core-paging": "^1.2.0",
"@azure/core-client": "^1.7.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-rest-pipeline": "^1.8.0",
"@azure/core-auth": "^1.6.0",
"@azure/core-rest-pipeline": "^1.14.0",
"tslib": "^2.2.0"
},
"keywords": [
Expand All @@ -32,19 +32,20 @@
"mkdirp": "^2.1.2",
"typescript": "~5.3.3",
"uglify-js": "^3.4.9",
"rimraf": "^5.0.5",
"rimraf": "^5.0.0",
"dotenv": "^16.0.0",
"@azure/dev-tool": "^1.0.0",
"@azure/identity": "^4.0.1",
"@azure-tools/test-recorder": "^3.0.0",
"@azure-tools/test-credential": "^1.0.0",
"mocha": "^10.0.0",
"@types/mocha": "^10.0.0",
"esm": "^3.2.18",
"@types/chai": "^4.2.8",
"chai": "^4.2.0",
"cross-env": "^7.0.2",
"@types/node": "^18.0.0",
"@azure/dev-tool": "^1.0.0",
"ts-node": "^10.0.0",
"@types/mocha": "^10.0.0"
"ts-node": "^10.0.0"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -77,7 +78,6 @@
"pack": "npm pack 2>&1",
"extract-api": "api-extractor run --local",
"lint": "echo skipped",
"audit": "echo skipped",
"clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
"build:node": "echo skipped",
"build:browser": "echo skipped",
Expand Down Expand Up @@ -115,4 +115,4 @@
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-quantum?view=azure-node-preview"
}
}
}
61 changes: 55 additions & 6 deletions sdk/quantum/arm-quantum/review/arm-quantum.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ import { OperationState } from '@azure/core-lro';
import { PagedAsyncIterableIterator } from '@azure/core-paging';
import { SimplePollerLike } from '@azure/core-lro';

// @public
export interface ApiKey {
createdAt?: Date;
readonly key?: string;
}

// @public
export interface APIKeys {
keys?: KeyType_2[];
}

// @public (undocumented)
export class AzureQuantumManagementClient extends coreClient.ServiceClient {
// (undocumented)
Expand Down Expand Up @@ -75,6 +86,10 @@ export interface ErrorResponse {
// @public
export function getContinuationToken(page: unknown): string | undefined;

// @public
type KeyType_2 = string;
export { KeyType_2 as KeyType }

// @public
export enum KnownCreatedByType {
Application = "Application",
Expand All @@ -83,6 +98,12 @@ export enum KnownCreatedByType {
User = "User"
}

// @public
export enum KnownKeyType {
Primary = "Primary",
Secondary = "Secondary"
}

// @public
export enum KnownProvisioningStatus {
Failed = "Failed",
Expand Down Expand Up @@ -116,6 +137,15 @@ export enum KnownUsableStatus {
Yes = "Yes"
}

// @public
export interface ListKeysResult {
apiKeyEnabled?: boolean;
readonly primaryConnectionString?: string;
primaryKey?: ApiKey;
readonly secondaryConnectionString?: string;
secondaryKey?: ApiKey;
}

// @public
export interface Offerings {
list(locationName: string, options?: OfferingsListOptionalParams): PagedAsyncIterableIterator<ProviderDescription>;
Expand Down Expand Up @@ -241,13 +271,8 @@ export type ProvisioningStatus = string;

// @public
export interface QuantumWorkspace extends TrackedResource {
readonly endpointUri?: string;
identity?: QuantumWorkspaceIdentity;
providers?: Provider[];
readonly provisioningState?: ProvisioningStatus;
storageAccount?: string;
readonly systemData?: SystemData;
readonly usable?: UsableStatus;
properties?: WorkspaceResourceProperties;
}

// @public
Expand All @@ -273,6 +298,7 @@ export interface QuotaDimension {
export interface Resource {
readonly id?: string;
readonly name?: string;
readonly systemData?: SystemData;
readonly type?: string;
}

Expand Down Expand Up @@ -335,6 +361,8 @@ export type UsableStatus = string;
// @public
export interface Workspace {
checkNameAvailability(locationName: string, checkNameAvailabilityParameters: CheckNameAvailabilityParameters, options?: WorkspaceCheckNameAvailabilityOptionalParams): Promise<WorkspaceCheckNameAvailabilityResponse>;
listKeys(resourceGroupName: string, workspaceName: string, options?: WorkspaceListKeysOptionalParams): Promise<WorkspaceListKeysResponse>;
regenerateKeys(resourceGroupName: string, workspaceName: string, keySpecification: APIKeys, options?: WorkspaceRegenerateKeysOptionalParams): Promise<void>;
}

// @public
Expand All @@ -344,12 +372,33 @@ export interface WorkspaceCheckNameAvailabilityOptionalParams extends coreClient
// @public
export type WorkspaceCheckNameAvailabilityResponse = CheckNameAvailabilityResult;

// @public
export interface WorkspaceListKeysOptionalParams extends coreClient.OperationOptions {
}

// @public
export type WorkspaceListKeysResponse = ListKeysResult;

// @public
export interface WorkspaceListResult {
nextLink?: string;
value?: QuantumWorkspace[];
}

// @public
export interface WorkspaceRegenerateKeysOptionalParams extends coreClient.OperationOptions {
}

// @public
export interface WorkspaceResourceProperties {
apiKeyEnabled?: boolean;
readonly endpointUri?: string;
providers?: Provider[];
readonly provisioningState?: ProvisioningStatus;
storageAccount?: string;
readonly usable?: UsableStatus;
}

// @public
export interface Workspaces {
beginCreateOrUpdate(resourceGroupName: string, workspaceName: string, quantumWorkspace: QuantumWorkspace, options?: WorkspacesCreateOrUpdateOptionalParams): Promise<SimplePollerLike<OperationState<WorkspacesCreateOrUpdateResponse>, WorkspacesCreateOrUpdateResponse>>;
Expand Down
2 changes: 1 addition & 1 deletion sdk/quantum/arm-quantum/samples-dev/offeringsListSample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dotenv.config();
* This sample demonstrates how to Returns the list of all provider offerings available for the given location.
*
* @summary Returns the list of all provider offerings available for the given location.
* x-ms-original-file: specification/quantum/resource-manager/Microsoft.Quantum/preview/2022-01-10-preview/examples/offeringsList.json
* x-ms-original-file: specification/quantum/resource-manager/Microsoft.Quantum/preview/2023-11-13-preview/examples/offeringsList.json
*/
async function offeringsList() {
const subscriptionId =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dotenv.config();
* This sample demonstrates how to Returns list of operations.
*
* @summary Returns list of operations.
* x-ms-original-file: specification/quantum/resource-manager/Microsoft.Quantum/preview/2022-01-10-preview/examples/operations.json
* x-ms-original-file: specification/quantum/resource-manager/Microsoft.Quantum/preview/2023-11-13-preview/examples/operations.json
*/
async function operations() {
const subscriptionId =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// Licensed under the MIT License.
import {
CheckNameAvailabilityParameters,
AzureQuantumManagementClient
AzureQuantumManagementClient,
} from "@azure/arm-quantum";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
Expand All @@ -21,7 +21,7 @@ dotenv.config();
* This sample demonstrates how to Check the availability of the resource name.
*
* @summary Check the availability of the resource name.
* x-ms-original-file: specification/quantum/resource-manager/Microsoft.Quantum/preview/2022-01-10-preview/examples/quantumWorkspacesCheckNameAvailability.json
* x-ms-original-file: specification/quantum/resource-manager/Microsoft.Quantum/preview/2023-11-13-preview/examples/quantumWorkspacesCheckNameAvailability.json
*/
async function quantumWorkspacesCheckNameAvailability() {
const subscriptionId =
Expand All @@ -30,13 +30,13 @@ async function quantumWorkspacesCheckNameAvailability() {
const locationName = "westus2";
const checkNameAvailabilityParameters: CheckNameAvailabilityParameters = {
name: "sample-workspace-name",
type: "Microsoft.Quantum/Workspaces"
type: "Microsoft.Quantum/Workspaces",
};
const credential = new DefaultAzureCredential();
const client = new AzureQuantumManagementClient(credential, subscriptionId);
const result = await client.workspace.checkNameAvailability(
locationName,
checkNameAvailabilityParameters
checkNameAvailabilityParameters,
);
console.log(result);
}
Expand Down
43 changes: 43 additions & 0 deletions sdk/quantum/arm-quantum/samples-dev/workspaceListKeysSample.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { AzureQuantumManagementClient } from "@azure/arm-quantum";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";

dotenv.config();

/**
* This sample demonstrates how to Get the keys to use with the Quantum APIs. A key is used to authenticate and authorize access to the Quantum REST APIs. Only one key is needed at a time; two are given to provide seamless key regeneration.
*
* @summary Get the keys to use with the Quantum APIs. A key is used to authenticate and authorize access to the Quantum REST APIs. Only one key is needed at a time; two are given to provide seamless key regeneration.
* x-ms-original-file: specification/quantum/resource-manager/Microsoft.Quantum/preview/2023-11-13-preview/examples/listKeys.json
*/
async function listKeys() {
const subscriptionId =
process.env["QUANTUM_SUBSCRIPTION_ID"] ||
"00000000-1111-2222-3333-444444444444";
const resourceGroupName =
process.env["QUANTUM_RESOURCE_GROUP"] || "quantumResourcegroup";
const workspaceName = "quantumworkspace1";
const credential = new DefaultAzureCredential();
const client = new AzureQuantumManagementClient(credential, subscriptionId);
const result = await client.workspace.listKeys(
resourceGroupName,
workspaceName,
);
console.log(result);
}

async function main() {
listKeys();
}

main().catch(console.error);
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { APIKeys, AzureQuantumManagementClient } from "@azure/arm-quantum";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";

dotenv.config();

/**
* This sample demonstrates how to Regenerate either the primary or secondary key for use with the Quantum APIs. The old key will stop working immediately.
*
* @summary Regenerate either the primary or secondary key for use with the Quantum APIs. The old key will stop working immediately.
* x-ms-original-file: specification/quantum/resource-manager/Microsoft.Quantum/preview/2023-11-13-preview/examples/regenerateKey.json
*/
async function regenerateKey() {
const subscriptionId =
process.env["QUANTUM_SUBSCRIPTION_ID"] ||
"00000000-1111-2222-3333-444444444444";
const resourceGroupName =
process.env["QUANTUM_RESOURCE_GROUP"] || "quantumResourcegroup";
const workspaceName = "quantumworkspace1";
const keySpecification: APIKeys = { keys: ["Primary", "Secondary"] };
const credential = new DefaultAzureCredential();
const client = new AzureQuantumManagementClient(credential, subscriptionId);
const result = await client.workspace.regenerateKeys(
resourceGroupName,
workspaceName,
keySpecification,
);
console.log(result);
}

async function main() {
regenerateKey();
}

main().catch(console.error);
Loading

0 comments on commit e8109d6

Please sign in to comment.