* devhub release

* update file

* update files
This commit is contained in:
kazrael2119 2022-10-18 21:07:45 +08:00 коммит произвёл GitHub
Родитель 4e7118cbdf
Коммит 87318cf4bc
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
64 изменённых файлов: 4639 добавлений и 6 удалений

Просмотреть файл

@ -73,6 +73,7 @@ specifiers:
'@rush-temp/arm-deploymentmanager': file:./projects/arm-deploymentmanager.tgz
'@rush-temp/arm-desktopvirtualization': file:./projects/arm-desktopvirtualization.tgz
'@rush-temp/arm-devcenter': file:./projects/arm-devcenter.tgz
'@rush-temp/arm-devhub': file:./projects/arm-devhub.tgz
'@rush-temp/arm-deviceprovisioningservices': file:./projects/arm-deviceprovisioningservices.tgz
'@rush-temp/arm-deviceupdate': file:./projects/arm-deviceupdate.tgz
'@rush-temp/arm-devspaces': file:./projects/arm-devspaces.tgz
@ -388,6 +389,7 @@ dependencies:
'@rush-temp/arm-deploymentmanager': file:projects/arm-deploymentmanager.tgz
'@rush-temp/arm-desktopvirtualization': file:projects/arm-desktopvirtualization.tgz
'@rush-temp/arm-devcenter': file:projects/arm-devcenter.tgz
'@rush-temp/arm-devhub': file:projects/arm-devhub.tgz
'@rush-temp/arm-deviceprovisioningservices': file:projects/arm-deviceprovisioningservices.tgz
'@rush-temp/arm-deviceupdate': file:projects/arm-deviceupdate.tgz
'@rush-temp/arm-devspaces': file:projects/arm-devspaces.tgz
@ -3961,7 +3963,7 @@ packages:
dependencies:
semver: 7.3.7
shelljs: 0.8.5
typescript: 4.9.0-dev.20221016
typescript: 4.9.0-dev.20221018
dev: false
/downlevel-dts/0.8.0:
@ -8958,8 +8960,8 @@ packages:
hasBin: true
dev: false
/typescript/4.9.0-dev.20221016:
resolution: {integrity: sha512-5ewJzFqYCUKUku9SdWIURLJW3PlkthY8C+HDu7kfWggpUJj3Ei7XrvMa32tMdl4a4H7k90m0xHRyoiCAH7wO2A==}
/typescript/4.9.0-dev.20221018:
resolution: {integrity: sha512-jHigCAzVp9JXy+t9J854z8ooZTtc1luK25iKKFF48w/AfRfTbypn8HkOGWDmb7x7RuAcZxo1zYcYDk4OaUFKjw==}
engines: {node: '>=4.2.0'}
hasBin: true
dev: false
@ -11775,6 +11777,33 @@ packages:
- supports-color
dev: false
file:projects/arm-devhub.tgz:
resolution: {integrity: sha512-24gOR9GRJsvhBH/A9WPsDIGQb0CoeWMkrCxqZBwi7DO2oM1qJbaBZmS84KRwTfEfPZ4GtJKkNQwEvMYitN0rzA==, tarball: file:projects/arm-devhub.tgz}
name: '@rush-temp/arm-devhub'
version: 0.0.0
dependencies:
'@azure/identity': 2.1.0
'@microsoft/api-extractor': 7.32.0
'@rollup/plugin-commonjs': 21.1.0_rollup@2.79.1
'@rollup/plugin-json': 4.1.0_rollup@2.79.1
'@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1
'@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1
'@types/chai': 4.3.3
'@types/node': 14.18.32
chai: 4.3.6
cross-env: 7.0.3
mkdirp: 1.0.4
mocha: 7.2.0
rimraf: 3.0.2
rollup: 2.79.1
rollup-plugin-sourcemaps: 0.6.3_c164e18ebb1175294129df0cff345d2e
tslib: 2.4.0
typescript: 4.6.4
uglify-js: 3.17.2
transitivePeerDependencies:
- supports-color
dev: false
file:projects/arm-deviceprovisioningservices.tgz:
resolution: {integrity: sha512-53bIZARkaTdNa44xHTcHoP42jNw0UvR9yO4dF/FBIyN80WKAZEVEUTOuGJh8joe6jXr8bG8EjBajo7pBFp+gOA==, tarball: file:projects/arm-deviceprovisioningservices.tgz}
name: '@rush-temp/arm-deviceprovisioningservices'
@ -17420,7 +17449,7 @@ packages:
dev: false
file:projects/keyvault-secrets.tgz:
resolution: {integrity: sha512-naBuklZ7AHmeVLo/R/ej1xsyI0Re5E6eQKusaUVJQtnZ9aazrtLeVDI6kVdT+oYtk2eS/injmQzwzx68yLDjUg==, tarball: file:projects/keyvault-secrets.tgz}
resolution: {integrity: sha512-glu2elfF+vMdKRUZllcVwLZrRooMSgc17x12lcYQZkksNvDvlXOJAbFP3sVdp77S6VhH5U4FBG2aSNRIwHV9CA==, tarball: file:projects/keyvault-secrets.tgz}
name: '@rush-temp/keyvault-secrets'
version: 0.0.0
dependencies:
@ -17622,7 +17651,7 @@ packages:
dev: false
file:projects/mixed-reality-remote-rendering.tgz:
resolution: {integrity: sha512-KLnDms6nk+EnBMcLlr3nwdhzi9NBLHo8NLR/J0pzEMJG1JtxkozXvku2pLsUf78oYUwlCzbAtJIH1j1O7FbH1Q==, tarball: file:projects/mixed-reality-remote-rendering.tgz}
resolution: {integrity: sha512-c+DeluRNwjQYq5UZMvSO/87WTaN/FjPKt77w4m64+5NStzY4sa8ock8tyfNEDWPts8V7mLarnIMiVDSS1JfOCA==, tarball: file:projects/mixed-reality-remote-rendering.tgz}
name: '@rush-temp/mixed-reality-remote-rendering'
version: 0.0.0
dependencies:
@ -19598,7 +19627,7 @@ packages:
dev: false
file:projects/video-analyzer-edge.tgz:
resolution: {integrity: sha512-khmGlWMF87TB6iTydsWU2lJr6mQb/nlRjYJBPZKVHl1NxGjd7bO9KYXXkLm3smdUy1zHKLAG0+8Imc483bc9zg==, tarball: file:projects/video-analyzer-edge.tgz}
resolution: {integrity: sha512-ev9PjvfbH+H1BE1EQYL/+kTzu/utd8oJTuXQ3s1g/eN5ArVxEEmt5UXz2fbkgUsSAEo4n4llhnPVZEOBKn0mHA==, tarball: file:projects/video-analyzer-edge.tgz}
name: '@rush-temp/video-analyzer-edge'
version: 0.0.0
dependencies:

Просмотреть файл

@ -27,3 +27,4 @@ https://docs.microsoft.com/javascript/api/@azure/arm-chaos?view=azure-node-previ
https://docs.microsoft.com/javascript/api/@azure-rest/arm-compute?view=azure-node-preview
https://docs.microsoft.com/javascript/api/@azure-rest/arm-network?view=azure-node-preview
https://docs.microsoft.com/javascript/api/@azure/arm-securitydevops?view=azure-node-preview
https://docs.microsoft.com/javascript/api/@azure/arm-devhub?view=azure-node-preview

Просмотреть файл

@ -1885,6 +1885,11 @@
"packageName": "@azure/arm-securitydevops",
"projectFolder": "sdk/securitydevops/arm-securitydevops",
"versionPolicyName": "management"
},
{
"packageName": "@azure/arm-devhub",
"projectFolder": "sdk/devhub/arm-devhub",
"versionPolicyName": "management"
}
]
}

Просмотреть файл

@ -0,0 +1,5 @@
# Release History
## 1.0.0-beta.1 (2022-10-18)
The package of @azure/arm-devhub is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart).

Просмотреть файл

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2022 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
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Просмотреть файл

@ -0,0 +1,109 @@
# Azure DeveloperHubService client library for JavaScript
This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure DeveloperHubService client.
The AKS Developer Hub Service Client
[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/devhub/arm-devhub) |
[Package (NPM)](https://www.npmjs.com/package/@azure/arm-devhub) |
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-devhub?view=azure-node-preview) |
[Samples](https://github.com/Azure-Samples/azure-samples-js-management)
## Getting started
### Currently supported environments
- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule)
- 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.
### Prerequisites
- An [Azure subscription][azure_sub].
### Install the `@azure/arm-devhub` package
Install the Azure DeveloperHubService client library for JavaScript with `npm`:
```bash
npm install @azure/arm-devhub
```
### Create and authenticate a `DeveloperHubServiceClient`
To create a client object to access the Azure DeveloperHubService API, you will need the `endpoint` of your Azure DeveloperHubService resource and a `credential`. The Azure DeveloperHubService client can use Azure Active Directory credentials to authenticate.
You can find the endpoint for your Azure DeveloperHubService resource in the [Azure Portal][azure_portal].
You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token).
To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package:
```bash
npm install @azure/identity
```
You will also need to **register a new AAD application and grant access to Azure DeveloperHubService** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions).
Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.
For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).
```javascript
const { DeveloperHubServiceClient } = require("@azure/arm-devhub");
const { DefaultAzureCredential } = require("@azure/identity");
// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details.
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new DeveloperHubServiceClient(new DefaultAzureCredential(), subscriptionId);
// For client-side applications running in the browser, use this code instead:
// const credential = new InteractiveBrowserCredential({
// tenantId: "<YOUR_TENANT_ID>",
// clientId: "<YOUR_CLIENT_ID>"
// });
// const client = new DeveloperHubServiceClient(credential, subscriptionId);
```
### JavaScript Bundle
To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling).
## Key concepts
### DeveloperHubServiceClient
`DeveloperHubServiceClient` is the primary interface for developers using the Azure DeveloperHubService client library. Explore the methods on this client object to understand the different features of the Azure DeveloperHubService service that you can access.
## Troubleshooting
### Logging
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
```javascript
const { setLogLevel } = require("@azure/logger");
setLogLevel("info");
```
For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).
## Next steps
Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library.
## Contributing
If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code.
## Related projects
- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js)
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fdevhub%2Farm-devhub%2FREADME.png)
[azure_cli]: https://docs.microsoft.com/cli/azure
[azure_sub]: https://azure.microsoft.com/free/
[azure_sub]: https://azure.microsoft.com/free/
[azure_portal]: https://portal.azure.com
[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity
[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential

Просмотреть файл

@ -0,0 +1,8 @@
{
"commit": "db05e631609fe183bb18083640fa8720504ba734",
"readme": "specification/developerhub/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\\developerhub\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.2 --generate-sample=true",
"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.2"
}

Просмотреть файл

@ -0,0 +1,31 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "./dist-esm/src/index.d.ts",
"docModel": {
"enabled": true
},
"apiReport": {
"enabled": true,
"reportFolder": "./review"
},
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "",
"publicTrimmedFilePath": "./types/arm-devhub.d.ts"
},
"messages": {
"tsdocMessageReporting": {
"default": {
"logLevel": "none"
}
},
"extractorMessageReporting": {
"ae-missing-release-tag": {
"logLevel": "none"
},
"ae-unresolved-link": {
"logLevel": "none"
}
}
}
}

Просмотреть файл

