Родитель
32c07776aa
Коммит
e0e845d096
|
@ -130,6 +130,7 @@ specifiers:
|
|||
'@rush-temp/arm-network': file:./projects/arm-network.tgz
|
||||
'@rush-temp/arm-network-profile-2020-09-01-hybrid': file:./projects/arm-network-profile-2020-09-01-hybrid.tgz
|
||||
'@rush-temp/arm-networkfunction': file:./projects/arm-networkfunction.tgz
|
||||
'@rush-temp/arm-nginx': file:./projects/arm-nginx.tgz
|
||||
'@rush-temp/arm-notificationhubs': file:./projects/arm-notificationhubs.tgz
|
||||
'@rush-temp/arm-oep': file:./projects/arm-oep.tgz
|
||||
'@rush-temp/arm-operationalinsights': file:./projects/arm-operationalinsights.tgz
|
||||
|
@ -433,6 +434,7 @@ dependencies:
|
|||
'@rush-temp/arm-network': file:projects/arm-network.tgz
|
||||
'@rush-temp/arm-network-profile-2020-09-01-hybrid': file:projects/arm-network-profile-2020-09-01-hybrid.tgz
|
||||
'@rush-temp/arm-networkfunction': file:projects/arm-networkfunction.tgz
|
||||
'@rush-temp/arm-nginx': file:projects/arm-nginx.tgz
|
||||
'@rush-temp/arm-notificationhubs': file:projects/arm-notificationhubs.tgz
|
||||
'@rush-temp/arm-oep': file:projects/arm-oep.tgz
|
||||
'@rush-temp/arm-operationalinsights': file:projects/arm-operationalinsights.tgz
|
||||
|
@ -13368,6 +13370,33 @@ packages:
|
|||
- supports-color
|
||||
dev: false
|
||||
|
||||
file:projects/arm-nginx.tgz:
|
||||
resolution: {integrity: sha512-5IlnxmWWszv6JYPoWKK8VwgWV5QouGfFlg6gzHGH1MCQhaPCtbM9PKilgsme72f/JltLcDp6QZPF2aciq3zLaw==, tarball: file:projects/arm-nginx.tgz}
|
||||
name: '@rush-temp/arm-nginx'
|
||||
version: 0.0.0
|
||||
dependencies:
|
||||
'@azure/identity': 2.1.0
|
||||
'@microsoft/api-extractor': 7.18.11
|
||||
'@rollup/plugin-commonjs': 21.1.0_rollup@2.77.2
|
||||
'@rollup/plugin-json': 4.1.0_rollup@2.77.2
|
||||
'@rollup/plugin-multi-entry': 4.1.0_rollup@2.77.2
|
||||
'@rollup/plugin-node-resolve': 13.3.0_rollup@2.77.2
|
||||
'@types/chai': 4.3.1
|
||||
chai: 4.3.6
|
||||
cross-env: 7.0.3
|
||||
mkdirp: 1.0.4
|
||||
mocha: 7.2.0
|
||||
rimraf: 3.0.2
|
||||
rollup: 2.77.2
|
||||
rollup-plugin-sourcemaps: 0.6.3_rollup@2.77.2
|
||||
tslib: 2.4.0
|
||||
typescript: 4.6.4
|
||||
uglify-js: 3.16.3
|
||||
transitivePeerDependencies:
|
||||
- '@types/node'
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
file:projects/arm-notificationhubs.tgz:
|
||||
resolution: {integrity: sha512-oi7F/O1BZM7OpqeCdkqFKpNc+mTKMbDmN3w5zJY+2YxH+Tn7qcyS9BUfrZqOYjOnVsUY5JXLS+ow0AzXKnqLTQ==, tarball: file:projects/arm-notificationhubs.tgz}
|
||||
name: '@rush-temp/arm-notificationhubs'
|
||||
|
|
|
@ -19,3 +19,5 @@ https://docs.microsoft.com/javascript/api/@azure/arm-automanage
|
|||
https://docs.microsoft.com/javascript/api/@azure/arm-automanage?view=azure-node-preview
|
||||
https://docs.microsoft.com/javascript/api/@azure/arm-devcenter?view=azure-node-preview
|
||||
https://docs.microsoft.com/javascript/api/@azure/arm-connectedvmware?view=azure-node-preview
|
||||
https://docs.microsoft.com/javascript/api/@azure/arm-nginx
|
||||
https://docs.microsoft.com/javascript/api/@azure/arm-nginx?view=azure-node-preview
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* This is the main configuration file for Rush.
|
||||
* For full documentation, please see https://rushjs.io
|
||||
*/ {
|
||||
*/{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush.schema.json",
|
||||
/**
|
||||
* (Required) This specifies the version of the Rush engine to be used in this repo.
|
||||
|
@ -1825,6 +1825,11 @@
|
|||
"packageName": "@azure/arm-connectedvmware",
|
||||
"projectFolder": "sdk/connectedvmware/arm-connectedvmware",
|
||||
"versionPolicyName": "management"
|
||||
},
|
||||
{
|
||||
"packageName": "@azure/arm-nginx",
|
||||
"projectFolder": "sdk/nginx/arm-nginx",
|
||||
"versionPolicyName": "management"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
# Release History
|
||||
|
||||
## 1.0.0 (2022-08-23)
|
||||
|
||||
The package of @azure/arm-nginx 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 NginxManagement client library for JavaScript
|
||||
|
||||
This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure NginxManagement client.
|
||||
|
||||
|
||||
|
||||
[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/nginx/arm-nginx) |
|
||||
[Package (NPM)](https://www.npmjs.com/package/@azure/arm-nginx) |
|
||||
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-nginx) |
|
||||
[Samples](https://github.com/Azure-Samples/azure-samples-js-management)
|
||||
|
||||
## Getting started
|
||||
|
||||
### Currently supported environments
|
||||
|
||||
- [LTS versions of Node.js](https://nodejs.org/about/releases/)
|
||||
- Latest versions of Safari, Chrome, Edge and Firefox.
|
||||
|
||||
See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- An [Azure subscription][azure_sub].
|
||||
|
||||
### Install the `@azure/arm-nginx` package
|
||||
|
||||
Install the Azure NginxManagement client library for JavaScript with `npm`:
|
||||
|
||||
```bash
|
||||
npm install @azure/arm-nginx
|
||||
```
|
||||
|
||||
### Create and authenticate a `NginxManagementClient`
|
||||
|
||||
To create a client object to access the Azure NginxManagement API, you will need the `endpoint` of your Azure NginxManagement resource and a `credential`. The Azure NginxManagement client can use Azure Active Directory credentials to authenticate.
|
||||
You can find the endpoint for your Azure NginxManagement 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 NginxManagement** 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 { NginxManagementClient } = require("@azure/arm-nginx");
|
||||
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 NginxManagementClient(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 NginxManagementClient(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
|
||||
|
||||
### NginxManagementClient
|
||||
|
||||
`NginxManagementClient` is the primary interface for developers using the Azure NginxManagement client library. Explore the methods on this client object to understand the different features of the Azure NginxManagement 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%2Fnginx%2Farm-nginx%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": "9401446f22177696d920cf110893a0de7452ee9e",
|
||||
"readme": "specification/nginx/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\\nginx\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.1.20220727.1 --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.1.20220727.1"
|
||||
}
|
|
@ -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-nginx.d.ts"
|
||||
},
|
||||
"messages": {
|
||||
"tsdocMessageReporting": {
|
||||
"default": {
|
||||
"logLevel": "none"
|
||||
}
|
||||
},
|
||||
"extractorMessageReporting": {
|
||||
"ae-missing-release-tag": {
|
||||
"logLevel": "none"
|
||||
},
|
||||
"ae-unresolved-link": {
|
||||
"logLevel": "none"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,121 @@
|
|||
{
|
||||
"name": "@azure/arm-nginx",
|
||||
"sdk-type": "mgmt",
|
||||
"author": "Microsoft Corporation",
|
||||
"description": "A generated SDK for NginxManagementClient.",
|
||||
"version": "1.0.0",
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@azure/core-lro": "^2.2.0",
|
||||
"@azure/abort-controller": "^1.0.0",
|
||||
"@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-nginx.d.ts",
|
||||
"devDependencies": {
|
||||
"@microsoft/api-extractor": "7.18.11",
|
||||
"@rollup/plugin-commonjs": "^21.0.1",
|
||||
"@rollup/plugin-json": "^4.1.0",
|
||||
"@rollup/plugin-multi-entry": "^4.1.0",
|
||||
"@rollup/plugin-node-resolve": "^13.1.3",
|
||||
"mkdirp": "^1.0.4",
|
||||
"rollup": "^2.66.1",
|
||||
"rollup-plugin-sourcemaps": "^0.6.3",
|
||||
"typescript": "~4.6.0",
|
||||
"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",
|
||||
"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/nginx/arm-nginx",
|
||||
"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/nginxManagementClient.ts",
|
||||
"prefix": "packageDetails"
|
||||
}
|
||||
]
|
||||
},
|
||||
"autoPublish": true,
|
||||
"//sampleConfiguration": {
|
||||
"productName": "",
|
||||
"productSlugs": [
|
||||
"azure"
|
||||
],
|
||||
"disableDocsMs": true,
|
||||
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-nginx?view=azure-node-preview"
|
||||
}
|
||||
}
|
4
sdk/nginx/arm-nginx/recordings/node/my_test/recording_sample_test.json
сгенерированный
Normal file
4
sdk/nginx/arm-nginx/recordings/node/my_test/recording_sample_test.json
сгенерированный
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"Entries": [],
|
||||
"Variables": {}
|
||||
}
|
|
@ -0,0 +1,547 @@
|
|||
## API Report File for "@azure/arm-nginx"
|
||||
|
||||
> 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';
|
||||
import { PollerLike } from '@azure/core-lro';
|
||||
import { PollOperationState } from '@azure/core-lro';
|
||||
|
||||
// @public
|
||||
export interface Certificates {
|
||||
beginCreate(resourceGroupName: string, deploymentName: string, certificateName: string, options?: CertificatesCreateOptionalParams): Promise<PollerLike<PollOperationState<CertificatesCreateResponse>, CertificatesCreateResponse>>;
|
||||
beginCreateAndWait(resourceGroupName: string, deploymentName: string, certificateName: string, options?: CertificatesCreateOptionalParams): Promise<CertificatesCreateResponse>;
|
||||
beginDelete(resourceGroupName: string, deploymentName: string, certificateName: string, options?: CertificatesDeleteOptionalParams): Promise<PollerLike<PollOperationState<void>, void>>;
|
||||
beginDeleteAndWait(resourceGroupName: string, deploymentName: string, certificateName: string, options?: CertificatesDeleteOptionalParams): Promise<void>;
|
||||
get(resourceGroupName: string, deploymentName: string, certificateName: string, options?: CertificatesGetOptionalParams): Promise<CertificatesGetResponse>;
|
||||
list(resourceGroupName: string, deploymentName: string, options?: CertificatesListOptionalParams): PagedAsyncIterableIterator<NginxCertificate>;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface CertificatesCreateOptionalParams extends coreClient.OperationOptions {
|
||||
body?: NginxCertificate;
|
||||
resumeFrom?: string;
|
||||
updateIntervalInMs?: number;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type CertificatesCreateResponse = NginxCertificate;
|
||||
|
||||
// @public
|
||||
export interface CertificatesDeleteOptionalParams extends coreClient.OperationOptions {
|
||||
resumeFrom?: string;
|
||||
updateIntervalInMs?: number;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface CertificatesGetOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type CertificatesGetResponse = NginxCertificate;
|
||||
|
||||
// @public
|
||||
export interface CertificatesListNextOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type CertificatesListNextResponse = NginxCertificateListResponse;
|
||||
|
||||
// @public
|
||||
export interface CertificatesListOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type CertificatesListResponse = NginxCertificateListResponse;
|
||||
|
||||
// @public
|
||||
export interface Configurations {
|
||||
beginCreateOrUpdate(resourceGroupName: string, deploymentName: string, configurationName: string, options?: ConfigurationsCreateOrUpdateOptionalParams): Promise<PollerLike<PollOperationState<ConfigurationsCreateOrUpdateResponse>, ConfigurationsCreateOrUpdateResponse>>;
|
||||
beginCreateOrUpdateAndWait(resourceGroupName: string, deploymentName: string, configurationName: string, options?: ConfigurationsCreateOrUpdateOptionalParams): Promise<ConfigurationsCreateOrUpdateResponse>;
|
||||
beginDelete(resourceGroupName: string, deploymentName: string, configurationName: string, options?: ConfigurationsDeleteOptionalParams): Promise<PollerLike<PollOperationState<void>, void>>;
|
||||
beginDeleteAndWait(resourceGroupName: string, deploymentName: string, configurationName: string, options?: ConfigurationsDeleteOptionalParams): Promise<void>;
|
||||
get(resourceGroupName: string, deploymentName: string, configurationName: string, options?: ConfigurationsGetOptionalParams): Promise<ConfigurationsGetResponse>;
|
||||
list(resourceGroupName: string, deploymentName: string, options?: ConfigurationsListOptionalParams): PagedAsyncIterableIterator<NginxConfiguration>;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface ConfigurationsCreateOrUpdateOptionalParams extends coreClient.OperationOptions {
|
||||
body?: NginxConfiguration;
|
||||
resumeFrom?: string;
|
||||
updateIntervalInMs?: number;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type ConfigurationsCreateOrUpdateResponse = NginxConfiguration;
|
||||
|
||||
// @public
|
||||
export interface ConfigurationsDeleteOptionalParams extends coreClient.OperationOptions {
|
||||
resumeFrom?: string;
|
||||
updateIntervalInMs?: number;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface ConfigurationsGetOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type ConfigurationsGetResponse = NginxConfiguration;
|
||||
|
||||
// @public
|
||||
export interface ConfigurationsListNextOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type ConfigurationsListNextResponse = NginxConfigurationListResponse;
|
||||
|
||||
// @public
|
||||
export interface ConfigurationsListOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type ConfigurationsListResponse = NginxConfigurationListResponse;
|
||||
|
||||
// @public
|
||||
export type CreatedByType = string;
|
||||
|
||||
// @public
|
||||
export interface Deployments {
|
||||
beginCreate(resourceGroupName: string, deploymentName: string, options?: DeploymentsCreateOptionalParams): Promise<PollerLike<PollOperationState<DeploymentsCreateResponse>, DeploymentsCreateResponse>>;
|
||||
beginCreateAndWait(resourceGroupName: string, deploymentName: string, options?: DeploymentsCreateOptionalParams): Promise<DeploymentsCreateResponse>;
|
||||
beginDelete(resourceGroupName: string, deploymentName: string, options?: DeploymentsDeleteOptionalParams): Promise<PollerLike<PollOperationState<void>, void>>;
|
||||
beginDeleteAndWait(resourceGroupName: string, deploymentName: string, options?: DeploymentsDeleteOptionalParams): Promise<void>;
|
||||
beginUpdate(resourceGroupName: string, deploymentName: string, options?: DeploymentsUpdateOptionalParams): Promise<PollerLike<PollOperationState<DeploymentsUpdateResponse>, DeploymentsUpdateResponse>>;
|
||||
beginUpdateAndWait(resourceGroupName: string, deploymentName: string, options?: DeploymentsUpdateOptionalParams): Promise<DeploymentsUpdateResponse>;
|
||||
get(resourceGroupName: string, deploymentName: string, options?: DeploymentsGetOptionalParams): Promise<DeploymentsGetResponse>;
|
||||
list(options?: DeploymentsListOptionalParams): PagedAsyncIterableIterator<NginxDeployment>;
|
||||
listByResourceGroup(resourceGroupName: string, options?: DeploymentsListByResourceGroupOptionalParams): PagedAsyncIterableIterator<NginxDeployment>;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface DeploymentsCreateOptionalParams extends coreClient.OperationOptions {
|
||||
// (undocumented)
|
||||
body?: NginxDeployment;
|
||||
resumeFrom?: string;
|
||||
updateIntervalInMs?: number;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type DeploymentsCreateResponse = NginxDeployment;
|
||||
|
||||
// @public
|
||||
export interface DeploymentsDeleteOptionalParams extends coreClient.OperationOptions {
|
||||
resumeFrom?: string;
|
||||
updateIntervalInMs?: number;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface DeploymentsGetOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type DeploymentsGetResponse = NginxDeployment;
|
||||
|
||||
// @public
|
||||
export interface DeploymentsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type DeploymentsListByResourceGroupNextResponse = NginxDeploymentListResponse;
|
||||
|
||||
// @public
|
||||
export interface DeploymentsListByResourceGroupOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type DeploymentsListByResourceGroupResponse = NginxDeploymentListResponse;
|
||||
|
||||
// @public
|
||||
export interface DeploymentsListNextOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type DeploymentsListNextResponse = NginxDeploymentListResponse;
|
||||
|
||||
// @public
|
||||
export interface DeploymentsListOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type DeploymentsListResponse = NginxDeploymentListResponse;
|
||||
|
||||
// @public
|
||||
export interface DeploymentsUpdateOptionalParams extends coreClient.OperationOptions {
|
||||
// (undocumented)
|
||||
body?: NginxDeploymentUpdateParameters;
|
||||
resumeFrom?: string;
|
||||
updateIntervalInMs?: number;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type DeploymentsUpdateResponse = NginxDeployment;
|
||||
|
||||
// @public (undocumented)
|
||||
export interface ErrorResponseBody {
|
||||
// (undocumented)
|
||||
code?: string;
|
||||
// (undocumented)
|
||||
details?: ErrorResponseBody[];
|
||||
// (undocumented)
|
||||
message?: string;
|
||||
// (undocumented)
|
||||
target?: string;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface IdentityProperties {
|
||||
readonly principalId?: string;
|
||||
readonly tenantId?: string;
|
||||
// (undocumented)
|
||||
type?: IdentityType;
|
||||
userAssignedIdentities?: {
|
||||
[propertyName: string]: UserIdentityProperties;
|
||||
};
|
||||
}
|
||||
|
||||
// @public
|
||||
export type IdentityType = string;
|
||||
|
||||
// @public
|
||||
export enum KnownCreatedByType {
|
||||
Application = "Application",
|
||||
Key = "Key",
|
||||
ManagedIdentity = "ManagedIdentity",
|
||||
User = "User"
|
||||
}
|
||||
|
||||
// @public
|
||||
export enum KnownIdentityType {
|
||||
None = "None",
|
||||
SystemAssigned = "SystemAssigned",
|
||||
SystemAssignedUserAssigned = "SystemAssigned, UserAssigned",
|
||||
UserAssigned = "UserAssigned"
|
||||
}
|
||||
|
||||
// @public
|
||||
export enum KnownNginxPrivateIPAllocationMethod {
|
||||
Dynamic = "Dynamic",
|
||||
Static = "Static"
|
||||
}
|
||||
|
||||
// @public
|
||||
export enum KnownProvisioningState {
|
||||
Accepted = "Accepted",
|
||||
Canceled = "Canceled",
|
||||
Creating = "Creating",
|
||||
Deleted = "Deleted",
|
||||
Deleting = "Deleting",
|
||||
Failed = "Failed",
|
||||
NotSpecified = "NotSpecified",
|
||||
Succeeded = "Succeeded",
|
||||
Updating = "Updating"
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface NginxCertificate {
|
||||
readonly id?: string;
|
||||
// (undocumented)
|
||||
location?: string;
|
||||
readonly name?: string;
|
||||
// (undocumented)
|
||||
properties?: NginxCertificateProperties;
|
||||
readonly systemData?: SystemData;
|
||||
tags?: {
|
||||
[propertyName: string]: string;
|
||||
};
|
||||
readonly type?: string;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface NginxCertificateListResponse {
|
||||
// (undocumented)
|
||||
nextLink?: string;
|
||||
// (undocumented)
|
||||
value?: NginxCertificate[];
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface NginxCertificateProperties {
|
||||
// (undocumented)
|
||||
certificateVirtualPath?: string;
|
||||
// (undocumented)
|
||||
keyVaultSecretId?: string;
|
||||
// (undocumented)
|
||||
keyVirtualPath?: string;
|
||||
// (undocumented)
|
||||
provisioningState?: ProvisioningState;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface NginxConfiguration {
|
||||
readonly id?: string;
|
||||
// (undocumented)
|
||||
location?: string;
|
||||
readonly name?: string;
|
||||
// (undocumented)
|
||||
properties?: NginxConfigurationProperties;
|
||||
readonly systemData?: SystemData;
|
||||
tags?: {
|
||||
[propertyName: string]: string;
|
||||
};
|
||||
readonly type?: string;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface NginxConfigurationFile {
|
||||
// (undocumented)
|
||||
content?: string;
|
||||
// (undocumented)
|
||||
virtualPath?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface NginxConfigurationListResponse {
|
||||
nextLink?: string;
|
||||
value?: NginxConfiguration[];
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface NginxConfigurationPackage {
|
||||
// (undocumented)
|
||||
data?: string;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface NginxConfigurationProperties {
|
||||
// (undocumented)
|
||||
files?: NginxConfigurationFile[];
|
||||
// (undocumented)
|
||||
package?: NginxConfigurationPackage;
|
||||
// (undocumented)
|
||||
provisioningState?: ProvisioningState;
|
||||
// (undocumented)
|
||||
rootFile?: string;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface NginxDeployment {
|
||||
readonly id?: string;
|
||||
// (undocumented)
|
||||
identity?: IdentityProperties;
|
||||
// (undocumented)
|
||||
location?: string;
|
||||
readonly name?: string;
|
||||
// (undocumented)
|
||||
properties?: NginxDeploymentProperties;
|
||||
// (undocumented)
|
||||
sku?: ResourceSku;
|
||||
readonly systemData?: SystemData;
|
||||
tags?: {
|
||||
[propertyName: string]: string;
|
||||
};
|
||||
readonly type?: string;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface NginxDeploymentListResponse {
|
||||
// (undocumented)
|
||||
nextLink?: string;
|
||||
// (undocumented)
|
||||
value?: NginxDeployment[];
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface NginxDeploymentProperties {
|
||||
// (undocumented)
|
||||
enableDiagnosticsSupport?: boolean;
|
||||
readonly ipAddress?: string;
|
||||
// (undocumented)
|
||||
logging?: NginxLogging;
|
||||
managedResourceGroup?: string;
|
||||
// (undocumented)
|
||||
networkProfile?: NginxNetworkProfile;
|
||||
readonly nginxVersion?: string;
|
||||
// (undocumented)
|
||||
provisioningState?: ProvisioningState;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface NginxDeploymentUpdateParameters {
|
||||
// (undocumented)
|
||||
identity?: IdentityProperties;
|
||||
// (undocumented)
|
||||
location?: string;
|
||||
// (undocumented)
|
||||
properties?: NginxDeploymentUpdateProperties;
|
||||
// (undocumented)
|
||||
sku?: ResourceSku;
|
||||
tags?: {
|
||||
[propertyName: string]: string;
|
||||
};
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface NginxDeploymentUpdateProperties {
|
||||
// (undocumented)
|
||||
enableDiagnosticsSupport?: boolean;
|
||||
// (undocumented)
|
||||
logging?: NginxLogging;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface NginxFrontendIPConfiguration {
|
||||
// (undocumented)
|
||||
privateIPAddresses?: NginxPrivateIPAddress[];
|
||||
// (undocumented)
|
||||
publicIPAddresses?: NginxPublicIPAddress[];
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface NginxLogging {
|
||||
// (undocumented)
|
||||
storageAccount?: NginxStorageAccount;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export class NginxManagementClient extends coreClient.ServiceClient {
|
||||
// (undocumented)
|
||||
$host: string;
|
||||
constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: NginxManagementClientOptionalParams);
|
||||
// (undocumented)
|
||||
apiVersion: string;
|
||||
// (undocumented)
|
||||
certificates: Certificates;
|
||||
// (undocumented)
|
||||
configurations: Configurations;
|
||||
// (undocumented)
|
||||
deployments: Deployments;
|
||||
// (undocumented)
|
||||
operations: Operations;
|
||||
// (undocumented)
|
||||
subscriptionId: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface NginxManagementClientOptionalParams extends coreClient.ServiceClientOptions {
|
||||
$host?: string;
|
||||
apiVersion?: string;
|
||||
endpoint?: string;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface NginxNetworkInterfaceConfiguration {
|
||||
// (undocumented)
|
||||
subnetId?: string;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface NginxNetworkProfile {
|
||||
// (undocumented)
|
||||
frontEndIPConfiguration?: NginxFrontendIPConfiguration;
|
||||
// (undocumented)
|
||||
networkInterfaceConfiguration?: NginxNetworkInterfaceConfiguration;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface NginxPrivateIPAddress {
|
||||
// (undocumented)
|
||||
privateIPAddress?: string;
|
||||
// (undocumented)
|
||||
privateIPAllocationMethod?: NginxPrivateIPAllocationMethod;
|
||||
// (undocumented)
|
||||
subnetId?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type NginxPrivateIPAllocationMethod = string;
|
||||
|
||||
// @public (undocumented)
|
||||
export interface NginxPublicIPAddress {
|
||||
// (undocumented)
|
||||
id?: string;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface NginxStorageAccount {
|
||||
// (undocumented)
|
||||
accountName?: string;
|
||||
// (undocumented)
|
||||
containerName?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface OperationDisplay {
|
||||
description?: string;
|
||||
operation?: string;
|
||||
provider?: string;
|
||||
resource?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface OperationListResult {
|
||||
nextLink?: string;
|
||||
value?: OperationResult[];
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface OperationResult {
|
||||
display?: OperationDisplay;
|
||||
isDataAction?: boolean;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface Operations {
|
||||
list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator<OperationResult>;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface OperationsListNextOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type OperationsListNextResponse = OperationListResult;
|
||||
|
||||
// @public
|
||||
export interface OperationsListOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type OperationsListResponse = OperationListResult;
|
||||
|
||||
// @public
|
||||
export type ProvisioningState = string;
|
||||
|
||||
// @public (undocumented)
|
||||
export interface ResourceProviderDefaultErrorResponse {
|
||||
// (undocumented)
|
||||
error?: ErrorResponseBody;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface ResourceSku {
|
||||
name: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface SystemData {
|
||||
createdAt?: Date;
|
||||
createdBy?: string;
|
||||
createdByType?: CreatedByType;
|
||||
lastModifiedAt?: Date;
|
||||
lastModifiedBy?: string;
|
||||
lastModifiedByType?: CreatedByType;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface UserIdentityProperties {
|
||||
readonly clientId?: string;
|
||||
readonly principalId?: string;
|
||||
}
|
||||
|
||||
// (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,35 @@
|
|||
/*
|
||||
* 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 { NginxManagementClient } from "@azure/arm-nginx";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update the Nginx certificates for given Nginx deployment
|
||||
*
|
||||
* @summary Create or update the Nginx certificates for given Nginx deployment
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Certificates_CreateOrUpdate.json
|
||||
*/
|
||||
async function certificatesCreateOrUpdate() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const certificateName = "default";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const result = await client.certificates.beginCreateAndWait(
|
||||
resourceGroupName,
|
||||
deploymentName,
|
||||
certificateName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
certificatesCreateOrUpdate().catch(console.error);
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* 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 { NginxManagementClient } from "@azure/arm-nginx";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a certificate from the nginx deployment
|
||||
*
|
||||
* @summary Deletes a certificate from the nginx deployment
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Certificates_Delete.json
|
||||
*/
|
||||
async function certificatesDelete() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const certificateName = "default";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const result = await client.certificates.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
deploymentName,
|
||||
certificateName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
certificatesDelete().catch(console.error);
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* 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 { NginxManagementClient } from "@azure/arm-nginx";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get a certificate of given Nginx deployment
|
||||
*
|
||||
* @summary Get a certificate of given Nginx deployment
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Certificates_Get.json
|
||||
*/
|
||||
async function certificatesGet() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const certificateName = "default";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const result = await client.certificates.get(
|
||||
resourceGroupName,
|
||||
deploymentName,
|
||||
certificateName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
certificatesGet().catch(console.error);
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* 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 { NginxManagementClient } from "@azure/arm-nginx";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to List all certificates of given Nginx deployment
|
||||
*
|
||||
* @summary List all certificates of given Nginx deployment
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Certificates_List.json
|
||||
*/
|
||||
async function certificatesList() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.certificates.list(
|
||||
resourceGroupName,
|
||||
deploymentName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
certificatesList().catch(console.error);
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* 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 { NginxManagementClient } from "@azure/arm-nginx";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update the Nginx configuration for given Nginx deployment
|
||||
*
|
||||
* @summary Create or update the Nginx configuration for given Nginx deployment
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Configurations_CreateOrUpdate.json
|
||||
*/
|
||||
async function configurationsCreateOrUpdate() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const configurationName = "default";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const result = await client.configurations.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
deploymentName,
|
||||
configurationName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
configurationsCreateOrUpdate().catch(console.error);
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* 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 { NginxManagementClient } from "@azure/arm-nginx";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Reset the Nginx configuration of given Nginx deployment to default
|
||||
*
|
||||
* @summary Reset the Nginx configuration of given Nginx deployment to default
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Configurations_Delete.json
|
||||
*/
|
||||
async function configurationsDelete() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const configurationName = "default";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const result = await client.configurations.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
deploymentName,
|
||||
configurationName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
configurationsDelete().catch(console.error);
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* 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 { NginxManagementClient } from "@azure/arm-nginx";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get the Nginx configuration of given Nginx deployment
|
||||
*
|
||||
* @summary Get the Nginx configuration of given Nginx deployment
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Configurations_Get.json
|
||||
*/
|
||||
async function configurationsGet() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const configurationName = "default";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const result = await client.configurations.get(
|
||||
resourceGroupName,
|
||||
deploymentName,
|
||||
configurationName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
configurationsGet().catch(console.error);
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* 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 { NginxManagementClient } from "@azure/arm-nginx";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to List the Nginx configuration of given Nginx deployment.
|
||||
*
|
||||
* @summary List the Nginx configuration of given Nginx deployment.
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Configurations_List.json
|
||||
*/
|
||||
async function configurationsList() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.configurations.list(
|
||||
resourceGroupName,
|
||||
deploymentName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
configurationsList().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 { NginxManagementClient } from "@azure/arm-nginx";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update the Nginx deployment
|
||||
*
|
||||
* @summary Create or update the Nginx deployment
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Deployments_Create.json
|
||||
*/
|
||||
async function deploymentsCreate() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const result = await client.deployments.beginCreateAndWait(
|
||||
resourceGroupName,
|
||||
deploymentName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deploymentsCreate().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 { NginxManagementClient } from "@azure/arm-nginx";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Delete the Nginx deployment resource
|
||||
*
|
||||
* @summary Delete the Nginx deployment resource
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Deployments_Delete.json
|
||||
*/
|
||||
async function deploymentsDelete() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const result = await client.deployments.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
deploymentName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deploymentsDelete().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 { NginxManagementClient } from "@azure/arm-nginx";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get the Nginx deployment
|
||||
*
|
||||
* @summary Get the Nginx deployment
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Deployments_Get.json
|
||||
*/
|
||||
async function deploymentsGet() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const result = await client.deployments.get(
|
||||
resourceGroupName,
|
||||
deploymentName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deploymentsGet().catch(console.error);
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* 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 { NginxManagementClient } from "@azure/arm-nginx";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to List all Nginx deployments under the specified resource group.
|
||||
*
|
||||
* @summary List all Nginx deployments under the specified resource group.
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Deployments_ListByResourceGroup.json
|
||||
*/
|
||||
async function deploymentsListByResourceGroup() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.deployments.listByResourceGroup(
|
||||
resourceGroupName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
deploymentsListByResourceGroup().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 { NginxManagementClient } from "@azure/arm-nginx";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to List the Nginx deployments resources
|
||||
*
|
||||
* @summary List the Nginx deployments resources
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Deployments_List.json
|
||||
*/
|
||||
async function deploymentsList() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.deployments.list()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
deploymentsList().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 { NginxManagementClient } from "@azure/arm-nginx";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Update the Nginx deployment
|
||||
*
|
||||
* @summary Update the Nginx deployment
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Deployments_Update.json
|
||||
*/
|
||||
async function deploymentsUpdate() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const result = await client.deployments.beginUpdateAndWait(
|
||||
resourceGroupName,
|
||||
deploymentName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deploymentsUpdate().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 { NginxManagementClient } from "@azure/arm-nginx";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to List all operations provided by Nginx.NginxPlus for the 2022-08-01 api version.
|
||||
*
|
||||
* @summary List all operations provided by Nginx.NginxPlus for the 2022-08-01 api version.
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Operations_List.json
|
||||
*/
|
||||
async function operationsList() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.operations.list()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
operationsList().catch(console.error);
|
|
@ -0,0 +1,78 @@
|
|||
# client library samples for JavaScript
|
||||
|
||||
These sample programs show how to use the JavaScript client libraries for in some common scenarios.
|
||||
|
||||
| **File Name** | **Description** |
|
||||
| ------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [certificatesCreateSample.js][certificatescreatesample] | Create or update the Nginx certificates for given Nginx deployment x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Certificates_CreateOrUpdate.json |
|
||||
| [certificatesDeleteSample.js][certificatesdeletesample] | Deletes a certificate from the nginx deployment x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Certificates_Delete.json |
|
||||
| [certificatesGetSample.js][certificatesgetsample] | Get a certificate of given Nginx deployment x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Certificates_Get.json |
|
||||
| [certificatesListSample.js][certificateslistsample] | List all certificates of given Nginx deployment x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Certificates_List.json |
|
||||
| [configurationsCreateOrUpdateSample.js][configurationscreateorupdatesample] | Create or update the Nginx configuration for given Nginx deployment x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Configurations_CreateOrUpdate.json |
|
||||
| [configurationsDeleteSample.js][configurationsdeletesample] | Reset the Nginx configuration of given Nginx deployment to default x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Configurations_Delete.json |
|
||||
| [configurationsGetSample.js][configurationsgetsample] | Get the Nginx configuration of given Nginx deployment x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Configurations_Get.json |
|
||||
| [configurationsListSample.js][configurationslistsample] | List the Nginx configuration of given Nginx deployment. x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Configurations_List.json |
|
||||
| [deploymentsCreateSample.js][deploymentscreatesample] | Create or update the Nginx deployment x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Deployments_Create.json |
|
||||
| [deploymentsDeleteSample.js][deploymentsdeletesample] | Delete the Nginx deployment resource x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Deployments_Delete.json |
|
||||
| [deploymentsGetSample.js][deploymentsgetsample] | Get the Nginx deployment x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Deployments_Get.json |
|
||||
| [deploymentsListByResourceGroupSample.js][deploymentslistbyresourcegroupsample] | List all Nginx deployments under the specified resource group. x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Deployments_ListByResourceGroup.json |
|
||||
| [deploymentsListSample.js][deploymentslistsample] | List the Nginx deployments resources x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Deployments_List.json |
|
||||
| [deploymentsUpdateSample.js][deploymentsupdatesample] | Update the Nginx deployment x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Deployments_Update.json |
|
||||
| [operationsListSample.js][operationslistsample] | List all operations provided by Nginx.NginxPlus for the 2022-08-01 api version. x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Operations_List.json |
|
||||
|
||||
## Prerequisites
|
||||
|
||||
The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/).
|
||||
|
||||
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 certificatesCreateSample.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 certificatesCreateSample.js
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
|
||||
|
||||
[certificatescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/nginx/arm-nginx/samples/v1/javascript/certificatesCreateSample.js
|
||||
[certificatesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/nginx/arm-nginx/samples/v1/javascript/certificatesDeleteSample.js
|
||||
[certificatesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/nginx/arm-nginx/samples/v1/javascript/certificatesGetSample.js
|
||||
[certificateslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/nginx/arm-nginx/samples/v1/javascript/certificatesListSample.js
|
||||
[configurationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/nginx/arm-nginx/samples/v1/javascript/configurationsCreateOrUpdateSample.js
|
||||
[configurationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/nginx/arm-nginx/samples/v1/javascript/configurationsDeleteSample.js
|
||||
[configurationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/nginx/arm-nginx/samples/v1/javascript/configurationsGetSample.js
|
||||
[configurationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/nginx/arm-nginx/samples/v1/javascript/configurationsListSample.js
|
||||
[deploymentscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/nginx/arm-nginx/samples/v1/javascript/deploymentsCreateSample.js
|
||||
[deploymentsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/nginx/arm-nginx/samples/v1/javascript/deploymentsDeleteSample.js
|
||||
[deploymentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/nginx/arm-nginx/samples/v1/javascript/deploymentsGetSample.js
|
||||
[deploymentslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/nginx/arm-nginx/samples/v1/javascript/deploymentsListByResourceGroupSample.js
|
||||
[deploymentslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/nginx/arm-nginx/samples/v1/javascript/deploymentsListSample.js
|
||||
[deploymentsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/nginx/arm-nginx/samples/v1/javascript/deploymentsUpdateSample.js
|
||||
[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/nginx/arm-nginx/samples/v1/javascript/operationsListSample.js
|
||||
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-nginx?view=azure-node-preview
|
||||
[freesub]: https://azure.microsoft.com/free/
|
||||
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/nginx/arm-nginx/README.md
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* 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 { NginxManagementClient } = require("@azure/arm-nginx");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update the Nginx certificates for given Nginx deployment
|
||||
*
|
||||
* @summary Create or update the Nginx certificates for given Nginx deployment
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Certificates_CreateOrUpdate.json
|
||||
*/
|
||||
async function certificatesCreateOrUpdate() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const certificateName = "default";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const result = await client.certificates.beginCreateAndWait(
|
||||
resourceGroupName,
|
||||
deploymentName,
|
||||
certificateName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
certificatesCreateOrUpdate().catch(console.error);
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* 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 { NginxManagementClient } = require("@azure/arm-nginx");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a certificate from the nginx deployment
|
||||
*
|
||||
* @summary Deletes a certificate from the nginx deployment
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Certificates_Delete.json
|
||||
*/
|
||||
async function certificatesDelete() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const certificateName = "default";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const result = await client.certificates.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
deploymentName,
|
||||
certificateName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
certificatesDelete().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 { NginxManagementClient } = require("@azure/arm-nginx");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get a certificate of given Nginx deployment
|
||||
*
|
||||
* @summary Get a certificate of given Nginx deployment
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Certificates_Get.json
|
||||
*/
|
||||
async function certificatesGet() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const certificateName = "default";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const result = await client.certificates.get(resourceGroupName, deploymentName, certificateName);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
certificatesGet().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 { NginxManagementClient } = require("@azure/arm-nginx");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to List all certificates of given Nginx deployment
|
||||
*
|
||||
* @summary List all certificates of given Nginx deployment
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Certificates_List.json
|
||||
*/
|
||||
async function certificatesList() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.certificates.list(resourceGroupName, deploymentName)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
certificatesList().catch(console.error);
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* 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 { NginxManagementClient } = require("@azure/arm-nginx");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update the Nginx configuration for given Nginx deployment
|
||||
*
|
||||
* @summary Create or update the Nginx configuration for given Nginx deployment
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Configurations_CreateOrUpdate.json
|
||||
*/
|
||||
async function configurationsCreateOrUpdate() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const configurationName = "default";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const result = await client.configurations.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
deploymentName,
|
||||
configurationName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
configurationsCreateOrUpdate().catch(console.error);
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* 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 { NginxManagementClient } = require("@azure/arm-nginx");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Reset the Nginx configuration of given Nginx deployment to default
|
||||
*
|
||||
* @summary Reset the Nginx configuration of given Nginx deployment to default
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Configurations_Delete.json
|
||||
*/
|
||||
async function configurationsDelete() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const configurationName = "default";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const result = await client.configurations.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
deploymentName,
|
||||
configurationName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
configurationsDelete().catch(console.error);
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* 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 { NginxManagementClient } = require("@azure/arm-nginx");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get the Nginx configuration of given Nginx deployment
|
||||
*
|
||||
* @summary Get the Nginx configuration of given Nginx deployment
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Configurations_Get.json
|
||||
*/
|
||||
async function configurationsGet() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const configurationName = "default";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const result = await client.configurations.get(
|
||||
resourceGroupName,
|
||||
deploymentName,
|
||||
configurationName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
configurationsGet().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 { NginxManagementClient } = require("@azure/arm-nginx");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to List the Nginx configuration of given Nginx deployment.
|
||||
*
|
||||
* @summary List the Nginx configuration of given Nginx deployment.
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Configurations_List.json
|
||||
*/
|
||||
async function configurationsList() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.configurations.list(resourceGroupName, deploymentName)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
configurationsList().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 { NginxManagementClient } = require("@azure/arm-nginx");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update the Nginx deployment
|
||||
*
|
||||
* @summary Create or update the Nginx deployment
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Deployments_Create.json
|
||||
*/
|
||||
async function deploymentsCreate() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const result = await client.deployments.beginCreateAndWait(resourceGroupName, deploymentName);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deploymentsCreate().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 { NginxManagementClient } = require("@azure/arm-nginx");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Delete the Nginx deployment resource
|
||||
*
|
||||
* @summary Delete the Nginx deployment resource
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Deployments_Delete.json
|
||||
*/
|
||||
async function deploymentsDelete() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const result = await client.deployments.beginDeleteAndWait(resourceGroupName, deploymentName);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deploymentsDelete().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 { NginxManagementClient } = require("@azure/arm-nginx");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get the Nginx deployment
|
||||
*
|
||||
* @summary Get the Nginx deployment
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Deployments_Get.json
|
||||
*/
|
||||
async function deploymentsGet() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const result = await client.deployments.get(resourceGroupName, deploymentName);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deploymentsGet().catch(console.error);
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* 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 { NginxManagementClient } = require("@azure/arm-nginx");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to List all Nginx deployments under the specified resource group.
|
||||
*
|
||||
* @summary List all Nginx deployments under the specified resource group.
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Deployments_ListByResourceGroup.json
|
||||
*/
|
||||
async function deploymentsListByResourceGroup() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.deployments.listByResourceGroup(resourceGroupName)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
deploymentsListByResourceGroup().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 { NginxManagementClient } = require("@azure/arm-nginx");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to List the Nginx deployments resources
|
||||
*
|
||||
* @summary List the Nginx deployments resources
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Deployments_List.json
|
||||
*/
|
||||
async function deploymentsList() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.deployments.list()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
deploymentsList().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 { NginxManagementClient } = require("@azure/arm-nginx");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Update the Nginx deployment
|
||||
*
|
||||
* @summary Update the Nginx deployment
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Deployments_Update.json
|
||||
*/
|
||||
async function deploymentsUpdate() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const result = await client.deployments.beginUpdateAndWait(resourceGroupName, deploymentName);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deploymentsUpdate().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 { NginxManagementClient } = require("@azure/arm-nginx");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to List all operations provided by Nginx.NginxPlus for the 2022-08-01 api version.
|
||||
*
|
||||
* @summary List all operations provided by Nginx.NginxPlus for the 2022-08-01 api version.
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Operations_List.json
|
||||
*/
|
||||
async function operationsList() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.operations.list()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
operationsList().catch(console.error);
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"name": "@azure-samples/arm-nginx-js",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"description": " client library samples for JavaScript",
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
|
||||
"directory": "sdk/nginx/arm-nginx"
|
||||
},
|
||||
"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/nginx/arm-nginx",
|
||||
"dependencies": {
|
||||
"@azure/arm-nginx": "latest",
|
||||
"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,91 @@
|
|||
# client library samples for TypeScript
|
||||
|
||||
These sample programs show how to use the TypeScript client libraries for in some common scenarios.
|
||||
|
||||
| **File Name** | **Description** |
|
||||
| ------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [certificatesCreateSample.ts][certificatescreatesample] | Create or update the Nginx certificates for given Nginx deployment x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Certificates_CreateOrUpdate.json |
|
||||
| [certificatesDeleteSample.ts][certificatesdeletesample] | Deletes a certificate from the nginx deployment x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Certificates_Delete.json |
|
||||
| [certificatesGetSample.ts][certificatesgetsample] | Get a certificate of given Nginx deployment x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Certificates_Get.json |
|
||||
| [certificatesListSample.ts][certificateslistsample] | List all certificates of given Nginx deployment x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Certificates_List.json |
|
||||
| [configurationsCreateOrUpdateSample.ts][configurationscreateorupdatesample] | Create or update the Nginx configuration for given Nginx deployment x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Configurations_CreateOrUpdate.json |
|
||||
| [configurationsDeleteSample.ts][configurationsdeletesample] | Reset the Nginx configuration of given Nginx deployment to default x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Configurations_Delete.json |
|
||||
| [configurationsGetSample.ts][configurationsgetsample] | Get the Nginx configuration of given Nginx deployment x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Configurations_Get.json |
|
||||
| [configurationsListSample.ts][configurationslistsample] | List the Nginx configuration of given Nginx deployment. x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Configurations_List.json |
|
||||
| [deploymentsCreateSample.ts][deploymentscreatesample] | Create or update the Nginx deployment x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Deployments_Create.json |
|
||||
| [deploymentsDeleteSample.ts][deploymentsdeletesample] | Delete the Nginx deployment resource x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Deployments_Delete.json |
|
||||
| [deploymentsGetSample.ts][deploymentsgetsample] | Get the Nginx deployment x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Deployments_Get.json |
|
||||
| [deploymentsListByResourceGroupSample.ts][deploymentslistbyresourcegroupsample] | List all Nginx deployments under the specified resource group. x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Deployments_ListByResourceGroup.json |
|
||||
| [deploymentsListSample.ts][deploymentslistsample] | List the Nginx deployments resources x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Deployments_List.json |
|
||||
| [deploymentsUpdateSample.ts][deploymentsupdatesample] | Update the Nginx deployment x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Deployments_Update.json |
|
||||
| [operationsListSample.ts][operationslistsample] | List all operations provided by Nginx.NginxPlus for the 2022-08-01 api version. x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Operations_List.json |
|
||||
|
||||
## Prerequisites
|
||||
|
||||
The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/).
|
||||
|
||||
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/certificatesCreateSample.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/certificatesCreateSample.js
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
|
||||
|
||||
[certificatescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/nginx/arm-nginx/samples/v1/typescript/src/certificatesCreateSample.ts
|
||||
[certificatesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/nginx/arm-nginx/samples/v1/typescript/src/certificatesDeleteSample.ts
|
||||
[certificatesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/nginx/arm-nginx/samples/v1/typescript/src/certificatesGetSample.ts
|
||||
[certificateslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/nginx/arm-nginx/samples/v1/typescript/src/certificatesListSample.ts
|
||||
[configurationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/nginx/arm-nginx/samples/v1/typescript/src/configurationsCreateOrUpdateSample.ts
|
||||
[configurationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/nginx/arm-nginx/samples/v1/typescript/src/configurationsDeleteSample.ts
|
||||
[configurationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/nginx/arm-nginx/samples/v1/typescript/src/configurationsGetSample.ts
|
||||
[configurationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/nginx/arm-nginx/samples/v1/typescript/src/configurationsListSample.ts
|
||||
[deploymentscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/nginx/arm-nginx/samples/v1/typescript/src/deploymentsCreateSample.ts
|
||||
[deploymentsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/nginx/arm-nginx/samples/v1/typescript/src/deploymentsDeleteSample.ts
|
||||
[deploymentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/nginx/arm-nginx/samples/v1/typescript/src/deploymentsGetSample.ts
|
||||
[deploymentslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/nginx/arm-nginx/samples/v1/typescript/src/deploymentsListByResourceGroupSample.ts
|
||||
[deploymentslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/nginx/arm-nginx/samples/v1/typescript/src/deploymentsListSample.ts
|
||||
[deploymentsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/nginx/arm-nginx/samples/v1/typescript/src/deploymentsUpdateSample.ts
|
||||
[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/nginx/arm-nginx/samples/v1/typescript/src/operationsListSample.ts
|
||||
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-nginx?view=azure-node-preview
|
||||
[freesub]: https://azure.microsoft.com/free/
|
||||
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/nginx/arm-nginx/README.md
|
||||
[typescript]: https://www.typescriptlang.org/docs/home.html
|
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
"name": "@azure-samples/arm-nginx-ts",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"description": " client library samples for TypeScript",
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"prebuild": "rimraf dist/"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
|
||||
"directory": "sdk/nginx/arm-nginx"
|
||||
},
|
||||
"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/nginx/arm-nginx",
|
||||
"dependencies": {
|
||||
"@azure/arm-nginx": "latest",
|
||||
"dotenv": "latest",
|
||||
"@azure/identity": "^2.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^12.0.0",
|
||||
"typescript": "~4.6.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,35 @@
|
|||
/*
|
||||
* 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 { NginxManagementClient } from "@azure/arm-nginx";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update the Nginx certificates for given Nginx deployment
|
||||
*
|
||||
* @summary Create or update the Nginx certificates for given Nginx deployment
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Certificates_CreateOrUpdate.json
|
||||
*/
|
||||
async function certificatesCreateOrUpdate() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const certificateName = "default";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const result = await client.certificates.beginCreateAndWait(
|
||||
resourceGroupName,
|
||||
deploymentName,
|
||||
certificateName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
certificatesCreateOrUpdate().catch(console.error);
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* 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 { NginxManagementClient } from "@azure/arm-nginx";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes a certificate from the nginx deployment
|
||||
*
|
||||
* @summary Deletes a certificate from the nginx deployment
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Certificates_Delete.json
|
||||
*/
|
||||
async function certificatesDelete() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const certificateName = "default";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const result = await client.certificates.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
deploymentName,
|
||||
certificateName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
certificatesDelete().catch(console.error);
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* 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 { NginxManagementClient } from "@azure/arm-nginx";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get a certificate of given Nginx deployment
|
||||
*
|
||||
* @summary Get a certificate of given Nginx deployment
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Certificates_Get.json
|
||||
*/
|
||||
async function certificatesGet() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const certificateName = "default";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const result = await client.certificates.get(
|
||||
resourceGroupName,
|
||||
deploymentName,
|
||||
certificateName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
certificatesGet().catch(console.error);
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* 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 { NginxManagementClient } from "@azure/arm-nginx";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to List all certificates of given Nginx deployment
|
||||
*
|
||||
* @summary List all certificates of given Nginx deployment
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Certificates_List.json
|
||||
*/
|
||||
async function certificatesList() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.certificates.list(
|
||||
resourceGroupName,
|
||||
deploymentName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
certificatesList().catch(console.error);
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* 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 { NginxManagementClient } from "@azure/arm-nginx";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update the Nginx configuration for given Nginx deployment
|
||||
*
|
||||
* @summary Create or update the Nginx configuration for given Nginx deployment
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Configurations_CreateOrUpdate.json
|
||||
*/
|
||||
async function configurationsCreateOrUpdate() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const configurationName = "default";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const result = await client.configurations.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
deploymentName,
|
||||
configurationName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
configurationsCreateOrUpdate().catch(console.error);
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* 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 { NginxManagementClient } from "@azure/arm-nginx";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Reset the Nginx configuration of given Nginx deployment to default
|
||||
*
|
||||
* @summary Reset the Nginx configuration of given Nginx deployment to default
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Configurations_Delete.json
|
||||
*/
|
||||
async function configurationsDelete() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const configurationName = "default";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const result = await client.configurations.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
deploymentName,
|
||||
configurationName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
configurationsDelete().catch(console.error);
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* 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 { NginxManagementClient } from "@azure/arm-nginx";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get the Nginx configuration of given Nginx deployment
|
||||
*
|
||||
* @summary Get the Nginx configuration of given Nginx deployment
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Configurations_Get.json
|
||||
*/
|
||||
async function configurationsGet() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const configurationName = "default";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const result = await client.configurations.get(
|
||||
resourceGroupName,
|
||||
deploymentName,
|
||||
configurationName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
configurationsGet().catch(console.error);
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* 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 { NginxManagementClient } from "@azure/arm-nginx";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to List the Nginx configuration of given Nginx deployment.
|
||||
*
|
||||
* @summary List the Nginx configuration of given Nginx deployment.
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Configurations_List.json
|
||||
*/
|
||||
async function configurationsList() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.configurations.list(
|
||||
resourceGroupName,
|
||||
deploymentName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
configurationsList().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 { NginxManagementClient } from "@azure/arm-nginx";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update the Nginx deployment
|
||||
*
|
||||
* @summary Create or update the Nginx deployment
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Deployments_Create.json
|
||||
*/
|
||||
async function deploymentsCreate() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const result = await client.deployments.beginCreateAndWait(
|
||||
resourceGroupName,
|
||||
deploymentName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deploymentsCreate().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 { NginxManagementClient } from "@azure/arm-nginx";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Delete the Nginx deployment resource
|
||||
*
|
||||
* @summary Delete the Nginx deployment resource
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Deployments_Delete.json
|
||||
*/
|
||||
async function deploymentsDelete() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const result = await client.deployments.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
deploymentName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deploymentsDelete().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 { NginxManagementClient } from "@azure/arm-nginx";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Get the Nginx deployment
|
||||
*
|
||||
* @summary Get the Nginx deployment
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Deployments_Get.json
|
||||
*/
|
||||
async function deploymentsGet() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const result = await client.deployments.get(
|
||||
resourceGroupName,
|
||||
deploymentName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deploymentsGet().catch(console.error);
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* 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 { NginxManagementClient } from "@azure/arm-nginx";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to List all Nginx deployments under the specified resource group.
|
||||
*
|
||||
* @summary List all Nginx deployments under the specified resource group.
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Deployments_ListByResourceGroup.json
|
||||
*/
|
||||
async function deploymentsListByResourceGroup() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.deployments.listByResourceGroup(
|
||||
resourceGroupName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
deploymentsListByResourceGroup().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 { NginxManagementClient } from "@azure/arm-nginx";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to List the Nginx deployments resources
|
||||
*
|
||||
* @summary List the Nginx deployments resources
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Deployments_List.json
|
||||
*/
|
||||
async function deploymentsList() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.deployments.list()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
deploymentsList().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 { NginxManagementClient } from "@azure/arm-nginx";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Update the Nginx deployment
|
||||
*
|
||||
* @summary Update the Nginx deployment
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Deployments_Update.json
|
||||
*/
|
||||
async function deploymentsUpdate() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const resourceGroupName = "myResourceGroup";
|
||||
const deploymentName = "myDeployment";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const result = await client.deployments.beginUpdateAndWait(
|
||||
resourceGroupName,
|
||||
deploymentName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deploymentsUpdate().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 { NginxManagementClient } from "@azure/arm-nginx";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to List all operations provided by Nginx.NginxPlus for the 2022-08-01 api version.
|
||||
*
|
||||
* @summary List all operations provided by Nginx.NginxPlus for the 2022-08-01 api version.
|
||||
* x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/stable/2022-08-01/examples/Operations_List.json
|
||||
*/
|
||||
async function operationsList() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new NginxManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.operations.list()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
operationsList().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,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 { NginxManagementClient } from "./nginxManagementClient";
|
||||
export * from "./operationsInterfaces";
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* 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 { LongRunningOperation, LroResponse } from "@azure/core-lro";
|
||||
|
||||
export class LroImpl<T> implements LongRunningOperation<T> {
|
||||
constructor(
|
||||
private sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>,
|
||||
private args: Record<string, unknown>,
|
||||
private spec: {
|
||||
readonly requestBody?: unknown;
|
||||
readonly path?: string;
|
||||
readonly httpMethod: string;
|
||||
} & Record<string, any>,
|
||||
public requestPath: string = spec.path!,
|
||||
public requestMethod: string = spec.httpMethod
|
||||
) {}
|
||||
public async sendInitialRequest(): Promise<LroResponse<T>> {
|
||||
return this.sendOperationFn(this.args, this.spec);
|
||||
}
|
||||
public async sendPollRequest(path: string): Promise<LroResponse<T>> {
|
||||
const { requestBody, ...restSpec } = this.spec;
|
||||
return this.sendOperationFn(this.args, {
|
||||
...restSpec,
|
||||
path,
|
||||
httpMethod: "GET"
|
||||
});
|
||||
}
|
||||
}
|
|
@ -0,0 +1,536 @@
|
|||
/*
|
||||
* 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 interface NginxCertificate {
|
||||
/** NOTE: This property will not be serialized. It can only be populated by the server. */
|
||||
readonly id?: string;
|
||||
/** NOTE: This property will not be serialized. It can only be populated by the server. */
|
||||
readonly name?: string;
|
||||
/** NOTE: This property will not be serialized. It can only be populated by the server. */
|
||||
readonly type?: string;
|
||||
properties?: NginxCertificateProperties;
|
||||
/** Dictionary of <string> */
|
||||
tags?: { [propertyName: string]: string };
|
||||
location?: string;
|
||||
/**
|
||||
* Metadata pertaining to creation and last modification of the resource.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly systemData?: SystemData;
|
||||
}
|
||||
|
||||
export interface NginxCertificateProperties {
|
||||
provisioningState?: ProvisioningState;
|
||||
keyVirtualPath?: string;
|
||||
certificateVirtualPath?: string;
|
||||
keyVaultSecretId?: string;
|
||||
}
|
||||
|
||||
/** 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;
|
||||
}
|
||||
|
||||
export interface ResourceProviderDefaultErrorResponse {
|
||||
error?: ErrorResponseBody;
|
||||
}
|
||||
|
||||
export interface ErrorResponseBody {
|
||||
code?: string;
|
||||
message?: string;
|
||||
target?: string;
|
||||
details?: ErrorResponseBody[];
|
||||
}
|
||||
|
||||
export interface NginxCertificateListResponse {
|
||||
value?: NginxCertificate[];
|
||||
nextLink?: string;
|
||||
}
|
||||
|
||||
/** Response of a list operation. */
|
||||
export interface NginxConfigurationListResponse {
|
||||
/** Results of a list operation. */
|
||||
value?: NginxConfiguration[];
|
||||
/** Link to the next set of results, if any. */
|
||||
nextLink?: string;
|
||||
}
|
||||
|
||||
export interface NginxConfiguration {
|
||||
/** NOTE: This property will not be serialized. It can only be populated by the server. */
|
||||
readonly id?: string;
|
||||
/** NOTE: This property will not be serialized. It can only be populated by the server. */
|
||||
readonly name?: string;
|
||||
/** NOTE: This property will not be serialized. It can only be populated by the server. */
|
||||
readonly type?: string;
|
||||
properties?: NginxConfigurationProperties;
|
||||
/** Dictionary of <string> */
|
||||
tags?: { [propertyName: string]: string };
|
||||
location?: string;
|
||||
/**
|
||||
* Metadata pertaining to creation and last modification of the resource.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly systemData?: SystemData;
|
||||
}
|
||||
|
||||
export interface NginxConfigurationProperties {
|
||||
provisioningState?: ProvisioningState;
|
||||
files?: NginxConfigurationFile[];
|
||||
package?: NginxConfigurationPackage;
|
||||
rootFile?: string;
|
||||
}
|
||||
|
||||
export interface NginxConfigurationFile {
|
||||
content?: string;
|
||||
virtualPath?: string;
|
||||
}
|
||||
|
||||
export interface NginxConfigurationPackage {
|
||||
data?: string;
|
||||
}
|
||||
|
||||
export interface NginxDeployment {
|
||||
/** NOTE: This property will not be serialized. It can only be populated by the server. */
|
||||
readonly id?: string;
|
||||
/** NOTE: This property will not be serialized. It can only be populated by the server. */
|
||||
readonly name?: string;
|
||||
/** NOTE: This property will not be serialized. It can only be populated by the server. */
|
||||
readonly type?: string;
|
||||
identity?: IdentityProperties;
|
||||
properties?: NginxDeploymentProperties;
|
||||
/** Dictionary of <string> */
|
||||
tags?: { [propertyName: string]: string };
|
||||
sku?: ResourceSku;
|
||||
location?: string;
|
||||
/**
|
||||
* Metadata pertaining to creation and last modification of the resource.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly systemData?: SystemData;
|
||||
}
|
||||
|
||||
export interface IdentityProperties {
|
||||
/** NOTE: This property will not be serialized. It can only be populated by the server. */
|
||||
readonly principalId?: string;
|
||||
/** NOTE: This property will not be serialized. It can only be populated by the server. */
|
||||
readonly tenantId?: string;
|
||||
type?: IdentityType;
|
||||
/** Dictionary of <UserIdentityProperties> */
|
||||
userAssignedIdentities?: { [propertyName: string]: UserIdentityProperties };
|
||||
}
|
||||
|
||||
export interface UserIdentityProperties {
|
||||
/** NOTE: This property will not be serialized. It can only be populated by the server. */
|
||||
readonly principalId?: string;
|
||||
/** NOTE: This property will not be serialized. It can only be populated by the server. */
|
||||
readonly clientId?: string;
|
||||
}
|
||||
|
||||
export interface NginxDeploymentProperties {
|
||||
provisioningState?: ProvisioningState;
|
||||
/** NOTE: This property will not be serialized. It can only be populated by the server. */
|
||||
readonly nginxVersion?: string;
|
||||
/** The managed resource group to deploy VNet injection related network resources. */
|
||||
managedResourceGroup?: string;
|
||||
networkProfile?: NginxNetworkProfile;
|
||||
/**
|
||||
* The IP address of the deployment.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly ipAddress?: string;
|
||||
enableDiagnosticsSupport?: boolean;
|
||||
logging?: NginxLogging;
|
||||
}
|
||||
|
||||
export interface NginxNetworkProfile {
|
||||
frontEndIPConfiguration?: NginxFrontendIPConfiguration;
|
||||
networkInterfaceConfiguration?: NginxNetworkInterfaceConfiguration;
|
||||
}
|
||||
|
||||
export interface NginxFrontendIPConfiguration {
|
||||
publicIPAddresses?: NginxPublicIPAddress[];
|
||||
privateIPAddresses?: NginxPrivateIPAddress[];
|
||||
}
|
||||
|
||||
export interface NginxPublicIPAddress {
|
||||
id?: string;
|
||||
}
|
||||
|
||||
export interface NginxPrivateIPAddress {
|
||||
privateIPAddress?: string;
|
||||
privateIPAllocationMethod?: NginxPrivateIPAllocationMethod;
|
||||
subnetId?: string;
|
||||
}
|
||||
|
||||
export interface NginxNetworkInterfaceConfiguration {
|
||||
subnetId?: string;
|
||||
}
|
||||
|
||||
export interface NginxLogging {
|
||||
storageAccount?: NginxStorageAccount;
|
||||
}
|
||||
|
||||
export interface NginxStorageAccount {
|
||||
accountName?: string;
|
||||
containerName?: string;
|
||||
}
|
||||
|
||||
export interface ResourceSku {
|
||||
/** Name of the SKU. */
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface NginxDeploymentUpdateParameters {
|
||||
identity?: IdentityProperties;
|
||||
/** Dictionary of <string> */
|
||||
tags?: { [propertyName: string]: string };
|
||||
sku?: ResourceSku;
|
||||
location?: string;
|
||||
properties?: NginxDeploymentUpdateProperties;
|
||||
}
|
||||
|
||||
export interface NginxDeploymentUpdateProperties {
|
||||
enableDiagnosticsSupport?: boolean;
|
||||
logging?: NginxLogging;
|
||||
}
|
||||
|
||||
export interface NginxDeploymentListResponse {
|
||||
value?: NginxDeployment[];
|
||||
nextLink?: string;
|
||||
}
|
||||
|
||||
/** Result of GET request to list Nginx.NginxPlus operations. */
|
||||
export interface OperationListResult {
|
||||
/** List of operations supported by the Nginx.NginxPlus provider. */
|
||||
value?: OperationResult[];
|
||||
/** URL to get the next set of operation list results if there are any. */
|
||||
nextLink?: string;
|
||||
}
|
||||
|
||||
/** A Nginx.NginxPlus REST API operation. */
|
||||
export interface OperationResult {
|
||||
/** Operation name: {provider}/{resource}/{operation} */
|
||||
name?: string;
|
||||
/** The object that represents the operation. */
|
||||
display?: OperationDisplay;
|
||||
/** Indicates whether the operation is a data action */
|
||||
isDataAction?: boolean;
|
||||
}
|
||||
|
||||
/** The object that represents the operation. */
|
||||
export interface OperationDisplay {
|
||||
/** Service provider: Nginx.NginxPlus */
|
||||
provider?: string;
|
||||
/** Type on which the operation is performed, e.g., 'deployments'. */
|
||||
resource?: string;
|
||||
/** Operation type, e.g., read, write, delete, etc. */
|
||||
operation?: string;
|
||||
/** Description of the operation, e.g., 'Write deployments'. */
|
||||
description?: string;
|
||||
}
|
||||
|
||||
/** Known values of {@link ProvisioningState} that the service accepts. */
|
||||
export enum KnownProvisioningState {
|
||||
/** Accepted */
|
||||
Accepted = "Accepted",
|
||||
/** Creating */
|
||||
Creating = "Creating",
|
||||
/** Updating */
|
||||
Updating = "Updating",
|
||||
/** Deleting */
|
||||
Deleting = "Deleting",
|
||||
/** Succeeded */
|
||||
Succeeded = "Succeeded",
|
||||
/** Failed */
|
||||
Failed = "Failed",
|
||||
/** Canceled */
|
||||
Canceled = "Canceled",
|
||||
/** Deleted */
|
||||
Deleted = "Deleted",
|
||||
/** NotSpecified */
|
||||
NotSpecified = "NotSpecified"
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines values for ProvisioningState. \
|
||||
* {@link KnownProvisioningState} can be used interchangeably with ProvisioningState,
|
||||
* this enum contains the known values that the service supports.
|
||||
* ### Known values supported by the service
|
||||
* **Accepted** \
|
||||
* **Creating** \
|
||||
* **Updating** \
|
||||
* **Deleting** \
|
||||
* **Succeeded** \
|
||||
* **Failed** \
|
||||
* **Canceled** \
|
||||
* **Deleted** \
|
||||
* **NotSpecified**
|
||||
*/
|
||||
export type ProvisioningState = 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 IdentityType} that the service accepts. */
|
||||
export enum KnownIdentityType {
|
||||
/** SystemAssigned */
|
||||
SystemAssigned = "SystemAssigned",
|
||||
/** UserAssigned */
|
||||
UserAssigned = "UserAssigned",
|
||||
/** SystemAssignedUserAssigned */
|
||||
SystemAssignedUserAssigned = "SystemAssigned, UserAssigned",
|
||||
/** None */
|
||||
None = "None"
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines values for IdentityType. \
|
||||
* {@link KnownIdentityType} can be used interchangeably with IdentityType,
|
||||
* this enum contains the known values that the service supports.
|
||||
* ### Known values supported by the service
|
||||
* **SystemAssigned** \
|
||||
* **UserAssigned** \
|
||||
* **SystemAssigned, UserAssigned** \
|
||||
* **None**
|
||||
*/
|
||||
export type IdentityType = string;
|
||||
|
||||
/** Known values of {@link NginxPrivateIPAllocationMethod} that the service accepts. */
|
||||
export enum KnownNginxPrivateIPAllocationMethod {
|
||||
/** Static */
|
||||
Static = "Static",
|
||||
/** Dynamic */
|
||||
Dynamic = "Dynamic"
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines values for NginxPrivateIPAllocationMethod. \
|
||||
* {@link KnownNginxPrivateIPAllocationMethod} can be used interchangeably with NginxPrivateIPAllocationMethod,
|
||||
* this enum contains the known values that the service supports.
|
||||
* ### Known values supported by the service
|
||||
* **Static** \
|
||||
* **Dynamic**
|
||||
*/
|
||||
export type NginxPrivateIPAllocationMethod = string;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface CertificatesGetOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the get operation. */
|
||||
export type CertificatesGetResponse = NginxCertificate;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface CertificatesCreateOptionalParams
|
||||
extends coreClient.OperationOptions {
|
||||
/** The certificate */
|
||||
body?: NginxCertificate;
|
||||
/** Delay to wait until next poll, in milliseconds. */
|
||||
updateIntervalInMs?: number;
|
||||
/** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */
|
||||
resumeFrom?: string;
|
||||
}
|
||||
|
||||
/** Contains response data for the create operation. */
|
||||
export type CertificatesCreateResponse = NginxCertificate;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface CertificatesDeleteOptionalParams
|
||||
extends coreClient.OperationOptions {
|
||||
/** Delay to wait until next poll, in milliseconds. */
|
||||
updateIntervalInMs?: number;
|
||||
/** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */
|
||||
resumeFrom?: string;
|
||||
}
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface CertificatesListOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the list operation. */
|
||||
export type CertificatesListResponse = NginxCertificateListResponse;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface CertificatesListNextOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the listNext operation. */
|
||||
export type CertificatesListNextResponse = NginxCertificateListResponse;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface ConfigurationsListOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the list operation. */
|
||||
export type ConfigurationsListResponse = NginxConfigurationListResponse;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface ConfigurationsGetOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the get operation. */
|
||||
export type ConfigurationsGetResponse = NginxConfiguration;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface ConfigurationsCreateOrUpdateOptionalParams
|
||||
extends coreClient.OperationOptions {
|
||||
/** The Nginx configuration */
|
||||
body?: NginxConfiguration;
|
||||
/** Delay to wait until next poll, in milliseconds. */
|
||||
updateIntervalInMs?: number;
|
||||
/** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */
|
||||
resumeFrom?: string;
|
||||
}
|
||||
|
||||
/** Contains response data for the createOrUpdate operation. */
|
||||
export type ConfigurationsCreateOrUpdateResponse = NginxConfiguration;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface ConfigurationsDeleteOptionalParams
|
||||
extends coreClient.OperationOptions {
|
||||
/** Delay to wait until next poll, in milliseconds. */
|
||||
updateIntervalInMs?: number;
|
||||
/** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */
|
||||
resumeFrom?: string;
|
||||
}
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface ConfigurationsListNextOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the listNext operation. */
|
||||
export type ConfigurationsListNextResponse = NginxConfigurationListResponse;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface DeploymentsGetOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the get operation. */
|
||||
export type DeploymentsGetResponse = NginxDeployment;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface DeploymentsCreateOptionalParams
|
||||
extends coreClient.OperationOptions {
|
||||
body?: NginxDeployment;
|
||||
/** Delay to wait until next poll, in milliseconds. */
|
||||
updateIntervalInMs?: number;
|
||||
/** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */
|
||||
resumeFrom?: string;
|
||||
}
|
||||
|
||||
/** Contains response data for the create operation. */
|
||||
export type DeploymentsCreateResponse = NginxDeployment;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface DeploymentsUpdateOptionalParams
|
||||
extends coreClient.OperationOptions {
|
||||
body?: NginxDeploymentUpdateParameters;
|
||||
/** Delay to wait until next poll, in milliseconds. */
|
||||
updateIntervalInMs?: number;
|
||||
/** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */
|
||||
resumeFrom?: string;
|
||||
}
|
||||
|
||||
/** Contains response data for the update operation. */
|
||||
export type DeploymentsUpdateResponse = NginxDeployment;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface DeploymentsDeleteOptionalParams
|
||||
extends coreClient.OperationOptions {
|
||||
/** Delay to wait until next poll, in milliseconds. */
|
||||
updateIntervalInMs?: number;
|
||||
/** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */
|
||||
resumeFrom?: string;
|
||||
}
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface DeploymentsListOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the list operation. */
|
||||
export type DeploymentsListResponse = NginxDeploymentListResponse;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface DeploymentsListByResourceGroupOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the listByResourceGroup operation. */
|
||||
export type DeploymentsListByResourceGroupResponse = NginxDeploymentListResponse;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface DeploymentsListNextOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the listNext operation. */
|
||||
export type DeploymentsListNextResponse = NginxDeploymentListResponse;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface DeploymentsListByResourceGroupNextOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the listByResourceGroupNext operation. */
|
||||
export type DeploymentsListByResourceGroupNextResponse = NginxDeploymentListResponse;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface OperationsListOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the list operation. */
|
||||
export type OperationsListResponse = OperationListResult;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface OperationsListNextOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the listNext operation. */
|
||||
export type OperationsListNextResponse = OperationListResult;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface NginxManagementClientOptionalParams
|
||||
extends coreClient.ServiceClientOptions {
|
||||
/** server parameter */
|
||||
$host?: string;
|
||||
/** Api Version */
|
||||
apiVersion?: string;
|
||||
/** Overrides client endpoint. */
|
||||
endpoint?: string;
|
||||
}
|
|
@ -0,0 +1,919 @@
|
|||
/*
|
||||
* 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 NginxCertificate: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxCertificate",
|
||||
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"
|
||||
}
|
||||
},
|
||||
properties: {
|
||||
serializedName: "properties",
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxCertificateProperties"
|
||||
}
|
||||
},
|
||||
tags: {
|
||||
serializedName: "tags",
|
||||
type: {
|
||||
name: "Dictionary",
|
||||
value: { type: { name: "String" } }
|
||||
}
|
||||
},
|
||||
location: {
|
||||
serializedName: "location",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
systemData: {
|
||||
serializedName: "systemData",
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "SystemData"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const NginxCertificateProperties: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxCertificateProperties",
|
||||
modelProperties: {
|
||||
provisioningState: {
|
||||
serializedName: "provisioningState",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
keyVirtualPath: {
|
||||
serializedName: "keyVirtualPath",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
certificateVirtualPath: {
|
||||
serializedName: "certificateVirtualPath",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
keyVaultSecretId: {
|
||||
serializedName: "keyVaultSecretId",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
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 ResourceProviderDefaultErrorResponse: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "ResourceProviderDefaultErrorResponse",
|
||||
modelProperties: {
|
||||
error: {
|
||||
serializedName: "error",
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "ErrorResponseBody"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const ErrorResponseBody: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "ErrorResponseBody",
|
||||
modelProperties: {
|
||||
code: {
|
||||
serializedName: "code",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
message: {
|
||||
serializedName: "message",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
target: {
|
||||
serializedName: "target",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
details: {
|
||||
serializedName: "details",
|
||||
type: {
|
||||
name: "Sequence",
|
||||
element: {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "ErrorResponseBody"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const NginxCertificateListResponse: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxCertificateListResponse",
|
||||
modelProperties: {
|
||||
value: {
|
||||
serializedName: "value",
|
||||
type: {
|
||||
name: "Sequence",
|
||||
element: {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxCertificate"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
nextLink: {
|
||||
serializedName: "nextLink",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const NginxConfigurationListResponse: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxConfigurationListResponse",
|
||||
modelProperties: {
|
||||
value: {
|
||||
serializedName: "value",
|
||||
type: {
|
||||
name: "Sequence",
|
||||
element: {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxConfiguration"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
nextLink: {
|
||||
serializedName: "nextLink",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const NginxConfiguration: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxConfiguration",
|
||||
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"
|
||||
}
|
||||
},
|
||||
properties: {
|
||||
serializedName: "properties",
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxConfigurationProperties"
|
||||
}
|
||||
},
|
||||
tags: {
|
||||
serializedName: "tags",
|
||||
type: {
|
||||
name: "Dictionary",
|
||||
value: { type: { name: "String" } }
|
||||
}
|
||||
},
|
||||
location: {
|
||||
serializedName: "location",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
systemData: {
|
||||
serializedName: "systemData",
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "SystemData"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const NginxConfigurationProperties: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxConfigurationProperties",
|
||||
modelProperties: {
|
||||
provisioningState: {
|
||||
serializedName: "provisioningState",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
files: {
|
||||
serializedName: "files",
|
||||
type: {
|
||||
name: "Sequence",
|
||||
element: {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxConfigurationFile"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
package: {
|
||||
serializedName: "package",
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxConfigurationPackage"
|
||||
}
|
||||
},
|
||||
rootFile: {
|
||||
serializedName: "rootFile",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const NginxConfigurationFile: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxConfigurationFile",
|
||||
modelProperties: {
|
||||
content: {
|
||||
serializedName: "content",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
virtualPath: {
|
||||
serializedName: "virtualPath",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const NginxConfigurationPackage: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxConfigurationPackage",
|
||||
modelProperties: {
|
||||
data: {
|
||||
serializedName: "data",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const NginxDeployment: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxDeployment",
|
||||
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"
|
||||
}
|
||||
},
|
||||
identity: {
|
||||
serializedName: "identity",
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "IdentityProperties"
|
||||
}
|
||||
},
|
||||
properties: {
|
||||
serializedName: "properties",
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxDeploymentProperties"
|
||||
}
|
||||
},
|
||||
tags: {
|
||||
serializedName: "tags",
|
||||
type: {
|
||||
name: "Dictionary",
|
||||
value: { type: { name: "String" } }
|
||||
}
|
||||
},
|
||||
sku: {
|
||||
serializedName: "sku",
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "ResourceSku"
|
||||
}
|
||||
},
|
||||
location: {
|
||||
serializedName: "location",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
systemData: {
|
||||
serializedName: "systemData",
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "SystemData"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const IdentityProperties: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "IdentityProperties",
|
||||
modelProperties: {
|
||||
principalId: {
|
||||
serializedName: "principalId",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
tenantId: {
|
||||
serializedName: "tenantId",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
type: {
|
||||
serializedName: "type",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
userAssignedIdentities: {
|
||||
serializedName: "userAssignedIdentities",
|
||||
type: {
|
||||
name: "Dictionary",
|
||||
value: {
|
||||
type: { name: "Composite", className: "UserIdentityProperties" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const UserIdentityProperties: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "UserIdentityProperties",
|
||||
modelProperties: {
|
||||
principalId: {
|
||||
serializedName: "principalId",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
clientId: {
|
||||
serializedName: "clientId",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const NginxDeploymentProperties: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxDeploymentProperties",
|
||||
modelProperties: {
|
||||
provisioningState: {
|
||||
serializedName: "provisioningState",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
nginxVersion: {
|
||||
serializedName: "nginxVersion",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
managedResourceGroup: {
|
||||
serializedName: "managedResourceGroup",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
networkProfile: {
|
||||
serializedName: "networkProfile",
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxNetworkProfile"
|
||||
}
|
||||
},
|
||||
ipAddress: {
|
||||
serializedName: "ipAddress",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
enableDiagnosticsSupport: {
|
||||
serializedName: "enableDiagnosticsSupport",
|
||||
type: {
|
||||
name: "Boolean"
|
||||
}
|
||||
},
|
||||
logging: {
|
||||
serializedName: "logging",
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxLogging"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const NginxNetworkProfile: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxNetworkProfile",
|
||||
modelProperties: {
|
||||
frontEndIPConfiguration: {
|
||||
serializedName: "frontEndIPConfiguration",
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxFrontendIPConfiguration"
|
||||
}
|
||||
},
|
||||
networkInterfaceConfiguration: {
|
||||
serializedName: "networkInterfaceConfiguration",
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxNetworkInterfaceConfiguration"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const NginxFrontendIPConfiguration: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxFrontendIPConfiguration",
|
||||
modelProperties: {
|
||||
publicIPAddresses: {
|
||||
serializedName: "publicIPAddresses",
|
||||
type: {
|
||||
name: "Sequence",
|
||||
element: {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxPublicIPAddress"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
privateIPAddresses: {
|
||||
serializedName: "privateIPAddresses",
|
||||
type: {
|
||||
name: "Sequence",
|
||||
element: {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxPrivateIPAddress"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const NginxPublicIPAddress: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxPublicIPAddress",
|
||||
modelProperties: {
|
||||
id: {
|
||||
serializedName: "id",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const NginxPrivateIPAddress: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxPrivateIPAddress",
|
||||
modelProperties: {
|
||||
privateIPAddress: {
|
||||
serializedName: "privateIPAddress",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
privateIPAllocationMethod: {
|
||||
serializedName: "privateIPAllocationMethod",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
subnetId: {
|
||||
serializedName: "subnetId",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const NginxNetworkInterfaceConfiguration: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxNetworkInterfaceConfiguration",
|
||||
modelProperties: {
|
||||
subnetId: {
|
||||
serializedName: "subnetId",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const NginxLogging: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxLogging",
|
||||
modelProperties: {
|
||||
storageAccount: {
|
||||
serializedName: "storageAccount",
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxStorageAccount"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const NginxStorageAccount: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxStorageAccount",
|
||||
modelProperties: {
|
||||
accountName: {
|
||||
serializedName: "accountName",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
containerName: {
|
||||
serializedName: "containerName",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const ResourceSku: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "ResourceSku",
|
||||
modelProperties: {
|
||||
name: {
|
||||
serializedName: "name",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const NginxDeploymentUpdateParameters: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxDeploymentUpdateParameters",
|
||||
modelProperties: {
|
||||
identity: {
|
||||
serializedName: "identity",
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "IdentityProperties"
|
||||
}
|
||||
},
|
||||
tags: {
|
||||
serializedName: "tags",
|
||||
type: {
|
||||
name: "Dictionary",
|
||||
value: { type: { name: "String" } }
|
||||
}
|
||||
},
|
||||
sku: {
|
||||
serializedName: "sku",
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "ResourceSku"
|
||||
}
|
||||
},
|
||||
location: {
|
||||
serializedName: "location",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
properties: {
|
||||
serializedName: "properties",
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxDeploymentUpdateProperties"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const NginxDeploymentUpdateProperties: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxDeploymentUpdateProperties",
|
||||
modelProperties: {
|
||||
enableDiagnosticsSupport: {
|
||||
serializedName: "enableDiagnosticsSupport",
|
||||
type: {
|
||||
name: "Boolean"
|
||||
}
|
||||
},
|
||||
logging: {
|
||||
serializedName: "logging",
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxLogging"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const NginxDeploymentListResponse: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxDeploymentListResponse",
|
||||
modelProperties: {
|
||||
value: {
|
||||
serializedName: "value",
|
||||
type: {
|
||||
name: "Sequence",
|
||||
element: {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NginxDeployment"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
nextLink: {
|
||||
serializedName: "nextLink",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const OperationListResult: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "OperationListResult",
|
||||
modelProperties: {
|
||||
value: {
|
||||
serializedName: "value",
|
||||
type: {
|
||||
name: "Sequence",
|
||||
element: {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "OperationResult"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
nextLink: {
|
||||
serializedName: "nextLink",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const OperationResult: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "OperationResult",
|
||||
modelProperties: {
|
||||
name: {
|
||||
serializedName: "name",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
display: {
|
||||
serializedName: "display",
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "OperationDisplay"
|
||||
}
|
||||
},
|
||||
isDataAction: {
|
||||
serializedName: "isDataAction",
|
||||
type: {
|
||||
name: "Boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const OperationDisplay: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "OperationDisplay",
|
||||
modelProperties: {
|
||||
provider: {
|
||||
serializedName: "provider",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
resource: {
|
||||
serializedName: "resource",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
operation: {
|
||||
serializedName: "operation",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
description: {
|
||||
serializedName: "description",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
|
@ -0,0 +1,161 @@
|
|||
/*
|
||||
* 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 {
|
||||
NginxCertificate as NginxCertificateMapper,
|
||||
NginxConfiguration as NginxConfigurationMapper,
|
||||
NginxDeployment as NginxDeploymentMapper,
|
||||
NginxDeploymentUpdateParameters as NginxDeploymentUpdateParametersMapper
|
||||
} 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 subscriptionId: OperationURLParameter = {
|
||||
parameterPath: "subscriptionId",
|
||||
mapper: {
|
||||
constraints: {
|
||||
MinLength: 1
|
||||
},
|
||||
serializedName: "subscriptionId",
|
||||
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 deploymentName: OperationURLParameter = {
|
||||
parameterPath: "deploymentName",
|
||||
mapper: {
|
||||
serializedName: "deploymentName",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const certificateName: OperationURLParameter = {
|
||||
parameterPath: "certificateName",
|
||||
mapper: {
|
||||
serializedName: "certificateName",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const contentType: OperationParameter = {
|
||||
parameterPath: ["options", "contentType"],
|
||||
mapper: {
|
||||
defaultValue: "application/json",
|
||||
isConstant: true,
|
||||
serializedName: "Content-Type",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const body: OperationParameter = {
|
||||
parameterPath: ["options", "body"],
|
||||
mapper: NginxCertificateMapper
|
||||
};
|
||||
|
||||
export const apiVersion: OperationQueryParameter = {
|
||||
parameterPath: "apiVersion",
|
||||
mapper: {
|
||||
defaultValue: "2022-08-01",
|
||||
isConstant: true,
|
||||
serializedName: "api-version",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const nextLink: OperationURLParameter = {
|
||||
parameterPath: "nextLink",
|
||||
mapper: {
|
||||
serializedName: "nextLink",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
skipEncoding: true
|
||||
};
|
||||
|
||||
export const configurationName: OperationURLParameter = {
|
||||
parameterPath: "configurationName",
|
||||
mapper: {
|
||||
serializedName: "configurationName",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const body1: OperationParameter = {
|
||||
parameterPath: ["options", "body"],
|
||||
mapper: NginxConfigurationMapper
|
||||
};
|
||||
|
||||
export const body2: OperationParameter = {
|
||||
parameterPath: ["options", "body"],
|
||||
mapper: NginxDeploymentMapper
|
||||
};
|
||||
|
||||
export const body3: OperationParameter = {
|
||||
parameterPath: ["options", "body"],
|
||||
mapper: NginxDeploymentUpdateParametersMapper
|
||||
};
|
|
@ -0,0 +1,157 @@
|
|||
/*
|
||||
* 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 {
|
||||
CertificatesImpl,
|
||||
ConfigurationsImpl,
|
||||
DeploymentsImpl,
|
||||
OperationsImpl
|
||||
} from "./operations";
|
||||
import {
|
||||
Certificates,
|
||||
Configurations,
|
||||
Deployments,
|
||||
Operations
|
||||
} from "./operationsInterfaces";
|
||||
import { NginxManagementClientOptionalParams } from "./models";
|
||||
|
||||
export class NginxManagementClient extends coreClient.ServiceClient {
|
||||
$host: string;
|
||||
subscriptionId: string;
|
||||
apiVersion: string;
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the NginxManagementClient 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?: NginxManagementClientOptionalParams
|
||||
) {
|
||||
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: NginxManagementClientOptionalParams = {
|
||||
requestContentType: "application/json; charset=utf-8",
|
||||
credential: credentials
|
||||
};
|
||||
|
||||
const packageDetails = `azsdk-js-arm-nginx/1.0.0`;
|
||||
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-08-01";
|
||||
this.certificates = new CertificatesImpl(this);
|
||||
this.configurations = new ConfigurationsImpl(this);
|
||||
this.deployments = new DeploymentsImpl(this);
|
||||
this.operations = new OperationsImpl(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);
|
||||
}
|
||||
|
||||
certificates: Certificates;
|
||||
configurations: Configurations;
|
||||
deployments: Deployments;
|
||||
operations: Operations;
|
||||
}
|
|
@ -0,0 +1,461 @@
|
|||
/*
|
||||
* 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 { Certificates } from "../operationsInterfaces";
|
||||
import * as coreClient from "@azure/core-client";
|
||||
import * as Mappers from "../models/mappers";
|
||||
import * as Parameters from "../models/parameters";
|
||||
import { NginxManagementClient } from "../nginxManagementClient";
|
||||
import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
|
||||
import { LroImpl } from "../lroImpl";
|
||||
import {
|
||||
NginxCertificate,
|
||||
CertificatesListNextOptionalParams,
|
||||
CertificatesListOptionalParams,
|
||||
CertificatesGetOptionalParams,
|
||||
CertificatesGetResponse,
|
||||
CertificatesCreateOptionalParams,
|
||||
CertificatesCreateResponse,
|
||||
CertificatesDeleteOptionalParams,
|
||||
CertificatesListResponse,
|
||||
CertificatesListNextResponse
|
||||
} from "../models";
|
||||
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
/** Class containing Certificates operations. */
|
||||
export class CertificatesImpl implements Certificates {
|
||||
private readonly client: NginxManagementClient;
|
||||
|
||||
/**
|
||||
* Initialize a new instance of the class Certificates class.
|
||||
* @param client Reference to the service client
|
||||
*/
|
||||
constructor(client: NginxManagementClient) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
/**
|
||||
* List all certificates of given Nginx deployment
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
public list(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
options?: CertificatesListOptionalParams
|
||||
): PagedAsyncIterableIterator<NginxCertificate> {
|
||||
const iter = this.listPagingAll(resourceGroupName, deploymentName, options);
|
||||
return {
|
||||
next() {
|
||||
return iter.next();
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return this;
|
||||
},
|
||||
byPage: () => {
|
||||
return this.listPagingPage(resourceGroupName, deploymentName, options);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private async *listPagingPage(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
options?: CertificatesListOptionalParams
|
||||
): AsyncIterableIterator<NginxCertificate[]> {
|
||||
let result = await this._list(resourceGroupName, deploymentName, options);
|
||||
yield result.value || [];
|
||||
let continuationToken = result.nextLink;
|
||||
while (continuationToken) {
|
||||
result = await this._listNext(
|
||||
resourceGroupName,
|
||||
deploymentName,
|
||||
continuationToken,
|
||||
options
|
||||
);
|
||||
continuationToken = result.nextLink;
|
||||
yield result.value || [];
|
||||
}
|
||||
}
|
||||
|
||||
private async *listPagingAll(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
options?: CertificatesListOptionalParams
|
||||
): AsyncIterableIterator<NginxCertificate> {
|
||||
for await (const page of this.listPagingPage(
|
||||
resourceGroupName,
|
||||
deploymentName,
|
||||
options
|
||||
)) {
|
||||
yield* page;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a certificate of given Nginx deployment
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param certificateName The name of certificate
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
get(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
certificateName: string,
|
||||
options?: CertificatesGetOptionalParams
|
||||
): Promise<CertificatesGetResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceGroupName, deploymentName, certificateName, options },
|
||||
getOperationSpec
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create or update the Nginx certificates for given Nginx deployment
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param certificateName The name of certificate
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
async beginCreate(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
certificateName: string,
|
||||
options?: CertificatesCreateOptionalParams
|
||||
): Promise<
|
||||
PollerLike<
|
||||
PollOperationState<CertificatesCreateResponse>,
|
||||
CertificatesCreateResponse
|
||||
>
|
||||
> {
|
||||
const directSendOperation = async (
|
||||
args: coreClient.OperationArguments,
|
||||
spec: coreClient.OperationSpec
|
||||
): Promise<CertificatesCreateResponse> => {
|
||||
return this.client.sendOperationRequest(args, spec);
|
||||
};
|
||||
const sendOperation = async (
|
||||
args: coreClient.OperationArguments,
|
||||
spec: coreClient.OperationSpec
|
||||
) => {
|
||||
let currentRawResponse:
|
||||
| coreClient.FullOperationResponse
|
||||
| undefined = undefined;
|
||||
const providedCallback = args.options?.onResponse;
|
||||
const callback: coreClient.RawResponseCallback = (
|
||||
rawResponse: coreClient.FullOperationResponse,
|
||||
flatResponse: unknown
|
||||
) => {
|
||||
currentRawResponse = rawResponse;
|
||||
providedCallback?.(rawResponse, flatResponse);
|
||||
};
|
||||
const updatedArgs = {
|
||||
...args,
|
||||
options: {
|
||||
...args.options,
|
||||
onResponse: callback
|
||||
}
|
||||
};
|
||||
const flatResponse = await directSendOperation(updatedArgs, spec);
|
||||
return {
|
||||
flatResponse,
|
||||
rawResponse: {
|
||||
statusCode: currentRawResponse!.status,
|
||||
body: currentRawResponse!.parsedBody,
|
||||
headers: currentRawResponse!.headers.toJSON()
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
const lro = new LroImpl(
|
||||
sendOperation,
|
||||
{ resourceGroupName, deploymentName, certificateName, options },
|
||||
createOperationSpec
|
||||
);
|
||||
const poller = new LroEngine(lro, {
|
||||
resumeFrom: options?.resumeFrom,
|
||||
intervalInMs: options?.updateIntervalInMs,
|
||||
lroResourceLocationConfig: "azure-async-operation"
|
||||
});
|
||||
await poller.poll();
|
||||
return poller;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create or update the Nginx certificates for given Nginx deployment
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param certificateName The name of certificate
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
async beginCreateAndWait(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
certificateName: string,
|
||||
options?: CertificatesCreateOptionalParams
|
||||
): Promise<CertificatesCreateResponse> {
|
||||
const poller = await this.beginCreate(
|
||||
resourceGroupName,
|
||||
deploymentName,
|
||||
certificateName,
|
||||
options
|
||||
);
|
||||
return poller.pollUntilDone();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a certificate from the nginx deployment
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param certificateName The name of certificate
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
async beginDelete(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
certificateName: string,
|
||||
options?: CertificatesDeleteOptionalParams
|
||||
): Promise<PollerLike<PollOperationState<void>, void>> {
|
||||
const directSendOperation = async (
|
||||
args: coreClient.OperationArguments,
|
||||
spec: coreClient.OperationSpec
|
||||
): Promise<void> => {
|
||||
return this.client.sendOperationRequest(args, spec);
|
||||
};
|
||||
const sendOperation = async (
|
||||
args: coreClient.OperationArguments,
|
||||
spec: coreClient.OperationSpec
|
||||
) => {
|
||||
let currentRawResponse:
|
||||
| coreClient.FullOperationResponse
|
||||
| undefined = undefined;
|
||||
const providedCallback = args.options?.onResponse;
|
||||
const callback: coreClient.RawResponseCallback = (
|
||||
rawResponse: coreClient.FullOperationResponse,
|
||||
flatResponse: unknown
|
||||
) => {
|
||||
currentRawResponse = rawResponse;
|
||||
providedCallback?.(rawResponse, flatResponse);
|
||||
};
|
||||
const updatedArgs = {
|
||||
...args,
|
||||
options: {
|
||||
...args.options,
|
||||
onResponse: callback
|
||||
}
|
||||
};
|
||||
const flatResponse = await directSendOperation(updatedArgs, spec);
|
||||
return {
|
||||
flatResponse,
|
||||
rawResponse: {
|
||||
statusCode: currentRawResponse!.status,
|
||||
body: currentRawResponse!.parsedBody,
|
||||
headers: currentRawResponse!.headers.toJSON()
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
const lro = new LroImpl(
|
||||
sendOperation,
|
||||
{ resourceGroupName, deploymentName, certificateName, options },
|
||||
deleteOperationSpec
|
||||
);
|
||||
const poller = new LroEngine(lro, {
|
||||
resumeFrom: options?.resumeFrom,
|
||||
intervalInMs: options?.updateIntervalInMs
|
||||
});
|
||||
await poller.poll();
|
||||
return poller;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a certificate from the nginx deployment
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param certificateName The name of certificate
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
async beginDeleteAndWait(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
certificateName: string,
|
||||
options?: CertificatesDeleteOptionalParams
|
||||
): Promise<void> {
|
||||
const poller = await this.beginDelete(
|
||||
resourceGroupName,
|
||||
deploymentName,
|
||||
certificateName,
|
||||
options
|
||||
);
|
||||
return poller.pollUntilDone();
|
||||
}
|
||||
|
||||
/**
|
||||
* List all certificates of given Nginx deployment
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
private _list(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
options?: CertificatesListOptionalParams
|
||||
): Promise<CertificatesListResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceGroupName, deploymentName, options },
|
||||
listOperationSpec
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* ListNext
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param nextLink The nextLink from the previous successful call to the List method.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
private _listNext(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
nextLink: string,
|
||||
options?: CertificatesListNextOptionalParams
|
||||
): Promise<CertificatesListNextResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceGroupName, deploymentName, nextLink, options },
|
||||
listNextOperationSpec
|
||||
);
|
||||
}
|
||||
}
|
||||
// Operation Specifications
|
||||
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
||||
|
||||
const getOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName}",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.NginxCertificate
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ResourceProviderDefaultErrorResponse
|
||||
}
|
||||
},
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.deploymentName,
|
||||
Parameters.certificateName
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
||||
const createOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName}",
|
||||
httpMethod: "PUT",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.NginxCertificate
|
||||
},
|
||||
201: {
|
||||
bodyMapper: Mappers.NginxCertificate
|
||||
},
|
||||
202: {
|
||||
bodyMapper: Mappers.NginxCertificate
|
||||
},
|
||||
204: {
|
||||
bodyMapper: Mappers.NginxCertificate
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ResourceProviderDefaultErrorResponse
|
||||
}
|
||||
},
|
||||
requestBody: Parameters.body,
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.deploymentName,
|
||||
Parameters.certificateName
|
||||
],
|
||||
headerParameters: [Parameters.accept, Parameters.contentType],
|
||||
mediaType: "json",
|
||||
serializer
|
||||
};
|
||||
const deleteOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName}",
|
||||
httpMethod: "DELETE",
|
||||
responses: {
|
||||
200: {},
|
||||
201: {},
|
||||
202: {},
|
||||
204: {},
|
||||
default: {
|
||||
bodyMapper: Mappers.ResourceProviderDefaultErrorResponse
|
||||
}
|
||||
},
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.deploymentName,
|
||||
Parameters.certificateName
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
||||
const listOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.NginxCertificateListResponse
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ResourceProviderDefaultErrorResponse
|
||||
}
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.deploymentName
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
||||
const listNextOperationSpec: coreClient.OperationSpec = {
|
||||
path: "{nextLink}",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.NginxCertificateListResponse
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ResourceProviderDefaultErrorResponse
|
||||
}
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.deploymentName,
|
||||
Parameters.nextLink
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
|
@ -0,0 +1,466 @@
|
|||
/*
|
||||
* 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 { Configurations } from "../operationsInterfaces";
|
||||
import * as coreClient from "@azure/core-client";
|
||||
import * as Mappers from "../models/mappers";
|
||||
import * as Parameters from "../models/parameters";
|
||||
import { NginxManagementClient } from "../nginxManagementClient";
|
||||
import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
|
||||
import { LroImpl } from "../lroImpl";
|
||||
import {
|
||||
NginxConfiguration,
|
||||
ConfigurationsListNextOptionalParams,
|
||||
ConfigurationsListOptionalParams,
|
||||
ConfigurationsListResponse,
|
||||
ConfigurationsGetOptionalParams,
|
||||
ConfigurationsGetResponse,
|
||||
ConfigurationsCreateOrUpdateOptionalParams,
|
||||
ConfigurationsCreateOrUpdateResponse,
|
||||
ConfigurationsDeleteOptionalParams,
|
||||
ConfigurationsListNextResponse
|
||||
} from "../models";
|
||||
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
/** Class containing Configurations operations. */
|
||||
export class ConfigurationsImpl implements Configurations {
|
||||
private readonly client: NginxManagementClient;
|
||||
|
||||
/**
|
||||
* Initialize a new instance of the class Configurations class.
|
||||
* @param client Reference to the service client
|
||||
*/
|
||||
constructor(client: NginxManagementClient) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
/**
|
||||
* List the Nginx configuration of given Nginx deployment.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
public list(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
options?: ConfigurationsListOptionalParams
|
||||
): PagedAsyncIterableIterator<NginxConfiguration> {
|
||||
const iter = this.listPagingAll(resourceGroupName, deploymentName, options);
|
||||
return {
|
||||
next() {
|
||||
return iter.next();
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return this;
|
||||
},
|
||||
byPage: () => {
|
||||
return this.listPagingPage(resourceGroupName, deploymentName, options);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private async *listPagingPage(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
options?: ConfigurationsListOptionalParams
|
||||
): AsyncIterableIterator<NginxConfiguration[]> {
|
||||
let result = await this._list(resourceGroupName, deploymentName, options);
|
||||
yield result.value || [];
|
||||
let continuationToken = result.nextLink;
|
||||
while (continuationToken) {
|
||||
result = await this._listNext(
|
||||
resourceGroupName,
|
||||
deploymentName,
|
||||
continuationToken,
|
||||
options
|
||||
);
|
||||
continuationToken = result.nextLink;
|
||||
yield result.value || [];
|
||||
}
|
||||
}
|
||||
|
||||
private async *listPagingAll(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
options?: ConfigurationsListOptionalParams
|
||||
): AsyncIterableIterator<NginxConfiguration> {
|
||||
for await (const page of this.listPagingPage(
|
||||
resourceGroupName,
|
||||
deploymentName,
|
||||
options
|
||||
)) {
|
||||
yield* page;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* List the Nginx configuration of given Nginx deployment.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
private _list(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
options?: ConfigurationsListOptionalParams
|
||||
): Promise<ConfigurationsListResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceGroupName, deploymentName, options },
|
||||
listOperationSpec
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Nginx configuration of given Nginx deployment
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param configurationName The name of configuration, only 'default' is supported value due to the
|
||||
* singleton of Nginx conf
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
get(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
configurationName: string,
|
||||
options?: ConfigurationsGetOptionalParams
|
||||
): Promise<ConfigurationsGetResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceGroupName, deploymentName, configurationName, options },
|
||||
getOperationSpec
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create or update the Nginx configuration for given Nginx deployment
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param configurationName The name of configuration, only 'default' is supported value due to the
|
||||
* singleton of Nginx conf
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
async beginCreateOrUpdate(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
configurationName: string,
|
||||
options?: ConfigurationsCreateOrUpdateOptionalParams
|
||||
): Promise<
|
||||
PollerLike<
|
||||
PollOperationState<ConfigurationsCreateOrUpdateResponse>,
|
||||
ConfigurationsCreateOrUpdateResponse
|
||||
>
|
||||
> {
|
||||
const directSendOperation = async (
|
||||
args: coreClient.OperationArguments,
|
||||
spec: coreClient.OperationSpec
|
||||
): Promise<ConfigurationsCreateOrUpdateResponse> => {
|
||||
return this.client.sendOperationRequest(args, spec);
|
||||
};
|
||||
const sendOperation = async (
|
||||
args: coreClient.OperationArguments,
|
||||
spec: coreClient.OperationSpec
|
||||
) => {
|
||||
let currentRawResponse:
|
||||
| coreClient.FullOperationResponse
|
||||
| undefined = undefined;
|
||||
const providedCallback = args.options?.onResponse;
|
||||
const callback: coreClient.RawResponseCallback = (
|
||||
rawResponse: coreClient.FullOperationResponse,
|
||||
flatResponse: unknown
|
||||
) => {
|
||||
currentRawResponse = rawResponse;
|
||||
providedCallback?.(rawResponse, flatResponse);
|
||||
};
|
||||
const updatedArgs = {
|
||||
...args,
|
||||
options: {
|
||||
...args.options,
|
||||
onResponse: callback
|
||||
}
|
||||
};
|
||||
const flatResponse = await directSendOperation(updatedArgs, spec);
|
||||
return {
|
||||
flatResponse,
|
||||
rawResponse: {
|
||||
statusCode: currentRawResponse!.status,
|
||||
body: currentRawResponse!.parsedBody,
|
||||
headers: currentRawResponse!.headers.toJSON()
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
const lro = new LroImpl(
|
||||
sendOperation,
|
||||
{ resourceGroupName, deploymentName, configurationName, options },
|
||||
createOrUpdateOperationSpec
|
||||
);
|
||||
const poller = new LroEngine(lro, {
|
||||
resumeFrom: options?.resumeFrom,
|
||||
intervalInMs: options?.updateIntervalInMs,
|
||||
lroResourceLocationConfig: "azure-async-operation"
|
||||
});
|
||||
await poller.poll();
|
||||
return poller;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create or update the Nginx configuration for given Nginx deployment
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param configurationName The name of configuration, only 'default' is supported value due to the
|
||||
* singleton of Nginx conf
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
async beginCreateOrUpdateAndWait(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
configurationName: string,
|
||||
options?: ConfigurationsCreateOrUpdateOptionalParams
|
||||
): Promise<ConfigurationsCreateOrUpdateResponse> {
|
||||
const poller = await this.beginCreateOrUpdate(
|
||||
resourceGroupName,
|
||||
deploymentName,
|
||||
configurationName,
|
||||
options
|
||||
);
|
||||
return poller.pollUntilDone();
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the Nginx configuration of given Nginx deployment to default
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param configurationName The name of configuration, only 'default' is supported value due to the
|
||||
* singleton of Nginx conf
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
async beginDelete(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
configurationName: string,
|
||||
options?: ConfigurationsDeleteOptionalParams
|
||||
): Promise<PollerLike<PollOperationState<void>, void>> {
|
||||
const directSendOperation = async (
|
||||
args: coreClient.OperationArguments,
|
||||
spec: coreClient.OperationSpec
|
||||
): Promise<void> => {
|
||||
return this.client.sendOperationRequest(args, spec);
|
||||
};
|
||||
const sendOperation = async (
|
||||
args: coreClient.OperationArguments,
|
||||
spec: coreClient.OperationSpec
|
||||
) => {
|
||||
let currentRawResponse:
|
||||
| coreClient.FullOperationResponse
|
||||
| undefined = undefined;
|
||||
const providedCallback = args.options?.onResponse;
|
||||
const callback: coreClient.RawResponseCallback = (
|
||||
rawResponse: coreClient.FullOperationResponse,
|
||||
flatResponse: unknown
|
||||
) => {
|
||||
currentRawResponse = rawResponse;
|
||||
providedCallback?.(rawResponse, flatResponse);
|
||||
};
|
||||
const updatedArgs = {
|
||||
...args,
|
||||
options: {
|
||||
...args.options,
|
||||
onResponse: callback
|
||||
}
|
||||
};
|
||||
const flatResponse = await directSendOperation(updatedArgs, spec);
|
||||
return {
|
||||
flatResponse,
|
||||
rawResponse: {
|
||||
statusCode: currentRawResponse!.status,
|
||||
body: currentRawResponse!.parsedBody,
|
||||
headers: currentRawResponse!.headers.toJSON()
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
const lro = new LroImpl(
|
||||
sendOperation,
|
||||
{ resourceGroupName, deploymentName, configurationName, options },
|
||||
deleteOperationSpec
|
||||
);
|
||||
const poller = new LroEngine(lro, {
|
||||
resumeFrom: options?.resumeFrom,
|
||||
intervalInMs: options?.updateIntervalInMs
|
||||
});
|
||||
await poller.poll();
|
||||
return poller;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the Nginx configuration of given Nginx deployment to default
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param configurationName The name of configuration, only 'default' is supported value due to the
|
||||
* singleton of Nginx conf
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
async beginDeleteAndWait(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
configurationName: string,
|
||||
options?: ConfigurationsDeleteOptionalParams
|
||||
): Promise<void> {
|
||||
const poller = await this.beginDelete(
|
||||
resourceGroupName,
|
||||
deploymentName,
|
||||
configurationName,
|
||||
options
|
||||
);
|
||||
return poller.pollUntilDone();
|
||||
}
|
||||
|
||||
/**
|
||||
* ListNext
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param nextLink The nextLink from the previous successful call to the List method.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
private _listNext(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
nextLink: string,
|
||||
options?: ConfigurationsListNextOptionalParams
|
||||
): Promise<ConfigurationsListNextResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceGroupName, deploymentName, nextLink, options },
|
||||
listNextOperationSpec
|
||||
);
|
||||
}
|
||||
}
|
||||
// Operation Specifications
|
||||
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
||||
|
||||
const listOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.NginxConfigurationListResponse
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ResourceProviderDefaultErrorResponse
|
||||
}
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.deploymentName
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
||||
const getOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.NginxConfiguration
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ResourceProviderDefaultErrorResponse
|
||||
}
|
||||
},
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.deploymentName,
|
||||
Parameters.configurationName
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
||||
const createOrUpdateOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}",
|
||||
httpMethod: "PUT",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.NginxConfiguration
|
||||
},
|
||||
201: {
|
||||
bodyMapper: Mappers.NginxConfiguration
|
||||
},
|
||||
202: {
|
||||
bodyMapper: Mappers.NginxConfiguration
|
||||
},
|
||||
204: {
|
||||
bodyMapper: Mappers.NginxConfiguration
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ResourceProviderDefaultErrorResponse
|
||||
}
|
||||
},
|
||||
requestBody: Parameters.body1,
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.deploymentName,
|
||||
Parameters.configurationName
|
||||
],
|
||||
headerParameters: [Parameters.accept, Parameters.contentType],
|
||||
mediaType: "json",
|
||||
serializer
|
||||
};
|
||||
const deleteOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}",
|
||||
httpMethod: "DELETE",
|
||||
responses: {
|
||||
200: {},
|
||||
201: {},
|
||||
202: {},
|
||||
204: {},
|
||||
default: {
|
||||
bodyMapper: Mappers.ResourceProviderDefaultErrorResponse
|
||||
}
|
||||
},
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.deploymentName,
|
||||
Parameters.configurationName
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
||||
const listNextOperationSpec: coreClient.OperationSpec = {
|
||||
path: "{nextLink}",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.NginxConfigurationListResponse
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ResourceProviderDefaultErrorResponse
|
||||
}
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.deploymentName,
|
||||
Parameters.nextLink
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
|
@ -0,0 +1,659 @@
|
|||
/*
|
||||
* 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 { Deployments } from "../operationsInterfaces";
|
||||
import * as coreClient from "@azure/core-client";
|
||||
import * as Mappers from "../models/mappers";
|
||||
import * as Parameters from "../models/parameters";
|
||||
import { NginxManagementClient } from "../nginxManagementClient";
|
||||
import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
|
||||
import { LroImpl } from "../lroImpl";
|
||||
import {
|
||||
NginxDeployment,
|
||||
DeploymentsListNextOptionalParams,
|
||||
DeploymentsListOptionalParams,
|
||||
DeploymentsListByResourceGroupNextOptionalParams,
|
||||
DeploymentsListByResourceGroupOptionalParams,
|
||||
DeploymentsGetOptionalParams,
|
||||
DeploymentsGetResponse,
|
||||
DeploymentsCreateOptionalParams,
|
||||
DeploymentsCreateResponse,
|
||||
DeploymentsUpdateOptionalParams,
|
||||
DeploymentsUpdateResponse,
|
||||
DeploymentsDeleteOptionalParams,
|
||||
DeploymentsListResponse,
|
||||
DeploymentsListByResourceGroupResponse,
|
||||
DeploymentsListNextResponse,
|
||||
DeploymentsListByResourceGroupNextResponse
|
||||
} from "../models";
|
||||
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
/** Class containing Deployments operations. */
|
||||
export class DeploymentsImpl implements Deployments {
|
||||
private readonly client: NginxManagementClient;
|
||||
|
||||
/**
|
||||
* Initialize a new instance of the class Deployments class.
|
||||
* @param client Reference to the service client
|
||||
*/
|
||||
constructor(client: NginxManagementClient) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
/**
|
||||
* List the Nginx deployments resources
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
public list(
|
||||
options?: DeploymentsListOptionalParams
|
||||
): PagedAsyncIterableIterator<NginxDeployment> {
|
||||
const iter = this.listPagingAll(options);
|
||||
return {
|
||||
next() {
|
||||
return iter.next();
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return this;
|
||||
},
|
||||
byPage: () => {
|
||||
return this.listPagingPage(options);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private async *listPagingPage(
|
||||
options?: DeploymentsListOptionalParams
|
||||
): AsyncIterableIterator<NginxDeployment[]> {
|
||||
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?: DeploymentsListOptionalParams
|
||||
): AsyncIterableIterator<NginxDeployment> {
|
||||
for await (const page of this.listPagingPage(options)) {
|
||||
yield* page;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* List all Nginx deployments under the specified 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?: DeploymentsListByResourceGroupOptionalParams
|
||||
): PagedAsyncIterableIterator<NginxDeployment> {
|
||||
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?: DeploymentsListByResourceGroupOptionalParams
|
||||
): AsyncIterableIterator<NginxDeployment[]> {
|
||||
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?: DeploymentsListByResourceGroupOptionalParams
|
||||
): AsyncIterableIterator<NginxDeployment> {
|
||||
for await (const page of this.listByResourceGroupPagingPage(
|
||||
resourceGroupName,
|
||||
options
|
||||
)) {
|
||||
yield* page;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Nginx deployment
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
get(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
options?: DeploymentsGetOptionalParams
|
||||
): Promise<DeploymentsGetResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceGroupName, deploymentName, options },
|
||||
getOperationSpec
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create or update the Nginx deployment
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
async beginCreate(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
options?: DeploymentsCreateOptionalParams
|
||||
): Promise<
|
||||
PollerLike<
|
||||
PollOperationState<DeploymentsCreateResponse>,
|
||||
DeploymentsCreateResponse
|
||||
>
|
||||
> {
|
||||
const directSendOperation = async (
|
||||
args: coreClient.OperationArguments,
|
||||
spec: coreClient.OperationSpec
|
||||
): Promise<DeploymentsCreateResponse> => {
|
||||
return this.client.sendOperationRequest(args, spec);
|
||||
};
|
||||
const sendOperation = async (
|
||||
args: coreClient.OperationArguments,
|
||||
spec: coreClient.OperationSpec
|
||||
) => {
|
||||
let currentRawResponse:
|
||||
| coreClient.FullOperationResponse
|
||||
| undefined = undefined;
|
||||
const providedCallback = args.options?.onResponse;
|
||||
const callback: coreClient.RawResponseCallback = (
|
||||
rawResponse: coreClient.FullOperationResponse,
|
||||
flatResponse: unknown
|
||||
) => {
|
||||
currentRawResponse = rawResponse;
|
||||
providedCallback?.(rawResponse, flatResponse);
|
||||
};
|
||||
const updatedArgs = {
|
||||
...args,
|
||||
options: {
|
||||
...args.options,
|
||||
onResponse: callback
|
||||
}
|
||||
};
|
||||
const flatResponse = await directSendOperation(updatedArgs, spec);
|
||||
return {
|
||||
flatResponse,
|
||||
rawResponse: {
|
||||
statusCode: currentRawResponse!.status,
|
||||
body: currentRawResponse!.parsedBody,
|
||||
headers: currentRawResponse!.headers.toJSON()
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
const lro = new LroImpl(
|
||||
sendOperation,
|
||||
{ resourceGroupName, deploymentName, options },
|
||||
createOperationSpec
|
||||
);
|
||||
const poller = new LroEngine(lro, {
|
||||
resumeFrom: options?.resumeFrom,
|
||||
intervalInMs: options?.updateIntervalInMs,
|
||||
lroResourceLocationConfig: "azure-async-operation"
|
||||
});
|
||||
await poller.poll();
|
||||
return poller;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create or update the Nginx deployment
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
async beginCreateAndWait(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
options?: DeploymentsCreateOptionalParams
|
||||
): Promise<DeploymentsCreateResponse> {
|
||||
const poller = await this.beginCreate(
|
||||
resourceGroupName,
|
||||
deploymentName,
|
||||
options
|
||||
);
|
||||
return poller.pollUntilDone();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the Nginx deployment
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
async beginUpdate(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
options?: DeploymentsUpdateOptionalParams
|
||||
): Promise<
|
||||
PollerLike<
|
||||
PollOperationState<DeploymentsUpdateResponse>,
|
||||
DeploymentsUpdateResponse
|
||||
>
|
||||
> {
|
||||
const directSendOperation = async (
|
||||
args: coreClient.OperationArguments,
|
||||
spec: coreClient.OperationSpec
|
||||
): Promise<DeploymentsUpdateResponse> => {
|
||||
return this.client.sendOperationRequest(args, spec);
|
||||
};
|
||||
const sendOperation = async (
|
||||
args: coreClient.OperationArguments,
|
||||
spec: coreClient.OperationSpec
|
||||
) => {
|
||||
let currentRawResponse:
|
||||
| coreClient.FullOperationResponse
|
||||
| undefined = undefined;
|
||||
const providedCallback = args.options?.onResponse;
|
||||
const callback: coreClient.RawResponseCallback = (
|
||||
rawResponse: coreClient.FullOperationResponse,
|
||||
flatResponse: unknown
|
||||
) => {
|
||||
currentRawResponse = rawResponse;
|
||||
providedCallback?.(rawResponse, flatResponse);
|
||||
};
|
||||
const updatedArgs = {
|
||||
...args,
|
||||
options: {
|
||||
...args.options,
|
||||
onResponse: callback
|
||||
}
|
||||
};
|
||||
const flatResponse = await directSendOperation(updatedArgs, spec);
|
||||
return {
|
||||
flatResponse,
|
||||
rawResponse: {
|
||||
statusCode: currentRawResponse!.status,
|
||||
body: currentRawResponse!.parsedBody,
|
||||
headers: currentRawResponse!.headers.toJSON()
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
const lro = new LroImpl(
|
||||
sendOperation,
|
||||
{ resourceGroupName, deploymentName, options },
|
||||
updateOperationSpec
|
||||
);
|
||||
const poller = new LroEngine(lro, {
|
||||
resumeFrom: options?.resumeFrom,
|
||||
intervalInMs: options?.updateIntervalInMs
|
||||
});
|
||||
await poller.poll();
|
||||
return poller;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the Nginx deployment
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
async beginUpdateAndWait(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
options?: DeploymentsUpdateOptionalParams
|
||||
): Promise<DeploymentsUpdateResponse> {
|
||||
const poller = await this.beginUpdate(
|
||||
resourceGroupName,
|
||||
deploymentName,
|
||||
options
|
||||
);
|
||||
return poller.pollUntilDone();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the Nginx deployment resource
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
async beginDelete(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
options?: DeploymentsDeleteOptionalParams
|
||||
): Promise<PollerLike<PollOperationState<void>, void>> {
|
||||
const directSendOperation = async (
|
||||
args: coreClient.OperationArguments,
|
||||
spec: coreClient.OperationSpec
|
||||
): Promise<void> => {
|
||||
return this.client.sendOperationRequest(args, spec);
|
||||
};
|
||||
const sendOperation = async (
|
||||
args: coreClient.OperationArguments,
|
||||
spec: coreClient.OperationSpec
|
||||
) => {
|
||||
let currentRawResponse:
|
||||
| coreClient.FullOperationResponse
|
||||
| undefined = undefined;
|
||||
const providedCallback = args.options?.onResponse;
|
||||
const callback: coreClient.RawResponseCallback = (
|
||||
rawResponse: coreClient.FullOperationResponse,
|
||||
flatResponse: unknown
|
||||
) => {
|
||||
currentRawResponse = rawResponse;
|
||||
providedCallback?.(rawResponse, flatResponse);
|
||||
};
|
||||
const updatedArgs = {
|
||||
...args,
|
||||
options: {
|
||||
...args.options,
|
||||
onResponse: callback
|
||||
}
|
||||
};
|
||||
const flatResponse = await directSendOperation(updatedArgs, spec);
|
||||
return {
|
||||
flatResponse,
|
||||
rawResponse: {
|
||||
statusCode: currentRawResponse!.status,
|
||||
body: currentRawResponse!.parsedBody,
|
||||
headers: currentRawResponse!.headers.toJSON()
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
const lro = new LroImpl(
|
||||
sendOperation,
|
||||
{ resourceGroupName, deploymentName, options },
|
||||
deleteOperationSpec
|
||||
);
|
||||
const poller = new LroEngine(lro, {
|
||||
resumeFrom: options?.resumeFrom,
|
||||
intervalInMs: options?.updateIntervalInMs
|
||||
});
|
||||
await poller.poll();
|
||||
return poller;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the Nginx deployment resource
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
async beginDeleteAndWait(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
options?: DeploymentsDeleteOptionalParams
|
||||
): Promise<void> {
|
||||
const poller = await this.beginDelete(
|
||||
resourceGroupName,
|
||||
deploymentName,
|
||||
options
|
||||
);
|
||||
return poller.pollUntilDone();
|
||||
}
|
||||
|
||||
/**
|
||||
* List the Nginx deployments resources
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
private _list(
|
||||
options?: DeploymentsListOptionalParams
|
||||
): Promise<DeploymentsListResponse> {
|
||||
return this.client.sendOperationRequest({ options }, listOperationSpec);
|
||||
}
|
||||
|
||||
/**
|
||||
* List all Nginx deployments under the specified 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?: DeploymentsListByResourceGroupOptionalParams
|
||||
): Promise<DeploymentsListByResourceGroupResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceGroupName, options },
|
||||
listByResourceGroupOperationSpec
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* ListNext
|
||||
* @param nextLink The nextLink from the previous successful call to the List method.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
private _listNext(
|
||||
nextLink: string,
|
||||
options?: DeploymentsListNextOptionalParams
|
||||
): Promise<DeploymentsListNextResponse> {
|
||||
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?: DeploymentsListByResourceGroupNextOptionalParams
|
||||
): Promise<DeploymentsListByResourceGroupNextResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceGroupName, nextLink, options },
|
||||
listByResourceGroupNextOperationSpec
|
||||
);
|
||||
}
|
||||
}
|
||||
// Operation Specifications
|
||||
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
||||
|
||||
const getOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.NginxDeployment
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ResourceProviderDefaultErrorResponse
|
||||
}
|
||||
},
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.deploymentName
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
||||
const createOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}",
|
||||
httpMethod: "PUT",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.NginxDeployment
|
||||
},
|
||||
201: {
|
||||
bodyMapper: Mappers.NginxDeployment
|
||||
},
|
||||
202: {
|
||||
bodyMapper: Mappers.NginxDeployment
|
||||
},
|
||||
204: {
|
||||
bodyMapper: Mappers.NginxDeployment
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ResourceProviderDefaultErrorResponse
|
||||
}
|
||||
},
|
||||
requestBody: Parameters.body2,
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.deploymentName
|
||||
],
|
||||
headerParameters: [Parameters.accept, Parameters.contentType],
|
||||
mediaType: "json",
|
||||
serializer
|
||||
};
|
||||
const updateOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}",
|
||||
httpMethod: "PATCH",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.NginxDeployment
|
||||
},
|
||||
201: {
|
||||
bodyMapper: Mappers.NginxDeployment
|
||||
},
|
||||
202: {
|
||||
bodyMapper: Mappers.NginxDeployment
|
||||
},
|
||||
204: {
|
||||
bodyMapper: Mappers.NginxDeployment
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ResourceProviderDefaultErrorResponse
|
||||
}
|
||||
},
|
||||
requestBody: Parameters.body3,
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.deploymentName
|
||||
],
|
||||
headerParameters: [Parameters.accept, Parameters.contentType],
|
||||
mediaType: "json",
|
||||
serializer
|
||||
};
|
||||
const deleteOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}",
|
||||
httpMethod: "DELETE",
|
||||
responses: {
|
||||
200: {},
|
||||
201: {},
|
||||
202: {},
|
||||
204: {},
|
||||
default: {
|
||||
bodyMapper: Mappers.ResourceProviderDefaultErrorResponse
|
||||
}
|
||||
},
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.deploymentName
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
||||
const listOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/providers/Nginx.NginxPlus/nginxDeployments",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.NginxDeploymentListResponse
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ResourceProviderDefaultErrorResponse
|
||||
}
|
||||
},
|
||||
urlParameters: [Parameters.$host, Parameters.subscriptionId],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
||||
const listByResourceGroupOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.NginxDeploymentListResponse
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ResourceProviderDefaultErrorResponse
|
||||
}
|
||||
},
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.resourceGroupName
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
||||
const listNextOperationSpec: coreClient.OperationSpec = {
|
||||
path: "{nextLink}",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.NginxDeploymentListResponse
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ResourceProviderDefaultErrorResponse
|
||||
}
|
||||
},
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.nextLink
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
||||
const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
|
||||
path: "{nextLink}",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.NginxDeploymentListResponse
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ResourceProviderDefaultErrorResponse
|
||||
}
|
||||
},
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.nextLink
|
||||
],
|
||||
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.
|
||||
*/
|
||||
|
||||
export * from "./certificates";
|
||||
export * from "./configurations";
|
||||
export * from "./deployments";
|
||||
export * from "./operations";
|
|
@ -0,0 +1,137 @@
|
|||
/*
|
||||
* 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 { Operations } from "../operationsInterfaces";
|
||||
import * as coreClient from "@azure/core-client";
|
||||
import * as Mappers from "../models/mappers";
|
||||
import * as Parameters from "../models/parameters";
|
||||
import { NginxManagementClient } from "../nginxManagementClient";
|
||||
import {
|
||||
OperationResult,
|
||||
OperationsListNextOptionalParams,
|
||||
OperationsListOptionalParams,
|
||||
OperationsListResponse,
|
||||
OperationsListNextResponse
|
||||
} from "../models";
|
||||
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
/** Class containing Operations operations. */
|
||||
export class OperationsImpl implements Operations {
|
||||
private readonly client: NginxManagementClient;
|
||||
|
||||
/**
|
||||
* Initialize a new instance of the class Operations class.
|
||||
* @param client Reference to the service client
|
||||
*/
|
||||
constructor(client: NginxManagementClient) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
/**
|
||||
* List all operations provided by Nginx.NginxPlus for the 2022-08-01 api version.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
public list(
|
||||
options?: OperationsListOptionalParams
|
||||
): PagedAsyncIterableIterator<OperationResult> {
|
||||
const iter = this.listPagingAll(options);
|
||||
return {
|
||||
next() {
|
||||
return iter.next();
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return this;
|
||||
},
|
||||
byPage: () => {
|
||||
return this.listPagingPage(options);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private async *listPagingPage(
|
||||
options?: OperationsListOptionalParams
|
||||
): AsyncIterableIterator<OperationResult[]> {
|
||||
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?: OperationsListOptionalParams
|
||||
): AsyncIterableIterator<OperationResult> {
|
||||
for await (const page of this.listPagingPage(options)) {
|
||||
yield* page;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* List all operations provided by Nginx.NginxPlus for the 2022-08-01 api version.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
private _list(
|
||||
options?: OperationsListOptionalParams
|
||||
): Promise<OperationsListResponse> {
|
||||
return this.client.sendOperationRequest({ options }, listOperationSpec);
|
||||
}
|
||||
|
||||
/**
|
||||
* ListNext
|
||||
* @param nextLink The nextLink from the previous successful call to the List method.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
private _listNext(
|
||||
nextLink: string,
|
||||
options?: OperationsListNextOptionalParams
|
||||
): Promise<OperationsListNextResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ nextLink, options },
|
||||
listNextOperationSpec
|
||||
);
|
||||
}
|
||||
}
|
||||
// Operation Specifications
|
||||
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
||||
|
||||
const listOperationSpec: coreClient.OperationSpec = {
|
||||
path: "/providers/Nginx.NginxPlus/operations",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.OperationListResult
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ResourceProviderDefaultErrorResponse
|
||||
}
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [Parameters.$host],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
||||
const listNextOperationSpec: coreClient.OperationSpec = {
|
||||
path: "{nextLink}",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.OperationListResult
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ResourceProviderDefaultErrorResponse
|
||||
}
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [Parameters.$host, Parameters.nextLink],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
|
@ -0,0 +1,105 @@
|
|||
/*
|
||||
* 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 { PollerLike, PollOperationState } from "@azure/core-lro";
|
||||
import {
|
||||
NginxCertificate,
|
||||
CertificatesListOptionalParams,
|
||||
CertificatesGetOptionalParams,
|
||||
CertificatesGetResponse,
|
||||
CertificatesCreateOptionalParams,
|
||||
CertificatesCreateResponse,
|
||||
CertificatesDeleteOptionalParams
|
||||
} from "../models";
|
||||
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
/** Interface representing a Certificates. */
|
||||
export interface Certificates {
|
||||
/**
|
||||
* List all certificates of given Nginx deployment
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
list(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
options?: CertificatesListOptionalParams
|
||||
): PagedAsyncIterableIterator<NginxCertificate>;
|
||||
/**
|
||||
* Get a certificate of given Nginx deployment
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param certificateName The name of certificate
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
get(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
certificateName: string,
|
||||
options?: CertificatesGetOptionalParams
|
||||
): Promise<CertificatesGetResponse>;
|
||||
/**
|
||||
* Create or update the Nginx certificates for given Nginx deployment
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param certificateName The name of certificate
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
beginCreate(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
certificateName: string,
|
||||
options?: CertificatesCreateOptionalParams
|
||||
): Promise<
|
||||
PollerLike<
|
||||
PollOperationState<CertificatesCreateResponse>,
|
||||
CertificatesCreateResponse
|
||||
>
|
||||
>;
|
||||
/**
|
||||
* Create or update the Nginx certificates for given Nginx deployment
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param certificateName The name of certificate
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
beginCreateAndWait(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
certificateName: string,
|
||||
options?: CertificatesCreateOptionalParams
|
||||
): Promise<CertificatesCreateResponse>;
|
||||
/**
|
||||
* Deletes a certificate from the nginx deployment
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param certificateName The name of certificate
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
beginDelete(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
certificateName: string,
|
||||
options?: CertificatesDeleteOptionalParams
|
||||
): Promise<PollerLike<PollOperationState<void>, void>>;
|
||||
/**
|
||||
* Deletes a certificate from the nginx deployment
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param certificateName The name of certificate
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
beginDeleteAndWait(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
certificateName: string,
|
||||
options?: CertificatesDeleteOptionalParams
|
||||
): Promise<void>;
|
||||
}
|
|
@ -0,0 +1,110 @@
|
|||
/*
|
||||
* 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 { PollerLike, PollOperationState } from "@azure/core-lro";
|
||||
import {
|
||||
NginxConfiguration,
|
||||
ConfigurationsListOptionalParams,
|
||||
ConfigurationsGetOptionalParams,
|
||||
ConfigurationsGetResponse,
|
||||
ConfigurationsCreateOrUpdateOptionalParams,
|
||||
ConfigurationsCreateOrUpdateResponse,
|
||||
ConfigurationsDeleteOptionalParams
|
||||
} from "../models";
|
||||
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
/** Interface representing a Configurations. */
|
||||
export interface Configurations {
|
||||
/**
|
||||
* List the Nginx configuration of given Nginx deployment.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
list(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
options?: ConfigurationsListOptionalParams
|
||||
): PagedAsyncIterableIterator<NginxConfiguration>;
|
||||
/**
|
||||
* Get the Nginx configuration of given Nginx deployment
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param configurationName The name of configuration, only 'default' is supported value due to the
|
||||
* singleton of Nginx conf
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
get(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
configurationName: string,
|
||||
options?: ConfigurationsGetOptionalParams
|
||||
): Promise<ConfigurationsGetResponse>;
|
||||
/**
|
||||
* Create or update the Nginx configuration for given Nginx deployment
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param configurationName The name of configuration, only 'default' is supported value due to the
|
||||
* singleton of Nginx conf
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
beginCreateOrUpdate(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
configurationName: string,
|
||||
options?: ConfigurationsCreateOrUpdateOptionalParams
|
||||
): Promise<
|
||||
PollerLike<
|
||||
PollOperationState<ConfigurationsCreateOrUpdateResponse>,
|
||||
ConfigurationsCreateOrUpdateResponse
|
||||
>
|
||||
>;
|
||||
/**
|
||||
* Create or update the Nginx configuration for given Nginx deployment
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param configurationName The name of configuration, only 'default' is supported value due to the
|
||||
* singleton of Nginx conf
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
beginCreateOrUpdateAndWait(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
configurationName: string,
|
||||
options?: ConfigurationsCreateOrUpdateOptionalParams
|
||||
): Promise<ConfigurationsCreateOrUpdateResponse>;
|
||||
/**
|
||||
* Reset the Nginx configuration of given Nginx deployment to default
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param configurationName The name of configuration, only 'default' is supported value due to the
|
||||
* singleton of Nginx conf
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
beginDelete(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
configurationName: string,
|
||||
options?: ConfigurationsDeleteOptionalParams
|
||||
): Promise<PollerLike<PollOperationState<void>, void>>;
|
||||
/**
|
||||
* Reset the Nginx configuration of given Nginx deployment to default
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param configurationName The name of configuration, only 'default' is supported value due to the
|
||||
* singleton of Nginx conf
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
beginDeleteAndWait(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
configurationName: string,
|
||||
options?: ConfigurationsDeleteOptionalParams
|
||||
): Promise<void>;
|
||||
}
|
|
@ -0,0 +1,130 @@
|
|||
/*
|
||||
* 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 { PollerLike, PollOperationState } from "@azure/core-lro";
|
||||
import {
|
||||
NginxDeployment,
|
||||
DeploymentsListOptionalParams,
|
||||
DeploymentsListByResourceGroupOptionalParams,
|
||||
DeploymentsGetOptionalParams,
|
||||
DeploymentsGetResponse,
|
||||
DeploymentsCreateOptionalParams,
|
||||
DeploymentsCreateResponse,
|
||||
DeploymentsUpdateOptionalParams,
|
||||
DeploymentsUpdateResponse,
|
||||
DeploymentsDeleteOptionalParams
|
||||
} from "../models";
|
||||
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
/** Interface representing a Deployments. */
|
||||
export interface Deployments {
|
||||
/**
|
||||
* List the Nginx deployments resources
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
list(
|
||||
options?: DeploymentsListOptionalParams
|
||||
): PagedAsyncIterableIterator<NginxDeployment>;
|
||||
/**
|
||||
* List all Nginx deployments under the specified resource group.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
listByResourceGroup(
|
||||
resourceGroupName: string,
|
||||
options?: DeploymentsListByResourceGroupOptionalParams
|
||||
): PagedAsyncIterableIterator<NginxDeployment>;
|
||||
/**
|
||||
* Get the Nginx deployment
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
get(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
options?: DeploymentsGetOptionalParams
|
||||
): Promise<DeploymentsGetResponse>;
|
||||
/**
|
||||
* Create or update the Nginx deployment
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
beginCreate(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
options?: DeploymentsCreateOptionalParams
|
||||
): Promise<
|
||||
PollerLike<
|
||||
PollOperationState<DeploymentsCreateResponse>,
|
||||
DeploymentsCreateResponse
|
||||
>
|
||||
>;
|
||||
/**
|
||||
* Create or update the Nginx deployment
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
beginCreateAndWait(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
options?: DeploymentsCreateOptionalParams
|
||||
): Promise<DeploymentsCreateResponse>;
|
||||
/**
|
||||
* Update the Nginx deployment
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
beginUpdate(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
options?: DeploymentsUpdateOptionalParams
|
||||
): Promise<
|
||||
PollerLike<
|
||||
PollOperationState<DeploymentsUpdateResponse>,
|
||||
DeploymentsUpdateResponse
|
||||
>
|
||||
>;
|
||||
/**
|
||||
* Update the Nginx deployment
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
beginUpdateAndWait(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
options?: DeploymentsUpdateOptionalParams
|
||||
): Promise<DeploymentsUpdateResponse>;
|
||||
/**
|
||||
* Delete the Nginx deployment resource
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
beginDelete(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
options?: DeploymentsDeleteOptionalParams
|
||||
): Promise<PollerLike<PollOperationState<void>, void>>;
|
||||
/**
|
||||
* Delete the Nginx deployment resource
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param deploymentName The name of targeted Nginx deployment
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
beginDeleteAndWait(
|
||||
resourceGroupName: string,
|
||||
deploymentName: string,
|
||||
options?: DeploymentsDeleteOptionalParams
|
||||
): Promise<void>;
|
||||
}
|
|
@ -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.
|
||||
*/
|
||||
|
||||
export * from "./certificates";
|
||||
export * from "./configurations";
|
||||
export * from "./deployments";
|
||||
export * from "./operations";
|
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* 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 { OperationResult, OperationsListOptionalParams } from "../models";
|
||||
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
/** Interface representing a Operations. */
|
||||
export interface Operations {
|
||||
/**
|
||||
* List all operations provided by Nginx.NginxPlus for the 2022-08-01 api version.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
list(
|
||||
options?: OperationsListOptionalParams
|
||||
): PagedAsyncIterableIterator<OperationResult>;
|
||||
}
|
|
@ -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.
|
||||
*/
|
||||
|
||||
import {
|
||||
Recorder,
|
||||
RecorderStartOptions,
|
||||
env
|
||||
} from "@azure-tools/test-recorder";
|
||||
import { assert } from "chai";
|
||||
import { Context } from "mocha";
|
||||
|
||||
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
|
||||
};
|
||||
|
||||
describe("My test", () => {
|
||||
let recorder: Recorder;
|
||||
|
||||
beforeEach(async function(this: Context) {
|
||||
recorder = new Recorder(this.currentTest);
|
||||
await recorder.start(recorderOptions);
|
||||
});
|
||||
|
||||
afterEach(async function() {
|
||||
await recorder.stop();
|
||||
});
|
||||
|
||||
it("sample test", async function() {
|
||||
console.log("Hi, I'm a test!");
|
||||
});
|
||||
});
|
|
@ -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-nginx": [
|
||||
"./src/index"
|
||||
]
|
||||
}
|
||||
},
|
||||
"include": [
|
||||
"./src/**/*.ts",
|
||||
"./test/**/*.ts",
|
||||
"samples-dev/**/*.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
]
|
||||
}
|
|
@ -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/nginx/arm-nginx
|
||||
- sdk/nginx/ci.mgmt.yml
|
||||
|
||||
pr:
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
- feature/*
|
||||
- release/*
|
||||
- hotfix/*
|
||||
exclude:
|
||||
- feature/v4
|
||||
paths:
|
||||
include:
|
||||
- sdk/nginx/arm-nginx
|
||||
- sdk/nginx/ci.mgmt.yml
|
||||
|
||||
extends:
|
||||
template: /eng/pipelines/templates/stages/archetype-sdk-client.yml
|
||||
parameters:
|
||||
ServiceDirectory: nginx
|
||||
Artifacts:
|
||||
- name: azure-arm-nginx
|
||||
safeName: azurearmnginx
|
||||
|
Загрузка…
Ссылка в новой задаче