@ -0,0 +1,120 @@
{
"name": "@azure/arm-devhub",
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "A generated SDK for DeveloperHubServiceClient.",
"version": "1.0.0-beta.1",
"engines": {
"node": ">=14.0.0"
},
"dependencies": {
"@azure/core-paging": "^1.2.0",
"@azure/core-client": "^1.5.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-rest-pipeline": "^1.8.0",
"tslib": "^2.2.0"
},
"keywords": [
"node",
"azure",
"typescript",
"browser",
"isomorphic"
],
"license": "MIT",
"main": "./dist/index.js",
"module": "./dist-esm/src/index.js",
"types": "./types/arm-devhub.d.ts",
"devDependencies": {
"@microsoft/api-extractor": "^7.31.1",
"@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",
"uglify-js": "^3.4.9",
"rimraf": "^3.0.0",
"@azure/identity": "^2.0.1",
"@azure-tools/test-recorder": "^2.0.0",
"@azure-tools/test-credential": "^1.0.0",
"mocha": "^7.1.1",
"@types/chai": "^4.2.8",
"@types/node": "^14.0.0",
"chai": "^4.2.0",
"cross-env": "^7.0.2",
"@azure/dev-tool": "^1.0.0"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/devhub/arm-devhub",
"repository": {
"type": "git",
"url": "https://github.com/Azure/azure-sdk-for-js.git"
},
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"files": [
"dist/**/*.js",
"dist/**/*.js.map",
"dist/**/*.d.ts",
"dist/**/*.d.ts.map",
"dist-esm/**/*.js",
"dist-esm/**/*.js.map",
"dist-esm/**/*.d.ts",
"dist-esm/**/*.d.ts.map",
"src/**/*.ts",
"README.md",
"LICENSE",
"rollup.config.js",
"tsconfig.json",
"review/*",
"CHANGELOG.md",
"types/*"
],
"scripts": {
"build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api",
"minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js",
"prepack": "npm run build",
"pack": "npm pack 2>&1",
"extract-api": "api-extractor run --local",
"lint": "echo skipped",
"audit": "echo skipped",
"clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log",
"build:node": "echo skipped",
"build:browser": "echo skipped",
"build:test": "echo skipped",
"build:samples": "echo skipped.",
"check-format": "echo skipped",
"execute:samples": "echo skipped",
"format": "echo skipped",
"test": "npm run integration-test",
"test:node": "echo skipped",
"test:browser": "echo skipped",
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
"unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node",
"unit-test:browser": "echo skipped",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'",
"integration-test:browser": "echo skipped"
},
"sideEffects": false,
"//metadata": {
"constantPaths": [
{
"path": "src/developerHubServiceClient.ts",
"prefix": "packageDetails"
}
]
},
"autoPublish": true,
"//sampleConfiguration": {
"productName": "",
"productSlugs": [
"azure"
],
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-devhub?view=azure-node-preview"
}
}

Просмотреть файл

@ -0,0 +1,38 @@
{
"Entries": [
{
"RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.DevHub/workflows?api-version=2022-04-01-preview",
"RequestMethod": "GET",
"RequestHeaders": {
"Accept": "application/json",
"Accept-Encoding": "gzip,deflate",
"Authorization": "Sanitized",
"Connection": "keep-alive",
"User-Agent": "azsdk-js-arm-devhub/1.0.0-beta.1 core-rest-pipeline/1.9.3 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)",
"x-ms-client-request-id": "145ec4eb-f051-47d3-82db-e1b793493413"
},
"RequestBody": null,
"StatusCode": 200,
"ResponseHeaders": {
"Cache-Control": "no-cache",
"Content-Encoding": "gzip",
"Content-Length": "12",
"Content-Type": "application/json; charset=utf-8",
"Date": "Tue, 18 Oct 2022 07:53:55 GMT",
"Expires": "-1",
"Pragma": "no-cache",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
"Vary": "Accept-Encoding",
"X-Content-Type-Options": "nosniff",
"x-ms-correlation-request-id": "bef96382-95a6-4544-8b69-00611af27fa9",
"x-ms-ratelimit-remaining-subscription-reads": "11999",
"x-ms-request-id": "bef96382-95a6-4544-8b69-00611af27fa9",
"x-ms-routing-request-id": "SOUTHEASTASIA:20221018T075355Z:bef96382-95a6-4544-8b69-00611af27fa9"
},
"ResponseBody": {
"value": []
}
}
],
"Variables": {}
}

Просмотреть файл

@ -0,0 +1,355 @@
## API Report File for "@azure/arm-devhub"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import * as coreAuth from '@azure/core-auth';
import * as coreClient from '@azure/core-client';
import { PagedAsyncIterableIterator } from '@azure/core-paging';
// @public
export interface Acr {
acrRegistryName?: string;
acrRepositoryName?: string;
acrResourceGroup?: string;
acrSubscriptionId?: string;
}
// @public
export type ActionType = string;
// @public
export type CreatedByType = string;
// @public
export interface DeleteWorkflowResponse {
status?: string;
}
// @public (undocumented)
export interface DeploymentProperties {
helmChartPath?: string;
helmValues?: string;
// (undocumented)
kubeManifestLocations?: string[];
manifestType?: ManifestType;
overrides?: {
[propertyName: string]: string;
};
}
// @public (undocumented)
export class DeveloperHubServiceClient extends coreClient.ServiceClient {
// (undocumented)
$host: string;
constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: DeveloperHubServiceClientOptionalParams);
// (undocumented)
apiVersion: string;
gitHubOAuth(location: string, options?: GitHubOAuthOptionalParams): Promise<GitHubOAuthOperationResponse>;
gitHubOAuthCallback(location: string, code: string, state: string, options?: GitHubOAuthCallbackOptionalParams): Promise<GitHubOAuthCallbackResponse>;
listGitHubOAuth(location: string, options?: ListGitHubOAuthOptionalParams): Promise<ListGitHubOAuthResponse>;
// (undocumented)
operations: Operations;
// (undocumented)
subscriptionId: string;
// (undocumented)
workflowOperations: WorkflowOperations;
}
// @public
export interface DeveloperHubServiceClientOptionalParams extends coreClient.ServiceClientOptions {
$host?: string;
apiVersion?: string;
endpoint?: string;
}
// @public
export interface ErrorAdditionalInfo {
readonly info?: Record<string, unknown>;
readonly type?: string;
}
// @public
export interface ErrorDetail {
readonly additionalInfo?: ErrorAdditionalInfo[];
readonly code?: string;
readonly details?: ErrorDetail[];
readonly message?: string;
readonly target?: string;
}
// @public
export interface ErrorResponse {
error?: ErrorDetail;
}
// @public
export interface GitHubOAuthCallbackOptionalParams extends coreClient.OperationOptions {
}
// @public
export type GitHubOAuthCallbackResponse = GitHubOAuthResponse;
// @public
export interface GitHubOAuthCallRequest {
redirectUrl?: string;
}
// @public
export interface GitHubOAuthInfoResponse {
authURL?: string;
token?: string;
}
// @public
export interface GitHubOAuthListResponse {
value?: GitHubOAuthResponse[];
}
// @public
export type GitHubOAuthOperationResponse = GitHubOAuthInfoResponse;
// @public
export interface GitHubOAuthOptionalParams extends coreClient.OperationOptions {
parameters?: GitHubOAuthCallRequest;
}
// @public
export interface GitHubOAuthResponse extends ProxyResource {
username?: string;
}
// @public
export interface GitHubWorkflowProfileOidcCredentials {
azureClientId?: string;
azureTenantId?: string;
}
// @public
export enum KnownActionType {
Internal = "Internal"
}
// @public
export enum KnownCreatedByType {
Application = "Application",
Key = "Key",
ManagedIdentity = "ManagedIdentity",
User = "User"
}
// @public
export enum KnownManifestType {
Helm = "helm",
Kube = "kube"
}
// @public
export enum KnownOrigin {
System = "system",
User = "user",
UserSystem = "user,system"
}
// @public
export enum KnownPullRequestStatus {
Merged = "merged",
Removed = "removed",
Submitted = "submitted",
Unknown = "unknown"
}
// @public
export interface ListGitHubOAuthOptionalParams extends coreClient.OperationOptions {
}
// @public
export type ListGitHubOAuthResponse = GitHubOAuthListResponse;
// @public
export type ManifestType = string;
// @public
export interface Operation {
readonly actionType?: ActionType;
display?: OperationDisplay;
readonly isDataAction?: boolean;
readonly name?: string;
readonly origin?: Origin;
}
// @public
export interface OperationDisplay {
readonly description?: string;
readonly operation?: string;
readonly provider?: string;
readonly resource?: string;
}
// @public
export interface OperationListResult {
readonly nextLink?: string;
readonly value?: Operation[];
}
// @public
export interface Operations {
list(options?: OperationsListOptionalParams): Promise<OperationsListResponse>;
}
// @public
export interface OperationsListOptionalParams extends coreClient.OperationOptions {
}
// @public
export type OperationsListResponse = OperationListResult;
// @public
export type Origin = string;
// @public
export interface ProxyResource extends Resource {
}
// @public
export type PullRequestStatus = string;
// @public
export interface Resource {
readonly id?: string;
readonly name?: string;
readonly systemData?: SystemData;
readonly type?: string;
}
// @public
export interface SystemData {
createdAt?: Date;
createdBy?: string;
createdByType?: CreatedByType;
lastModifiedAt?: Date;
lastModifiedBy?: string;
lastModifiedByType?: CreatedByType;
}
// @public
export interface TagsObject {
tags?: {
[propertyName: string]: string;
};
}
// @public
export interface TrackedResource extends Resource {
location: string;
tags?: {
[propertyName: string]: string;
};
}
// @public
export interface Workflow extends TrackedResource {
acr?: Acr;
aksResourceId?: string;
authStatus?: ManifestType;
branchName?: string;
// (undocumented)
deploymentProperties?: DeploymentProperties;
dockerBuildContext?: string;
dockerfile?: string;
// (undocumented)
lastWorkflowRun?: WorkflowRun;
namespace?: string;
oidcCredentials?: GitHubWorkflowProfileOidcCredentials;
readonly prStatus?: PullRequestStatus;
readonly prURL?: string;
readonly pullNumber?: number;
repositoryName?: string;
repositoryOwner?: string;
}
// @public
export interface WorkflowCreateOrUpdateOptionalParams extends coreClient.OperationOptions {
}
// @public
export type WorkflowCreateOrUpdateResponse = Workflow;
// @public
export interface WorkflowDeleteOptionalParams extends coreClient.OperationOptions {
}
// @public
export type WorkflowDeleteResponse = DeleteWorkflowResponse;
// @public
export interface WorkflowGetOptionalParams extends coreClient.OperationOptions {
}
// @public
export type WorkflowGetResponse = Workflow;
// @public
export interface WorkflowListByResourceGroupNextOptionalParams extends coreClient.OperationOptions {
managedClusterResource?: string;
}
// @public
export type WorkflowListByResourceGroupNextResponse = WorkflowListResult;
// @public
export interface WorkflowListByResourceGroupOptionalParams extends coreClient.OperationOptions {
managedClusterResource?: string;
}
// @public
export type WorkflowListByResourceGroupResponse = WorkflowListResult;
// @public
export interface WorkflowListNextOptionalParams extends coreClient.OperationOptions {
}
// @public
export type WorkflowListNextResponse = WorkflowListResult;
// @public
export interface WorkflowListOptionalParams extends coreClient.OperationOptions {
}
// @public
export type WorkflowListResponse = WorkflowListResult;
// @public
export interface WorkflowListResult {
readonly nextLink?: string;
value?: Workflow[];
}
// @public
export interface WorkflowOperations {
createOrUpdate(resourceGroupName: string, workflowName: string, parameters: Workflow, options?: WorkflowCreateOrUpdateOptionalParams): Promise<WorkflowCreateOrUpdateResponse>;
delete(resourceGroupName: string, workflowName: string, options?: WorkflowDeleteOptionalParams): Promise<WorkflowDeleteResponse>;
get(resourceGroupName: string, workflowName: string, options?: WorkflowGetOptionalParams): Promise<WorkflowGetResponse>;
list(options?: WorkflowListOptionalParams): PagedAsyncIterableIterator<Workflow>;
listByResourceGroup(resourceGroupName: string, options?: WorkflowListByResourceGroupOptionalParams): PagedAsyncIterableIterator<Workflow>;
updateTags(resourceGroupName: string, workflowName: string, parameters: TagsObject, options?: WorkflowUpdateTagsOptionalParams): Promise<WorkflowUpdateTagsResponse>;
}
// @public (undocumented)
export interface WorkflowRun {
readonly lastRunAt?: Date;
readonly succeeded?: boolean;
readonly workflowRunURL?: string;
}
// @public
export interface WorkflowUpdateTagsOptionalParams extends coreClient.OperationOptions {
}
// @public
export type WorkflowUpdateTagsResponse = Workflow;
// (No @packageDocumentation comment for this package)
```

Просмотреть файл

@ -0,0 +1,122 @@
/*
* 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.
*/
import nodeResolve from "@rollup/plugin-node-resolve";
import cjs from "@rollup/plugin-commonjs";
import sourcemaps from "rollup-plugin-sourcemaps";
import multiEntry from "@rollup/plugin-multi-entry";
import json from "@rollup/plugin-json";
import nodeBuiltins from "builtin-modules";
// #region Warning Handler
/**
* A function that can determine whether a rollup warning should be ignored. If
* the function returns `true`, then the warning will not be displayed.
*/
function ignoreNiseSinonEval(warning) {
return (
warning.code === "EVAL" &&
warning.id &&
(warning.id.includes("node_modules/nise") ||
warning.id.includes("node_modules/sinon")) === true
);
}
function ignoreChaiCircularDependency(warning) {
return (
warning.code === "CIRCULAR_DEPENDENCY" &&
warning.importer && warning.importer.includes("node_modules/chai") === true
);
}
const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval];
/**
* Construct a warning handler for the shared rollup configuration
* that ignores certain warnings that are not relevant to testing.
*/
function makeOnWarnForTesting() {
return (warning, warn) => {
// If every inhibitor returns false (i.e. no inhibitors), then show the warning
if (warningInhibitors.every((inhib) => !inhib(warning))) {
warn(warning);
}
};
}
// #endregion
function makeBrowserTestConfig() {
const config = {
input: {
include: ["dist-esm/test/**/*.spec.js"],
exclude: ["dist-esm/test/**/node/**"]
},
output: {
file: `dist-test/index.browser.js`,
format: "umd",
sourcemap: true
},
preserveSymlinks: false,
plugins: [
multiEntry({ exports: false }),
nodeResolve({
mainFields: ["module", "browser"]
}),
cjs(),
json(),
sourcemaps()
//viz({ filename: "dist-test/browser-stats.html", sourcemap: true })
],
onwarn: makeOnWarnForTesting(),
// Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0,
// rollup started respecting the "sideEffects" field in package.json. Since
// our package.json sets "sideEffects=false", this also applies to test
// code, which causes all tests to be removed by tree-shaking.
treeshake: false
};
return config;
}
const defaultConfigurationOptions = {
disableBrowserBundle: false
};
export function makeConfig(pkg, options) {
options = {
...defaultConfigurationOptions,
...(options || {})
};
const baseConfig = {
// Use the package's module field if it has one
input: pkg["module"] || "dist-esm/src/index.js",
external: [
...nodeBuiltins,
...Object.keys(pkg.dependencies),
...Object.keys(pkg.devDependencies)
],
output: { file: "dist/index.js", format: "cjs", sourcemap: true },
preserveSymlinks: false,
plugins: [sourcemaps(), nodeResolve()]
};
const config = [baseConfig];
if (!options.disableBrowserBundle) {
config.push(makeBrowserTestConfig());
}
return config;
}
export default makeConfig(require("./package.json"));

Просмотреть файл

@ -0,0 +1,4 @@
# App registration secret for AAD authentication
AZURE_CLIENT_SECRET=
AZURE_CLIENT_ID=
AZURE_TENANT_ID=

Просмотреть файл

@ -0,0 +1,31 @@
/*
* 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 { DeveloperHubServiceClient } from "@azure/arm-devhub";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Callback URL to hit once authenticated with GitHub App to have the service store the OAuth token.
*
* @summary Callback URL to hit once authenticated with GitHub App to have the service store the OAuth token.
* x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/GitHubOAuthCallback.json
*/
async function gitHubOAuthCallback() {
const subscriptionId = "subscriptionId1";
const location = "eastus2euap";
const code = "3584d83530557fdd1f46af8289938c8ef79f9dc5";
const state = "12345678-3456-7890-5678-012345678901";
const credential = new DefaultAzureCredential();
const client = new DeveloperHubServiceClient(credential, subscriptionId);
const result = await client.gitHubOAuthCallback(location, code, state);
console.log(result);
}
gitHubOAuthCallback().catch(console.error);

Просмотреть файл

@ -0,0 +1,37 @@
/*
* 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 {
GitHubOAuthCallRequest,
GitHubOAuthOptionalParams,
DeveloperHubServiceClient
} from "@azure/arm-devhub";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Gets GitHubOAuth info used to authenticate users with the Developer Hub GitHub App.
*
* @summary Gets GitHubOAuth info used to authenticate users with the Developer Hub GitHub App.
* x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/GitHubOAuth.json
*/
async function gitHubOAuth() {
const subscriptionId = "subscriptionId1";
const location = "eastus2euap";
const parameters: GitHubOAuthCallRequest = {
redirectUrl: "https://ms.portal.azure.com/aks"
};
const options: GitHubOAuthOptionalParams = { parameters };
const credential = new DefaultAzureCredential();
const client = new DeveloperHubServiceClient(credential, subscriptionId);
const result = await client.gitHubOAuth(location, options);
console.log(result);
}
gitHubOAuth().catch(console.error);

Просмотреть файл

@ -0,0 +1,29 @@
/*
* 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 { DeveloperHubServiceClient } from "@azure/arm-devhub";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Callback URL to hit once authenticated with GitHub App to have the service store the OAuth token.
*
* @summary Callback URL to hit once authenticated with GitHub App to have the service store the OAuth token.
* x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/GitHubOAuth_List.json
*/
async function listGitHubOAuth() {
const subscriptionId = "subscriptionId1";
const location = "eastus2euap";
const credential = new DefaultAzureCredential();
const client = new DeveloperHubServiceClient(credential, subscriptionId);
const result = await client.listGitHubOAuth(location);
console.log(result);
}
listGitHubOAuth().catch(console.error);

Просмотреть файл

@ -0,0 +1,30 @@
/*
* 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 { DeveloperHubServiceClient } from "@azure/arm-devhub";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns list of operations.
*
* @summary Returns list of operations.
* x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Operation_List.json
*/
async function listAvailableOperationsForTheContainerServiceResourceProvider() {
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new DeveloperHubServiceClient(credential, subscriptionId);
const result = await client.operations.list();
console.log(result);
}
listAvailableOperationsForTheContainerServiceResourceProvider().catch(
console.error
);

Просмотреть файл

@ -0,0 +1,60 @@
/*
* 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 { Workflow, DeveloperHubServiceClient } from "@azure/arm-devhub";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Creates or updates a workflow
*
* @summary Creates or updates a workflow
* x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Workflow_CreateOrUpdate.json
*/
async function createWorkflow() {
const subscriptionId = "subscriptionId1";
const resourceGroupName = "resourceGroup1";
const workflowName = "workflow1";
const parameters: Workflow = {
acr: {
acrRegistryName: "registry1",
acrRepositoryName: "repo1",
acrResourceGroup: "resourceGroup1",
acrSubscriptionId: "subscriptionId1"
},
aksResourceId:
"/subscriptions/subscriptionId1/resourcegroups/resourceGroup1/providers/Microsoft.ContainerService/managedClusters/cluster1",
branchName: "branch1",
deploymentProperties: {
kubeManifestLocations: ["/src/manifests/"],
manifestType: "kube",
overrides: { key1: "value1" }
},
dockerBuildContext: "repo1/src/",
dockerfile: "repo1/images/Dockerfile",
location: "location1",
oidcCredentials: {
azureClientId: "12345678-3456-7890-5678-012345678901",
azureTenantId: "66666666-3456-7890-5678-012345678901"
},
repositoryName: "repo1",
repositoryOwner: "owner1",
tags: { appname: "testApp" }
};
const credential = new DefaultAzureCredential();
const client = new DeveloperHubServiceClient(credential, subscriptionId);
const result = await client.workflowOperations.createOrUpdate(
resourceGroupName,
workflowName,
parameters
);
console.log(result);
}
createWorkflow().catch(console.error);

Просмотреть файл

@ -0,0 +1,33 @@
/*
* 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 { DeveloperHubServiceClient } from "@azure/arm-devhub";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Deletes a workflow
*
* @summary Deletes a workflow
* x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Workflow_Delete.json
*/
async function deleteWorkflow() {
const subscriptionId = "subscriptionId1";
const resourceGroupName = "resourceGroup1";
const workflowName = "workflow1";
const credential = new DefaultAzureCredential();
const client = new DeveloperHubServiceClient(credential, subscriptionId);
const result = await client.workflowOperations.delete(
resourceGroupName,
workflowName
);
console.log(result);
}
deleteWorkflow().catch(console.error);

Просмотреть файл

@ -0,0 +1,33 @@
/*
* 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 { DeveloperHubServiceClient } from "@azure/arm-devhub";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Gets a workflow.
*
* @summary Gets a workflow.
* x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Workflow_Get.json
*/
async function getWorkflow() {
const subscriptionId = "subscriptionId1";
const resourceGroupName = "resourceGroup1";
const workflowName = "workflow1";
const credential = new DefaultAzureCredential();
const client = new DeveloperHubServiceClient(credential, subscriptionId);
const result = await client.workflowOperations.get(
resourceGroupName,
workflowName
);
console.log(result);
}
getWorkflow().catch(console.error);

Просмотреть файл

@ -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 {
WorkflowListByResourceGroupOptionalParams,
DeveloperHubServiceClient
} from "@azure/arm-devhub";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Gets a list of workflows within a resource group.
*
* @summary Gets a list of workflows within a resource group.
* x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Workflow_ListByResourceGroup.json
*/
async function listWorkflows() {
const subscriptionId = "subscriptionId1";
const resourceGroupName = "resourceGroup1";
const managedClusterResource =
"/subscriptions/subscriptionId1/resourcegroups/resourceGroup1/providers/Microsoft.ContainerService/managedClusters/cluster1";
const options: WorkflowListByResourceGroupOptionalParams = {
managedClusterResource
};
const credential = new DefaultAzureCredential();
const client = new DeveloperHubServiceClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.workflowOperations.listByResourceGroup(
resourceGroupName,
options
)) {
resArray.push(item);
}
console.log(resArray);
}
listWorkflows().catch(console.error);

Просмотреть файл

@ -0,0 +1,31 @@
/*
* 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 { DeveloperHubServiceClient } from "@azure/arm-devhub";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Gets a list of workflows associated with the specified subscription.
*
* @summary Gets a list of workflows associated with the specified subscription.
* x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Workflow_List.json
*/
async function listWorkflows() {
const subscriptionId = "subscriptionId1";
const credential = new DefaultAzureCredential();
const client = new DeveloperHubServiceClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.workflowOperations.list()) {
resArray.push(item);
}
console.log(resArray);
}
listWorkflows().catch(console.error);

Просмотреть файл

@ -0,0 +1,37 @@
/*
* 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 { TagsObject, DeveloperHubServiceClient } from "@azure/arm-devhub";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Updates tags on a workflow.
*
* @summary Updates tags on a workflow.
* x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Workflow_UpdateTags.json
*/
async function updateManagedClusterTags() {
const subscriptionId = "subscriptionId1";
const resourceGroupName = "resourceGroup1";
const workflowName = "workflow1";
const parameters: TagsObject = {
tags: { promote: "false", resourceEnv: "testing" }
};
const credential = new DefaultAzureCredential();
const client = new DeveloperHubServiceClient(credential, subscriptionId);
const result = await client.workflowOperations.updateTags(
resourceGroupName,
workflowName,
parameters
);
console.log(result);
}
updateManagedClusterTags().catch(console.error);

Просмотреть файл

@ -0,0 +1,68 @@
# client library samples for JavaScript (Beta)
These sample programs show how to use the JavaScript client libraries for in some common scenarios.
| **File Name** | **Description** |
| ------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [gitHubOAuthCallbackSample.js][githuboauthcallbacksample] | Callback URL to hit once authenticated with GitHub App to have the service store the OAuth token. x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/GitHubOAuthCallback.json |
| [gitHubOAuthSample.js][githuboauthsample] | Gets GitHubOAuth info used to authenticate users with the Developer Hub GitHub App. x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/GitHubOAuth.json |
| [listGitHubOAuthSample.js][listgithuboauthsample] | Callback URL to hit once authenticated with GitHub App to have the service store the OAuth token. x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/GitHubOAuth_List.json |
| [operationsListSample.js][operationslistsample] | Returns list of operations. x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Operation_List.json |
| [workflowCreateOrUpdateSample.js][workflowcreateorupdatesample] | Creates or updates a workflow x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Workflow_CreateOrUpdate.json |
| [workflowDeleteSample.js][workflowdeletesample] | Deletes a workflow x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Workflow_Delete.json |
| [workflowGetSample.js][workflowgetsample] | Gets a workflow. x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Workflow_Get.json |
| [workflowListByResourceGroupSample.js][workflowlistbyresourcegroupsample] | Gets a list of workflows within a resource group. x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Workflow_ListByResourceGroup.json |
| [workflowListSample.js][workflowlistsample] | Gets a list of workflows associated with the specified subscription. x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Workflow_List.json |
| [workflowUpdateTagsSample.js][workflowupdatetagssample] | Updates tags on a workflow. x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Workflow_UpdateTags.json |
## Prerequisites
The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule).
You need [an Azure subscription][freesub] to run these sample programs.
Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function.
Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package].
## Setup
To run the samples using the published version of the package:
1. Install the dependencies using `npm`:
```bash
npm install
```
2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically.
3. Run whichever samples you like (note that some samples may require additional setup, see the table above):
```bash
node gitHubOAuthCallbackSample.js
```
Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform):
```bash
npx cross-env node gitHubOAuthCallbackSample.js
```
## Next Steps
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
[githuboauthcallbacksample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devhub/arm-devhub/samples/v1-beta/javascript/gitHubOAuthCallbackSample.js
[githuboauthsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devhub/arm-devhub/samples/v1-beta/javascript/gitHubOAuthSample.js
[listgithuboauthsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devhub/arm-devhub/samples/v1-beta/javascript/listGitHubOAuthSample.js
[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devhub/arm-devhub/samples/v1-beta/javascript/operationsListSample.js
[workflowcreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devhub/arm-devhub/samples/v1-beta/javascript/workflowCreateOrUpdateSample.js
[workflowdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devhub/arm-devhub/samples/v1-beta/javascript/workflowDeleteSample.js
[workflowgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devhub/arm-devhub/samples/v1-beta/javascript/workflowGetSample.js
[workflowlistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devhub/arm-devhub/samples/v1-beta/javascript/workflowListByResourceGroupSample.js
[workflowlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devhub/arm-devhub/samples/v1-beta/javascript/workflowListSample.js
[workflowupdatetagssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devhub/arm-devhub/samples/v1-beta/javascript/workflowUpdateTagsSample.js
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-devhub?view=azure-node-preview
[freesub]: https://azure.microsoft.com/free/
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/devhub/arm-devhub/README.md

Просмотреть файл

@ -0,0 +1,31 @@
/*
* 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.
const { DeveloperHubServiceClient } = require("@azure/arm-devhub");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Callback URL to hit once authenticated with GitHub App to have the service store the OAuth token.
*
* @summary Callback URL to hit once authenticated with GitHub App to have the service store the OAuth token.
* x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/GitHubOAuthCallback.json
*/
async function gitHubOAuthCallback() {
const subscriptionId = "subscriptionId1";
const location = "eastus2euap";
const code = "3584d83530557fdd1f46af8289938c8ef79f9dc5";
const state = "12345678-3456-7890-5678-012345678901";
const credential = new DefaultAzureCredential();
const client = new DeveloperHubServiceClient(credential, subscriptionId);
const result = await client.gitHubOAuthCallback(location, code, state);
console.log(result);
}
gitHubOAuthCallback().catch(console.error);

Просмотреть файл

@ -0,0 +1,33 @@
/*
* 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.
const { DeveloperHubServiceClient } = require("@azure/arm-devhub");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets GitHubOAuth info used to authenticate users with the Developer Hub GitHub App.
*
* @summary Gets GitHubOAuth info used to authenticate users with the Developer Hub GitHub App.
* x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/GitHubOAuth.json
*/
async function gitHubOAuth() {
const subscriptionId = "subscriptionId1";
const location = "eastus2euap";
const parameters = {
redirectUrl: "https://ms.portal.azure.com/aks",
};
const options = { parameters };
const credential = new DefaultAzureCredential();
const client = new DeveloperHubServiceClient(credential, subscriptionId);
const result = await client.gitHubOAuth(location, options);
console.log(result);
}
gitHubOAuth().catch(console.error);

Просмотреть файл

@ -0,0 +1,29 @@
/*
* 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.
const { DeveloperHubServiceClient } = require("@azure/arm-devhub");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Callback URL to hit once authenticated with GitHub App to have the service store the OAuth token.
*
* @summary Callback URL to hit once authenticated with GitHub App to have the service store the OAuth token.
* x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/GitHubOAuth_List.json
*/
async function listGitHubOAuth() {
const subscriptionId = "subscriptionId1";
const location = "eastus2euap";
const credential = new DefaultAzureCredential();
const client = new DeveloperHubServiceClient(credential, subscriptionId);
const result = await client.listGitHubOAuth(location);
console.log(result);
}
listGitHubOAuth().catch(console.error);

Просмотреть файл

@ -0,0 +1,28 @@
/*
* 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.
const { DeveloperHubServiceClient } = require("@azure/arm-devhub");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Returns list of operations.
*
* @summary Returns list of operations.
* x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Operation_List.json
*/
async function listAvailableOperationsForTheContainerServiceResourceProvider() {
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new DeveloperHubServiceClient(credential, subscriptionId);
const result = await client.operations.list();
console.log(result);
}
listAvailableOperationsForTheContainerServiceResourceProvider().catch(console.error);

Просмотреть файл

@ -0,0 +1,32 @@
{
"name": "@azure-samples/arm-devhub-js-beta",
"private": true,
"version": "1.0.0",
"description": " client library samples for JavaScript (Beta)",
"engines": {
"node": ">=14.0.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
"directory": "sdk/devhub/arm-devhub"
},
"keywords": [
"node",
"azure",
"typescript",
"browser",
"isomorphic"
],
"author": "Microsoft Corporation",
"license": "MIT",
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/devhub/arm-devhub",
"dependencies": {
"@azure/arm-devhub": "next",
"dotenv": "latest",
"@azure/identity": "^2.0.1"
}
}

Просмотреть файл

@ -0,0 +1,4 @@
# App registration secret for AAD authentication
AZURE_CLIENT_SECRET=
AZURE_CLIENT_ID=
AZURE_TENANT_ID=

Просмотреть файл

@ -0,0 +1,60 @@
/*
* 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.
const { DeveloperHubServiceClient } = require("@azure/arm-devhub");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates a workflow
*
* @summary Creates or updates a workflow
* x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Workflow_CreateOrUpdate.json
*/
async function createWorkflow() {
const subscriptionId = "subscriptionId1";
const resourceGroupName = "resourceGroup1";
const workflowName = "workflow1";
const parameters = {
acr: {
acrRegistryName: "registry1",
acrRepositoryName: "repo1",
acrResourceGroup: "resourceGroup1",
acrSubscriptionId: "subscriptionId1",
},
aksResourceId:
"/subscriptions/subscriptionId1/resourcegroups/resourceGroup1/providers/Microsoft.ContainerService/managedClusters/cluster1",
branchName: "branch1",
deploymentProperties: {
kubeManifestLocations: ["/src/manifests/"],
manifestType: "kube",
overrides: { key1: "value1" },
},
dockerBuildContext: "repo1/src/",
dockerfile: "repo1/images/Dockerfile",
location: "location1",
oidcCredentials: {
azureClientId: "12345678-3456-7890-5678-012345678901",
azureTenantId: "66666666-3456-7890-5678-012345678901",
},
repositoryName: "repo1",
repositoryOwner: "owner1",
tags: { appname: "testApp" },
};
const credential = new DefaultAzureCredential();
const client = new DeveloperHubServiceClient(credential, subscriptionId);
const result = await client.workflowOperations.createOrUpdate(
resourceGroupName,
workflowName,
parameters
);
console.log(result);
}
createWorkflow().catch(console.error);

Просмотреть файл

@ -0,0 +1,30 @@
/*
* 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.
const { DeveloperHubServiceClient } = require("@azure/arm-devhub");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Deletes a workflow
*
* @summary Deletes a workflow
* x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Workflow_Delete.json
*/
async function deleteWorkflow() {
const subscriptionId = "subscriptionId1";
const resourceGroupName = "resourceGroup1";
const workflowName = "workflow1";
const credential = new DefaultAzureCredential();
const client = new DeveloperHubServiceClient(credential, subscriptionId);
const result = await client.workflowOperations.delete(resourceGroupName, workflowName);
console.log(result);
}
deleteWorkflow().catch(console.error);

Просмотреть файл

@ -0,0 +1,30 @@
/*
* 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.
const { DeveloperHubServiceClient } = require("@azure/arm-devhub");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets a workflow.
*
* @summary Gets a workflow.
* x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Workflow_Get.json
*/
async function getWorkflow() {
const subscriptionId = "subscriptionId1";
const resourceGroupName = "resourceGroup1";
const workflowName = "workflow1";
const credential = new DefaultAzureCredential();
const client = new DeveloperHubServiceClient(credential, subscriptionId);
const result = await client.workflowOperations.get(resourceGroupName, workflowName);
console.log(result);
}
getWorkflow().catch(console.error);

Просмотреть файл

@ -0,0 +1,40 @@
/*
* 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.
const { DeveloperHubServiceClient } = require("@azure/arm-devhub");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets a list of workflows within a resource group.
*
* @summary Gets a list of workflows within a resource group.
* x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Workflow_ListByResourceGroup.json
*/
async function listWorkflows() {
const subscriptionId = "subscriptionId1";
const resourceGroupName = "resourceGroup1";
const managedClusterResource =
"/subscriptions/subscriptionId1/resourcegroups/resourceGroup1/providers/Microsoft.ContainerService/managedClusters/cluster1";
const options = {
managedClusterResource,
};
const credential = new DefaultAzureCredential();
const client = new DeveloperHubServiceClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.workflowOperations.listByResourceGroup(
resourceGroupName,
options
)) {
resArray.push(item);
}
console.log(resArray);
}
listWorkflows().catch(console.error);

Просмотреть файл

@ -0,0 +1,31 @@
/*
* 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.
const { DeveloperHubServiceClient } = require("@azure/arm-devhub");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets a list of workflows associated with the specified subscription.
*
* @summary Gets a list of workflows associated with the specified subscription.
* x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Workflow_List.json
*/
async function listWorkflows() {
const subscriptionId = "subscriptionId1";
const credential = new DefaultAzureCredential();
const client = new DeveloperHubServiceClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.workflowOperations.list()) {
resArray.push(item);
}
console.log(resArray);
}
listWorkflows().catch(console.error);

Просмотреть файл

@ -0,0 +1,37 @@
/*
* 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.
const { DeveloperHubServiceClient } = require("@azure/arm-devhub");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Updates tags on a workflow.
*
* @summary Updates tags on a workflow.
* x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Workflow_UpdateTags.json
*/
async function updateManagedClusterTags() {
const subscriptionId = "subscriptionId1";
const resourceGroupName = "resourceGroup1";
const workflowName = "workflow1";
const parameters = {
tags: { promote: "false", resourceEnv: "testing" },
};
const credential = new DefaultAzureCredential();
const client = new DeveloperHubServiceClient(credential, subscriptionId);
const result = await client.workflowOperations.updateTags(
resourceGroupName,
workflowName,
parameters
);
console.log(result);
}
updateManagedClusterTags().catch(console.error);

Просмотреть файл

@ -0,0 +1,81 @@
# client library samples for TypeScript (Beta)
These sample programs show how to use the TypeScript client libraries for in some common scenarios.
| **File Name** | **Description** |
| ------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [gitHubOAuthCallbackSample.ts][githuboauthcallbacksample] | Callback URL to hit once authenticated with GitHub App to have the service store the OAuth token. x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/GitHubOAuthCallback.json |
| [gitHubOAuthSample.ts][githuboauthsample] | Gets GitHubOAuth info used to authenticate users with the Developer Hub GitHub App. x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/GitHubOAuth.json |
| [listGitHubOAuthSample.ts][listgithuboauthsample] | Callback URL to hit once authenticated with GitHub App to have the service store the OAuth token. x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/GitHubOAuth_List.json |
| [operationsListSample.ts][operationslistsample] | Returns list of operations. x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Operation_List.json |
| [workflowCreateOrUpdateSample.ts][workflowcreateorupdatesample] | Creates or updates a workflow x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Workflow_CreateOrUpdate.json |
| [workflowDeleteSample.ts][workflowdeletesample] | Deletes a workflow x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Workflow_Delete.json |
| [workflowGetSample.ts][workflowgetsample] | Gets a workflow. x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Workflow_Get.json |
| [workflowListByResourceGroupSample.ts][workflowlistbyresourcegroupsample] | Gets a list of workflows within a resource group. x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Workflow_ListByResourceGroup.json |
| [workflowListSample.ts][workflowlistsample] | Gets a list of workflows associated with the specified subscription. x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Workflow_List.json |
| [workflowUpdateTagsSample.ts][workflowupdatetagssample] | Updates tags on a workflow. x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Workflow_UpdateTags.json |
## Prerequisites
The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule).
Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using:
```bash
npm install -g typescript
```
You need [an Azure subscription][freesub] to run these sample programs.
Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function.
Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package].
## Setup
To run the samples using the published version of the package:
1. Install the dependencies using `npm`:
```bash
npm install
```
2. Compile the samples:
```bash
npm run build
```
3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically.
4. Run whichever samples you like (note that some samples may require additional setup, see the table above):
```bash
node dist/gitHubOAuthCallbackSample.js
```
Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform):
```bash
npx cross-env node dist/gitHubOAuthCallbackSample.js
```
## Next Steps
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
[githuboauthcallbacksample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devhub/arm-devhub/samples/v1-beta/typescript/src/gitHubOAuthCallbackSample.ts
[githuboauthsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devhub/arm-devhub/samples/v1-beta/typescript/src/gitHubOAuthSample.ts
[listgithuboauthsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devhub/arm-devhub/samples/v1-beta/typescript/src/listGitHubOAuthSample.ts
[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devhub/arm-devhub/samples/v1-beta/typescript/src/operationsListSample.ts
[workflowcreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devhub/arm-devhub/samples/v1-beta/typescript/src/workflowCreateOrUpdateSample.ts
[workflowdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devhub/arm-devhub/samples/v1-beta/typescript/src/workflowDeleteSample.ts
[workflowgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devhub/arm-devhub/samples/v1-beta/typescript/src/workflowGetSample.ts
[workflowlistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devhub/arm-devhub/samples/v1-beta/typescript/src/workflowListByResourceGroupSample.ts
[workflowlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devhub/arm-devhub/samples/v1-beta/typescript/src/workflowListSample.ts
[workflowupdatetagssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/devhub/arm-devhub/samples/v1-beta/typescript/src/workflowUpdateTagsSample.ts
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-devhub?view=azure-node-preview
[freesub]: https://azure.microsoft.com/free/
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/devhub/arm-devhub/README.md
[typescript]: https://www.typescriptlang.org/docs/home.html

Просмотреть файл

@ -0,0 +1,41 @@
{
"name": "@azure-samples/arm-devhub-ts-beta",
"private": true,
"version": "1.0.0",
"description": " client library samples for TypeScript (Beta)",
"engines": {
"node": ">=14.0.0"
},
"scripts": {
"build": "tsc",
"prebuild": "rimraf dist/"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
"directory": "sdk/devhub/arm-devhub"
},
"keywords": [
"node",
"azure",
"typescript",
"browser",
"isomorphic"
],
"author": "Microsoft Corporation",
"license": "MIT",
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/devhub/arm-devhub",
"dependencies": {
"@azure/arm-devhub": "next",
"dotenv": "latest",
"@azure/identity": "^2.0.1"
},
"devDependencies": {
"@types/node": "^14.0.0",
"typescript": "~4.8.0",
"rimraf": "latest"
}
}

Просмотреть файл

@ -0,0 +1,4 @@
# App registration secret for AAD authentication
AZURE_CLIENT_SECRET=
AZURE_CLIENT_ID=
AZURE_TENANT_ID=

Просмотреть файл

@ -0,0 +1,31 @@
/*
* 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 { DeveloperHubServiceClient } from "@azure/arm-devhub";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Callback URL to hit once authenticated with GitHub App to have the service store the OAuth token.
*
* @summary Callback URL to hit once authenticated with GitHub App to have the service store the OAuth token.
* x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/GitHubOAuthCallback.json
*/
async function gitHubOAuthCallback() {
const subscriptionId = "subscriptionId1";
const location = "eastus2euap";
const code = "3584d83530557fdd1f46af8289938c8ef79f9dc5";
const state = "12345678-3456-7890-5678-012345678901";
const credential = new DefaultAzureCredential();
const client = new DeveloperHubServiceClient(credential, subscriptionId);
const result = await client.gitHubOAuthCallback(location, code, state);
console.log(result);
}
gitHubOAuthCallback().catch(console.error);

Просмотреть файл

@ -0,0 +1,37 @@
/*
* 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 {
GitHubOAuthCallRequest,
GitHubOAuthOptionalParams,
DeveloperHubServiceClient
} from "@azure/arm-devhub";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Gets GitHubOAuth info used to authenticate users with the Developer Hub GitHub App.
*
* @summary Gets GitHubOAuth info used to authenticate users with the Developer Hub GitHub App.
* x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/GitHubOAuth.json
*/
async function gitHubOAuth() {
const subscriptionId = "subscriptionId1";
const location = "eastus2euap";
const parameters: GitHubOAuthCallRequest = {
redirectUrl: "https://ms.portal.azure.com/aks"
};
const options: GitHubOAuthOptionalParams = { parameters };
const credential = new DefaultAzureCredential();
const client = new DeveloperHubServiceClient(credential, subscriptionId);
const result = await client.gitHubOAuth(location, options);
console.log(result);
}
gitHubOAuth().catch(console.error);

Просмотреть файл

@ -0,0 +1,29 @@
/*
* 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 { DeveloperHubServiceClient } from "@azure/arm-devhub";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Callback URL to hit once authenticated with GitHub App to have the service store the OAuth token.
*
* @summary Callback URL to hit once authenticated with GitHub App to have the service store the OAuth token.
* x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/GitHubOAuth_List.json
*/
async function listGitHubOAuth() {
const subscriptionId = "subscriptionId1";
const location = "eastus2euap";
const credential = new DefaultAzureCredential();
const client = new DeveloperHubServiceClient(credential, subscriptionId);
const result = await client.listGitHubOAuth(location);
console.log(result);
}
listGitHubOAuth().catch(console.error);

Просмотреть файл

@ -0,0 +1,30 @@
/*
* 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 { DeveloperHubServiceClient } from "@azure/arm-devhub";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns list of operations.
*
* @summary Returns list of operations.
* x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Operation_List.json
*/
async function listAvailableOperationsForTheContainerServiceResourceProvider() {
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new DeveloperHubServiceClient(credential, subscriptionId);
const result = await client.operations.list();
console.log(result);
}
listAvailableOperationsForTheContainerServiceResourceProvider().catch(
console.error
);

Просмотреть файл

@ -0,0 +1,60 @@
/*
* 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 { Workflow, DeveloperHubServiceClient } from "@azure/arm-devhub";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Creates or updates a workflow
*
* @summary Creates or updates a workflow
* x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Workflow_CreateOrUpdate.json
*/
async function createWorkflow() {
const subscriptionId = "subscriptionId1";
const resourceGroupName = "resourceGroup1";
const workflowName = "workflow1";
const parameters: Workflow = {
acr: {
acrRegistryName: "registry1",
acrRepositoryName: "repo1",
acrResourceGroup: "resourceGroup1",
acrSubscriptionId: "subscriptionId1"
},
aksResourceId:
"/subscriptions/subscriptionId1/resourcegroups/resourceGroup1/providers/Microsoft.ContainerService/managedClusters/cluster1",
branchName: "branch1",
deploymentProperties: {
kubeManifestLocations: ["/src/manifests/"],
manifestType: "kube",
overrides: { key1: "value1" }
},
dockerBuildContext: "repo1/src/",
dockerfile: "repo1/images/Dockerfile",
location: "location1",
oidcCredentials: {
azureClientId: "12345678-3456-7890-5678-012345678901",
azureTenantId: "66666666-3456-7890-5678-012345678901"
},
repositoryName: "repo1",
repositoryOwner: "owner1",
tags: { appname: "testApp" }
};
const credential = new DefaultAzureCredential();
const client = new DeveloperHubServiceClient(credential, subscriptionId);
const result = await client.workflowOperations.createOrUpdate(
resourceGroupName,
workflowName,
parameters
);
console.log(result);
}
createWorkflow().catch(console.error);

Просмотреть файл

@ -0,0 +1,33 @@
/*
* 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 { DeveloperHubServiceClient } from "@azure/arm-devhub";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Deletes a workflow
*
* @summary Deletes a workflow
* x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Workflow_Delete.json
*/
async function deleteWorkflow() {
const subscriptionId = "subscriptionId1";
const resourceGroupName = "resourceGroup1";
const workflowName = "workflow1";
const credential = new DefaultAzureCredential();
const client = new DeveloperHubServiceClient(credential, subscriptionId);
const result = await client.workflowOperations.delete(
resourceGroupName,
workflowName
);
console.log(result);
}
deleteWorkflow().catch(console.error);

Просмотреть файл

@ -0,0 +1,33 @@
/*
* 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 { DeveloperHubServiceClient } from "@azure/arm-devhub";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Gets a workflow.
*
* @summary Gets a workflow.
* x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Workflow_Get.json
*/
async function getWorkflow() {
const subscriptionId = "subscriptionId1";
const resourceGroupName = "resourceGroup1";
const workflowName = "workflow1";
const credential = new DefaultAzureCredential();
const client = new DeveloperHubServiceClient(credential, subscriptionId);
const result = await client.workflowOperations.get(
resourceGroupName,
workflowName
);
console.log(result);
}
getWorkflow().catch(console.error);

Просмотреть файл

@ -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 {
WorkflowListByResourceGroupOptionalParams,
DeveloperHubServiceClient
} from "@azure/arm-devhub";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Gets a list of workflows within a resource group.
*
* @summary Gets a list of workflows within a resource group.
* x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Workflow_ListByResourceGroup.json
*/
async function listWorkflows() {
const subscriptionId = "subscriptionId1";
const resourceGroupName = "resourceGroup1";
const managedClusterResource =
"/subscriptions/subscriptionId1/resourcegroups/resourceGroup1/providers/Microsoft.ContainerService/managedClusters/cluster1";
const options: WorkflowListByResourceGroupOptionalParams = {
managedClusterResource
};
const credential = new DefaultAzureCredential();
const client = new DeveloperHubServiceClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.workflowOperations.listByResourceGroup(
resourceGroupName,
options
)) {
resArray.push(item);
}
console.log(resArray);
}
listWorkflows().catch(console.error);

Просмотреть файл

@ -0,0 +1,31 @@
/*
* 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 { DeveloperHubServiceClient } from "@azure/arm-devhub";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Gets a list of workflows associated with the specified subscription.
*
* @summary Gets a list of workflows associated with the specified subscription.
* x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Workflow_List.json
*/
async function listWorkflows() {
const subscriptionId = "subscriptionId1";
const credential = new DefaultAzureCredential();
const client = new DeveloperHubServiceClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.workflowOperations.list()) {
resArray.push(item);
}
console.log(resArray);
}
listWorkflows().catch(console.error);

Просмотреть файл

@ -0,0 +1,37 @@
/*
* 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 { TagsObject, DeveloperHubServiceClient } from "@azure/arm-devhub";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Updates tags on a workflow.
*
* @summary Updates tags on a workflow.
* x-ms-original-file: specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-04-01-preview/examples/Workflow_UpdateTags.json
*/
async function updateManagedClusterTags() {
const subscriptionId = "subscriptionId1";
const resourceGroupName = "resourceGroup1";
const workflowName = "workflow1";
const parameters: TagsObject = {
tags: { promote: "false", resourceEnv: "testing" }
};
const credential = new DefaultAzureCredential();
const client = new DeveloperHubServiceClient(credential, subscriptionId);
const result = await client.workflowOperations.updateTags(
resourceGroupName,
workflowName,
parameters
);
console.log(result);
}
updateManagedClusterTags().catch(console.error);

Просмотреть файл

@ -0,0 +1,17 @@
{
"compilerOptions": {
"target": "ES2018",
"module": "commonjs",
"moduleResolution": "node",
"resolveJsonModule": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"alwaysStrict": true,
"outDir": "dist",
"rootDir": "src"
},
"include": [
"src/**.ts"
]
}

Просмотреть файл

@ -0,0 +1,270 @@
/*
* 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.
*/
import * as coreClient from "@azure/core-client";
import * as coreRestPipeline from "@azure/core-rest-pipeline";
import {
PipelineRequest,
PipelineResponse,
SendRequest
} from "@azure/core-rest-pipeline";
import * as coreAuth from "@azure/core-auth";
import { OperationsImpl, WorkflowOperationsImpl } from "./operations";
import { Operations, WorkflowOperations } from "./operationsInterfaces";
import * as Parameters from "./models/parameters";
import * as Mappers from "./models/mappers";
import {
DeveloperHubServiceClientOptionalParams,
GitHubOAuthOptionalParams,
GitHubOAuthOperationResponse,
GitHubOAuthCallbackOptionalParams,
GitHubOAuthCallbackResponse,
ListGitHubOAuthOptionalParams,
ListGitHubOAuthResponse
} from "./models";
export class DeveloperHubServiceClient extends coreClient.ServiceClient {
$host: string;
apiVersion: string;
subscriptionId: string;
/**
* Initializes a new instance of the DeveloperHubServiceClient class.
* @param credentials Subscription credentials which uniquely identify client subscription.
* @param subscriptionId The ID of the target subscription.
* @param options The parameter options
*/
constructor(
credentials: coreAuth.TokenCredential,
subscriptionId: string,
options?: DeveloperHubServiceClientOptionalParams
) {
if (credentials === undefined) {
throw new Error("'credentials' cannot be null");
}
if (subscriptionId === undefined) {
throw new Error("'subscriptionId' cannot be null");
}
// Initializing default values for options
if (!options) {
options = {};
}
const defaults: DeveloperHubServiceClientOptionalParams = {
requestContentType: "application/json; charset=utf-8",
credential: credentials
};
const packageDetails = `azsdk-js-arm-devhub/1.0.0-beta.1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
: `${packageDetails}`;
if (!options.credentialScopes) {
options.credentialScopes = ["https://management.azure.com/.default"];
}
const optionsWithDefaults = {
...defaults,
...options,
userAgentOptions: {
userAgentPrefix
},
baseUri:
options.endpoint ?? options.baseUri ?? "https://management.azure.com"
};
super(optionsWithDefaults);
let bearerTokenAuthenticationPolicyFound: boolean = false;
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
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
}
})
);
}
// Parameter assignments
this.subscriptionId = subscriptionId;
// Assigning values to Constant parameters
this.$host = options.$host || "https://management.azure.com";
this.apiVersion = options.apiVersion || "2022-04-01-preview";
this.operations = new OperationsImpl(this);
this.workflowOperations = new WorkflowOperationsImpl(this);
this.addCustomApiVersionPolicy(options.apiVersion);
}
/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
private addCustomApiVersionPolicy(apiVersion?: string) {
if (!apiVersion) {
return;
}
const apiVersionPolicy = {
name: "CustomApiVersionPolicy",
async sendRequest(
request: PipelineRequest,
next: SendRequest
): Promise<PipelineResponse> {
const param = request.url.split("?");
if (param.length > 1) {
const newParams = param[1].split("&").map((item) => {
if (item.indexOf("api-version") > -1) {
return "api-version=" + apiVersion;
} else {
return item;
}
});
request.url = param[0] + "?" + newParams.join("&");
}
return next(request);
}
};
this.pipeline.addPolicy(apiVersionPolicy);
}
/**
* Gets GitHubOAuth info used to authenticate users with the Developer Hub GitHub App.
* @param location The name of Azure region.
* @param options The options parameters.
*/
gitHubOAuth(
location: string,
options?: GitHubOAuthOptionalParams
): Promise<GitHubOAuthOperationResponse> {
return this.sendOperationRequest(
{ location, options },
gitHubOAuthOperationSpec
);
}
/**
* Callback URL to hit once authenticated with GitHub App to have the service store the OAuth token.
* @param location The name of Azure region.
* @param code The code response from authenticating the GitHub App.
* @param state The state response from authenticating the GitHub App.
* @param options The options parameters.
*/
gitHubOAuthCallback(
location: string,
code: string,
state: string,
options?: GitHubOAuthCallbackOptionalParams
): Promise<GitHubOAuthCallbackResponse> {
return this.sendOperationRequest(
{ location, code, state, options },
gitHubOAuthCallbackOperationSpec
);
}
/**
* Callback URL to hit once authenticated with GitHub App to have the service store the OAuth token.
* @param location The name of Azure region.
* @param options The options parameters.
*/
listGitHubOAuth(
location: string,
options?: ListGitHubOAuthOptionalParams
): Promise<ListGitHubOAuthResponse> {
return this.sendOperationRequest(
{ location, options },
listGitHubOAuthOperationSpec
);
}
operations: Operations;
workflowOperations: WorkflowOperations;
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const gitHubOAuthOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/providers/Microsoft.DevHub/locations/{location}/githuboauth/default/getGitHubOAuthInfo",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.GitHubOAuthInfoResponse
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
requestBody: Parameters.parameters,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.location
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const gitHubOAuthCallbackOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/providers/Microsoft.DevHub/locations/{location}/githuboauth/default",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.GitHubOAuthResponse
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion, Parameters.code, Parameters.state],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.location
],
headerParameters: [Parameters.accept],
serializer
};
const listGitHubOAuthOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/providers/Microsoft.DevHub/locations/{location}/githuboauth",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.GitHubOAuthListResponse
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.location
],
headerParameters: [Parameters.accept],
serializer
};

Просмотреть файл

@ -0,0 +1,12 @@
/*
* 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.
*/
/// <reference lib="esnext.asynciterable" />
export * from "./models";
export { DeveloperHubServiceClient } from "./developerHubServiceClient";
export * from "./operationsInterfaces";

Просмотреть файл

@ -0,0 +1,518 @@
/*
* 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.
*/
import * as coreClient from "@azure/core-client";
/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */
export interface OperationListResult {
/**
* List of operations supported by the resource provider
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly value?: Operation[];
/**
* URL to get the next set of operation list results (if there are any).
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly nextLink?: string;
}
/** Details of a REST API operation, returned from the Resource Provider Operations API */
export interface Operation {
/**
* The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action"
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly name?: string;
/**
* Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly isDataAction?: boolean;
/** Localized display information for this particular operation. */
display?: OperationDisplay;
/**
* The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system"
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly origin?: Origin;
/**
* Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly actionType?: ActionType;
}
/** Localized display information for this particular operation. */
export interface OperationDisplay {
/**
* The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute".
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly provider?: string;
/**
* The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections".
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly resource?: string;
/**
* The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine".
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly operation?: string;
/**
* The short, localized friendly description of the operation; suitable for tool tips and detailed views.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly description?: string;
}
/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */
export interface ErrorResponse {
/** The error object. */
error?: ErrorDetail;
}
/** The error detail. */
export interface ErrorDetail {
/**
* The error code.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly code?: string;
/**
* The error message.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly message?: string;
/**
* The error target.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly target?: string;
/**
* The error details.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly details?: ErrorDetail[];
/**
* The error additional info.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly additionalInfo?: ErrorAdditionalInfo[];
}
/** The resource management error additional info. */
export interface ErrorAdditionalInfo {
/**
* The additional info type.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly type?: string;
/**
* The additional info.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly info?: Record<string, unknown>;
}
/** GitHubOAuth request object */
export interface GitHubOAuthCallRequest {
/** The URL the client will redirect to on successful authentication. If empty, no redirect will occur. */
redirectUrl?: string;
}
/** URL used to authorize the Developer Hub GitHub App */
export interface GitHubOAuthInfoResponse {
/** URL for authorizing the Developer Hub GitHub App */
authURL?: string;
/** OAuth token used to make calls to GitHub */
token?: string;
}
/** Common fields that are returned in the response for all Azure Resource Manager resources */
export interface Resource {
/**
* Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly id?: string;
/**
* The name of the resource
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly name?: string;
/**
* The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly type?: string;
/**
* Azure Resource Manager metadata containing createdBy and modifiedBy information.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly systemData?: SystemData;
}
/** Metadata pertaining to creation and last modification of the resource. */
export interface SystemData {
/** The identity that created the resource. */
createdBy?: string;
/** The type of identity that created the resource. */
createdByType?: CreatedByType;
/** The timestamp of resource creation (UTC). */
createdAt?: Date;
/** The identity that last modified the resource. */
lastModifiedBy?: string;
/** The type of identity that last modified the resource. */
lastModifiedByType?: CreatedByType;
/** The timestamp of resource last modification (UTC) */
lastModifiedAt?: Date;
}
/** The response from List GitHubOAuth operation. */
export interface GitHubOAuthListResponse {
/** Singleton list response containing one GitHubOAuthResponse response */
value?: GitHubOAuthResponse[];
}
/** The response from List Workflows operation. */
export interface WorkflowListResult {
/** The list of workflows. */
value?: Workflow[];
/**
* The URL to the next set of workflow results.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly nextLink?: string;
}
export interface DeploymentProperties {
/** Determines the type of manifests within the repository. */
manifestType?: ManifestType;
kubeManifestLocations?: string[];
/** Helm chart directory path in repository. */
helmChartPath?: string;
/** Helm Values.yaml file location in repository. */
helmValues?: string;
/** Manifest override values. */
overrides?: { [propertyName: string]: string };
}
/** Information on the azure container registry */
export interface Acr {
/** ACR subscription id */
acrSubscriptionId?: string;
/** ACR resource group */
acrResourceGroup?: string;
/** ACR registry */
acrRegistryName?: string;
/** ACR repository */
acrRepositoryName?: string;
}
/** The fields needed for OIDC with GitHub. */
export interface GitHubWorkflowProfileOidcCredentials {
/** Azure Application Client ID */
azureClientId?: string;
/** Azure Directory (tenant) ID */
azureTenantId?: string;
}
export interface WorkflowRun {
/**
* Describes if the workflow run succeeded.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly succeeded?: boolean;
/**
* URL to the run of the workflow.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly workflowRunURL?: string;
/**
* The timestamp of the last workflow run.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly lastRunAt?: Date;
}
/** delete response if content must be provided on delete operation */
export interface DeleteWorkflowResponse {
/** delete status message */
status?: string;
}
/** Resource tags. */
export interface TagsObject {
/** Dictionary of <string> */
tags?: { [propertyName: string]: string };
}
/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */
export interface ProxyResource extends Resource {}
/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */
export interface TrackedResource extends Resource {
/** Resource tags. */
tags?: { [propertyName: string]: string };
/** The geo-location where the resource lives */
location: string;
}
/** Singleton response of GitHubOAuth containing */
export interface GitHubOAuthResponse extends ProxyResource {
/** user making request */
username?: string;
}
/** Resource representation of a workflow */
export interface Workflow extends TrackedResource {
/** Repository Owner */
repositoryOwner?: string;
/** Repository Name */
repositoryName?: string;
/** Repository Branch Name */
branchName?: string;
/** Path to the Dockerfile within the repository. */
dockerfile?: string;
/** Path to Dockerfile Build Context within the repository. */
dockerBuildContext?: string;
deploymentProperties?: DeploymentProperties;
/** Kubernetes namespace the application is deployed to. */
namespace?: string;
/** Information on the azure container registry */
acr?: Acr;
/** The fields needed for OIDC with GitHub. */
oidcCredentials?: GitHubWorkflowProfileOidcCredentials;
/** The Azure Kubernetes Cluster Resource the application will be deployed to. */
aksResourceId?: string;
/**
* The URL to the Pull Request submitted against the users repository.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly prURL?: string;
/**
* The number associated with the submitted pull request.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly pullNumber?: number;
/**
* The status of the Pull Request submitted against the users repository.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly prStatus?: PullRequestStatus;
lastWorkflowRun?: WorkflowRun;
/** Determines the type of manifests within the repository. */
authStatus?: ManifestType;
}
/** Known values of {@link Origin} that the service accepts. */
export enum KnownOrigin {
/** User */
User = "user",
/** System */
System = "system",
/** UserSystem */
UserSystem = "user,system"
}
/**
* Defines values for Origin. \
* {@link KnownOrigin} can be used interchangeably with Origin,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **user** \
* **system** \
* **user,system**
*/
export type Origin = string;
/** Known values of {@link ActionType} that the service accepts. */
export enum KnownActionType {
/** Internal */
Internal = "Internal"
}
/**
* Defines values for ActionType. \
* {@link KnownActionType} can be used interchangeably with ActionType,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **Internal**
*/
export type ActionType = string;
/** Known values of {@link CreatedByType} that the service accepts. */
export enum KnownCreatedByType {
/** User */
User = "User",
/** Application */
Application = "Application",
/** ManagedIdentity */
ManagedIdentity = "ManagedIdentity",
/** Key */
Key = "Key"
}
/**
* Defines values for CreatedByType. \
* {@link KnownCreatedByType} can be used interchangeably with CreatedByType,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **User** \
* **Application** \
* **ManagedIdentity** \
* **Key**
*/
export type CreatedByType = string;
/** Known values of {@link ManifestType} that the service accepts. */
export enum KnownManifestType {
/** Repositories using helm */
Helm = "helm",
/** Repositories using kubernetes manifests */
Kube = "kube"
}
/**
* Defines values for ManifestType. \
* {@link KnownManifestType} can be used interchangeably with ManifestType,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **helm**: Repositories using helm \
* **kube**: Repositories using kubernetes manifests
*/
export type ManifestType = string;
/** Known values of {@link PullRequestStatus} that the service accepts. */
export enum KnownPullRequestStatus {
/** Pull Request state unknown. */
Unknown = "unknown",
/** Pull Request submitted to repository. */
Submitted = "submitted",
/** Pull Request merged into repository. */
Merged = "merged",
/** Workflow no longer found within repository. */
Removed = "removed"
}
/**
* Defines values for PullRequestStatus. \
* {@link KnownPullRequestStatus} can be used interchangeably with PullRequestStatus,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **unknown**: Pull Request state unknown. \
* **submitted**: Pull Request submitted to repository. \
* **merged**: Pull Request merged into repository. \
* **removed**: Workflow no longer found within repository.
*/
export type PullRequestStatus = string;
/** Optional parameters. */
export interface OperationsListOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the list operation. */
export type OperationsListResponse = OperationListResult;
/** Optional parameters. */
export interface GitHubOAuthOptionalParams extends coreClient.OperationOptions {
/** GitHubOAuth request object */
parameters?: GitHubOAuthCallRequest;
}
/** Contains response data for the gitHubOAuth operation. */
export type GitHubOAuthOperationResponse = GitHubOAuthInfoResponse;
/** Optional parameters. */
export interface GitHubOAuthCallbackOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the gitHubOAuthCallback operation. */
export type GitHubOAuthCallbackResponse = GitHubOAuthResponse;
/** Optional parameters. */
export interface ListGitHubOAuthOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the listGitHubOAuth operation. */
export type ListGitHubOAuthResponse = GitHubOAuthListResponse;
/** Optional parameters. */
export interface WorkflowListOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the list operation. */
export type WorkflowListResponse = WorkflowListResult;
/** Optional parameters. */
export interface WorkflowListByResourceGroupOptionalParams
extends coreClient.OperationOptions {
/** The ManagedCluster resource associated with the workflows. */
managedClusterResource?: string;
}
/** Contains response data for the listByResourceGroup operation. */
export type WorkflowListByResourceGroupResponse = WorkflowListResult;
/** Optional parameters. */
export interface WorkflowGetOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the get operation. */
export type WorkflowGetResponse = Workflow;
/** Optional parameters. */
export interface WorkflowCreateOrUpdateOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the createOrUpdate operation. */
export type WorkflowCreateOrUpdateResponse = Workflow;
/** Optional parameters. */
export interface WorkflowDeleteOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the delete operation. */
export type WorkflowDeleteResponse = DeleteWorkflowResponse;
/** Optional parameters. */
export interface WorkflowUpdateTagsOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the updateTags operation. */
export type WorkflowUpdateTagsResponse = Workflow;
/** Optional parameters. */
export interface WorkflowListNextOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the listNext operation. */
export type WorkflowListNextResponse = WorkflowListResult;
/** Optional parameters. */
export interface WorkflowListByResourceGroupNextOptionalParams
extends coreClient.OperationOptions {
/** The ManagedCluster resource associated with the workflows. */
managedClusterResource?: string;
}
/** Contains response data for the listByResourceGroupNext operation. */
export type WorkflowListByResourceGroupNextResponse = WorkflowListResult;
/** Optional parameters. */
export interface DeveloperHubServiceClientOptionalParams
extends coreClient.ServiceClientOptions {
/** server parameter */
$host?: string;
/** Api Version */
apiVersion?: string;
/** Overrides client endpoint. */
endpoint?: string;
}

Просмотреть файл

@ -0,0 +1,699 @@
/*
* 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.
*/
import * as coreClient from "@azure/core-client";
export const OperationListResult: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "OperationListResult",
modelProperties: {
value: {
serializedName: "value",
readOnly: true,
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "Operation"
}
}
}
},
nextLink: {
serializedName: "nextLink",
readOnly: true,
type: {
name: "String"
}
}
}
}
};
export const Operation: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "Operation",
modelProperties: {
name: {
serializedName: "name",
readOnly: true,
type: {
name: "String"
}
},
isDataAction: {
serializedName: "isDataAction",
readOnly: true,
type: {
name: "Boolean"
}
},
display: {
serializedName: "display",
type: {
name: "Composite",
className: "OperationDisplay"
}
},
origin: {
serializedName: "origin",
readOnly: true,
type: {
name: "String"
}
},
actionType: {
serializedName: "actionType",
readOnly: true,
type: {
name: "String"
}
}
}
}
};
export const OperationDisplay: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "OperationDisplay",
modelProperties: {
provider: {
serializedName: "provider",
readOnly: true,
type: {
name: "String"
}
},
resource: {
serializedName: "resource",
readOnly: true,
type: {
name: "String"
}
},
operation: {
serializedName: "operation",
readOnly: true,
type: {
name: "String"
}
},
description: {
serializedName: "description",
readOnly: true,
type: {
name: "String"
}
}
}
}
};
export const ErrorResponse: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "ErrorResponse",
modelProperties: {
error: {
serializedName: "error",
type: {
name: "Composite",
className: "ErrorDetail"
}
}
}
}
};
export const ErrorDetail: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "ErrorDetail",
modelProperties: {
code: {
serializedName: "code",
readOnly: true,
type: {
name: "String"
}
},
message: {
serializedName: "message",
readOnly: true,
type: {
name: "String"
}
},
target: {
serializedName: "target",
readOnly: true,
type: {
name: "String"
}
},
details: {
serializedName: "details",
readOnly: true,
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "ErrorDetail"
}
}
}
},
additionalInfo: {
serializedName: "additionalInfo",
readOnly: true,
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "ErrorAdditionalInfo"
}
}
}
}
}
}
};
export const ErrorAdditionalInfo: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "ErrorAdditionalInfo",
modelProperties: {
type: {
serializedName: "type",
readOnly: true,
type: {
name: "String"
}
},
info: {
serializedName: "info",
readOnly: true,
type: {
name: "Dictionary",
value: { type: { name: "any" } }
}
}
}
}
};
export const GitHubOAuthCallRequest: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "GitHubOAuthCallRequest",
modelProperties: {
redirectUrl: {
serializedName: "redirectUrl",
type: {
name: "String"
}
}
}
}
};
export const GitHubOAuthInfoResponse: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "GitHubOAuthInfoResponse",
modelProperties: {
authURL: {
serializedName: "authURL",
type: {
name: "String"
}
},
token: {
serializedName: "token",
type: {
name: "String"
}
}
}
}
};
export const Resource: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "Resource",
modelProperties: {
id: {
serializedName: "id",
readOnly: true,
type: {
name: "String"
}
},
name: {
serializedName: "name",
readOnly: true,
type: {
name: "String"
}
},
type: {
serializedName: "type",
readOnly: true,
type: {
name: "String"
}
},
systemData: {
serializedName: "systemData",
type: {
name: "Composite",
className: "SystemData"
}
}
}
}
};
export const SystemData: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "SystemData",
modelProperties: {
createdBy: {
serializedName: "createdBy",
type: {
name: "String"
}
},
createdByType: {
serializedName: "createdByType",
type: {
name: "String"
}
},
createdAt: {
serializedName: "createdAt",
type: {
name: "DateTime"
}
},
lastModifiedBy: {
serializedName: "lastModifiedBy",
type: {
name: "String"
}
},
lastModifiedByType: {
serializedName: "lastModifiedByType",
type: {
name: "String"
}
},
lastModifiedAt: {
serializedName: "lastModifiedAt",
type: {
name: "DateTime"
}
}
}
}
};
export const GitHubOAuthListResponse: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "GitHubOAuthListResponse",
modelProperties: {
value: {
serializedName: "value",
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "GitHubOAuthResponse"
}
}
}
}
}
}
};
export const WorkflowListResult: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "WorkflowListResult",
modelProperties: {
value: {
serializedName: "value",
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "Workflow"
}
}
}
},
nextLink: {
serializedName: "nextLink",
readOnly: true,
type: {
name: "String"
}
}
}
}
};
export const DeploymentProperties: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "DeploymentProperties",
modelProperties: {
manifestType: {
serializedName: "manifestType",
type: {
name: "String"
}
},
kubeManifestLocations: {
serializedName: "kubeManifestLocations",
type: {
name: "Sequence",
element: {
type: {
name: "String"
}
}
}
},
helmChartPath: {
serializedName: "helmChartPath",
type: {
name: "String"
}
},
helmValues: {
serializedName: "helmValues",
type: {
name: "String"
}
},
overrides: {
serializedName: "overrides",
type: {
name: "Dictionary",
value: { type: { name: "String" } }
}
}
}
}
};
export const Acr: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "Acr",
modelProperties: {
acrSubscriptionId: {
serializedName: "acrSubscriptionId",
type: {
name: "String"
}
},
acrResourceGroup: {
serializedName: "acrResourceGroup",
type: {
name: "String"
}
},
acrRegistryName: {
serializedName: "acrRegistryName",
type: {
name: "String"
}
},
acrRepositoryName: {
serializedName: "acrRepositoryName",
type: {
name: "String"
}
}
}
}
};
export const GitHubWorkflowProfileOidcCredentials: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "GitHubWorkflowProfileOidcCredentials",
modelProperties: {
azureClientId: {
serializedName: "azureClientId",
type: {
name: "String"
}
},
azureTenantId: {
serializedName: "azureTenantId",
type: {
name: "String"
}
}
}
}
};
export const WorkflowRun: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "WorkflowRun",
modelProperties: {
succeeded: {
serializedName: "succeeded",
readOnly: true,
type: {
name: "Boolean"
}
},
workflowRunURL: {
serializedName: "workflowRunURL",
readOnly: true,
type: {
name: "String"
}
},
lastRunAt: {
serializedName: "lastRunAt",
readOnly: true,
type: {
name: "DateTime"
}
}
}
}
};
export const DeleteWorkflowResponse: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "DeleteWorkflowResponse",
modelProperties: {
status: {
serializedName: "status",
type: {
name: "String"
}
}
}
}
};
export const TagsObject: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "TagsObject",
modelProperties: {
tags: {
serializedName: "tags",
type: {
name: "Dictionary",
value: { type: { name: "String" } }
}
}
}
}
};
export const ProxyResource: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "ProxyResource",
modelProperties: {
...Resource.type.modelProperties
}
}
};
export const TrackedResource: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "TrackedResource",
modelProperties: {
...Resource.type.modelProperties,
tags: {
serializedName: "tags",
type: {
name: "Dictionary",
value: { type: { name: "String" } }
}
},
location: {
serializedName: "location",
required: true,
type: {
name: "String"
}
}
}
}
};
export const GitHubOAuthResponse: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "GitHubOAuthResponse",
modelProperties: {
...ProxyResource.type.modelProperties,
username: {
serializedName: "properties.username",
type: {
name: "String"
}
}
}
}
};
export const Workflow: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "Workflow",
modelProperties: {
...TrackedResource.type.modelProperties,
repositoryOwner: {
serializedName: "properties.githubWorkflowProfile.repositoryOwner",
type: {
name: "String"
}
},
repositoryName: {
serializedName: "properties.githubWorkflowProfile.repositoryName",
type: {
name: "String"
}
},
branchName: {
serializedName: "properties.githubWorkflowProfile.branchName",
type: {
name: "String"
}
},
dockerfile: {
serializedName: "properties.githubWorkflowProfile.dockerfile",
type: {
name: "String"
}
},
dockerBuildContext: {
serializedName: "properties.githubWorkflowProfile.dockerBuildContext",
type: {
name: "String"
}
},
deploymentProperties: {
serializedName: "properties.githubWorkflowProfile.deploymentProperties",
type: {
name: "Composite",
className: "DeploymentProperties"
}
},
namespace: {
serializedName: "properties.githubWorkflowProfile.namespace",
type: {
name: "String"
}
},
acr: {
serializedName: "properties.githubWorkflowProfile.acr",
type: {
name: "Composite",
className: "Acr"
}
},
oidcCredentials: {
serializedName: "properties.githubWorkflowProfile.oidcCredentials",
type: {
name: "Composite",
className: "GitHubWorkflowProfileOidcCredentials"
}
},
aksResourceId: {
serializedName: "properties.githubWorkflowProfile.aksResourceId",
type: {
name: "String"
}
},
prURL: {
serializedName: "properties.githubWorkflowProfile.prURL",
readOnly: true,
type: {
name: "String"
}
},
pullNumber: {
serializedName: "properties.githubWorkflowProfile.pullNumber",
readOnly: true,
type: {
name: "Number"
}
},
prStatus: {
serializedName: "properties.githubWorkflowProfile.prStatus",
readOnly: true,
type: {
name: "String"
}
},
lastWorkflowRun: {
serializedName: "properties.githubWorkflowProfile.lastWorkflowRun",
type: {
name: "Composite",
className: "WorkflowRun"
}
},
authStatus: {
serializedName: "properties.githubWorkflowProfile.authStatus",
type: {
name: "String"
}
}
}
}
};

Просмотреть файл

@ -0,0 +1,186 @@
/*
* 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.
*/
import {
OperationParameter,
OperationURLParameter,
OperationQueryParameter
} from "@azure/core-client";
import {
GitHubOAuthCallRequest as GitHubOAuthCallRequestMapper,
Workflow as WorkflowMapper,
TagsObject as TagsObjectMapper
} from "../models/mappers";
export const accept: OperationParameter = {
parameterPath: "accept",
mapper: {
defaultValue: "application/json",
isConstant: true,
serializedName: "Accept",
type: {
name: "String"
}
}
};
export const $host: OperationURLParameter = {
parameterPath: "$host",
mapper: {
serializedName: "$host",
required: true,
type: {
name: "String"
}
},
skipEncoding: true
};
export const apiVersion: OperationQueryParameter = {
parameterPath: "apiVersion",
mapper: {
defaultValue: "2022-04-01-preview",
isConstant: true,
serializedName: "api-version",
type: {
name: "String"
}
}
};
export const contentType: OperationParameter = {
parameterPath: ["options", "contentType"],
mapper: {
defaultValue: "application/json",
isConstant: true,
serializedName: "Content-Type",
type: {
name: "String"
}
}
};
export const parameters: OperationParameter = {
parameterPath: ["options", "parameters"],
mapper: GitHubOAuthCallRequestMapper
};
export const subscriptionId: OperationURLParameter = {
parameterPath: "subscriptionId",
mapper: {
constraints: {
MinLength: 1
},
serializedName: "subscriptionId",
required: true,
type: {
name: "String"
}
}
};
export const location: OperationURLParameter = {
parameterPath: "location",
mapper: {
constraints: {
MinLength: 1
},
serializedName: "location",
required: true,
type: {
name: "String"
}
}
};
export const code: OperationQueryParameter = {
parameterPath: "code",
mapper: {
serializedName: "code",
required: true,
type: {
name: "String"
}
}
};
export const state: OperationQueryParameter = {
parameterPath: "state",
mapper: {
serializedName: "state",
required: true,
type: {
name: "String"
}
}
};
export const resourceGroupName: OperationURLParameter = {
parameterPath: "resourceGroupName",
mapper: {
constraints: {
MaxLength: 90,
MinLength: 1
},
serializedName: "resourceGroupName",
required: true,
type: {
name: "String"
}
}
};
export const managedClusterResource: OperationQueryParameter = {
parameterPath: ["options", "managedClusterResource"],
mapper: {
serializedName: "managedClusterResource",
type: {
name: "String"
}
}
};
export const workflowName: OperationURLParameter = {
parameterPath: "workflowName",
mapper: {
constraints: {
Pattern: new RegExp(
"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"
),
MaxLength: 63,
MinLength: 1
},
serializedName: "workflowName",
required: true,
type: {
name: "String"
}
}
};
export const parameters1: OperationParameter = {
parameterPath: "parameters",
mapper: WorkflowMapper
};
export const parameters2: OperationParameter = {
parameterPath: "parameters",
mapper: TagsObjectMapper
};
export const nextLink: OperationURLParameter = {
parameterPath: "nextLink",
mapper: {
serializedName: "nextLink",
required: true,
type: {
name: "String"
}
},
skipEncoding: true
};

Просмотреть файл

@ -0,0 +1,10 @@
/*
* 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.
*/
export * from "./operations";
export * from "./workflowOperations";

Просмотреть файл

@ -0,0 +1,59 @@
/*
* 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.
*/
import { Operations } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { DeveloperHubServiceClient } from "../developerHubServiceClient";
import {
OperationsListOptionalParams,
OperationsListResponse
} from "../models";
/** Class containing Operations operations. */
export class OperationsImpl implements Operations {
private readonly client: DeveloperHubServiceClient;
/**
* Initialize a new instance of the class Operations class.
* @param client Reference to the service client
*/
constructor(client: DeveloperHubServiceClient) {
this.client = client;
}
/**
* Returns list of operations.
* @param options The options parameters.
*/
list(
options?: OperationsListOptionalParams
): Promise<OperationsListResponse> {
return this.client.sendOperationRequest({ options }, listOperationSpec);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const listOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.DevHub/operations",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.OperationListResult
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [Parameters.$host],
headerParameters: [Parameters.accept],
serializer
};

Просмотреть файл

@ -0,0 +1,449 @@
/*
* 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.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import { WorkflowOperations } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { DeveloperHubServiceClient } from "../developerHubServiceClient";
import {
Workflow,
WorkflowListNextOptionalParams,
WorkflowListOptionalParams,
WorkflowListByResourceGroupNextOptionalParams,
WorkflowListByResourceGroupOptionalParams,
WorkflowListResponse,
WorkflowListByResourceGroupResponse,
WorkflowGetOptionalParams,
WorkflowGetResponse,
WorkflowCreateOrUpdateOptionalParams,
WorkflowCreateOrUpdateResponse,
WorkflowDeleteOptionalParams,
WorkflowDeleteResponse,
TagsObject,
WorkflowUpdateTagsOptionalParams,
WorkflowUpdateTagsResponse,
WorkflowListNextResponse,
WorkflowListByResourceGroupNextResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Class containing WorkflowOperations operations. */
export class WorkflowOperationsImpl implements WorkflowOperations {
private readonly client: DeveloperHubServiceClient;
/**
* Initialize a new instance of the class WorkflowOperations class.
* @param client Reference to the service client
*/
constructor(client: DeveloperHubServiceClient) {
this.client = client;
}
/**
* Gets a list of workflows associated with the specified subscription.
* @param options The options parameters.
*/
public list(
options?: WorkflowListOptionalParams
): PagedAsyncIterableIterator<Workflow> {
const iter = this.listPagingAll(options);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: () => {
return this.listPagingPage(options);
}
};
}
private async *listPagingPage(
options?: WorkflowListOptionalParams
): AsyncIterableIterator<Workflow[]> {
let result = await this._list(options);
yield result.value || [];
let continuationToken = result.nextLink;
while (continuationToken) {
result = await this._listNext(continuationToken, options);
continuationToken = result.nextLink;
yield result.value || [];
}
}
private async *listPagingAll(
options?: WorkflowListOptionalParams
): AsyncIterableIterator<Workflow> {
for await (const page of this.listPagingPage(options)) {
yield* page;
}
}
/**
* Gets a list of workflows within a resource group.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param options The options parameters.
*/
public listByResourceGroup(
resourceGroupName: string,
options?: WorkflowListByResourceGroupOptionalParams
): PagedAsyncIterableIterator<Workflow> {
const iter = this.listByResourceGroupPagingAll(resourceGroupName, options);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: () => {
return this.listByResourceGroupPagingPage(resourceGroupName, options);
}
};
}
private async *listByResourceGroupPagingPage(
resourceGroupName: string,
options?: WorkflowListByResourceGroupOptionalParams
): AsyncIterableIterator<Workflow[]> {
let result = await this._listByResourceGroup(resourceGroupName, options);
yield result.value || [];
let continuationToken = result.nextLink;
while (continuationToken) {
result = await this._listByResourceGroupNext(
resourceGroupName,
continuationToken,
options
);
continuationToken = result.nextLink;
yield result.value || [];
}
}
private async *listByResourceGroupPagingAll(
resourceGroupName: string,
options?: WorkflowListByResourceGroupOptionalParams
): AsyncIterableIterator<Workflow> {
for await (const page of this.listByResourceGroupPagingPage(
resourceGroupName,
options
)) {
yield* page;
}
}
/**
* Gets a list of workflows associated with the specified subscription.
* @param options The options parameters.
*/
private _list(
options?: WorkflowListOptionalParams
): Promise<WorkflowListResponse> {
return this.client.sendOperationRequest({ options }, listOperationSpec);
}
/**
* Gets a list of workflows within a resource group.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param options The options parameters.
*/
private _listByResourceGroup(
resourceGroupName: string,
options?: WorkflowListByResourceGroupOptionalParams
): Promise<WorkflowListByResourceGroupResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, options },
listByResourceGroupOperationSpec
);
}
/**
* Gets a workflow.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param workflowName The name of the workflow resource.
* @param options The options parameters.
*/
get(
resourceGroupName: string,
workflowName: string,
options?: WorkflowGetOptionalParams
): Promise<WorkflowGetResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, workflowName, options },
getOperationSpec
);
}
/**
* Creates or updates a workflow
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param workflowName The name of the workflow resource.
* @param parameters Resource representation of a workflow
* @param options The options parameters.
*/
createOrUpdate(
resourceGroupName: string,
workflowName: string,
parameters: Workflow,
options?: WorkflowCreateOrUpdateOptionalParams
): Promise<WorkflowCreateOrUpdateResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, workflowName, parameters, options },
createOrUpdateOperationSpec
);
}
/**
* Deletes a workflow
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param workflowName The name of the workflow resource.
* @param options The options parameters.
*/
delete(
resourceGroupName: string,
workflowName: string,
options?: WorkflowDeleteOptionalParams
): Promise<WorkflowDeleteResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, workflowName, options },
deleteOperationSpec
);
}
/**
* Updates tags on a workflow.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param workflowName The name of the workflow resource.
* @param parameters Parameters supplied to the Update Workflow Tags operation.
* @param options The options parameters.
*/
updateTags(
resourceGroupName: string,
workflowName: string,
parameters: TagsObject,
options?: WorkflowUpdateTagsOptionalParams
): Promise<WorkflowUpdateTagsResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, workflowName, parameters, options },
updateTagsOperationSpec
);
}
/**
* ListNext
* @param nextLink The nextLink from the previous successful call to the List method.
* @param options The options parameters.
*/
private _listNext(
nextLink: string,
options?: WorkflowListNextOptionalParams
): Promise<WorkflowListNextResponse> {
return this.client.sendOperationRequest(
{ nextLink, options },
listNextOperationSpec
);
}
/**
* ListByResourceGroupNext
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method.
* @param options The options parameters.
*/
private _listByResourceGroupNext(
resourceGroupName: string,
nextLink: string,
options?: WorkflowListByResourceGroupNextOptionalParams
): Promise<WorkflowListByResourceGroupNextResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, nextLink, options },
listByResourceGroupNextOperationSpec
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const listOperationSpec: coreClient.OperationSpec = {
path: "/subscriptions/{subscriptionId}/providers/Microsoft.DevHub/workflows",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.WorkflowListResult
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [Parameters.$host, Parameters.subscriptionId],
headerParameters: [Parameters.accept],
serializer
};
const listByResourceGroupOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevHub/workflows",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.WorkflowListResult
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion, Parameters.managedClusterResource],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName
],
headerParameters: [Parameters.accept],
serializer
};
const getOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevHub/workflows/{workflowName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.Workflow
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.workflowName
],
headerParameters: [Parameters.accept],
serializer
};
const createOrUpdateOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevHub/workflows/{workflowName}",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.Workflow
},
201: {
bodyMapper: Mappers.Workflow
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
requestBody: Parameters.parameters1,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.workflowName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const deleteOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevHub/workflows/{workflowName}",
httpMethod: "DELETE",
responses: {
200: {
bodyMapper: Mappers.DeleteWorkflowResponse
},
204: {},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.workflowName
],
headerParameters: [Parameters.accept],
serializer
};
const updateTagsOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevHub/workflows/{workflowName}",
httpMethod: "PATCH",
responses: {
200: {
bodyMapper: Mappers.Workflow
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
requestBody: Parameters.parameters2,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.workflowName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const listNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.WorkflowListResult
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.nextLink
],
headerParameters: [Parameters.accept],
serializer
};
const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.WorkflowListResult
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion, Parameters.managedClusterResource],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.nextLink
],
headerParameters: [Parameters.accept],
serializer
};

Просмотреть файл

@ -0,0 +1,10 @@
/*
* 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.
*/
export * from "./operations";
export * from "./workflowOperations";

Просмотреть файл

@ -0,0 +1,21 @@
/*
* 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.
*/
import {
OperationsListOptionalParams,
OperationsListResponse
} from "../models";
/** Interface representing a Operations. */
export interface Operations {
/**
* Returns list of operations.
* @param options The options parameters.
*/
list(options?: OperationsListOptionalParams): Promise<OperationsListResponse>;
}

Просмотреть файл

@ -0,0 +1,92 @@
/*
* 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.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import {
Workflow,
WorkflowListOptionalParams,
WorkflowListByResourceGroupOptionalParams,
WorkflowGetOptionalParams,
WorkflowGetResponse,
WorkflowCreateOrUpdateOptionalParams,
WorkflowCreateOrUpdateResponse,
WorkflowDeleteOptionalParams,
WorkflowDeleteResponse,
TagsObject,
WorkflowUpdateTagsOptionalParams,
WorkflowUpdateTagsResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Interface representing a WorkflowOperations. */
export interface WorkflowOperations {
/**
* Gets a list of workflows associated with the specified subscription.
* @param options The options parameters.
*/
list(
options?: WorkflowListOptionalParams
): PagedAsyncIterableIterator<Workflow>;
/**
* Gets a list of workflows within a resource group.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param options The options parameters.
*/
listByResourceGroup(
resourceGroupName: string,
options?: WorkflowListByResourceGroupOptionalParams
): PagedAsyncIterableIterator<Workflow>;
/**
* Gets a workflow.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param workflowName The name of the workflow resource.
* @param options The options parameters.
*/
get(
resourceGroupName: string,
workflowName: string,
options?: WorkflowGetOptionalParams
): Promise<WorkflowGetResponse>;
/**
* Creates or updates a workflow
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param workflowName The name of the workflow resource.
* @param parameters Resource representation of a workflow
* @param options The options parameters.
*/
createOrUpdate(
resourceGroupName: string,
workflowName: string,
parameters: Workflow,
options?: WorkflowCreateOrUpdateOptionalParams
): Promise<WorkflowCreateOrUpdateResponse>;
/**
* Deletes a workflow
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param workflowName The name of the workflow resource.
* @param options The options parameters.
*/
delete(
resourceGroupName: string,
workflowName: string,
options?: WorkflowDeleteOptionalParams
): Promise<WorkflowDeleteResponse>;
/**
* Updates tags on a workflow.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param workflowName The name of the workflow resource.
* @param parameters Parameters supplied to the Update Workflow Tags operation.
* @param options The options parameters.
*/
updateTags(
resourceGroupName: string,
workflowName: string,
parameters: TagsObject,
options?: WorkflowUpdateTagsOptionalParams
): Promise<WorkflowUpdateTagsResponse>;
}

Просмотреть файл

@ -0,0 +1,64 @@
/*
* 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.
*/
import {
env,
Recorder,
RecorderStartOptions,
delay,
isPlaybackMode,
} from "@azure-tools/test-recorder";
import { createTestCredential } from "@azure-tools/test-credential";
import { assert } from "chai";
import { Context } from "mocha";
import { DeveloperHubServiceClient } from "../src/developerHubServiceClient";
const replaceableVariables: Record<string, string> = {
AZURE_CLIENT_ID: "azure_client_id",
AZURE_CLIENT_SECRET: "azure_client_secret",
AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888",
SUBSCRIPTION_ID: "azure_subscription_id"
};
const recorderOptions: RecorderStartOptions = {
envSetupForPlayback: replaceableVariables
};
export const testPollingOptions = {
updateIntervalInMs: isPlaybackMode() ? 0 : undefined,
};
describe("devhub test", () => {
let recorder: Recorder;
let subscriptionId: string;
let client: DeveloperHubServiceClient;
let location: string;
let resourceGroup: string;
beforeEach(async function (this: Context) {
recorder = new Recorder(this.currentTest);
await recorder.start(recorderOptions);
subscriptionId = env.SUBSCRIPTION_ID || '';
// This is an example of how the environment variables are used
const credential = createTestCredential();
client = new DeveloperHubServiceClient(credential, subscriptionId, recorder.configureClientOptions({}));
location = "eastus";
resourceGroup = "myjstest";
});
afterEach(async function () {
await recorder.stop();
});
it("workflow list test", async function () {
const resArray = new Array();
for await (let item of client.workflowOperations.listByResourceGroup(resourceGroup)) {
resArray.push(item);
}
});
})

Просмотреть файл

@ -0,0 +1,33 @@
{
"compilerOptions": {
"module": "es6",
"moduleResolution": "node",
"strict": true,
"target": "es6",
"sourceMap": true,
"declarationMap": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"lib": [
"es6",
"dom"
],
"declaration": true,
"outDir": "./dist-esm",
"importHelpers": true,
"paths": {
"@azure/arm-devhub": [
"./src/index"
]
}
},
"include": [
"./src/**/*.ts",
"./test/**/*.ts",
"samples-dev/**/*.ts"
],
"exclude": [
"node_modules"
]
}

38
sdk/devhub/ci.mgmt.yml Normal file
Просмотреть файл

@ -0,0 +1,38 @@
# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.
trigger:
branches:
include:
- main
- feature/*
- release/*
- hotfix/*
exclude:
- feature/v4
paths:
include:
- sdk/devhub/arm-devhub
- sdk/devhub/ci.mgmt.yml
pr:
branches:
include:
- main
- feature/*
- release/*
- hotfix/*
exclude:
- feature/v4
paths:
include:
- sdk/devhub/arm-devhub
- sdk/devhub/ci.mgmt.yml
extends:
template: /eng/pipelines/templates/stages/archetype-sdk-client.yml
parameters:
ServiceDirectory: devhub
Artifacts:
- name: azure-arm-devhub
safeName: azurearmdevhub