This commit is contained in:
colawwj 2021-11-29 16:36:28 +08:00 коммит произвёл GitHub
Родитель abaff23f6b
Коммит 6b4ef20ab5
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
47 изменённых файлов: 6674 добавлений и 2110 удалений

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

@ -51,6 +51,7 @@ specifiers:
'@rush-temp/arm-resourcehealth': file:./projects/arm-resourcehealth.tgz
'@rush-temp/arm-resources': file:./projects/arm-resources.tgz
'@rush-temp/arm-resources-subscriptions': file:./projects/arm-resources-subscriptions.tgz
'@rush-temp/arm-search': file:./projects/arm-search.tgz
'@rush-temp/arm-security': file:./projects/arm-security.tgz
'@rush-temp/arm-servicebus': file:./projects/arm-servicebus.tgz
'@rush-temp/arm-servicefabric': file:./projects/arm-servicefabric.tgz
@ -213,6 +214,7 @@ dependencies:
'@rush-temp/arm-resourcehealth': file:projects/arm-resourcehealth.tgz
'@rush-temp/arm-resources': file:projects/arm-resources.tgz
'@rush-temp/arm-resources-subscriptions': file:projects/arm-resources-subscriptions.tgz
'@rush-temp/arm-search': file:projects/arm-search.tgz
'@rush-temp/arm-security': file:projects/arm-security.tgz
'@rush-temp/arm-servicebus': file:projects/arm-servicebus.tgz
'@rush-temp/arm-servicefabric': file:projects/arm-servicefabric.tgz
@ -9481,6 +9483,27 @@ packages:
uglify-js: 3.14.3
dev: false
file:projects/arm-search.tgz:
resolution: {integrity: sha512-4+mXE+vttvJx6IJk7orgfc07g9HHSnEO3W1jjXslwshUQNBaUj9uvxYsMzD6ldSAXkv1hTEYWD7QLpAZA006GA==, tarball: file:projects/arm-search.tgz}
name: '@rush-temp/arm-search'
version: 0.0.0
dependencies:
'@microsoft/api-extractor': 7.18.19
'@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1
'@rollup/plugin-json': 4.1.0_rollup@1.32.1
'@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1
'@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1
cross-env: 7.0.3
mkdirp: 1.0.4
mocha: 7.2.0
rimraf: 3.0.2
rollup: 1.32.1
rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1
tslib: 2.3.1
typescript: 4.2.4
uglify-js: 3.14.3
dev: false
file:projects/arm-security.tgz:
resolution: {integrity: sha512-H6aa5+i2bHOriVDn+PUCkK+41MEGxvUdTsROIVPid3VHe60jOeVVdyUrfclje0XeFUi5E4aQHZPECNYsz27A7w==, tarball: file:projects/arm-security.tgz}
name: '@rush-temp/arm-security'

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

@ -1120,6 +1120,11 @@
"packageName": "@azure/arm-botservice",
"projectFolder": "sdk/botservice/arm-botservice",
"versionPolicyName": "management"
},
{
"packageName": "@azure/arm-search",
"projectFolder": "sdk/search/arm-search",
"versionPolicyName": "management"
}
]
}
}

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

@ -0,0 +1,14 @@
## 3.0.0-beta.1 (2021-11-29)
This is the first preview for the new version of the `@azure/arm-search` package that follows the new [guidelines for TypeScript SDKs](https://azure.github.io/azure-sdk/typescript_introduction.html) for Azure services.
While this package remains auto generated, the SDK generator itself has undergone changes to comply with the above guidelines in order to generate packages that are idiomatic to the JavaScript/TypeScript ecosystem and consistent with other packages for Azure services. For more on this, please see [State of the Azure SDK 2021](https://devblogs.microsoft.com/azure-sdk/state-of-the-azure-sdk-2021/).
Please note that this version has breaking changes, all of which were made after careful consideration during the authoring of the guidelines and user studies.
**Noteworthy changes and features**
- Authentication: The packages `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` are no longer supported. Use package [@azure/identity](https://www.npmjs.com/package/@azure/identity) instead. Select a credential from Azure Identity examples based on the authentication method of your choice.
- Callbacks: Method overloads that used callbacks have been removed and the use of promises is encouraged instead.
- List operations now return an iterable result that follows the `PagedAsyncIterableIterator` interface as opposed to the previous model where you had to make a new request using the link to the next page.
- Long running operations i.e. the Lro related object returned by methods whose names started with `begin`, now uses `pollUntilDone` to check whether the request is finished, instead of `pollUntilFinished`. To get the final result, use the corresponding method that will have the suffix `AndWait`.
- The SDK only supports ECMAScript 2015 (ES6) and beyond, all projects that referenced this SDK should be upgraded to use ES6.

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

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2018 Microsoft
Copyright (c) 2021 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
@ -18,4 +18,4 @@ 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.
SOFTWARE.

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

@ -1,99 +1,98 @@
## Azure SearchManagementClient SDK for JavaScript
# Azure SearchManagement client library for JavaScript
This package contains an isomorphic SDK for SearchManagementClient.
This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure SearchManagement client.
Client that can be used to manage Azure Cognitive Search services and API keys.
[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/search/arm-search) |
[Package (NPM)](https://www.npmjs.com/package/@azure/arm-search) |
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-search?view=azure-node-preview) |
[Samples](https://github.com/Azure-Samples/azure-samples-js-management)
## Getting started
### Currently supported environments
- [LTS versions of Node.js](https://nodejs.org/about/releases/)
- Latest versions of Safari, Chrome, Edge, and Firefox.
- Latest versions of Safari, Chrome, Edge and Firefox.
### How to Install
### Prerequisites
```
- An [Azure subscription][azure_sub].
### Install the `@azure/arm-search` package
Install the Azure SearchManagement client library for JavaScript with `npm`:
```bash
npm install @azure/arm-search
```
### How to use
### Create and authenticate a `SearchManagementClient`
#### nodejs - Authentication, client creation and list operations as an example written in TypeScript.
To create a client object to access the Azure SearchManagement API, you will need the `endpoint` of your Azure SearchManagement resource and a `credential`. The Azure SearchManagement client can use Azure Active Directory credentials to authenticate.
You can find the endpoint for your Azure SearchManagement resource in the [Azure Portal][azure_portal].
##### Install @azure/ms-rest-nodeauth
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).
```
npm install @azure/ms-rest-nodeauth
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
```
##### Sample code
You will also need to **register a new AAD application and grant access to Azure SearchManagement** 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`.
```ts
import * as msRest from "@azure/ms-rest-js";
import * as msRestAzure from "@azure/ms-rest-azure-js";
import * as msRestNodeAuth from "@azure/ms-rest-nodeauth";
import { SearchManagementClient, SearchManagementModels, SearchManagementMappers } from "@azure/arm-search";
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];
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).
msRestNodeAuth.interactiveLogin().then((creds) => {
const client = new SearchManagementClient(creds, subscriptionId);
client.operations.list().then((result) => {
console.log("The result is:");
console.log(result);
});
}).catch((err) => {
console.error(err);
});
```javascript
const { SearchManagementClient } = require("@azure/arm-search");
const { DefaultAzureCredential } = require("@azure/identity");
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new SearchManagementClient(new DefaultAzureCredential(), subscriptionId);
```
#### browser - Authentication, client creation and list operations as an example written in JavaScript.
##### Install @azure/ms-rest-browserauth
### 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).
```
npm install @azure/ms-rest-browserauth
## Key concepts
### SearchManagementClient
`SearchManagementClient` is the primary interface for developers using the Azure SearchManagement client library. Explore the methods on this client object to understand the different features of the Azure SearchManagement 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");
```
##### Sample code
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).
See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser.
## Next steps
- index.html
```html
<!DOCTYPE html>
<html lang="en">
<head>
<title>@azure/arm-search sample</title>
<script src="node_modules/@azure/ms-rest-js/dist/msRest.browser.js"></script>
<script src="node_modules/@azure/ms-rest-azure-js/dist/msRestAzure.js"></script>
<script src="node_modules/@azure/ms-rest-browserauth/dist/msAuth.js"></script>
<script src="node_modules/@azure/arm-search/dist/arm-search.js"></script>
<script type="text/javascript">
const subscriptionId = "<Subscription_Id>";
const authManager = new msAuth.AuthManager({
clientId: "<client id for your Azure AD app>",
tenant: "<optional tenant for your organization>"
});
authManager.finalizeLogin().then((res) => {
if (!res.isLoggedIn) {
// may cause redirects
authManager.login();
}
const client = new Azure.ArmSearch.SearchManagementClient(res.creds, subscriptionId);
client.operations.list().then((result) => {
console.log("The result is:");
console.log(result);
}).catch((err) => {
console.log("An error occurred:");
console.error(err);
});
});
</script>
</head>
<body></body>
</html>
```
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)
- [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%2Fsearch%2Farm-search%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,7 @@
{
"commit": "3ad7a853aa7b10ccd820220c58023d5325eb1a49",
"readme": "specification/search/resource-manager/readme.md",
"autorest_command": "autorest --version=3.1.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/search/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20211123.1",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"use": "@autorest/typescript@6.0.0-alpha.16.20211123.1"
}

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

@ -0,0 +1,18 @@
{
"$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-search.d.ts"
},
"messages": {
"tsdocMessageReporting": { "default": { "logLevel": "none" } },
"extractorMessageReporting": {
"ae-missing-release-tag": { "logLevel": "none" },
"ae-unresolved-link": { "logLevel": "none" }
}
}
}

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

@ -1,55 +1,91 @@
{
"name": "@azure/arm-search",
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "SearchManagementClient Library with typescript type definitions for node.js and browser.",
"version": "1.3.0",
"description": "A generated SDK for SearchManagementClient.",
"version": "3.0.0-beta.1",
"engines": { "node": ">=12.0.0" },
"dependencies": {
"@azure/ms-rest-azure-js": "^1.1.0",
"@azure/ms-rest-js": "^1.1.0",
"tslib": "^1.9.3"
"@azure/core-lro": "^2.2.0",
"@azure/abort-controller": "^1.0.0",
"@azure/core-paging": "^1.2.0",
"@azure/core-client": "^1.0.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-rest-pipeline": "^1.1.0",
"tslib": "^2.2.0"
},
"keywords": [
"node",
"azure",
"typescript",
"browser",
"isomorphic"
],
"keywords": ["node", "azure", "typescript", "browser", "isomorphic"],
"license": "MIT",
"main": "./dist/arm-search.js",
"module": "./esm/searchManagementClient.js",
"types": "./esm/searchManagementClient.d.ts",
"main": "./dist/index.js",
"module": "./dist-esm/src/index.js",
"types": "./types/arm-search.d.ts",
"devDependencies": {
"typescript": "^3.1.1",
"rollup": "^0.66.2",
"rollup-plugin-node-resolve": "^3.4.0",
"uglify-js": "^3.4.9"
"@microsoft/api-extractor": "^7.18.11",
"@rollup/plugin-commonjs": "11.0.2",
"@rollup/plugin-json": "^4.0.0",
"@rollup/plugin-multi-entry": "^3.0.0",
"@rollup/plugin-node-resolve": "^8.0.0",
"mkdirp": "^1.0.4",
"rollup": "^1.16.3",
"rollup-plugin-sourcemaps": "^0.4.2",
"typescript": "~4.2.0",
"uglify-js": "^3.4.9",
"rimraf": "^3.0.0",
"@azure/identity": "^2.0.1",
"@azure-tools/test-recorder": "^1.0.0",
"mocha": "^7.1.1",
"cross-env": "^7.0.2"
},
"homepage": "https://github.com/azure/azure-sdk-for-js/tree/main/sdk/search/arm-search",
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/search/arm-search",
"repository": {
"type": "git",
"url": "https://github.com/azure/azure-sdk-for-js.git"
},
"bugs": {
"url": "https://github.com/azure/azure-sdk-for-js/issues"
"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",
"esm/**/*.js",
"esm/**/*.js.map",
"esm/**/*.d.ts",
"esm/**/*.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"
"tsconfig.json",
"review/*",
"CHANGELOG.md",
"types/*"
],
"scripts": {
"build": "tsc && rollup -c rollup.config.js && npm run minify",
"minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-search.js.map'\" -o ./dist/arm-search.min.js ./dist/arm-search.js",
"prepack": "npm install && npm run build"
"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": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js",
"integration-test:browser": "echo skipped",
"docs": "echo skipped"
},
"sideEffects": false,
"autoPublish": true

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

@ -0,0 +1,149 @@
let nock = require('nock');
module.exports.hash = "0902a8985af6c00e5484cc29b54ef73d";
module.exports.testInfo = {"uniqueName":{},"newDate":{}}
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.get('/common/discovery/instance')
.query(true)
.reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [
'Cache-Control',
'max-age=86400, private',
'Content-Type',
'application/json; charset=utf-8',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'Access-Control-Allow-Origin',
'*',
'Access-Control-Allow-Methods',
'GET, OPTIONS',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'072cda1b-922b-40cc-b9fc-db3c54473b00',
'x-ms-ests-server',
'2.1.12249.14 - KRSLR2 ProdSlices',
'Set-Cookie',
'fpc=AtaPVGOAmRBPrYATPuFBYG8; expires=Wed, 29-Dec-2021 07:37:04 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr9htX6b700UttTV-SPdziW597vdk66L1g0GDek8LyN7vY5BUvOsW3FHWa4S5lMTsbYBFbyeetJ2rOjYbpy7dELeeHtxJIKvotLutDU3-vsileLlsdCd2FIBDfqHxrCUHNOCxOrJvpB0shHeqjQk-vGl2nwUGT-UBaHusXfD0GEVUgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Mon, 29 Nov 2021 07:37:04 GMT',
'Content-Length',
'980'
]);
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration')
.reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [
'Cache-Control',
'max-age=86400, private',
'Content-Type',
'application/json; charset=utf-8',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'Access-Control-Allow-Origin',
'*',
'Access-Control-Allow-Methods',
'GET, OPTIONS',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'2aa0e74a-1391-4187-b36e-afa937ea3800',
'x-ms-ests-server',
'2.1.12249.14 - KRSLR1 ProdSlices',
'Set-Cookie',
'fpc=AigznX-F0xROvW3opXvMD2o; expires=Wed, 29-Dec-2021 07:37:05 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrJBYFFGnI4uXrjZQYxtv79X1zb3_Vk6pG5rvCbhkVSG0SD_yaXDXbN0HOOT9UVq8lJqGTrWf6AZYla55HC2a2WQewhI_t_-vDzxKQvqrX4DN3uWzmOEldHiglJLMwucFET_ZpEcj5d57-gatJf1ASTX6MBfDUfS-chD6lYfPgW6YgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Mon, 29 Nov 2021 07:37:05 GMT',
'Content-Length',
'1753'
]);
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=f30416e9-805f-410d-ada2-e027a089abb3&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D")
.reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [
'Cache-Control',
'no-store, no-cache',
'Pragma',
'no-cache',
'Content-Type',
'application/json; charset=utf-8',
'Expires',
'-1',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'072cda1b-922b-40cc-b9fc-db3c59473b00',
'x-ms-ests-server',
'2.1.12249.14 - KRSLR2 ProdSlices',
'x-ms-clitelem',
'1,0,0,,',
'Set-Cookie',
'fpc=Akubm36q_BhOiRla4iSySWEWPr5BAQAAACB6NtkOAAAA; expires=Wed, 29-Dec-2021 07:37:05 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Mon, 29 Nov 2021 07:37:05 GMT',
'Content-Length',
'1374'
]);
nock('https://management.azure.com:443', {"encodedQueryParams":true})
.post('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Search/searchServices/myjssearchservicexx/createQueryKey/testjskey')
.query(true)
.reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147cb6c917ff4e8a3366fda9f6edee6d71f8d3ec2bf8f3e3ab9b77ff0f0e9f1c1c3e34fefef3e78f0f0e9e9934f8f9fee1defecec1fefededef7ef4","4bfe1f70fb28e53d000000"], [
'Cache-Control',
'no-cache',
'Pragma',
'no-cache',
'Transfer-Encoding',
'chunked',
'Content-Type',
'application/json; charset=utf-8',
'Content-Encoding',
'gzip',
'Expires',
'-1',
'Vary',
'Accept-Encoding,Accept-Encoding',
'x-ms-request-id',
'90ffb2a6-4b20-4ee3-b645-f6e22850c435',
'request-id',
'90ffb2a6-4b20-4ee3-b645-f6e22850c435',
'elapsed-time',
'220',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'x-ms-ratelimit-remaining-subscription-writes',
'1199',
'x-ms-correlation-request-id',
'c7043ce4-93fb-4144-b193-5c589176ff2c',
'x-ms-routing-request-id',
'JAPANEAST:20211129T073705Z:c7043ce4-93fb-4144-b193-5c589176ff2c',
'X-Content-Type-Options',
'nosniff',
'Date',
'Mon, 29 Nov 2021 07:37:05 GMT'
]);

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

@ -0,0 +1,185 @@
let nock = require('nock');
module.exports.hash = "d8c1c488682a2eebf8fa7687871680ed";
module.exports.testInfo = {"uniqueName":{},"newDate":{}}
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.get('/common/discovery/instance')
.query(true)
.reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [
'Cache-Control',
'max-age=86400, private',
'Content-Type',
'application/json; charset=utf-8',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'Access-Control-Allow-Origin',
'*',
'Access-Control-Allow-Methods',
'GET, OPTIONS',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'072cda1b-922b-40cc-b9fc-db3c68473b00',
'x-ms-ests-server',
'2.1.12249.14 - KRSLR2 ProdSlices',
'Set-Cookie',
'fpc=AjV4coaVURVErX4u_WMD6y0; expires=Wed, 29-Dec-2021 07:37:06 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrrzjxX47r5ejHlDyLm8-2JQ42Y4ovHQ9fMxYKDa68khKNUZZWOhlfsgKb-9xvDg90ThxMBcRyj2GdvcmDlOAPL1eD0X9r94s9pboku1Xqw8u45QixhKBV-WOqz1RJux6oIiyL9ZtTf2eFZsT9eTsdH3ySUkTi15xauKq6IPVxcjQgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Mon, 29 Nov 2021 07:37:06 GMT',
'Content-Length',
'980'
]);
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration')
.reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [
'Cache-Control',
'max-age=86400, private',
'Content-Type',
'application/json; charset=utf-8',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'Access-Control-Allow-Origin',
'*',
'Access-Control-Allow-Methods',
'GET, OPTIONS',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'23a0a219-e578-46a1-bb8e-ccefc8e53a00',
'x-ms-ests-server',
'2.1.12249.14 - SEASLR1 ProdSlices',
'Set-Cookie',
'fpc=ArKfJ_KPiMxDg9i_6IPRAU8; expires=Wed, 29-Dec-2021 07:37:07 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrP3GhebmgpV4BvITJoRfpnrn6d2AIUzyaPggdZONezuBiH7I7E12nnnotg_5oRXbml1SJMqJ9gXp0E8kW-jbqNIm2UUYVASllrHst_BjnBeFFsySAgWnepo0imWaI_LNf8i-4mp_fxcXZviHsw-QIxt08vNptVjRZEjER4mHKC4cgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Mon, 29 Nov 2021 07:37:07 GMT',
'Content-Length',
'1753'
]);
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=42c848ff-5426-4e2c-8397-60727cf2b1c1&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D")
.reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [
'Cache-Control',
'no-store, no-cache',
'Pragma',
'no-cache',
'Content-Type',
'application/json; charset=utf-8',
'Expires',
'-1',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'93ef7e08-1935-4d62-bd81-4c49cd363900',
'x-ms-ests-server',
'2.1.12249.14 - SEASLR2 ProdSlices',
'x-ms-clitelem',
'1,0,0,,',
'Set-Cookie',
'fpc=Avgdoy3LqCpLmNFP165oaUoWPr5BAQAAACJ6NtkOAAAA; expires=Wed, 29-Dec-2021 07:37:07 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Mon, 29 Nov 2021 07:37:07 GMT',
'Content-Length',
'1374'
]);
nock('https://management.azure.com:443', {"encodedQueryParams":true})
.delete('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Search/searchServices/myjssearchservicexx/deleteQueryKey/testjskey')
.query(true)
.reply(404, {"error":{"code":"Unknown","message":"This API key does not exist for service 'myjssearchservicexx'. RequestId: b814ae43-3178-4414-98bf-70b58b3816cb","target":null,"details":null}}, [
'Cache-Control',
'no-cache',
'Pragma',
'no-cache',
'Content-Length',
'180',
'Content-Type',
'application/json; charset=utf-8',
'Content-Language',
'en',
'Expires',
'-1',
'x-ms-request-id',
'b814ae43-3178-4414-98bf-70b58b3816cb',
'request-id',
'b814ae43-3178-4414-98bf-70b58b3816cb',
'elapsed-time',
'155',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'x-ms-ratelimit-remaining-subscription-deletes',
'14999',
'x-ms-correlation-request-id',
'9af75175-8482-436e-8d56-6f222b545635',
'x-ms-routing-request-id',
'JAPANEAST:20211129T073707Z:9af75175-8482-436e-8d56-6f222b545635',
'X-Content-Type-Options',
'nosniff',
'Date',
'Mon, 29 Nov 2021 07:37:07 GMT'
]);
nock('https://management.azure.com:443', {"encodedQueryParams":true})
.post('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Search/searchServices/myjssearchservicexx/listQueryKeys')
.query(true)
.reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1479759b9ce3f7af4bd5ffcd1325bd02fcb75598e3e7a9b5f7ff4e8a3dd83270f3e7db277faecc1a77bf79e1def3f3bb977f26cffc1de83bd674fef1d1c9f7ef44b46e6b58fdabc697fbac17be6ed937bfb070f9f1e1f3c3cfef4feee83070f9f9e3ef9f4f8e9def1cecefef1dedefeee47bfe4fba38f96f9bbf679b17c2b1d","ff92ff073ac80f6490000000"], [
'Cache-Control',
'no-cache',
'Pragma',
'no-cache',
'Transfer-Encoding',
'chunked',
'Content-Type',
'application/json; charset=utf-8',
'Content-Encoding',
'gzip',
'Expires',
'-1',
'Vary',
'Accept-Encoding,Accept-Encoding',
'x-ms-request-id',
'50181b30-2b2f-4c96-8eca-64412da3d8c5',
'request-id',
'50181b30-2b2f-4c96-8eca-64412da3d8c5',
'elapsed-time',
'289',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'x-ms-ratelimit-remaining-subscription-writes',
'1197',
'x-ms-correlation-request-id',
'73f13728-4c82-4633-ad0e-feb6e9d67355',
'x-ms-routing-request-id',
'JAPANEAST:20211129T073708Z:73f13728-4c82-4633-ad0e-feb6e9d67355',
'X-Content-Type-Options',
'nosniff',
'Date',
'Mon, 29 Nov 2021 07:37:07 GMT'
]);

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

@ -0,0 +1,149 @@
let nock = require('nock');
module.exports.hash = "253cb4f279bde5f04cb6f6e7543edb51";
module.exports.testInfo = {"uniqueName":{},"newDate":{}}
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.get('/common/discovery/instance')
.query(true)
.reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [
'Cache-Control',
'max-age=86400, private',
'Content-Type',
'application/json; charset=utf-8',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'Access-Control-Allow-Origin',
'*',
'Access-Control-Allow-Methods',
'GET, OPTIONS',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'072cda1b-922b-40cc-b9fc-db3c62473b00',
'x-ms-ests-server',
'2.1.12249.14 - KRSLR2 ProdSlices',
'Set-Cookie',
'fpc=Ancd4i7mQbVFiBj08ykF6HY; expires=Wed, 29-Dec-2021 07:37:05 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevrsl1N9uadL0ytGOpjrKNtCREzLBef2QjeizDl_I-T-ghV72prcgfiLSPFVduWQvbmF-Bqd1_XQXMzPQFm9zf68K6NknSiJk_Mi8lpxO2FfKbhIVGHlm4nmC4ipxFvGprW7egrbLBcSXTLoMIvFf507katuGWrCYxZvCC9xjBBavQgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Mon, 29 Nov 2021 07:37:05 GMT',
'Content-Length',
'980'
]);
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration')
.reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [
'Cache-Control',
'max-age=86400, private',
'Content-Type',
'application/json; charset=utf-8',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'Access-Control-Allow-Origin',
'*',
'Access-Control-Allow-Methods',
'GET, OPTIONS',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'072cda1b-922b-40cc-b9fc-db3c63473b00',
'x-ms-ests-server',
'2.1.12249.14 - KRSLR2 ProdSlices',
'Set-Cookie',
'fpc=AkCdLPTAqR1EgL93xEnIKN0; expires=Wed, 29-Dec-2021 07:37:06 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr8mMiqmECxhcISngmj1WdeQPOe1m1FNQhrO41ooUXumdQHJC5qL93KQT5sp93a3Ug1gTZyM4BxERpE9QdgTdR8I5BDIBii2N-vZ0ZdTt8zpOtzhzSa3N4jeRt4iO_xnop-yCBa3gAaBMNHnMYdINMZFfu1WQ9PD-ToQCpAf1LskMgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Mon, 29 Nov 2021 07:37:06 GMT',
'Content-Length',
'1753'
]);
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=db09f8be-4719-4679-9ee3-ce70ac67c00a&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D")
.reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [
'Cache-Control',
'no-store, no-cache',
'Pragma',
'no-cache',
'Content-Type',
'application/json; charset=utf-8',
'Expires',
'-1',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'2aa0e74a-1391-4187-b36e-afa94cea3800',
'x-ms-ests-server',
'2.1.12249.14 - KRSLR1 ProdSlices',
'x-ms-clitelem',
'1,0,0,,',
'Set-Cookie',
'fpc=Aq8vcn_FDnFJlmpiQ8gPeGgWPr5BAQAAACF6NtkOAAAA; expires=Wed, 29-Dec-2021 07:37:06 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Mon, 29 Nov 2021 07:37:06 GMT',
'Content-Length',
'1374'
]);
nock('https://management.azure.com:443', {"encodedQueryParams":true})
.post('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Search/searchServices/myjssearchservicexx/listQueryKeys')
.query(true)
.reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1479759b9ce3f7af4bd5ffcd1325bd02fcb75598e3e7a9b5f7ff4e8a3dd83270f3e7db277faecc1a77bf79e1def3f3bb977f26cffc1de83bd674fef1d1c9f7ef44b46e6b58fdabc697fbac17be6ed937bfb070f9f1e1f3c3cfef4feee83070f9f9e3ef9f4f8e9def1cecefef1dedefeee47bfe4fba38f96f9bbf679b17c2b1d","ff92ff073ac80f6490000000"], [
'Cache-Control',
'no-cache',
'Pragma',
'no-cache',
'Transfer-Encoding',
'chunked',
'Content-Type',
'application/json; charset=utf-8',
'Content-Encoding',
'gzip',
'Expires',
'-1',
'Vary',
'Accept-Encoding,Accept-Encoding',
'x-ms-request-id',
'c4d9d3b7-91cf-4f33-b99d-53922fb52ab1',
'request-id',
'c4d9d3b7-91cf-4f33-b99d-53922fb52ab1',
'elapsed-time',
'166',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'x-ms-ratelimit-remaining-subscription-writes',
'1198',
'x-ms-correlation-request-id',
'd35832d6-007c-42b4-9d01-3c621c2cf09b',
'x-ms-routing-request-id',
'JAPANEAST:20211129T073706Z:d35832d6-007c-42b4-9d01-3c621c2cf09b',
'X-Content-Type-Options',
'nosniff',
'Date',
'Mon, 29 Nov 2021 07:37:06 GMT'
]);

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

@ -0,0 +1,147 @@
let nock = require('nock');
module.exports.hash = "b3017d75108c0f0ee9f900fba34addd1";
module.exports.testInfo = {"uniqueName":{},"newDate":{}}
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.get('/common/discovery/instance')
.query(true)
.reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [
'Cache-Control',
'max-age=86400, private',
'Content-Type',
'application/json; charset=utf-8',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'Access-Control-Allow-Origin',
'*',
'Access-Control-Allow-Methods',
'GET, OPTIONS',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'4db399e4-6594-4f67-8a89-15a77c0d3e00',
'x-ms-ests-server',
'2.1.12249.14 - SEASLR2 ProdSlices',
'Set-Cookie',
'fpc=Am5F1T4oIZNPvMRwoH9kjLo; expires=Wed, 29-Dec-2021 07:36:51 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr2DoT8uZcRZxHRNqgwfMk4kKCivLixHQtxjYMpcm2yDVoWkzXDDoSsapnMH7KuWc3I-vBzeaM3a62YsFwe5wiblPJGNyn7YUstVcaiCSVNFVEPV__z2_DfwoEKDh8PiLZWd6evWK0sQIQutO3SE87t4ahRFExdUwAx8-zvXkviqsgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Mon, 29 Nov 2021 07:36:50 GMT',
'Content-Length',
'980'
]);
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration')
.reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [
'Cache-Control',
'max-age=86400, private',
'Content-Type',
'application/json; charset=utf-8',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'Access-Control-Allow-Origin',
'*',
'Access-Control-Allow-Methods',
'GET, OPTIONS',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'7f6f33c0-2e74-490e-8f6c-dc65cef63b00',
'x-ms-ests-server',
'2.1.12249.14 - SEASLR1 ProdSlices',
'Set-Cookie',
'fpc=ArjBbbNnJ0ZJizct2hwGDhs; expires=Wed, 29-Dec-2021 07:36:51 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrPEccV8PDNte8zitIaVgA1HaDtm0Pqupqh9A0ls0Kuh9pXlcyDS-thcjH4Aqd2T1F1x90Wdrtj5vj6yhrm9NTEqxmSXvzNhcZTEAwcNS6elALkQSgOhOjPtrYehchbwlbSP539QInZNjr2jQyxB88YUlkCFBkHY0a3oRUmkjXJIsgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Mon, 29 Nov 2021 07:36:50 GMT',
'Content-Length',
'1753'
]);
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=9a3043b5-5b36-4057-998e-9cb4e6753305&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D")
.reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [
'Cache-Control',
'no-store, no-cache',
'Pragma',
'no-cache',
'Content-Type',
'application/json; charset=utf-8',
'Expires',
'-1',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'072cda1b-922b-40cc-b9fc-db3ce0463b00',
'x-ms-ests-server',
'2.1.12249.14 - KRSLR2 ProdSlices',
'x-ms-clitelem',
'1,0,0,,',
'Set-Cookie',
'fpc=AgoMMYBxVldPk7TDVmBnYtgWPr5BAQAAABJ6NtkOAAAA; expires=Wed, 29-Dec-2021 07:36:51 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Mon, 29 Nov 2021 07:36:50 GMT',
'Content-Length',
'1374'
]);
nock('https://management.azure.com:443', {"encodedQueryParams":true})
.put('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Search/searchServices/myjssearchservicexx', {"location":"eastus","sku":{"name":"standard"},"properties":{"replicaCount":1,"partitionCount":1,"hostingMode":"default"}})
.query(true)
.reply(201, {"id":"/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Search/searchServices/myjssearchservicexx","name":"myjssearchservicexx","type":"Microsoft.Search/searchServices","location":"East US","properties":{"replicaCount":1,"partitionCount":1,"status":"running","statusDetails":"","provisioningState":"succeeded","hostingMode":"default","publicNetworkAccess":"Enabled","networkRuleSet":{"ipRules":[],"bypass":"None"},"privateEndpointConnections":[],"sharedPrivateLinkResources":[]},"sku":{"name":"standard"}}, [
'Cache-Control',
'no-cache',
'Pragma',
'no-cache',
'Content-Length',
'552',
'Content-Type',
'application/json; charset=utf-8',
'Expires',
'-1',
'ETag',
`W/"datetime'2021-11-29T07%3A37%3A00.9040836Z'"`,
'x-ms-request-id',
'cf196434-8c1d-44f0-87a7-b07694cf2f14',
'request-id',
'cf196434-8c1d-44f0-87a7-b07694cf2f14',
'elapsed-time',
'2483',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'x-ms-ratelimit-remaining-subscription-writes',
'1199',
'x-ms-correlation-request-id',
'f35c88b7-0855-4c3a-b3e0-1cd6cef6c80f',
'x-ms-routing-request-id',
'JAPANEAST:20211129T073702Z:f35c88b7-0855-4c3a-b3e0-1cd6cef6c80f',
'X-Content-Type-Options',
'nosniff',
'Date',
'Mon, 29 Nov 2021 07:37:01 GMT'
]);

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

@ -0,0 +1,177 @@
let nock = require('nock');
module.exports.hash = "058e97a52ffbf0d84ec36fab6e5997fe";
module.exports.testInfo = {"uniqueName":{},"newDate":{}}
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.get('/common/discovery/instance')
.query(true)
.reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [
'Cache-Control',
'max-age=86400, private',
'Content-Type',
'application/json; charset=utf-8',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'Access-Control-Allow-Origin',
'*',
'Access-Control-Allow-Methods',
'GET, OPTIONS',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'7f6f33c0-2e74-490e-8f6c-dc6588f73b00',
'x-ms-ests-server',
'2.1.12249.14 - SEASLR1 ProdSlices',
'Set-Cookie',
'fpc=AsHO3CCmJaxOhH5bP1Y1DwQ; expires=Wed, 29-Dec-2021 07:37:08 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr052CMdHYRfYQfVAKKJSKtPfcq1g_XJthoZJQslI_UaDgHP8IVF50B1Ylpek5xFIEaUDn1RLvojsiFKGLU5uSZ1eynkvWBs8BsuMGlBQR8hzvu8NvyJ6IRjZ6PAdWlTGDuJ0fzrMPaFFbU4yd88lJdmXD-umYnEnO8U5llcqyRUAgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Mon, 29 Nov 2021 07:37:08 GMT',
'Content-Length',
'980'
]);
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration')
.reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [
'Cache-Control',
'max-age=86400, private',
'Content-Type',
'application/json; charset=utf-8',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'Access-Control-Allow-Origin',
'*',
'Access-Control-Allow-Methods',
'GET, OPTIONS',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'072cda1b-922b-40cc-b9fc-db3c78473b00',
'x-ms-ests-server',
'2.1.12249.14 - KRSLR2 ProdSlices',
'Set-Cookie',
'fpc=Attfl_2Th2tJuX6uDHUcOkI; expires=Wed, 29-Dec-2021 07:37:08 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrTfNNTGnw1TIsg12xfIVUMpbfKJiCmgw_-b_3f5rEWDWOBh1Uk_oReSrmi75jhn-1v51EDtAnCA51A4vg5TUpPd-F24wlMffvIJAJzVINjQtDzfE4BJ6zpW_DJpdZiDRilergJgtlHyeS0c6dWtGBpDON4Nr7AqxKSrxLNlKvmnogAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Mon, 29 Nov 2021 07:37:08 GMT',
'Content-Length',
'1753'
]);
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=801dc019-8e3c-423e-9605-a32c39808b68&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D")
.reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [
'Cache-Control',
'no-store, no-cache',
'Pragma',
'no-cache',
'Content-Type',
'application/json; charset=utf-8',
'Expires',
'-1',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'3907abd4-3310-4e27-b9d6-d5757b7c3900',
'x-ms-ests-server',
'2.1.12249.14 - SEASLR1 ProdSlices',
'x-ms-clitelem',
'1,0,0,,',
'Set-Cookie',
'fpc=Amz5vDPOZHRHmAGvNXwOcEsWPr5BAQAAACR6NtkOAAAA; expires=Wed, 29-Dec-2021 07:37:08 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Mon, 29 Nov 2021 07:37:08 GMT',
'Content-Length',
'1374'
]);
nock('https://management.azure.com:443', {"encodedQueryParams":true})
.delete('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Search/searchServices/myjssearchservicexx')
.query(true)
.reply(200, "", [
'Cache-Control',
'no-cache',
'Pragma',
'no-cache',
'Expires',
'-1',
'x-ms-request-id',
'15eab2e1-23d3-4649-b771-85cdf92f6272',
'request-id',
'15eab2e1-23d3-4649-b771-85cdf92f6272',
'elapsed-time',
'976',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'x-ms-ratelimit-remaining-subscription-deletes',
'14998',
'x-ms-correlation-request-id',
'12fabb03-1bdb-4788-878e-8494c23c6f1c',
'x-ms-routing-request-id',
'JAPANEAST:20211129T073713Z:12fabb03-1bdb-4788-878e-8494c23c6f1c',
'X-Content-Type-Options',
'nosniff',
'Date',
'Mon, 29 Nov 2021 07:37:13 GMT',
'Content-Length',
'0'
]);
nock('https://management.azure.com:443', {"encodedQueryParams":true})
.get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Search/searchServices')
.query(true)
.reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1479759b9ce3f7af4bdefff92ff0742ea40440c000000"], [
'Cache-Control',
'no-cache',
'Pragma',
'no-cache',
'Content-Type',
'application/json; charset=utf-8',
'Content-Encoding',
'gzip',
'Expires',
'-1',
'Vary',
'Accept-Encoding',
'x-ms-ratelimit-remaining-subscription-reads',
'11997',
'x-ms-request-id',
'49e7149b-2750-4c19-96d1-cb1f15af650e',
'x-ms-correlation-request-id',
'49e7149b-2750-4c19-96d1-cb1f15af650e',
'x-ms-routing-request-id',
'JAPANEAST:20211129T073714Z:49e7149b-2750-4c19-96d1-cb1f15af650e',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'Date',
'Mon, 29 Nov 2021 07:37:13 GMT',
'Content-Length',
'133'
]);

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

@ -0,0 +1,151 @@
let nock = require('nock');
module.exports.hash = "e814c202711fbf5816839f23314bc9bf";
module.exports.testInfo = {"uniqueName":{},"newDate":{}}
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.get('/common/discovery/instance')
.query(true)
.reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [
'Cache-Control',
'max-age=86400, private',
'Content-Type',
'application/json; charset=utf-8',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'Access-Control-Allow-Origin',
'*',
'Access-Control-Allow-Methods',
'GET, OPTIONS',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'4db399e4-6594-4f67-8a89-15a7ee0d3e00',
'x-ms-ests-server',
'2.1.12249.14 - SEASLR2 ProdSlices',
'Set-Cookie',
'fpc=AmMAZdqrQqpKkdwpllB4nEM; expires=Wed, 29-Dec-2021 07:37:02 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrWERAkm_GHcXI9CYdIWFwFdCQV6NfA9GEScVJqoQKDZPjPdOM_tNYcYeK5ZCnBkf3E7ySNUry7OYQeUdMNnC5nru7b-HHSOPWC8l99WmSbardH7xbB-rzZO-LhxeyB160dX40XVT-imzJJ588x-8LdecgVnP0eswjLYflUU0AeUsgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Mon, 29 Nov 2021 07:37:02 GMT',
'Content-Length',
'980'
]);
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration')
.reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [
'Cache-Control',
'max-age=86400, private',
'Content-Type',
'application/json; charset=utf-8',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'Access-Control-Allow-Origin',
'*',
'Access-Control-Allow-Methods',
'GET, OPTIONS',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'7f6f33c0-2e74-490e-8f6c-dc6550f73b00',
'x-ms-ests-server',
'2.1.12249.14 - SEASLR1 ProdSlices',
'Set-Cookie',
'fpc=ApCQv3B5Y6ZKlIAJq3DAZpM; expires=Wed, 29-Dec-2021 07:37:02 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrLx_CpKwlcg2tGH4QArvVnxsCC2-olWyPefwo59aPzx9aXkwZwzTjVkxQvq3Vi-F4Fs_nIB0HOsxSKEpfoj2c6xJlLQKijM4lCKX72Al3vJkx5axdvGntUoYoQWfxh3UxA9yNeEh7TERNoJQRtUDHGTDILKmE5tL4ZyAGF3s9og8gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Mon, 29 Nov 2021 07:37:02 GMT',
'Content-Length',
'1753'
]);
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=5fc5ce79-53e6-4cf0-953c-fc533ecbc425&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D")
.reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [
'Cache-Control',
'no-store, no-cache',
'Pragma',
'no-cache',
'Content-Type',
'application/json; charset=utf-8',
'Expires',
'-1',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'23a0a219-e578-46a1-bb8e-ccefa2e53a00',
'x-ms-ests-server',
'2.1.12249.14 - SEASLR1 ProdSlices',
'x-ms-clitelem',
'1,0,0,,',
'Set-Cookie',
'fpc=Akba4QhUsmRIrdehEFbOW5IWPr5BAQAAAB56NtkOAAAA; expires=Wed, 29-Dec-2021 07:37:02 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Mon, 29 Nov 2021 07:37:02 GMT',
'Content-Length',
'1374'
]);
nock('https://management.azure.com:443', {"encodedQueryParams":true})
.get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Search/searchServices/myjssearchservicexx')
.query(true)
.reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef147c5eca3471fdd6dd693665a17abb6a896cddd877be70fefcf0eceb7ef4d3f7db0bdbfbbb7bffd7077fa60fb607abef3603a9b9cefedefdeadf3a65ad7d3fcf3ba5aaf9abb8beb9f6edabc69efaeeaeab298e57573f78b625a574d75de8e5fe7593d9ddf6df8c7ebbcbe2ca6b9bc221f35f2d1bb771f8d3e5a668b9c508a7fd95eaff0e50d90a961594d330c861a9f664d9b7ef59a3e24d45679dd16d4e2d12ffea8ce576531cd4eaaf5b2fde8d12e7d9dd17778c97dd4b459bba6d61fd5ebe5b2585e1010f9e869de6645896fe823827b5934f422b5784d5f03c5663d9de6f92c9fd1f7f3aa69e9ab2faa19be99e5e7d9ba6ce9f3d57a4218bcc8dbabaa7e7b4ced1b003c5d669392df5bca37afd665fe3a278468b656f8835a7deffba38f26d7ab8cdf78512df38f7e09c1ab8b4beafd74395b55c5b23da996cb7c8a015123bcd0ccb33a9fbd9456cf8be5db573a87fc3d0168deaed18b4e018d7439cbead947bfe4","97fc3f2787116028020000"], [
'Cache-Control',
'no-cache',
'Pragma',
'no-cache',
'Transfer-Encoding',
'chunked',
'Content-Type',
'application/json; charset=utf-8',
'Content-Encoding',
'gzip',
'Expires',
'-1',
'ETag',
`W/"datetime'2021-11-29T07%3A37%3A00.9040836Z'"`,
'Vary',
'Accept-Encoding,Accept-Encoding',
'x-ms-request-id',
'f5e4ad66-1f14-43ae-b298-3d47ce67be19',
'request-id',
'f5e4ad66-1f14-43ae-b298-3d47ce67be19',
'elapsed-time',
'222',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'x-ms-ratelimit-remaining-subscription-reads',
'11999',
'x-ms-correlation-request-id',
'33151f26-9a01-4b8e-ba68-3a1b92ec5007',
'x-ms-routing-request-id',
'JAPANEAST:20211129T073703Z:33151f26-9a01-4b8e-ba68-3a1b92ec5007',
'X-Content-Type-Options',
'nosniff',
'Date',
'Mon, 29 Nov 2021 07:37:02 GMT'
]);

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

@ -0,0 +1,149 @@
let nock = require('nock');
module.exports.hash = "e5c7e28b729fddab131c256371a7e658";
module.exports.testInfo = {"uniqueName":{},"newDate":{}}
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.get('/common/discovery/instance')
.query(true)
.reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [
'Cache-Control',
'max-age=86400, private',
'Content-Type',
'application/json; charset=utf-8',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'Access-Control-Allow-Origin',
'*',
'Access-Control-Allow-Methods',
'GET, OPTIONS',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'4db399e4-6594-4f67-8a89-15a7f80d3e00',
'x-ms-ests-server',
'2.1.12249.14 - SEASLR2 ProdSlices',
'Set-Cookie',
'fpc=Ajbdle-chxJEmKmEeeBgEys; expires=Wed, 29-Dec-2021 07:37:03 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr7v48qN9zN6oQBaBaN5Kx81_4shUeH-fxIw9kkDmFNQmmTAC9UzxzI1qUbkbcMlXb7QAhcep2-RGK5yDdz-tY6GxD8urr8gl78HR03OYtuGEtv977MwfYJuPG5qSbJtVx2uZLy_xUIS0pffnD70LW6C-X0k5W0qBwXCKgWLJBDtUgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Mon, 29 Nov 2021 07:37:03 GMT',
'Content-Length',
'980'
]);
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration')
.reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [
'Cache-Control',
'max-age=86400, private',
'Content-Type',
'application/json; charset=utf-8',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'Access-Control-Allow-Origin',
'*',
'Access-Control-Allow-Methods',
'GET, OPTIONS',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'23a0a219-e578-46a1-bb8e-ccefabe53a00',
'x-ms-ests-server',
'2.1.12249.14 - SEASLR1 ProdSlices',
'Set-Cookie',
'fpc=AmW9AvMEZdBOpBU4lXKtJfo; expires=Wed, 29-Dec-2021 07:37:03 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevrd8JAbpss64WXl6RbBZERJz8HTNr2mM8tLrKCHR6Y9sSFGFcCCJB3FOauQQgOA2f6GL1_JeTqr_wmtwf_zKZRTaQ28Q8IOVQn4ZJ6BYnbI8CPonTb08qVTQ7q4dKct4JkL5cT9JBCTBwX8Rw0eYRaSoU8xmOBxeu2s0SC0DKEdnsgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Mon, 29 Nov 2021 07:37:03 GMT',
'Content-Length',
'1753'
]);
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.3&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=650c3d18-f071-436f-b369-f499e865aaa6&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D")
.reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [
'Cache-Control',
'no-store, no-cache',
'Pragma',
'no-cache',
'Content-Type',
'application/json; charset=utf-8',
'Expires',
'-1',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'2aa0e74a-1391-4187-b36e-afa92bea3800',
'x-ms-ests-server',
'2.1.12249.14 - KRSLR1 ProdSlices',
'x-ms-clitelem',
'1,0,0,,',
'Set-Cookie',
'fpc=AmRyFGxBmH9OhClv5_rwaYIWPr5BAQAAAB96NtkOAAAA; expires=Wed, 29-Dec-2021 07:37:04 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Mon, 29 Nov 2021 07:37:04 GMT',
'Content-Length',
'1374'
]);
nock('https://management.azure.com:443', {"encodedQueryParams":true})
.get('/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Search/searchServices')
.query(true)
.reply(200, ["1f8b0800000000000400edbd07601c499625262f6dca7b7f4af54ad7e074a10880601324d8904010ecc188cde692ec1d69472329ab2a81ca6556655d661640cced9dbcf7de7befbdf7de7befbdf7ba3b9d4e27f7dfff3f5c6664016cf6ce4adac99e2180aac81f3f7e7c1f3f227ef1479759b9ce3f7af4bd5ffc5131fbe8d147779bf5a499d6c5aa2daa6573f7e1def9c3fbb383f3ed7bd34f1f6cefefeeed6f3fdc9d3ed83e989eef3c98ce26e77bfbbb77ebbca9d6f534ffbcaed6abe6eee2faa79b366fdabbabbaba2c6679dddcfda298d655539db7e3d779564fe7771bfef13aaf2f8b692eafc8478d7cf4eedd47a38f96d98230fb28fe657bbdc2973740a6866535cd30186a7c9a356dfad56bfa90505be5755b508b47bff8a33a5f95c5343ba9d6cbf6a347bbf47546dfe125f751d366ed9a5a7f54af97cb62794140e4a3a7799b1525bea18f08ee65d1d08bd4e2357d0d149bf5749ae7b37c46dfcfaba6a5afbea866f866969f67ebb2a5cf57eb0961f0226fafaafaed31b56f00f074994d4a7e6f29dfbc5a97f9eb9c10a2d95ae10f6af5bdef8f3e9a5caf327ee345b5cc3ffa2504af2e2ea9f7d3e56c5515cbf6a45a2ef32906448df04233cfea7cf6525a3d2f966f5fe91ceaf7f99bec82c07df7eeeffbd18c5ab4c522ff786f676f777b77777befe19b9d07bffbbde37bf8676767fc70677fe7e0dea73ff5f1effb11ba6edeae819f4e1ed16839cbead947bfe49710d865feae456f1f3d5aaecbf297","fc3f9952c9507e020000"], [
'Cache-Control',
'no-cache',
'Pragma',
'no-cache',
'Transfer-Encoding',
'chunked',
'Content-Type',
'application/json; charset=utf-8',
'Content-Encoding',
'gzip',
'Expires',
'-1',
'Vary',
'Accept-Encoding,Accept-Encoding',
'x-ms-request-id',
'99d32749-ce18-4517-a100-311c06c7b445',
'request-id',
'99d32749-ce18-4517-a100-311c06c7b445',
'elapsed-time',
'182',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'x-ms-ratelimit-remaining-subscription-reads',
'11998',
'x-ms-correlation-request-id',
'60c8aaa8-6c7c-4f23-a3f4-d4704a4fa5b7',
'x-ms-routing-request-id',
'JAPANEAST:20211129T073704Z:60c8aaa8-6c7c-4f23-a3f4-d4704a4fa5b7',
'X-Content-Type-Options',
'nosniff',
'Date',
'Mon, 29 Nov 2021 07:37:04 GMT'
]);

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

@ -0,0 +1,600 @@
## API Report File for "@azure/arm-search"
> 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 type AdminKeyKind = "primary" | "secondary";
// @public
export interface AdminKeyResult {
readonly primaryKey?: string;
readonly secondaryKey?: string;
}
// @public
export interface AdminKeys {
get(resourceGroupName: string, searchServiceName: string, options?: AdminKeysGetOptionalParams): Promise<AdminKeysGetResponse>;
regenerate(resourceGroupName: string, searchServiceName: string, keyKind: AdminKeyKind, options?: AdminKeysRegenerateOptionalParams): Promise<AdminKeysRegenerateResponse>;
}
// @public
export interface AdminKeysGetOptionalParams extends coreClient.OperationOptions {
searchManagementRequestOptions?: SearchManagementRequestOptions;
}
// @public
export type AdminKeysGetResponse = AdminKeyResult;
// @public
export interface AdminKeysRegenerateOptionalParams extends coreClient.OperationOptions {
searchManagementRequestOptions?: SearchManagementRequestOptions;
}
// @public
export type AdminKeysRegenerateResponse = AdminKeyResult;
// @public
export interface AsyncOperationResult {
status?: SharedPrivateLinkResourceAsyncOperationResult;
}
// @public
export interface CheckNameAvailabilityInput {
name: string;
type: "searchServices";
}
// @public
export interface CheckNameAvailabilityOutput {
readonly isNameAvailable?: boolean;
readonly message?: string;
readonly reason?: UnavailableNameReason;
}
// @public
export interface CloudError {
error?: CloudErrorBody;
}
// @public
export interface CloudErrorBody {
code?: string;
details?: CloudErrorBody[];
message?: string;
target?: string;
}
// @public
export type HostingMode = "default" | "highDensity";
// @public
export interface Identity {
readonly principalId?: string;
readonly tenantId?: string;
type: IdentityType;
}
// @public
export type IdentityType = "None" | "SystemAssigned";
// @public
export interface IpRule {
value?: string;
}
// @public
export enum KnownSharedPrivateLinkResourceAsyncOperationResult {
// (undocumented)
Failed = "Failed",
// (undocumented)
Running = "Running",
// (undocumented)
Succeeded = "Succeeded"
}
// @public
export enum KnownUnavailableNameReason {
// (undocumented)
AlreadyExists = "AlreadyExists",
// (undocumented)
Invalid = "Invalid"
}
// @public
export interface ListQueryKeysResult {
readonly nextLink?: string;
readonly value?: QueryKey[];
}
// @public
export interface NetworkRuleSet {
ipRules?: IpRule[];
}
// @public
export interface Operation {
readonly display?: OperationDisplay;
readonly name?: string;
}
// @public
export interface OperationDisplay {
readonly description?: string;
readonly operation?: string;
readonly provider?: string;
readonly resource?: string;
}
// @public
export interface OperationListResult {
readonly nextLink?: string;
readonly value?: Operation[];
}
// @public
export interface Operations {
list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator<Operation>;
}
// @public
export interface OperationsListOptionalParams extends coreClient.OperationOptions {
}
// @public
export type OperationsListResponse = OperationListResult;
// @public
export type PrivateEndpointConnection = Resource & {
properties?: PrivateEndpointConnectionProperties;
};
// @public
export interface PrivateEndpointConnectionListResult {
readonly nextLink?: string;
readonly value?: PrivateEndpointConnection[];
}
// @public
export interface PrivateEndpointConnectionProperties {
privateEndpoint?: PrivateEndpointConnectionPropertiesPrivateEndpoint;
privateLinkServiceConnectionState?: PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState;
}
// @public
export interface PrivateEndpointConnectionPropertiesPrivateEndpoint {
id?: string;
}
// @public
export interface PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState {
actionsRequired?: string;
description?: string;
status?: PrivateLinkServiceConnectionStatus;
}
// @public
export interface PrivateEndpointConnections {
delete(resourceGroupName: string, searchServiceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise<PrivateEndpointConnectionsDeleteResponse>;
get(resourceGroupName: string, searchServiceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams): Promise<PrivateEndpointConnectionsGetResponse>;
listByService(resourceGroupName: string, searchServiceName: string, options?: PrivateEndpointConnectionsListByServiceOptionalParams): PagedAsyncIterableIterator<PrivateEndpointConnection>;
update(resourceGroupName: string, searchServiceName: string, privateEndpointConnectionName: string, privateEndpointConnection: PrivateEndpointConnection, options?: PrivateEndpointConnectionsUpdateOptionalParams): Promise<PrivateEndpointConnectionsUpdateResponse>;
}
// @public
export interface PrivateEndpointConnectionsDeleteOptionalParams extends coreClient.OperationOptions {
searchManagementRequestOptions?: SearchManagementRequestOptions;
}
// @public
export type PrivateEndpointConnectionsDeleteResponse = PrivateEndpointConnection;
// @public
export interface PrivateEndpointConnectionsGetOptionalParams extends coreClient.OperationOptions {
searchManagementRequestOptions?: SearchManagementRequestOptions;
}
// @public
export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection;
// @public
export interface PrivateEndpointConnectionsListByServiceNextOptionalParams extends coreClient.OperationOptions {
searchManagementRequestOptions?: SearchManagementRequestOptions;
}
// @public
export type PrivateEndpointConnectionsListByServiceNextResponse = PrivateEndpointConnectionListResult;
// @public
export interface PrivateEndpointConnectionsListByServiceOptionalParams extends coreClient.OperationOptions {
searchManagementRequestOptions?: SearchManagementRequestOptions;
}
// @public
export type PrivateEndpointConnectionsListByServiceResponse = PrivateEndpointConnectionListResult;
// @public
export interface PrivateEndpointConnectionsUpdateOptionalParams extends coreClient.OperationOptions {
searchManagementRequestOptions?: SearchManagementRequestOptions;
}
// @public
export type PrivateEndpointConnectionsUpdateResponse = PrivateEndpointConnection;
// @public
export type PrivateLinkResource = Resource & {
readonly properties?: PrivateLinkResourceProperties;
};
// @public
export interface PrivateLinkResourceProperties {
readonly groupId?: string;
readonly requiredMembers?: string[];
readonly requiredZoneNames?: string[];
readonly shareablePrivateLinkResourceTypes?: ShareablePrivateLinkResourceType[];
}
// @public
export interface PrivateLinkResources {
listSupported(resourceGroupName: string, searchServiceName: string, options?: PrivateLinkResourcesListSupportedOptionalParams): PagedAsyncIterableIterator<PrivateLinkResource>;
}
// @public
export interface PrivateLinkResourcesListSupportedOptionalParams extends coreClient.OperationOptions {
searchManagementRequestOptions?: SearchManagementRequestOptions;
}
// @public
export type PrivateLinkResourcesListSupportedResponse = PrivateLinkResourcesResult;
// @public
export interface PrivateLinkResourcesResult {
readonly value?: PrivateLinkResource[];
}
// @public
export type PrivateLinkServiceConnectionStatus = "Pending" | "Approved" | "Rejected" | "Disconnected";
// @public
export type ProvisioningState = "succeeded" | "provisioning" | "failed";
// @public
export type PublicNetworkAccess = "enabled" | "disabled";
// @public
export interface QueryKey {
readonly key?: string;
readonly name?: string;
}
// @public
export interface QueryKeys {
create(resourceGroupName: string, searchServiceName: string, name: string, options?: QueryKeysCreateOptionalParams): Promise<QueryKeysCreateResponse>;
delete(resourceGroupName: string, searchServiceName: string, key: string, options?: QueryKeysDeleteOptionalParams): Promise<void>;
listBySearchService(resourceGroupName: string, searchServiceName: string, options?: QueryKeysListBySearchServiceOptionalParams): PagedAsyncIterableIterator<QueryKey>;
}
// @public
export interface QueryKeysCreateOptionalParams extends coreClient.OperationOptions {
searchManagementRequestOptions?: SearchManagementRequestOptions;
}
// @public
export type QueryKeysCreateResponse = QueryKey;
// @public
export interface QueryKeysDeleteOptionalParams extends coreClient.OperationOptions {
searchManagementRequestOptions?: SearchManagementRequestOptions;
}
// @public
export interface QueryKeysListBySearchServiceNextOptionalParams extends coreClient.OperationOptions {
searchManagementRequestOptions?: SearchManagementRequestOptions;
}
// @public
export type QueryKeysListBySearchServiceNextResponse = ListQueryKeysResult;
// @public
export interface QueryKeysListBySearchServiceOptionalParams extends coreClient.OperationOptions {
searchManagementRequestOptions?: SearchManagementRequestOptions;
}
// @public
export type QueryKeysListBySearchServiceResponse = ListQueryKeysResult;
// @public
export interface Resource {
readonly id?: string;
readonly name?: string;
readonly type?: string;
}
// @public (undocumented)
export class SearchManagementClient extends coreClient.ServiceClient {
// (undocumented)
$host: string;
constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: SearchManagementClientOptionalParams);
// (undocumented)
adminKeys: AdminKeys;
// (undocumented)
apiVersion: string;
// (undocumented)
operations: Operations;
// (undocumented)
privateEndpointConnections: PrivateEndpointConnections;
// (undocumented)
privateLinkResources: PrivateLinkResources;
// (undocumented)
queryKeys: QueryKeys;
// (undocumented)
services: Services;
// (undocumented)
sharedPrivateLinkResources: SharedPrivateLinkResources;
// (undocumented)
subscriptionId: string;
}
// @public
export interface SearchManagementClientOptionalParams extends coreClient.ServiceClientOptions {
$host?: string;
apiVersion?: string;
endpoint?: string;
}
// @public
export interface SearchManagementRequestOptions {
clientRequestId?: string;
}
// @public
export type SearchService = TrackedResource & {
sku?: Sku;
identity?: Identity;
replicaCount?: number;
partitionCount?: number;
hostingMode?: HostingMode;
publicNetworkAccess?: PublicNetworkAccess;
readonly status?: SearchServiceStatus;
readonly statusDetails?: string;
readonly provisioningState?: ProvisioningState;
networkRuleSet?: NetworkRuleSet;
readonly privateEndpointConnections?: PrivateEndpointConnection[];
readonly sharedPrivateLinkResources?: SharedPrivateLinkResource[];
};
// @public
export interface SearchServiceListResult {
readonly nextLink?: string;
readonly value?: SearchService[];
}
// @public
export type SearchServiceStatus = "running" | "provisioning" | "deleting" | "degraded" | "disabled" | "error";
// @public
export type SearchServiceUpdate = Resource & {
sku?: Sku;
location?: string;
tags?: {
[propertyName: string]: string;
};
identity?: Identity;
replicaCount?: number;
partitionCount?: number;
hostingMode?: HostingMode;
publicNetworkAccess?: PublicNetworkAccess;
readonly status?: SearchServiceStatus;
readonly statusDetails?: string;
readonly provisioningState?: ProvisioningState;
networkRuleSet?: NetworkRuleSet;
readonly privateEndpointConnections?: PrivateEndpointConnection[];
readonly sharedPrivateLinkResources?: SharedPrivateLinkResource[];
};
// @public
export interface Services {
beginCreateOrUpdate(resourceGroupName: string, searchServiceName: string, service: SearchService, options?: ServicesCreateOrUpdateOptionalParams): Promise<PollerLike<PollOperationState<ServicesCreateOrUpdateResponse>, ServicesCreateOrUpdateResponse>>;
beginCreateOrUpdateAndWait(resourceGroupName: string, searchServiceName: string, service: SearchService, options?: ServicesCreateOrUpdateOptionalParams): Promise<ServicesCreateOrUpdateResponse>;
checkNameAvailability(name: string, options?: ServicesCheckNameAvailabilityOptionalParams): Promise<ServicesCheckNameAvailabilityResponse>;
delete(resourceGroupName: string, searchServiceName: string, options?: ServicesDeleteOptionalParams): Promise<void>;
get(resourceGroupName: string, searchServiceName: string, options?: ServicesGetOptionalParams): Promise<ServicesGetResponse>;
listByResourceGroup(resourceGroupName: string, options?: ServicesListByResourceGroupOptionalParams): PagedAsyncIterableIterator<SearchService>;
listBySubscription(options?: ServicesListBySubscriptionOptionalParams): PagedAsyncIterableIterator<SearchService>;
update(resourceGroupName: string, searchServiceName: string, service: SearchServiceUpdate, options?: ServicesUpdateOptionalParams): Promise<ServicesUpdateResponse>;
}
// @public
export interface ServicesCheckNameAvailabilityOptionalParams extends coreClient.OperationOptions {
searchManagementRequestOptions?: SearchManagementRequestOptions;
}
// @public
export type ServicesCheckNameAvailabilityResponse = CheckNameAvailabilityOutput;
// @public
export interface ServicesCreateOrUpdateOptionalParams extends coreClient.OperationOptions {
resumeFrom?: string;
searchManagementRequestOptions?: SearchManagementRequestOptions;
updateIntervalInMs?: number;
}
// @public
export type ServicesCreateOrUpdateResponse = SearchService;
// @public
export interface ServicesDeleteOptionalParams extends coreClient.OperationOptions {
searchManagementRequestOptions?: SearchManagementRequestOptions;
}
// @public
export interface ServicesGetOptionalParams extends coreClient.OperationOptions {
searchManagementRequestOptions?: SearchManagementRequestOptions;
}
// @public
export type ServicesGetResponse = SearchService;
// @public
export interface ServicesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions {
searchManagementRequestOptions?: SearchManagementRequestOptions;
}
// @public
export type ServicesListByResourceGroupNextResponse = SearchServiceListResult;
// @public
export interface ServicesListByResourceGroupOptionalParams extends coreClient.OperationOptions {
searchManagementRequestOptions?: SearchManagementRequestOptions;
}
// @public
export type ServicesListByResourceGroupResponse = SearchServiceListResult;
// @public
export interface ServicesListBySubscriptionNextOptionalParams extends coreClient.OperationOptions {
searchManagementRequestOptions?: SearchManagementRequestOptions;
}
// @public
export type ServicesListBySubscriptionNextResponse = SearchServiceListResult;
// @public
export interface ServicesListBySubscriptionOptionalParams extends coreClient.OperationOptions {
searchManagementRequestOptions?: SearchManagementRequestOptions;
}
// @public
export type ServicesListBySubscriptionResponse = SearchServiceListResult;
// @public
export interface ServicesUpdateOptionalParams extends coreClient.OperationOptions {
searchManagementRequestOptions?: SearchManagementRequestOptions;
}
// @public
export type ServicesUpdateResponse = SearchService;
// @public
export interface ShareablePrivateLinkResourceProperties {
readonly description?: string;
readonly groupId?: string;
readonly type?: string;
}
// @public
export interface ShareablePrivateLinkResourceType {
readonly name?: string;
readonly properties?: ShareablePrivateLinkResourceProperties;
}
// @public
export type SharedPrivateLinkResource = Resource & {
properties?: SharedPrivateLinkResourceProperties;
};
// @public
export type SharedPrivateLinkResourceAsyncOperationResult = string;
// @public
export interface SharedPrivateLinkResourceListResult {
nextLink?: string;
readonly value?: SharedPrivateLinkResource[];
}
// @public
export interface SharedPrivateLinkResourceProperties {
groupId?: string;
privateLinkResourceId?: string;
provisioningState?: SharedPrivateLinkResourceProvisioningState;
requestMessage?: string;
resourceRegion?: string;
status?: SharedPrivateLinkResourceStatus;
}
// @public
export type SharedPrivateLinkResourceProvisioningState = "Updating" | "Deleting" | "Failed" | "Succeeded" | "Incomplete";
// @public
export interface SharedPrivateLinkResources {
beginCreateOrUpdate(resourceGroupName: string, searchServiceName: string, sharedPrivateLinkResourceName: string, sharedPrivateLinkResource: SharedPrivateLinkResource, options?: SharedPrivateLinkResourcesCreateOrUpdateOptionalParams): Promise<PollerLike<PollOperationState<SharedPrivateLinkResourcesCreateOrUpdateResponse>, SharedPrivateLinkResourcesCreateOrUpdateResponse>>;
beginCreateOrUpdateAndWait(resourceGroupName: string, searchServiceName: string, sharedPrivateLinkResourceName: string, sharedPrivateLinkResource: SharedPrivateLinkResource, options?: SharedPrivateLinkResourcesCreateOrUpdateOptionalParams): Promise<SharedPrivateLinkResourcesCreateOrUpdateResponse>;
beginDelete(resourceGroupName: string, searchServiceName: string, sharedPrivateLinkResourceName: string, options?: SharedPrivateLinkResourcesDeleteOptionalParams): Promise<PollerLike<PollOperationState<void>, void>>;
beginDeleteAndWait(resourceGroupName: string, searchServiceName: string, sharedPrivateLinkResourceName: string, options?: SharedPrivateLinkResourcesDeleteOptionalParams): Promise<void>;
get(resourceGroupName: string, searchServiceName: string, sharedPrivateLinkResourceName: string, options?: SharedPrivateLinkResourcesGetOptionalParams): Promise<SharedPrivateLinkResourcesGetResponse>;
listByService(resourceGroupName: string, searchServiceName: string, options?: SharedPrivateLinkResourcesListByServiceOptionalParams): PagedAsyncIterableIterator<SharedPrivateLinkResource>;
}
// @public
export interface SharedPrivateLinkResourcesCreateOrUpdateOptionalParams extends coreClient.OperationOptions {
resumeFrom?: string;
searchManagementRequestOptions?: SearchManagementRequestOptions;
updateIntervalInMs?: number;
}
// @public
export type SharedPrivateLinkResourcesCreateOrUpdateResponse = SharedPrivateLinkResource;
// @public
export interface SharedPrivateLinkResourcesDeleteOptionalParams extends coreClient.OperationOptions {
resumeFrom?: string;
searchManagementRequestOptions?: SearchManagementRequestOptions;
updateIntervalInMs?: number;
}
// @public
export interface SharedPrivateLinkResourcesGetOptionalParams extends coreClient.OperationOptions {
searchManagementRequestOptions?: SearchManagementRequestOptions;
}
// @public
export type SharedPrivateLinkResourcesGetResponse = SharedPrivateLinkResource;
// @public
export interface SharedPrivateLinkResourcesListByServiceNextOptionalParams extends coreClient.OperationOptions {
searchManagementRequestOptions?: SearchManagementRequestOptions;
}
// @public
export type SharedPrivateLinkResourcesListByServiceNextResponse = SharedPrivateLinkResourceListResult;
// @public
export interface SharedPrivateLinkResourcesListByServiceOptionalParams extends coreClient.OperationOptions {
searchManagementRequestOptions?: SearchManagementRequestOptions;
}
// @public
export type SharedPrivateLinkResourcesListByServiceResponse = SharedPrivateLinkResourceListResult;
// @public
export type SharedPrivateLinkResourceStatus = "Pending" | "Approved" | "Rejected" | "Disconnected";
// @public
export interface Sku {
name?: SkuName;
}
// @public
export type SkuName = "free" | "basic" | "standard" | "standard2" | "standard3" | "storage_optimized_l1" | "storage_optimized_l2";
// @public
export type TrackedResource = Resource & {
tags?: {
[propertyName: string]: string;
};
location: string;
};
// @public
export type UnavailableNameReason = string;
// (No @packageDocumentation comment for this package)
```

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

@ -1,31 +1,188 @@
import nodeResolve from "rollup-plugin-node-resolve";
/**
* @type {import('rollup').RollupFileOptions}
*/
const config = {
input: './esm/searchManagementClient.js',
external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"],
output: {
file: "./dist/arm-search.js",
format: "umd",
name: "Azure.ArmSearch",
sourcemap: true,
globals: {
"@azure/ms-rest-js": "msRest",
"@azure/ms-rest-azure-js": "msRestAzure"
},
banner: `/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
/*
* 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.
*/`
},
plugins: [
nodeResolve({ module: true })
]
* 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";
/**
* Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api.
*
* NOTE: this manual configuration is only needed because OpenTelemetry uses an
* __exportStar downleveled helper function to declare its exports which confuses
* rollup's automatic discovery mechanism.
*
* @returns an object reference that can be `...`'d into your cjs() configuration.
*/
export function openTelemetryCommonJs() {
const namedExports = {};
for (const key of [
"@opentelemetry/api",
"@azure/core-tracing/node_modules/@opentelemetry/api"
]) {
namedExports[key] = [
"SpanKind",
"TraceFlags",
"getSpan",
"setSpan",
"SpanStatusCode",
"getSpanContext",
"setSpanContext"
];
}
const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"];
for (const version of releasedOpenTelemetryVersions) {
namedExports[
// working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path.
`../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js`
] = [
"SpanKind",
"TraceFlags",
"getSpan",
"setSpan",
"StatusCode",
"CanonicalCode",
"getSpanContext",
"setSpanContext"
];
}
return namedExports;
}
// #region Warning Handler
/**
* A function that can determine whether a rollupwarning should be ignored. If
* the function returns `true`, then the warning will not be displayed.
*/
function ignoreNiseSinonEvalWarnings(warning) {
return (
warning.code === "EVAL" &&
warning.id &&
(warning.id.includes("node_modules/nise") ||
warning.id.includes("node_modules/sinon")) === true
);
}
function ignoreChaiCircularDependencyWarnings(warning) {
return (
warning.code === "CIRCULAR_DEPENDENCY" &&
warning.importer && warning.importer.includes("node_modules/chai") === true
);
}
const warningInhibitors = [
ignoreChaiCircularDependencyWarnings,
ignoreNiseSinonEvalWarnings
];
/**
* 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({
namedExports: {
// Chai's strange internal architecture makes it impossible to statically
// analyze its exports.
chai: [
"version",
"use",
"util",
"config",
"expect",
"should",
"assert"
],
...openTelemetryCommonJs()
}
}),
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 default config;
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(), cjs()]
};
const config = [baseConfig];
if (!options.disableBrowserBundle) {
config.push(makeBrowserTestConfig());
}
return config;
}
export default makeConfig(require("./package.json"));

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

@ -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 { SearchManagementClient } from "./searchManagementClient";
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"
});
}
}

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

@ -1,15 +0,0 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
export {
AdminKeyResult,
CloudError
} from "../models/mappers";

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -1,17 +0,0 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
export {
OperationListResult,
Operation,
OperationDisplay,
CloudError
} from "../models/mappers";

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

@ -1,36 +1,83 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
* 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.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import * as msRest from "@azure/ms-rest-js";
import {
OperationParameter,
OperationURLParameter,
OperationQueryParameter
} from "@azure/core-client";
import {
SearchService as SearchServiceMapper,
SearchServiceUpdate as SearchServiceUpdateMapper,
CheckNameAvailabilityInput as CheckNameAvailabilityInputMapper,
PrivateEndpointConnection as PrivateEndpointConnectionMapper,
SharedPrivateLinkResource as SharedPrivateLinkResourceMapper
} from "../models/mappers";
export const acceptLanguage: msRest.OperationParameter = {
parameterPath: "acceptLanguage",
export const accept: OperationParameter = {
parameterPath: "accept",
mapper: {
serializedName: "accept-language",
defaultValue: 'en-US',
defaultValue: "application/json",
isConstant: true,
serializedName: "Accept",
type: {
name: "String"
}
}
};
export const apiVersion: msRest.OperationQueryParameter = {
export const $host: OperationURLParameter = {
parameterPath: "$host",
mapper: {
serializedName: "$host",
required: true,
type: {
name: "String"
}
},
skipEncoding: true
};
export const apiVersion: OperationQueryParameter = {
parameterPath: "apiVersion",
mapper: {
required: true,
defaultValue: "2020-08-01",
isConstant: true,
serializedName: "api-version",
type: {
name: "String"
}
}
};
export const clientRequestId: msRest.OperationParameter = {
export const resourceGroupName: OperationURLParameter = {
parameterPath: "resourceGroupName",
mapper: {
serializedName: "resourceGroupName",
required: true,
type: {
name: "String"
}
}
};
export const searchServiceName: OperationURLParameter = {
parameterPath: "searchServiceName",
mapper: {
serializedName: "searchServiceName",
required: true,
type: {
name: "String"
}
}
};
export const clientRequestId: OperationParameter = {
parameterPath: [
"options",
"searchManagementRequestOptions",
@ -43,65 +90,122 @@ export const clientRequestId: msRest.OperationParameter = {
}
}
};
export const key: msRest.OperationURLParameter = {
parameterPath: "key",
mapper: {
required: true,
serializedName: "key",
type: {
name: "String"
}
}
};
export const keyKind: msRest.OperationURLParameter = {
parameterPath: "keyKind",
mapper: {
required: true,
serializedName: "keyKind",
type: {
name: "Enum",
allowedValues: [
"primary",
"secondary"
]
}
}
};
export const name: msRest.OperationURLParameter = {
parameterPath: "name",
mapper: {
required: true,
serializedName: "name",
type: {
name: "String"
}
}
};
export const resourceGroupName: msRest.OperationURLParameter = {
parameterPath: "resourceGroupName",
mapper: {
required: true,
serializedName: "resourceGroupName",
type: {
name: "String"
}
}
};
export const searchServiceName: msRest.OperationURLParameter = {
parameterPath: "searchServiceName",
mapper: {
required: true,
serializedName: "searchServiceName",
type: {
name: "String"
}
}
};
export const subscriptionId: msRest.OperationURLParameter = {
export const subscriptionId: OperationURLParameter = {
parameterPath: "subscriptionId",
mapper: {
required: true,
serializedName: "subscriptionId",
required: true,
type: {
name: "String"
}
}
};
export const keyKind: OperationURLParameter = {
parameterPath: "keyKind",
mapper: {
serializedName: "keyKind",
required: true,
type: {
name: "Enum",
allowedValues: ["primary", "secondary"]
}
}
};
export const name: OperationURLParameter = {
parameterPath: "name",
mapper: {
serializedName: "name",
required: true,
type: {
name: "String"
}
}
};
export const key: OperationURLParameter = {
parameterPath: "key",
mapper: {
serializedName: "key",
required: true,
type: {
name: "String"
}
}
};
export const nextLink: OperationURLParameter = {
parameterPath: "nextLink",
mapper: {
serializedName: "nextLink",
required: true,
type: {
name: "String"
}
},
skipEncoding: true
};
export const contentType: OperationParameter = {
parameterPath: ["options", "contentType"],
mapper: {
defaultValue: "application/json",
isConstant: true,
serializedName: "Content-Type",
type: {
name: "String"
}
}
};
export const service: OperationParameter = {
parameterPath: "service",
mapper: SearchServiceMapper
};
export const service1: OperationParameter = {
parameterPath: "service",
mapper: SearchServiceUpdateMapper
};
export const name1: OperationParameter = {
parameterPath: "name",
mapper: CheckNameAvailabilityInputMapper
};
export const typeParam: OperationParameter = {
parameterPath: "typeParam",
mapper: CheckNameAvailabilityInputMapper
};
export const privateEndpointConnection: OperationParameter = {
parameterPath: "privateEndpointConnection",
mapper: PrivateEndpointConnectionMapper
};
export const privateEndpointConnectionName: OperationURLParameter = {
parameterPath: "privateEndpointConnectionName",
mapper: {
serializedName: "privateEndpointConnectionName",
required: true,
type: {
name: "String"
}
}
};
export const sharedPrivateLinkResource: OperationParameter = {
parameterPath: "sharedPrivateLinkResource",
mapper: SharedPrivateLinkResourceMapper
};
export const sharedPrivateLinkResourceName: OperationURLParameter = {
parameterPath: "sharedPrivateLinkResourceName",
mapper: {
serializedName: "sharedPrivateLinkResourceName",
required: true,
type: {
name: "String"
}

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

@ -1,16 +0,0 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
export {
QueryKey,
CloudError,
ListQueryKeysResult
} from "../models/mappers";

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

@ -1,22 +0,0 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
export {
SearchService,
Resource,
BaseResource,
Identity,
Sku,
CloudError,
SearchServiceListResult,
CheckNameAvailabilityInput,
CheckNameAvailabilityOutput
} from "../models/mappers";

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

@ -1,160 +1,84 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
* 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.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import * as msRest from "@azure/ms-rest-js";
import * as Models from "../models";
import * as Mappers from "../models/adminKeysMappers";
import { AdminKeys } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { SearchManagementClientContext } from "../searchManagementClientContext";
import { SearchManagementClient } from "../searchManagementClient";
import {
AdminKeysGetOptionalParams,
AdminKeysGetResponse,
AdminKeyKind,
AdminKeysRegenerateOptionalParams,
AdminKeysRegenerateResponse
} from "../models";
/** Class representing a AdminKeys. */
export class AdminKeys {
private readonly client: SearchManagementClientContext;
/** Class containing AdminKeys operations. */
export class AdminKeysImpl implements AdminKeys {
private readonly client: SearchManagementClient;
/**
* Create a AdminKeys.
* @param {SearchManagementClientContext} client Reference to the service client.
* Initialize a new instance of the class AdminKeys class.
* @param client Reference to the service client
*/
constructor(client: SearchManagementClientContext) {
constructor(client: SearchManagementClient) {
this.client = client;
}
/**
* Gets the primary and secondary admin API keys for the specified Azure Search service.
* Gets the primary and secondary admin API keys for the specified Azure Cognitive Search service.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Search service associated with the specified
* resource group.
* @param [options] The optional parameters
* @returns Promise<Models.AdminKeysGetResponse>
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param options The options parameters.
*/
get(resourceGroupName: string, searchServiceName: string, options?: Models.AdminKeysGetOptionalParams): Promise<Models.AdminKeysGetResponse>;
/**
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Search service associated with the specified
* resource group.
* @param callback The callback
*/
get(resourceGroupName: string, searchServiceName: string, callback: msRest.ServiceCallback<Models.AdminKeyResult>): void;
/**
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Search service associated with the specified
* resource group.
* @param options The optional parameters
* @param callback The callback
*/
get(resourceGroupName: string, searchServiceName: string, options: Models.AdminKeysGetOptionalParams, callback: msRest.ServiceCallback<Models.AdminKeyResult>): void;
get(resourceGroupName: string, searchServiceName: string, options?: Models.AdminKeysGetOptionalParams | msRest.ServiceCallback<Models.AdminKeyResult>, callback?: msRest.ServiceCallback<Models.AdminKeyResult>): Promise<Models.AdminKeysGetResponse> {
get(
resourceGroupName: string,
searchServiceName: string,
options?: AdminKeysGetOptionalParams
): Promise<AdminKeysGetResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
searchServiceName,
options
},
getOperationSpec,
callback) as Promise<Models.AdminKeysGetResponse>;
{ resourceGroupName, searchServiceName, options },
getOperationSpec
);
}
/**
* Regenerates either the primary or secondary admin API key. You can only regenerate one key at a
* time.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Search service associated with the specified
* resource group.
* @param keyKind Specifies which key to regenerate. Valid values include 'primary' and
* 'secondary'. Possible values include: 'primary', 'secondary'
* @param [options] The optional parameters
* @returns Promise<Models.AdminKeysRegenerateResponse>
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param keyKind Specifies which key to regenerate. Valid values include 'primary' and 'secondary'.
* @param options The options parameters.
*/
regenerate(resourceGroupName: string, searchServiceName: string, keyKind: Models.AdminKeyKind, options?: Models.AdminKeysRegenerateOptionalParams): Promise<Models.AdminKeysRegenerateResponse>;
/**
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Search service associated with the specified
* resource group.
* @param keyKind Specifies which key to regenerate. Valid values include 'primary' and
* 'secondary'. Possible values include: 'primary', 'secondary'
* @param callback The callback
*/
regenerate(resourceGroupName: string, searchServiceName: string, keyKind: Models.AdminKeyKind, callback: msRest.ServiceCallback<Models.AdminKeyResult>): void;
/**
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Search service associated with the specified
* resource group.
* @param keyKind Specifies which key to regenerate. Valid values include 'primary' and
* 'secondary'. Possible values include: 'primary', 'secondary'
* @param options The optional parameters
* @param callback The callback
*/
regenerate(resourceGroupName: string, searchServiceName: string, keyKind: Models.AdminKeyKind, options: Models.AdminKeysRegenerateOptionalParams, callback: msRest.ServiceCallback<Models.AdminKeyResult>): void;
regenerate(resourceGroupName: string, searchServiceName: string, keyKind: Models.AdminKeyKind, options?: Models.AdminKeysRegenerateOptionalParams | msRest.ServiceCallback<Models.AdminKeyResult>, callback?: msRest.ServiceCallback<Models.AdminKeyResult>): Promise<Models.AdminKeysRegenerateResponse> {
regenerate(
resourceGroupName: string,
searchServiceName: string,
keyKind: AdminKeyKind,
options?: AdminKeysRegenerateOptionalParams
): Promise<AdminKeysRegenerateResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
searchServiceName,
keyKind,
options
},
regenerateOperationSpec,
callback) as Promise<Models.AdminKeysRegenerateResponse>;
{ resourceGroupName, searchServiceName, keyKind, options },
regenerateOperationSpec
);
}
}
// Operation Specifications
const serializer = new msRest.Serializer(Mappers);
const getOperationSpec: msRest.OperationSpec = {
httpMethod: "POST",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/listAdminKeys",
urlParameters: [
Parameters.resourceGroupName,
Parameters.searchServiceName,
Parameters.subscriptionId
],
queryParameters: [
Parameters.apiVersion
],
headerParameters: [
Parameters.acceptLanguage,
Parameters.clientRequestId
],
responses: {
200: {
bodyMapper: Mappers.AdminKeyResult
},
default: {
bodyMapper: Mappers.CloudError
}
},
serializer
};
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const regenerateOperationSpec: msRest.OperationSpec = {
const getOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/listAdminKeys",
httpMethod: "POST",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/regenerateAdminKey/{keyKind}",
urlParameters: [
Parameters.resourceGroupName,
Parameters.searchServiceName,
Parameters.keyKind,
Parameters.subscriptionId
],
queryParameters: [
Parameters.apiVersion
],
headerParameters: [
Parameters.acceptLanguage,
Parameters.clientRequestId
],
responses: {
200: {
bodyMapper: Mappers.AdminKeyResult
@ -163,5 +87,36 @@ const regenerateOperationSpec: msRest.OperationSpec = {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.resourceGroupName,
Parameters.searchServiceName,
Parameters.subscriptionId
],
headerParameters: [Parameters.accept, Parameters.clientRequestId],
serializer
};
const regenerateOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/regenerateAdminKey/{keyKind}",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.AdminKeyResult
},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.resourceGroupName,
Parameters.searchServiceName,
Parameters.subscriptionId,
Parameters.keyKind
],
headerParameters: [Parameters.accept, Parameters.clientRequestId],
serializer
};

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

@ -1,14 +1,15 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
* 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.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
export * from "./operations";
export * from "./adminKeys";
export * from "./queryKeys";
export * from "./services";
export * from "./privateLinkResources";
export * from "./privateEndpointConnections";
export * from "./sharedPrivateLinkResources";

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

@ -1,67 +1,88 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
* 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.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import * as msRest from "@azure/ms-rest-js";
import * as Models from "../models";
import * as Mappers from "../models/operationsMappers";
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 { SearchManagementClientContext } from "../searchManagementClientContext";
import { SearchManagementClient } from "../searchManagementClient";
import {
Operation,
OperationsListOptionalParams,
OperationsListResponse
} from "../models";
/** Class representing a Operations. */
export class Operations {
private readonly client: SearchManagementClientContext;
/// <reference lib="esnext.asynciterable" />
/** Class containing Operations operations. */
export class OperationsImpl implements Operations {
private readonly client: SearchManagementClient;
/**
* Create a Operations.
* @param {SearchManagementClientContext} client Reference to the service client.
* Initialize a new instance of the class Operations class.
* @param client Reference to the service client
*/
constructor(client: SearchManagementClientContext) {
constructor(client: SearchManagementClient) {
this.client = client;
}
/**
* Lists all of the available REST API operations of the Microsoft.Search provider.
* @param [options] The optional parameters
* @returns Promise<Models.OperationsListResponse>
* @param options The options parameters.
*/
list(options?: msRest.RequestOptionsBase): Promise<Models.OperationsListResponse>;
/**
* @param callback The callback
*/
list(callback: msRest.ServiceCallback<Models.OperationListResult>): void;
/**
* @param options The optional parameters
* @param callback The callback
*/
list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.OperationListResult>): void;
list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.OperationListResult>, callback?: msRest.ServiceCallback<Models.OperationListResult>): Promise<Models.OperationsListResponse> {
return this.client.sendOperationRequest(
{
options
public list(
options?: OperationsListOptionalParams
): PagedAsyncIterableIterator<Operation> {
const iter = this.listPagingAll(options);
return {
next() {
return iter.next();
},
listOperationSpec,
callback) as Promise<Models.OperationsListResponse>;
[Symbol.asyncIterator]() {
return this;
},
byPage: () => {
return this.listPagingPage(options);
}
};
}
private async *listPagingPage(
options?: OperationsListOptionalParams
): AsyncIterableIterator<Operation[]> {
let result = await this._list(options);
yield result.value || [];
}
private async *listPagingAll(
options?: OperationsListOptionalParams
): AsyncIterableIterator<Operation> {
for await (const page of this.listPagingPage(options)) {
yield* page;
}
}
/**
* Lists all of the available REST API operations of the Microsoft.Search provider.
* @param options The options parameters.
*/
private _list(
options?: OperationsListOptionalParams
): Promise<OperationsListResponse> {
return this.client.sendOperationRequest({ options }, listOperationSpec);
}
}
// Operation Specifications
const serializer = new msRest.Serializer(Mappers);
const listOperationSpec: msRest.OperationSpec = {
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const listOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.Search/operations",
httpMethod: "GET",
path: "providers/Microsoft.Search/operations",
queryParameters: [
Parameters.apiVersion
],
headerParameters: [
Parameters.acceptLanguage
],
responses: {
200: {
bodyMapper: Mappers.OperationListResult
@ -70,5 +91,8 @@ const listOperationSpec: msRest.OperationSpec = {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [Parameters.$host],
headerParameters: [Parameters.accept],
serializer
};

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

@ -0,0 +1,363 @@
/*
* 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 { PrivateEndpointConnections } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { SearchManagementClient } from "../searchManagementClient";
import {
PrivateEndpointConnection,
PrivateEndpointConnectionsListByServiceNextOptionalParams,
PrivateEndpointConnectionsListByServiceOptionalParams,
PrivateEndpointConnectionsUpdateOptionalParams,
PrivateEndpointConnectionsUpdateResponse,
PrivateEndpointConnectionsGetOptionalParams,
PrivateEndpointConnectionsGetResponse,
PrivateEndpointConnectionsDeleteOptionalParams,
PrivateEndpointConnectionsDeleteResponse,
PrivateEndpointConnectionsListByServiceResponse,
PrivateEndpointConnectionsListByServiceNextResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Class containing PrivateEndpointConnections operations. */
export class PrivateEndpointConnectionsImpl
implements PrivateEndpointConnections {
private readonly client: SearchManagementClient;
/**
* Initialize a new instance of the class PrivateEndpointConnections class.
* @param client Reference to the service client
*/
constructor(client: SearchManagementClient) {
this.client = client;
}
/**
* Gets a list of all private endpoint connections in the given service.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param options The options parameters.
*/
public listByService(
resourceGroupName: string,
searchServiceName: string,
options?: PrivateEndpointConnectionsListByServiceOptionalParams
): PagedAsyncIterableIterator<PrivateEndpointConnection> {
const iter = this.listByServicePagingAll(
resourceGroupName,
searchServiceName,
options
);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: () => {
return this.listByServicePagingPage(
resourceGroupName,
searchServiceName,
options
);
}
};
}
private async *listByServicePagingPage(
resourceGroupName: string,
searchServiceName: string,
options?: PrivateEndpointConnectionsListByServiceOptionalParams
): AsyncIterableIterator<PrivateEndpointConnection[]> {
let result = await this._listByService(
resourceGroupName,
searchServiceName,
options
);
yield result.value || [];
let continuationToken = result.nextLink;
while (continuationToken) {
result = await this._listByServiceNext(
resourceGroupName,
searchServiceName,
continuationToken,
options
);
continuationToken = result.nextLink;
yield result.value || [];
}
}
private async *listByServicePagingAll(
resourceGroupName: string,
searchServiceName: string,
options?: PrivateEndpointConnectionsListByServiceOptionalParams
): AsyncIterableIterator<PrivateEndpointConnection> {
for await (const page of this.listByServicePagingPage(
resourceGroupName,
searchServiceName,
options
)) {
yield* page;
}
}
/**
* Updates a Private Endpoint connection to the search service in the given resource group.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param privateEndpointConnectionName The name of the private endpoint connection to the Azure
* Cognitive Search service with the specified resource group.
* @param privateEndpointConnection The definition of the private endpoint connection to update.
* @param options The options parameters.
*/
update(
resourceGroupName: string,
searchServiceName: string,
privateEndpointConnectionName: string,
privateEndpointConnection: PrivateEndpointConnection,
options?: PrivateEndpointConnectionsUpdateOptionalParams
): Promise<PrivateEndpointConnectionsUpdateResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
searchServiceName,
privateEndpointConnectionName,
privateEndpointConnection,
options
},
updateOperationSpec
);
}
/**
* Gets the details of the private endpoint connection to the search service in the given resource
* group.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param privateEndpointConnectionName The name of the private endpoint connection to the Azure
* Cognitive Search service with the specified resource group.
* @param options The options parameters.
*/
get(
resourceGroupName: string,
searchServiceName: string,
privateEndpointConnectionName: string,
options?: PrivateEndpointConnectionsGetOptionalParams
): Promise<PrivateEndpointConnectionsGetResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
searchServiceName,
privateEndpointConnectionName,
options
},
getOperationSpec
);
}
/**
* Disconnects the private endpoint connection and deletes it from the search service.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param privateEndpointConnectionName The name of the private endpoint connection to the Azure
* Cognitive Search service with the specified resource group.
* @param options The options parameters.
*/
delete(
resourceGroupName: string,
searchServiceName: string,
privateEndpointConnectionName: string,
options?: PrivateEndpointConnectionsDeleteOptionalParams
): Promise<PrivateEndpointConnectionsDeleteResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
searchServiceName,
privateEndpointConnectionName,
options
},
deleteOperationSpec
);
}
/**
* Gets a list of all private endpoint connections in the given service.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param options The options parameters.
*/
private _listByService(
resourceGroupName: string,
searchServiceName: string,
options?: PrivateEndpointConnectionsListByServiceOptionalParams
): Promise<PrivateEndpointConnectionsListByServiceResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, searchServiceName, options },
listByServiceOperationSpec
);
}
/**
* ListByServiceNext
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param nextLink The nextLink from the previous successful call to the ListByService method.
* @param options The options parameters.
*/
private _listByServiceNext(
resourceGroupName: string,
searchServiceName: string,
nextLink: string,
options?: PrivateEndpointConnectionsListByServiceNextOptionalParams
): Promise<PrivateEndpointConnectionsListByServiceNextResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, searchServiceName, nextLink, options },
listByServiceNextOperationSpec
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const updateOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateEndpointConnections/{privateEndpointConnectionName}",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.PrivateEndpointConnection
},
default: {
bodyMapper: Mappers.CloudError
}
},
requestBody: Parameters.privateEndpointConnection,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.resourceGroupName,
Parameters.searchServiceName,
Parameters.subscriptionId,
Parameters.privateEndpointConnectionName
],
headerParameters: [
Parameters.accept,
Parameters.clientRequestId,
Parameters.contentType
],
mediaType: "json",
serializer
};
const getOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateEndpointConnections/{privateEndpointConnectionName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.PrivateEndpointConnection
},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.resourceGroupName,
Parameters.searchServiceName,
Parameters.subscriptionId,
Parameters.privateEndpointConnectionName
],
headerParameters: [Parameters.accept, Parameters.clientRequestId],
serializer
};
const deleteOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateEndpointConnections/{privateEndpointConnectionName}",
httpMethod: "DELETE",
responses: {
200: {
bodyMapper: Mappers.PrivateEndpointConnection
},
404: {},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.resourceGroupName,
Parameters.searchServiceName,
Parameters.subscriptionId,
Parameters.privateEndpointConnectionName
],
headerParameters: [Parameters.accept, Parameters.clientRequestId],
serializer
};
const listByServiceOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateEndpointConnections",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.PrivateEndpointConnectionListResult
},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.resourceGroupName,
Parameters.searchServiceName,
Parameters.subscriptionId
],
headerParameters: [Parameters.accept, Parameters.clientRequestId],
serializer
};
const listByServiceNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.PrivateEndpointConnectionListResult
},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.resourceGroupName,
Parameters.searchServiceName,
Parameters.subscriptionId,
Parameters.nextLink
],
headerParameters: [Parameters.accept, Parameters.clientRequestId],
serializer
};

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

@ -0,0 +1,139 @@
/*
* 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 { PrivateLinkResources } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { SearchManagementClient } from "../searchManagementClient";
import {
PrivateLinkResource,
PrivateLinkResourcesListSupportedOptionalParams,
PrivateLinkResourcesListSupportedResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Class containing PrivateLinkResources operations. */
export class PrivateLinkResourcesImpl implements PrivateLinkResources {
private readonly client: SearchManagementClient;
/**
* Initialize a new instance of the class PrivateLinkResources class.
* @param client Reference to the service client
*/
constructor(client: SearchManagementClient) {
this.client = client;
}
/**
* Gets a list of all supported private link resource types for the given service.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param options The options parameters.
*/
public listSupported(
resourceGroupName: string,
searchServiceName: string,
options?: PrivateLinkResourcesListSupportedOptionalParams
): PagedAsyncIterableIterator<PrivateLinkResource> {
const iter = this.listSupportedPagingAll(
resourceGroupName,
searchServiceName,
options
);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: () => {
return this.listSupportedPagingPage(
resourceGroupName,
searchServiceName,
options
);
}
};
}
private async *listSupportedPagingPage(
resourceGroupName: string,
searchServiceName: string,
options?: PrivateLinkResourcesListSupportedOptionalParams
): AsyncIterableIterator<PrivateLinkResource[]> {
let result = await this._listSupported(
resourceGroupName,
searchServiceName,
options
);
yield result.value || [];
}
private async *listSupportedPagingAll(
resourceGroupName: string,
searchServiceName: string,
options?: PrivateLinkResourcesListSupportedOptionalParams
): AsyncIterableIterator<PrivateLinkResource> {
for await (const page of this.listSupportedPagingPage(
resourceGroupName,
searchServiceName,
options
)) {
yield* page;
}
}
/**
* Gets a list of all supported private link resource types for the given service.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param options The options parameters.
*/
private _listSupported(
resourceGroupName: string,
searchServiceName: string,
options?: PrivateLinkResourcesListSupportedOptionalParams
): Promise<PrivateLinkResourcesListSupportedResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, searchServiceName, options },
listSupportedOperationSpec
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const listSupportedOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateLinkResources",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.PrivateLinkResourcesResult
},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.resourceGroupName,
Parameters.searchServiceName,
Parameters.subscriptionId
],
headerParameters: [Parameters.accept, Parameters.clientRequestId],
serializer
};

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

@ -1,174 +1,205 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
* 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.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import * as msRest from "@azure/ms-rest-js";
import * as Models from "../models";
import * as Mappers from "../models/queryKeysMappers";
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import { QueryKeys } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { SearchManagementClientContext } from "../searchManagementClientContext";
import { SearchManagementClient } from "../searchManagementClient";
import {
QueryKey,
QueryKeysListBySearchServiceNextOptionalParams,
QueryKeysListBySearchServiceOptionalParams,
QueryKeysCreateOptionalParams,
QueryKeysCreateResponse,
QueryKeysListBySearchServiceResponse,
QueryKeysDeleteOptionalParams,
QueryKeysListBySearchServiceNextResponse
} from "../models";
/** Class representing a QueryKeys. */
export class QueryKeys {
private readonly client: SearchManagementClientContext;
/// <reference lib="esnext.asynciterable" />
/** Class containing QueryKeys operations. */
export class QueryKeysImpl implements QueryKeys {
private readonly client: SearchManagementClient;
/**
* Create a QueryKeys.
* @param {SearchManagementClientContext} client Reference to the service client.
* Initialize a new instance of the class QueryKeys class.
* @param client Reference to the service client
*/
constructor(client: SearchManagementClientContext) {
constructor(client: SearchManagementClient) {
this.client = client;
}
/**
* Generates a new query key for the specified Search service. You can create up to 50 query keys
* per service.
* Returns the list of query API keys for the given Azure Cognitive Search service.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Search service associated with the specified
* resource group.
* @param name The name of the new query API key.
* @param [options] The optional parameters
* @returns Promise<Models.QueryKeysCreateResponse>
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param options The options parameters.
*/
create(resourceGroupName: string, searchServiceName: string, name: string, options?: Models.QueryKeysCreateOptionalParams): Promise<Models.QueryKeysCreateResponse>;
/**
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Search service associated with the specified
* resource group.
* @param name The name of the new query API key.
* @param callback The callback
*/
create(resourceGroupName: string, searchServiceName: string, name: string, callback: msRest.ServiceCallback<Models.QueryKey>): void;
/**
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Search service associated with the specified
* resource group.
* @param name The name of the new query API key.
* @param options The optional parameters
* @param callback The callback
*/
create(resourceGroupName: string, searchServiceName: string, name: string, options: Models.QueryKeysCreateOptionalParams, callback: msRest.ServiceCallback<Models.QueryKey>): void;
create(resourceGroupName: string, searchServiceName: string, name: string, options?: Models.QueryKeysCreateOptionalParams | msRest.ServiceCallback<Models.QueryKey>, callback?: msRest.ServiceCallback<Models.QueryKey>): Promise<Models.QueryKeysCreateResponse> {
return this.client.sendOperationRequest(
{
public listBySearchService(
resourceGroupName: string,
searchServiceName: string,
options?: QueryKeysListBySearchServiceOptionalParams
): PagedAsyncIterableIterator<QueryKey> {
const iter = this.listBySearchServicePagingAll(
resourceGroupName,
searchServiceName,
options
);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: () => {
return this.listBySearchServicePagingPage(
resourceGroupName,
searchServiceName,
options
);
}
};
}
private async *listBySearchServicePagingPage(
resourceGroupName: string,
searchServiceName: string,
options?: QueryKeysListBySearchServiceOptionalParams
): AsyncIterableIterator<QueryKey[]> {
let result = await this._listBySearchService(
resourceGroupName,
searchServiceName,
options
);
yield result.value || [];
let continuationToken = result.nextLink;
while (continuationToken) {
result = await this._listBySearchServiceNext(
resourceGroupName,
searchServiceName,
name,
continuationToken,
options
},
createOperationSpec,
callback) as Promise<Models.QueryKeysCreateResponse>;
);
continuationToken = result.nextLink;
yield result.value || [];
}
}
private async *listBySearchServicePagingAll(
resourceGroupName: string,
searchServiceName: string,
options?: QueryKeysListBySearchServiceOptionalParams
): AsyncIterableIterator<QueryKey> {
for await (const page of this.listBySearchServicePagingPage(
resourceGroupName,
searchServiceName,
options
)) {
yield* page;
}
}
/**
* Returns the list of query API keys for the given Azure Search service.
* Generates a new query key for the specified search service. You can create up to 50 query keys per
* service.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Search service associated with the specified
* resource group.
* @param [options] The optional parameters
* @returns Promise<Models.QueryKeysListBySearchServiceResponse>
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param name The name of the new query API key.
* @param options The options parameters.
*/
listBySearchService(resourceGroupName: string, searchServiceName: string, options?: Models.QueryKeysListBySearchServiceOptionalParams): Promise<Models.QueryKeysListBySearchServiceResponse>;
/**
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Search service associated with the specified
* resource group.
* @param callback The callback
*/
listBySearchService(resourceGroupName: string, searchServiceName: string, callback: msRest.ServiceCallback<Models.ListQueryKeysResult>): void;
/**
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Search service associated with the specified
* resource group.
* @param options The optional parameters
* @param callback The callback
*/
listBySearchService(resourceGroupName: string, searchServiceName: string, options: Models.QueryKeysListBySearchServiceOptionalParams, callback: msRest.ServiceCallback<Models.ListQueryKeysResult>): void;
listBySearchService(resourceGroupName: string, searchServiceName: string, options?: Models.QueryKeysListBySearchServiceOptionalParams | msRest.ServiceCallback<Models.ListQueryKeysResult>, callback?: msRest.ServiceCallback<Models.ListQueryKeysResult>): Promise<Models.QueryKeysListBySearchServiceResponse> {
create(
resourceGroupName: string,
searchServiceName: string,
name: string,
options?: QueryKeysCreateOptionalParams
): Promise<QueryKeysCreateResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
searchServiceName,
options
},
listBySearchServiceOperationSpec,
callback) as Promise<Models.QueryKeysListBySearchServiceResponse>;
{ resourceGroupName, searchServiceName, name, options },
createOperationSpec
);
}
/**
* Deletes the specified query key. Unlike admin keys, query keys are not regenerated. The process
* for regenerating a query key is to delete and then recreate it.
* Returns the list of query API keys for the given Azure Cognitive Search service.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Search service associated with the specified
* resource group.
* @param key The query key to be deleted. Query keys are identified by value, not by name.
* @param [options] The optional parameters
* @returns Promise<msRest.RestResponse>
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param options The options parameters.
*/
deleteMethod(resourceGroupName: string, searchServiceName: string, key: string, options?: Models.QueryKeysDeleteMethodOptionalParams): Promise<msRest.RestResponse>;
/**
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Search service associated with the specified
* resource group.
* @param key The query key to be deleted. Query keys are identified by value, not by name.
* @param callback The callback
*/
deleteMethod(resourceGroupName: string, searchServiceName: string, key: string, callback: msRest.ServiceCallback<void>): void;
/**
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Search service associated with the specified
* resource group.
* @param key The query key to be deleted. Query keys are identified by value, not by name.
* @param options The optional parameters
* @param callback The callback
*/
deleteMethod(resourceGroupName: string, searchServiceName: string, key: string, options: Models.QueryKeysDeleteMethodOptionalParams, callback: msRest.ServiceCallback<void>): void;
deleteMethod(resourceGroupName: string, searchServiceName: string, key: string, options?: Models.QueryKeysDeleteMethodOptionalParams | msRest.ServiceCallback<void>, callback?: msRest.ServiceCallback<void>): Promise<msRest.RestResponse> {
private _listBySearchService(
resourceGroupName: string,
searchServiceName: string,
options?: QueryKeysListBySearchServiceOptionalParams
): Promise<QueryKeysListBySearchServiceResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
searchServiceName,
key,
options
},
deleteMethodOperationSpec,
callback);
{ resourceGroupName, searchServiceName, options },
listBySearchServiceOperationSpec
);
}
/**
* Deletes the specified query key. Unlike admin keys, query keys are not regenerated. The process for
* regenerating a query key is to delete and then recreate it.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param key The query key to be deleted. Query keys are identified by value, not by name.
* @param options The options parameters.
*/
delete(
resourceGroupName: string,
searchServiceName: string,
key: string,
options?: QueryKeysDeleteOptionalParams
): Promise<void> {
return this.client.sendOperationRequest(
{ resourceGroupName, searchServiceName, key, options },
deleteOperationSpec
);
}
/**
* ListBySearchServiceNext
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param nextLink The nextLink from the previous successful call to the ListBySearchService method.
* @param options The options parameters.
*/
private _listBySearchServiceNext(
resourceGroupName: string,
searchServiceName: string,
nextLink: string,
options?: QueryKeysListBySearchServiceNextOptionalParams
): Promise<QueryKeysListBySearchServiceNextResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, searchServiceName, nextLink, options },
listBySearchServiceNextOperationSpec
);
}
}
// Operation Specifications
const serializer = new msRest.Serializer(Mappers);
const createOperationSpec: msRest.OperationSpec = {
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const createOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/createQueryKey/{name}",
httpMethod: "POST",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/createQueryKey/{name}",
urlParameters: [
Parameters.resourceGroupName,
Parameters.searchServiceName,
Parameters.name,
Parameters.subscriptionId
],
queryParameters: [
Parameters.apiVersion
],
headerParameters: [
Parameters.acceptLanguage,
Parameters.clientRequestId
],
responses: {
200: {
bodyMapper: Mappers.QueryKey
@ -177,24 +208,21 @@ const createOperationSpec: msRest.OperationSpec = {
bodyMapper: Mappers.CloudError
}
},
serializer
};
const listBySearchServiceOperationSpec: msRest.OperationSpec = {
httpMethod: "GET",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/listQueryKeys",
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.resourceGroupName,
Parameters.searchServiceName,
Parameters.subscriptionId
],
queryParameters: [
Parameters.apiVersion
],
headerParameters: [
Parameters.acceptLanguage,
Parameters.clientRequestId
Parameters.subscriptionId,
Parameters.name
],
headerParameters: [Parameters.accept, Parameters.clientRequestId],
serializer
};
const listBySearchServiceOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/listQueryKeys",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.ListQueryKeysResult
@ -203,25 +231,20 @@ const listBySearchServiceOperationSpec: msRest.OperationSpec = {
bodyMapper: Mappers.CloudError
}
},
serializer
};
const deleteMethodOperationSpec: msRest.OperationSpec = {
httpMethod: "DELETE",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/deleteQueryKey/{key}",
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.resourceGroupName,
Parameters.searchServiceName,
Parameters.key,
Parameters.subscriptionId
],
queryParameters: [
Parameters.apiVersion
],
headerParameters: [
Parameters.acceptLanguage,
Parameters.clientRequestId
],
headerParameters: [Parameters.accept, Parameters.clientRequestId],
serializer
};
const deleteOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/deleteQueryKey/{key}",
httpMethod: "DELETE",
responses: {
200: {},
204: {},
@ -230,5 +253,36 @@ const deleteMethodOperationSpec: msRest.OperationSpec = {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.resourceGroupName,
Parameters.searchServiceName,
Parameters.subscriptionId,
Parameters.key
],
headerParameters: [Parameters.accept, Parameters.clientRequestId],
serializer
};
const listBySearchServiceNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.ListQueryKeysResult
},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.resourceGroupName,
Parameters.searchServiceName,
Parameters.subscriptionId,
Parameters.nextLink
],
headerParameters: [Parameters.accept, Parameters.clientRequestId],
serializer
};

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

@ -1,286 +1,436 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
* 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.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import * as msRest from "@azure/ms-rest-js";
import * as msRestAzure from "@azure/ms-rest-azure-js";
import * as Models from "../models";
import * as Mappers from "../models/servicesMappers";
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import { Services } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { SearchManagementClientContext } from "../searchManagementClientContext";
import { SearchManagementClient } from "../searchManagementClient";
import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
import { LroImpl } from "../lroImpl";
import {
SearchService,
ServicesListByResourceGroupNextOptionalParams,
ServicesListByResourceGroupOptionalParams,
ServicesListBySubscriptionNextOptionalParams,
ServicesListBySubscriptionOptionalParams,
ServicesCreateOrUpdateOptionalParams,
ServicesCreateOrUpdateResponse,
SearchServiceUpdate,
ServicesUpdateOptionalParams,
ServicesUpdateResponse,
ServicesGetOptionalParams,
ServicesGetResponse,
ServicesDeleteOptionalParams,
ServicesListByResourceGroupResponse,
ServicesListBySubscriptionResponse,
ServicesCheckNameAvailabilityOptionalParams,
ServicesCheckNameAvailabilityResponse,
ServicesListByResourceGroupNextResponse,
ServicesListBySubscriptionNextResponse
} from "../models";
/** Class representing a Services. */
export class Services {
private readonly client: SearchManagementClientContext;
/// <reference lib="esnext.asynciterable" />
/** Class containing Services operations. */
export class ServicesImpl implements Services {
private readonly client: SearchManagementClient;
/**
* Create a Services.
* @param {SearchManagementClientContext} client Reference to the service client.
* Initialize a new instance of the class Services class.
* @param client Reference to the service client
*/
constructor(client: SearchManagementClientContext) {
constructor(client: SearchManagementClient) {
this.client = client;
}
/**
* Creates or updates a Search service in the given resource group. If the Search service already
* Gets a list of all search services in the given resource group.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param options The options parameters.
*/
public listByResourceGroup(
resourceGroupName: string,
options?: ServicesListByResourceGroupOptionalParams
): PagedAsyncIterableIterator<SearchService> {
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?: ServicesListByResourceGroupOptionalParams
): AsyncIterableIterator<SearchService[]> {
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?: ServicesListByResourceGroupOptionalParams
): AsyncIterableIterator<SearchService> {
for await (const page of this.listByResourceGroupPagingPage(
resourceGroupName,
options
)) {
yield* page;
}
}
/**
* Gets a list of all search services in the given subscription.
* @param options The options parameters.
*/
public listBySubscription(
options?: ServicesListBySubscriptionOptionalParams
): PagedAsyncIterableIterator<SearchService> {
const iter = this.listBySubscriptionPagingAll(options);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: () => {
return this.listBySubscriptionPagingPage(options);
}
};
}
private async *listBySubscriptionPagingPage(
options?: ServicesListBySubscriptionOptionalParams
): AsyncIterableIterator<SearchService[]> {
let result = await this._listBySubscription(options);
yield result.value || [];
let continuationToken = result.nextLink;
while (continuationToken) {
result = await this._listBySubscriptionNext(continuationToken, options);
continuationToken = result.nextLink;
yield result.value || [];
}
}
private async *listBySubscriptionPagingAll(
options?: ServicesListBySubscriptionOptionalParams
): AsyncIterableIterator<SearchService> {
for await (const page of this.listBySubscriptionPagingPage(options)) {
yield* page;
}
}
/**
* Creates or updates a search service in the given resource group. If the search service already
* exists, all properties will be updated with the given values.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Search service to create or update. Search
* service names must only contain lowercase letters, digits or dashes, cannot use dash as the
* first two or last one characters, cannot contain consecutive dashes, and must be between 2 and
* 60 characters in length. Search service names must be globally unique since they are part of the
* service URI (https://<name>.search.windows.net). You cannot change the service name after the
* service is created.
* @param service The definition of the Search service to create or update.
* @param [options] The optional parameters
* @returns Promise<Models.ServicesCreateOrUpdateResponse>
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service to create or update. Search
* service names must only contain lowercase letters, digits or dashes, cannot use dash as the first
* two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60
* characters in length. Search service names must be globally unique since they are part of the
* service URI (https://<name>.search.windows.net). You cannot change the service name after the
* service is created.
* @param service The definition of the search service to create or update.
* @param options The options parameters.
*/
createOrUpdate(resourceGroupName: string, searchServiceName: string, service: Models.SearchService, options?: Models.ServicesCreateOrUpdateOptionalParams): Promise<Models.ServicesCreateOrUpdateResponse> {
return this.beginCreateOrUpdate(resourceGroupName,searchServiceName,service,options)
.then(lroPoller => lroPoller.pollUntilFinished()) as Promise<Models.ServicesCreateOrUpdateResponse>;
async beginCreateOrUpdate(
resourceGroupName: string,
searchServiceName: string,
service: SearchService,
options?: ServicesCreateOrUpdateOptionalParams
): Promise<
PollerLike<
PollOperationState<ServicesCreateOrUpdateResponse>,
ServicesCreateOrUpdateResponse
>
> {
const directSendOperation = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec
): Promise<ServicesCreateOrUpdateResponse> => {
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, searchServiceName, service, options },
createOrUpdateOperationSpec
);
return new LroEngine(lro, {
resumeFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs
});
}
/**
* Updates an existing Search service in the given resource group.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Search service to update.
* @param service The definition of the Search service to update.
* @param [options] The optional parameters
* @returns Promise<Models.ServicesUpdateResponse>
*/
update(resourceGroupName: string, searchServiceName: string, service: Models.SearchService, options?: Models.ServicesUpdateOptionalParams): Promise<Models.ServicesUpdateResponse>;
/**
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Search service to update.
* @param service The definition of the Search service to update.
* @param callback The callback
*/
update(resourceGroupName: string, searchServiceName: string, service: Models.SearchService, callback: msRest.ServiceCallback<Models.SearchService>): void;
/**
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Search service to update.
* @param service The definition of the Search service to update.
* @param options The optional parameters
* @param callback The callback
*/
update(resourceGroupName: string, searchServiceName: string, service: Models.SearchService, options: Models.ServicesUpdateOptionalParams, callback: msRest.ServiceCallback<Models.SearchService>): void;
update(resourceGroupName: string, searchServiceName: string, service: Models.SearchService, options?: Models.ServicesUpdateOptionalParams | msRest.ServiceCallback<Models.SearchService>, callback?: msRest.ServiceCallback<Models.SearchService>): Promise<Models.ServicesUpdateResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
searchServiceName,
service,
options
},
updateOperationSpec,
callback) as Promise<Models.ServicesUpdateResponse>;
}
/**
* Gets the Search service with the given name in the given resource group.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Search service associated with the specified
* resource group.
* @param [options] The optional parameters
* @returns Promise<Models.ServicesGetResponse>
*/
get(resourceGroupName: string, searchServiceName: string, options?: Models.ServicesGetOptionalParams): Promise<Models.ServicesGetResponse>;
/**
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Search service associated with the specified
* resource group.
* @param callback The callback
*/
get(resourceGroupName: string, searchServiceName: string, callback: msRest.ServiceCallback<Models.SearchService>): void;
/**
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Search service associated with the specified
* resource group.
* @param options The optional parameters
* @param callback The callback
*/
get(resourceGroupName: string, searchServiceName: string, options: Models.ServicesGetOptionalParams, callback: msRest.ServiceCallback<Models.SearchService>): void;
get(resourceGroupName: string, searchServiceName: string, options?: Models.ServicesGetOptionalParams | msRest.ServiceCallback<Models.SearchService>, callback?: msRest.ServiceCallback<Models.SearchService>): Promise<Models.ServicesGetResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
searchServiceName,
options
},
getOperationSpec,
callback) as Promise<Models.ServicesGetResponse>;
}
/**
* Deletes a Search service in the given resource group, along with its associated resources.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Search service associated with the specified
* resource group.
* @param [options] The optional parameters
* @returns Promise<msRest.RestResponse>
*/
deleteMethod(resourceGroupName: string, searchServiceName: string, options?: Models.ServicesDeleteMethodOptionalParams): Promise<msRest.RestResponse>;
/**
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Search service associated with the specified
* resource group.
* @param callback The callback
*/
deleteMethod(resourceGroupName: string, searchServiceName: string, callback: msRest.ServiceCallback<void>): void;
/**
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Search service associated with the specified
* resource group.
* @param options The optional parameters
* @param callback The callback
*/
deleteMethod(resourceGroupName: string, searchServiceName: string, options: Models.ServicesDeleteMethodOptionalParams, callback: msRest.ServiceCallback<void>): void;
deleteMethod(resourceGroupName: string, searchServiceName: string, options?: Models.ServicesDeleteMethodOptionalParams | msRest.ServiceCallback<void>, callback?: msRest.ServiceCallback<void>): Promise<msRest.RestResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
searchServiceName,
options
},
deleteMethodOperationSpec,
callback);
}
/**
* Gets a list of all Search services in the given resource group.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param [options] The optional parameters
* @returns Promise<Models.ServicesListByResourceGroupResponse>
*/
listByResourceGroup(resourceGroupName: string, options?: Models.ServicesListByResourceGroupOptionalParams): Promise<Models.ServicesListByResourceGroupResponse>;
/**
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param callback The callback
*/
listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback<Models.SearchServiceListResult>): void;
/**
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param options The optional parameters
* @param callback The callback
*/
listByResourceGroup(resourceGroupName: string, options: Models.ServicesListByResourceGroupOptionalParams, callback: msRest.ServiceCallback<Models.SearchServiceListResult>): void;
listByResourceGroup(resourceGroupName: string, options?: Models.ServicesListByResourceGroupOptionalParams | msRest.ServiceCallback<Models.SearchServiceListResult>, callback?: msRest.ServiceCallback<Models.SearchServiceListResult>): Promise<Models.ServicesListByResourceGroupResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
options
},
listByResourceGroupOperationSpec,
callback) as Promise<Models.ServicesListByResourceGroupResponse>;
}
/**
* Checks whether or not the given Search service name is available for use. Search service names
* must be globally unique since they are part of the service URI
* (https://<name>.search.windows.net).
* @param name The Search service name to validate. Search service names must only contain
* lowercase letters, digits or dashes, cannot use dash as the first two or last one characters,
* cannot contain consecutive dashes, and must be between 2 and 60 characters in length.
* @param [options] The optional parameters
* @returns Promise<Models.ServicesCheckNameAvailabilityResponse>
*/
checkNameAvailability(name: string, options?: Models.ServicesCheckNameAvailabilityOptionalParams): Promise<Models.ServicesCheckNameAvailabilityResponse>;
/**
* @param name The Search service name to validate. Search service names must only contain
* lowercase letters, digits or dashes, cannot use dash as the first two or last one characters,
* cannot contain consecutive dashes, and must be between 2 and 60 characters in length.
* @param callback The callback
*/
checkNameAvailability(name: string, callback: msRest.ServiceCallback<Models.CheckNameAvailabilityOutput>): void;
/**
* @param name The Search service name to validate. Search service names must only contain
* lowercase letters, digits or dashes, cannot use dash as the first two or last one characters,
* cannot contain consecutive dashes, and must be between 2 and 60 characters in length.
* @param options The optional parameters
* @param callback The callback
*/
checkNameAvailability(name: string, options: Models.ServicesCheckNameAvailabilityOptionalParams, callback: msRest.ServiceCallback<Models.CheckNameAvailabilityOutput>): void;
checkNameAvailability(name: string, options?: Models.ServicesCheckNameAvailabilityOptionalParams | msRest.ServiceCallback<Models.CheckNameAvailabilityOutput>, callback?: msRest.ServiceCallback<Models.CheckNameAvailabilityOutput>): Promise<Models.ServicesCheckNameAvailabilityResponse> {
return this.client.sendOperationRequest(
{
name,
options
},
checkNameAvailabilityOperationSpec,
callback) as Promise<Models.ServicesCheckNameAvailabilityResponse>;
}
/**
* Creates or updates a Search service in the given resource group. If the Search service already
* Creates or updates a search service in the given resource group. If the search service already
* exists, all properties will be updated with the given values.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Search service to create or update. Search
* service names must only contain lowercase letters, digits or dashes, cannot use dash as the
* first two or last one characters, cannot contain consecutive dashes, and must be between 2 and
* 60 characters in length. Search service names must be globally unique since they are part of the
* service URI (https://<name>.search.windows.net). You cannot change the service name after the
* service is created.
* @param service The definition of the Search service to create or update.
* @param [options] The optional parameters
* @returns Promise<msRestAzure.LROPoller>
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service to create or update. Search
* service names must only contain lowercase letters, digits or dashes, cannot use dash as the first
* two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60
* characters in length. Search service names must be globally unique since they are part of the
* service URI (https://<name>.search.windows.net). You cannot change the service name after the
* service is created.
* @param service The definition of the search service to create or update.
* @param options The options parameters.
*/
beginCreateOrUpdate(resourceGroupName: string, searchServiceName: string, service: Models.SearchService, options?: Models.ServicesBeginCreateOrUpdateOptionalParams): Promise<msRestAzure.LROPoller> {
return this.client.sendLRORequest(
{
resourceGroupName,
searchServiceName,
service,
options
},
beginCreateOrUpdateOperationSpec,
options);
async beginCreateOrUpdateAndWait(
resourceGroupName: string,
searchServiceName: string,
service: SearchService,
options?: ServicesCreateOrUpdateOptionalParams
): Promise<ServicesCreateOrUpdateResponse> {
const poller = await this.beginCreateOrUpdate(
resourceGroupName,
searchServiceName,
service,
options
);
return poller.pollUntilDone();
}
/**
* Updates an existing search service in the given resource group.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service to update.
* @param service The definition of the search service to update.
* @param options The options parameters.
*/
update(
resourceGroupName: string,
searchServiceName: string,
service: SearchServiceUpdate,
options?: ServicesUpdateOptionalParams
): Promise<ServicesUpdateResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, searchServiceName, service, options },
updateOperationSpec
);
}
/**
* Gets the search service with the given name in the given resource group.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param options The options parameters.
*/
get(
resourceGroupName: string,
searchServiceName: string,
options?: ServicesGetOptionalParams
): Promise<ServicesGetResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, searchServiceName, options },
getOperationSpec
);
}
/**
* Deletes a search service in the given resource group, along with its associated resources.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param options The options parameters.
*/
delete(
resourceGroupName: string,
searchServiceName: string,
options?: ServicesDeleteOptionalParams
): Promise<void> {
return this.client.sendOperationRequest(
{ resourceGroupName, searchServiceName, options },
deleteOperationSpec
);
}
/**
* Gets a list of all search services in the given resource group.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param options The options parameters.
*/
private _listByResourceGroup(
resourceGroupName: string,
options?: ServicesListByResourceGroupOptionalParams
): Promise<ServicesListByResourceGroupResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, options },
listByResourceGroupOperationSpec
);
}
/**
* Gets a list of all search services in the given subscription.
* @param options The options parameters.
*/
private _listBySubscription(
options?: ServicesListBySubscriptionOptionalParams
): Promise<ServicesListBySubscriptionResponse> {
return this.client.sendOperationRequest(
{ options },
listBySubscriptionOperationSpec
);
}
/**
* Checks whether or not the given search service name is available for use. Search service names must
* be globally unique since they are part of the service URI (https://<name>.search.windows.net).
* @param name The search service name to validate. Search service names must only contain lowercase
* letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain
* consecutive dashes, and must be between 2 and 60 characters in length.
* @param options The options parameters.
*/
checkNameAvailability(
name: string,
options?: ServicesCheckNameAvailabilityOptionalParams
): Promise<ServicesCheckNameAvailabilityResponse> {
return this.client.sendOperationRequest(
{ name, options },
checkNameAvailabilityOperationSpec
);
}
/**
* ListByResourceGroupNext
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @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?: ServicesListByResourceGroupNextOptionalParams
): Promise<ServicesListByResourceGroupNextResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, nextLink, options },
listByResourceGroupNextOperationSpec
);
}
/**
* ListBySubscriptionNext
* @param nextLink The nextLink from the previous successful call to the ListBySubscription method.
* @param options The options parameters.
*/
private _listBySubscriptionNext(
nextLink: string,
options?: ServicesListBySubscriptionNextOptionalParams
): Promise<ServicesListBySubscriptionNextResponse> {
return this.client.sendOperationRequest(
{ nextLink, options },
listBySubscriptionNextOperationSpec
);
}
}
// Operation Specifications
const serializer = new msRest.Serializer(Mappers);
const updateOperationSpec: msRest.OperationSpec = {
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const createOrUpdateOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.SearchService
},
201: {
bodyMapper: Mappers.SearchService
},
202: {
bodyMapper: Mappers.SearchService
},
204: {
bodyMapper: Mappers.SearchService
},
default: {
bodyMapper: Mappers.CloudError
}
},
requestBody: Parameters.service,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.resourceGroupName,
Parameters.searchServiceName,
Parameters.subscriptionId
],
headerParameters: [
Parameters.accept,
Parameters.clientRequestId,
Parameters.contentType
],
mediaType: "json",
serializer
};
const updateOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}",
httpMethod: "PATCH",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}",
urlParameters: [
Parameters.resourceGroupName,
Parameters.searchServiceName,
Parameters.subscriptionId
],
queryParameters: [
Parameters.apiVersion
],
headerParameters: [
Parameters.acceptLanguage,
Parameters.clientRequestId
],
requestBody: {
parameterPath: "service",
mapper: {
...Mappers.SearchService,
required: true
}
},
responses: {
200: {
bodyMapper: Mappers.SearchService
@ -289,24 +439,26 @@ const updateOperationSpec: msRest.OperationSpec = {
bodyMapper: Mappers.CloudError
}
},
requestBody: Parameters.service1,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.resourceGroupName,
Parameters.searchServiceName,
Parameters.subscriptionId
],
headerParameters: [
Parameters.accept,
Parameters.clientRequestId,
Parameters.contentType
],
mediaType: "json",
serializer
};
const getOperationSpec: msRest.OperationSpec = {
const getOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}",
httpMethod: "GET",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}",
urlParameters: [
Parameters.resourceGroupName,
Parameters.searchServiceName,
Parameters.subscriptionId
],
queryParameters: [
Parameters.apiVersion
],
headerParameters: [
Parameters.acceptLanguage,
Parameters.clientRequestId
],
responses: {
200: {
bodyMapper: Mappers.SearchService
@ -315,24 +467,20 @@ const getOperationSpec: msRest.OperationSpec = {
bodyMapper: Mappers.CloudError
}
},
serializer
};
const deleteMethodOperationSpec: msRest.OperationSpec = {
httpMethod: "DELETE",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}",
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.resourceGroupName,
Parameters.searchServiceName,
Parameters.subscriptionId
],
queryParameters: [
Parameters.apiVersion
],
headerParameters: [
Parameters.acceptLanguage,
Parameters.clientRequestId
],
headerParameters: [Parameters.accept, Parameters.clientRequestId],
serializer
};
const deleteOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}",
httpMethod: "DELETE",
responses: {
200: {},
204: {},
@ -341,23 +489,20 @@ const deleteMethodOperationSpec: msRest.OperationSpec = {
bodyMapper: Mappers.CloudError
}
},
serializer
};
const listByResourceGroupOperationSpec: msRest.OperationSpec = {
httpMethod: "GET",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices",
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.resourceGroupName,
Parameters.searchServiceName,
Parameters.subscriptionId
],
queryParameters: [
Parameters.apiVersion
],
headerParameters: [
Parameters.acceptLanguage,
Parameters.clientRequestId
],
headerParameters: [Parameters.accept, Parameters.clientRequestId],
serializer
};
const listByResourceGroupOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.SearchServiceListResult
@ -366,31 +511,36 @@ const listByResourceGroupOperationSpec: msRest.OperationSpec = {
bodyMapper: Mappers.CloudError
}
},
serializer
};
const checkNameAvailabilityOperationSpec: msRest.OperationSpec = {
httpMethod: "POST",
path: "subscriptions/{subscriptionId}/providers/Microsoft.Search/checkNameAvailability",
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.resourceGroupName,
Parameters.subscriptionId
],
queryParameters: [
Parameters.apiVersion
],
headerParameters: [
Parameters.acceptLanguage,
Parameters.clientRequestId
],
requestBody: {
parameterPath: {
name: "name"
headerParameters: [Parameters.accept, Parameters.clientRequestId],
serializer
};
const listBySubscriptionOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/providers/Microsoft.Search/searchServices",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.SearchServiceListResult
},
mapper: {
...Mappers.CheckNameAvailabilityInput,
required: true
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [Parameters.$host, Parameters.subscriptionId],
headerParameters: [Parameters.accept, Parameters.clientRequestId],
serializer
};
const checkNameAvailabilityOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/providers/Microsoft.Search/checkNameAvailability",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.CheckNameAvailabilityOutput
@ -399,41 +549,58 @@ const checkNameAvailabilityOperationSpec: msRest.OperationSpec = {
bodyMapper: Mappers.CloudError
}
},
requestBody: {
parameterPath: { name: ["name"], typeParam: ["typeParam"] },
mapper: { ...Mappers.CheckNameAvailabilityInput, required: true }
},
queryParameters: [Parameters.apiVersion],
urlParameters: [Parameters.$host, Parameters.subscriptionId],
headerParameters: [
Parameters.accept,
Parameters.clientRequestId,
Parameters.contentType
],
mediaType: "json",
serializer
};
const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = {
httpMethod: "PUT",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}",
urlParameters: [
Parameters.resourceGroupName,
Parameters.searchServiceName,
Parameters.subscriptionId
],
queryParameters: [
Parameters.apiVersion
],
headerParameters: [
Parameters.acceptLanguage,
Parameters.clientRequestId
],
requestBody: {
parameterPath: "service",
mapper: {
...Mappers.SearchService,
required: true
}
},
const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.SearchService
},
201: {
bodyMapper: Mappers.SearchService
bodyMapper: Mappers.SearchServiceListResult
},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.resourceGroupName,
Parameters.subscriptionId,
Parameters.nextLink
],
headerParameters: [Parameters.accept, Parameters.clientRequestId],
serializer
};
const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.SearchServiceListResult
},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.nextLink
],
headerParameters: [Parameters.accept, Parameters.clientRequestId],
serializer
};

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

@ -0,0 +1,525 @@
/*
* 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 { SharedPrivateLinkResources } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { SearchManagementClient } from "../searchManagementClient";
import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
import { LroImpl } from "../lroImpl";
import {
SharedPrivateLinkResource,
SharedPrivateLinkResourcesListByServiceNextOptionalParams,
SharedPrivateLinkResourcesListByServiceOptionalParams,
SharedPrivateLinkResourcesCreateOrUpdateOptionalParams,
SharedPrivateLinkResourcesCreateOrUpdateResponse,
SharedPrivateLinkResourcesGetOptionalParams,
SharedPrivateLinkResourcesGetResponse,
SharedPrivateLinkResourcesDeleteOptionalParams,
SharedPrivateLinkResourcesListByServiceResponse,
SharedPrivateLinkResourcesListByServiceNextResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Class containing SharedPrivateLinkResources operations. */
export class SharedPrivateLinkResourcesImpl
implements SharedPrivateLinkResources {
private readonly client: SearchManagementClient;
/**
* Initialize a new instance of the class SharedPrivateLinkResources class.
* @param client Reference to the service client
*/
constructor(client: SearchManagementClient) {
this.client = client;
}
/**
* Gets a list of all shared private link resources managed by the given service.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param options The options parameters.
*/
public listByService(
resourceGroupName: string,
searchServiceName: string,
options?: SharedPrivateLinkResourcesListByServiceOptionalParams
): PagedAsyncIterableIterator<SharedPrivateLinkResource> {
const iter = this.listByServicePagingAll(
resourceGroupName,
searchServiceName,
options
);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: () => {
return this.listByServicePagingPage(
resourceGroupName,
searchServiceName,
options
);
}
};
}
private async *listByServicePagingPage(
resourceGroupName: string,
searchServiceName: string,
options?: SharedPrivateLinkResourcesListByServiceOptionalParams
): AsyncIterableIterator<SharedPrivateLinkResource[]> {
let result = await this._listByService(
resourceGroupName,
searchServiceName,
options
);
yield result.value || [];
let continuationToken = result.nextLink;
while (continuationToken) {
result = await this._listByServiceNext(
resourceGroupName,
searchServiceName,
continuationToken,
options
);
continuationToken = result.nextLink;
yield result.value || [];
}
}
private async *listByServicePagingAll(
resourceGroupName: string,
searchServiceName: string,
options?: SharedPrivateLinkResourcesListByServiceOptionalParams
): AsyncIterableIterator<SharedPrivateLinkResource> {
for await (const page of this.listByServicePagingPage(
resourceGroupName,
searchServiceName,
options
)) {
yield* page;
}
}
/**
* Initiates the creation or update of a shared private link resource managed by the search service in
* the given resource group.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the
* Azure Cognitive Search service within the specified resource group.
* @param sharedPrivateLinkResource The definition of the shared private link resource to create or
* update.
* @param options The options parameters.
*/
async beginCreateOrUpdate(
resourceGroupName: string,
searchServiceName: string,
sharedPrivateLinkResourceName: string,
sharedPrivateLinkResource: SharedPrivateLinkResource,
options?: SharedPrivateLinkResourcesCreateOrUpdateOptionalParams
): Promise<
PollerLike<
PollOperationState<SharedPrivateLinkResourcesCreateOrUpdateResponse>,
SharedPrivateLinkResourcesCreateOrUpdateResponse
>
> {
const directSendOperation = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec
): Promise<SharedPrivateLinkResourcesCreateOrUpdateResponse> => {
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,
searchServiceName,
sharedPrivateLinkResourceName,
sharedPrivateLinkResource,
options
},
createOrUpdateOperationSpec
);
return new LroEngine(lro, {
resumeFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs,
lroResourceLocationConfig: "azure-async-operation"
});
}
/**
* Initiates the creation or update of a shared private link resource managed by the search service in
* the given resource group.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the
* Azure Cognitive Search service within the specified resource group.
* @param sharedPrivateLinkResource The definition of the shared private link resource to create or
* update.
* @param options The options parameters.
*/
async beginCreateOrUpdateAndWait(
resourceGroupName: string,
searchServiceName: string,
sharedPrivateLinkResourceName: string,
sharedPrivateLinkResource: SharedPrivateLinkResource,
options?: SharedPrivateLinkResourcesCreateOrUpdateOptionalParams
): Promise<SharedPrivateLinkResourcesCreateOrUpdateResponse> {
const poller = await this.beginCreateOrUpdate(
resourceGroupName,
searchServiceName,
sharedPrivateLinkResourceName,
sharedPrivateLinkResource,
options
);
return poller.pollUntilDone();
}
/**
* Gets the details of the shared private link resource managed by the search service in the given
* resource group.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the
* Azure Cognitive Search service within the specified resource group.
* @param options The options parameters.
*/
get(
resourceGroupName: string,
searchServiceName: string,
sharedPrivateLinkResourceName: string,
options?: SharedPrivateLinkResourcesGetOptionalParams
): Promise<SharedPrivateLinkResourcesGetResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
searchServiceName,
sharedPrivateLinkResourceName,
options
},
getOperationSpec
);
}
/**
* Initiates the deletion of the shared private link resource from the search service.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the
* Azure Cognitive Search service within the specified resource group.
* @param options The options parameters.
*/
async beginDelete(
resourceGroupName: string,
searchServiceName: string,
sharedPrivateLinkResourceName: string,
options?: SharedPrivateLinkResourcesDeleteOptionalParams
): 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,
searchServiceName,
sharedPrivateLinkResourceName,
options
},
deleteOperationSpec
);
return new LroEngine(lro, {
resumeFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs,
lroResourceLocationConfig: "azure-async-operation"
});
}
/**
* Initiates the deletion of the shared private link resource from the search service.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the
* Azure Cognitive Search service within the specified resource group.
* @param options The options parameters.
*/
async beginDeleteAndWait(
resourceGroupName: string,
searchServiceName: string,
sharedPrivateLinkResourceName: string,
options?: SharedPrivateLinkResourcesDeleteOptionalParams
): Promise<void> {
const poller = await this.beginDelete(
resourceGroupName,
searchServiceName,
sharedPrivateLinkResourceName,
options
);
return poller.pollUntilDone();
}
/**
* Gets a list of all shared private link resources managed by the given service.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param options The options parameters.
*/
private _listByService(
resourceGroupName: string,
searchServiceName: string,
options?: SharedPrivateLinkResourcesListByServiceOptionalParams
): Promise<SharedPrivateLinkResourcesListByServiceResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, searchServiceName, options },
listByServiceOperationSpec
);
}
/**
* ListByServiceNext
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param nextLink The nextLink from the previous successful call to the ListByService method.
* @param options The options parameters.
*/
private _listByServiceNext(
resourceGroupName: string,
searchServiceName: string,
nextLink: string,
options?: SharedPrivateLinkResourcesListByServiceNextOptionalParams
): Promise<SharedPrivateLinkResourcesListByServiceNextResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, searchServiceName, nextLink, options },
listByServiceNextOperationSpec
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const createOrUpdateOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.SharedPrivateLinkResource
},
201: {
bodyMapper: Mappers.SharedPrivateLinkResource
},
202: {
bodyMapper: Mappers.SharedPrivateLinkResource
},
204: {
bodyMapper: Mappers.SharedPrivateLinkResource
},
default: {
bodyMapper: Mappers.CloudError
}
},
requestBody: Parameters.sharedPrivateLinkResource,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.resourceGroupName,
Parameters.searchServiceName,
Parameters.subscriptionId,
Parameters.sharedPrivateLinkResourceName
],
headerParameters: [
Parameters.accept,
Parameters.clientRequestId,
Parameters.contentType
],
mediaType: "json",
serializer
};
const getOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.SharedPrivateLinkResource
},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.resourceGroupName,
Parameters.searchServiceName,
Parameters.subscriptionId,
Parameters.sharedPrivateLinkResourceName
],
headerParameters: [Parameters.accept, Parameters.clientRequestId],
serializer
};
const deleteOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}",
httpMethod: "DELETE",
responses: {
200: {},
201: {},
202: {},
204: {},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.resourceGroupName,
Parameters.searchServiceName,
Parameters.subscriptionId,
Parameters.sharedPrivateLinkResourceName
],
headerParameters: [Parameters.accept, Parameters.clientRequestId],
serializer
};
const listByServiceOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/sharedPrivateLinkResources",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.SharedPrivateLinkResourceListResult
},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.resourceGroupName,
Parameters.searchServiceName,
Parameters.subscriptionId
],
headerParameters: [Parameters.accept, Parameters.clientRequestId],
serializer
};
const listByServiceNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.SharedPrivateLinkResourceListResult
},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.resourceGroupName,
Parameters.searchServiceName,
Parameters.subscriptionId,
Parameters.nextLink
],
headerParameters: [Parameters.accept, Parameters.clientRequestId],
serializer
};

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

@ -0,0 +1,48 @@
/*
* 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 {
AdminKeysGetOptionalParams,
AdminKeysGetResponse,
AdminKeyKind,
AdminKeysRegenerateOptionalParams,
AdminKeysRegenerateResponse
} from "../models";
/** Interface representing a AdminKeys. */
export interface AdminKeys {
/**
* Gets the primary and secondary admin API keys for the specified Azure Cognitive Search service.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param options The options parameters.
*/
get(
resourceGroupName: string,
searchServiceName: string,
options?: AdminKeysGetOptionalParams
): Promise<AdminKeysGetResponse>;
/**
* Regenerates either the primary or secondary admin API key. You can only regenerate one key at a
* time.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param keyKind Specifies which key to regenerate. Valid values include 'primary' and 'secondary'.
* @param options The options parameters.
*/
regenerate(
resourceGroupName: string,
searchServiceName: string,
keyKind: AdminKeyKind,
options?: AdminKeysRegenerateOptionalParams
): Promise<AdminKeysRegenerateResponse>;
}

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

@ -0,0 +1,15 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
export * from "./operations";
export * from "./adminKeys";
export * from "./queryKeys";
export * from "./services";
export * from "./privateLinkResources";
export * from "./privateEndpointConnections";
export * from "./sharedPrivateLinkResources";

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

@ -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 { Operation, OperationsListOptionalParams } from "../models";
/// <reference lib="esnext.asynciterable" />
/** Interface representing a Operations. */
export interface Operations {
/**
* Lists all of the available REST API operations of the Microsoft.Search provider.
* @param options The options parameters.
*/
list(
options?: OperationsListOptionalParams
): PagedAsyncIterableIterator<Operation>;
}

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

@ -0,0 +1,88 @@
/*
* 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 {
PrivateEndpointConnection,
PrivateEndpointConnectionsListByServiceOptionalParams,
PrivateEndpointConnectionsUpdateOptionalParams,
PrivateEndpointConnectionsUpdateResponse,
PrivateEndpointConnectionsGetOptionalParams,
PrivateEndpointConnectionsGetResponse,
PrivateEndpointConnectionsDeleteOptionalParams,
PrivateEndpointConnectionsDeleteResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Interface representing a PrivateEndpointConnections. */
export interface PrivateEndpointConnections {
/**
* Gets a list of all private endpoint connections in the given service.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param options The options parameters.
*/
listByService(
resourceGroupName: string,
searchServiceName: string,
options?: PrivateEndpointConnectionsListByServiceOptionalParams
): PagedAsyncIterableIterator<PrivateEndpointConnection>;
/**
* Updates a Private Endpoint connection to the search service in the given resource group.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param privateEndpointConnectionName The name of the private endpoint connection to the Azure
* Cognitive Search service with the specified resource group.
* @param privateEndpointConnection The definition of the private endpoint connection to update.
* @param options The options parameters.
*/
update(
resourceGroupName: string,
searchServiceName: string,
privateEndpointConnectionName: string,
privateEndpointConnection: PrivateEndpointConnection,
options?: PrivateEndpointConnectionsUpdateOptionalParams
): Promise<PrivateEndpointConnectionsUpdateResponse>;
/**
* Gets the details of the private endpoint connection to the search service in the given resource
* group.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param privateEndpointConnectionName The name of the private endpoint connection to the Azure
* Cognitive Search service with the specified resource group.
* @param options The options parameters.
*/
get(
resourceGroupName: string,
searchServiceName: string,
privateEndpointConnectionName: string,
options?: PrivateEndpointConnectionsGetOptionalParams
): Promise<PrivateEndpointConnectionsGetResponse>;
/**
* Disconnects the private endpoint connection and deletes it from the search service.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param privateEndpointConnectionName The name of the private endpoint connection to the Azure
* Cognitive Search service with the specified resource group.
* @param options The options parameters.
*/
delete(
resourceGroupName: string,
searchServiceName: string,
privateEndpointConnectionName: string,
options?: PrivateEndpointConnectionsDeleteOptionalParams
): Promise<PrivateEndpointConnectionsDeleteResponse>;
}

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

@ -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.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import {
PrivateLinkResource,
PrivateLinkResourcesListSupportedOptionalParams
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Interface representing a PrivateLinkResources. */
export interface PrivateLinkResources {
/**
* Gets a list of all supported private link resource types for the given service.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param options The options parameters.
*/
listSupported(
resourceGroupName: string,
searchServiceName: string,
options?: PrivateLinkResourcesListSupportedOptionalParams
): PagedAsyncIterableIterator<PrivateLinkResource>;
}

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

@ -0,0 +1,66 @@
/*
* 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 {
QueryKey,
QueryKeysListBySearchServiceOptionalParams,
QueryKeysCreateOptionalParams,
QueryKeysCreateResponse,
QueryKeysDeleteOptionalParams
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Interface representing a QueryKeys. */
export interface QueryKeys {
/**
* Returns the list of query API keys for the given Azure Cognitive Search service.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param options The options parameters.
*/
listBySearchService(
resourceGroupName: string,
searchServiceName: string,
options?: QueryKeysListBySearchServiceOptionalParams
): PagedAsyncIterableIterator<QueryKey>;
/**
* Generates a new query key for the specified search service. You can create up to 50 query keys per
* service.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param name The name of the new query API key.
* @param options The options parameters.
*/
create(
resourceGroupName: string,
searchServiceName: string,
name: string,
options?: QueryKeysCreateOptionalParams
): Promise<QueryKeysCreateResponse>;
/**
* Deletes the specified query key. Unlike admin keys, query keys are not regenerated. The process for
* regenerating a query key is to delete and then recreate it.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param key The query key to be deleted. Query keys are identified by value, not by name.
* @param options The options parameters.
*/
delete(
resourceGroupName: string,
searchServiceName: string,
key: string,
options?: QueryKeysDeleteOptionalParams
): Promise<void>;
}

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

@ -0,0 +1,144 @@
/*
* 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 {
SearchService,
ServicesListByResourceGroupOptionalParams,
ServicesListBySubscriptionOptionalParams,
ServicesCreateOrUpdateOptionalParams,
ServicesCreateOrUpdateResponse,
SearchServiceUpdate,
ServicesUpdateOptionalParams,
ServicesUpdateResponse,
ServicesGetOptionalParams,
ServicesGetResponse,
ServicesDeleteOptionalParams,
ServicesCheckNameAvailabilityOptionalParams,
ServicesCheckNameAvailabilityResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Interface representing a Services. */
export interface Services {
/**
* Gets a list of all search services in the given resource group.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param options The options parameters.
*/
listByResourceGroup(
resourceGroupName: string,
options?: ServicesListByResourceGroupOptionalParams
): PagedAsyncIterableIterator<SearchService>;
/**
* Gets a list of all search services in the given subscription.
* @param options The options parameters.
*/
listBySubscription(
options?: ServicesListBySubscriptionOptionalParams
): PagedAsyncIterableIterator<SearchService>;
/**
* Creates or updates a search service in the given resource group. If the search service already
* exists, all properties will be updated with the given values.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service to create or update. Search
* service names must only contain lowercase letters, digits or dashes, cannot use dash as the first
* two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60
* characters in length. Search service names must be globally unique since they are part of the
* service URI (https://<name>.search.windows.net). You cannot change the service name after the
* service is created.
* @param service The definition of the search service to create or update.
* @param options The options parameters.
*/
beginCreateOrUpdate(
resourceGroupName: string,
searchServiceName: string,
service: SearchService,
options?: ServicesCreateOrUpdateOptionalParams
): Promise<
PollerLike<
PollOperationState<ServicesCreateOrUpdateResponse>,
ServicesCreateOrUpdateResponse
>
>;
/**
* Creates or updates a search service in the given resource group. If the search service already
* exists, all properties will be updated with the given values.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service to create or update. Search
* service names must only contain lowercase letters, digits or dashes, cannot use dash as the first
* two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60
* characters in length. Search service names must be globally unique since they are part of the
* service URI (https://<name>.search.windows.net). You cannot change the service name after the
* service is created.
* @param service The definition of the search service to create or update.
* @param options The options parameters.
*/
beginCreateOrUpdateAndWait(
resourceGroupName: string,
searchServiceName: string,
service: SearchService,
options?: ServicesCreateOrUpdateOptionalParams
): Promise<ServicesCreateOrUpdateResponse>;
/**
* Updates an existing search service in the given resource group.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service to update.
* @param service The definition of the search service to update.
* @param options The options parameters.
*/
update(
resourceGroupName: string,
searchServiceName: string,
service: SearchServiceUpdate,
options?: ServicesUpdateOptionalParams
): Promise<ServicesUpdateResponse>;
/**
* Gets the search service with the given name in the given resource group.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param options The options parameters.
*/
get(
resourceGroupName: string,
searchServiceName: string,
options?: ServicesGetOptionalParams
): Promise<ServicesGetResponse>;
/**
* Deletes a search service in the given resource group, along with its associated resources.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param options The options parameters.
*/
delete(
resourceGroupName: string,
searchServiceName: string,
options?: ServicesDeleteOptionalParams
): Promise<void>;
/**
* Checks whether or not the given search service name is available for use. Search service names must
* be globally unique since they are part of the service URI (https://<name>.search.windows.net).
* @param name The search service name to validate. Search service names must only contain lowercase
* letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain
* consecutive dashes, and must be between 2 and 60 characters in length.
* @param options The options parameters.
*/
checkNameAvailability(
name: string,
options?: ServicesCheckNameAvailabilityOptionalParams
): Promise<ServicesCheckNameAvailabilityResponse>;
}

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

@ -0,0 +1,131 @@
/*
* 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 {
SharedPrivateLinkResource,
SharedPrivateLinkResourcesListByServiceOptionalParams,
SharedPrivateLinkResourcesCreateOrUpdateOptionalParams,
SharedPrivateLinkResourcesCreateOrUpdateResponse,
SharedPrivateLinkResourcesGetOptionalParams,
SharedPrivateLinkResourcesGetResponse,
SharedPrivateLinkResourcesDeleteOptionalParams
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Interface representing a SharedPrivateLinkResources. */
export interface SharedPrivateLinkResources {
/**
* Gets a list of all shared private link resources managed by the given service.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param options The options parameters.
*/
listByService(
resourceGroupName: string,
searchServiceName: string,
options?: SharedPrivateLinkResourcesListByServiceOptionalParams
): PagedAsyncIterableIterator<SharedPrivateLinkResource>;
/**
* Initiates the creation or update of a shared private link resource managed by the search service in
* the given resource group.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the
* Azure Cognitive Search service within the specified resource group.
* @param sharedPrivateLinkResource The definition of the shared private link resource to create or
* update.
* @param options The options parameters.
*/
beginCreateOrUpdate(
resourceGroupName: string,
searchServiceName: string,
sharedPrivateLinkResourceName: string,
sharedPrivateLinkResource: SharedPrivateLinkResource,
options?: SharedPrivateLinkResourcesCreateOrUpdateOptionalParams
): Promise<
PollerLike<
PollOperationState<SharedPrivateLinkResourcesCreateOrUpdateResponse>,
SharedPrivateLinkResourcesCreateOrUpdateResponse
>
>;
/**
* Initiates the creation or update of a shared private link resource managed by the search service in
* the given resource group.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the
* Azure Cognitive Search service within the specified resource group.
* @param sharedPrivateLinkResource The definition of the shared private link resource to create or
* update.
* @param options The options parameters.
*/
beginCreateOrUpdateAndWait(
resourceGroupName: string,
searchServiceName: string,
sharedPrivateLinkResourceName: string,
sharedPrivateLinkResource: SharedPrivateLinkResource,
options?: SharedPrivateLinkResourcesCreateOrUpdateOptionalParams
): Promise<SharedPrivateLinkResourcesCreateOrUpdateResponse>;
/**
* Gets the details of the shared private link resource managed by the search service in the given
* resource group.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the
* Azure Cognitive Search service within the specified resource group.
* @param options The options parameters.
*/
get(
resourceGroupName: string,
searchServiceName: string,
sharedPrivateLinkResourceName: string,
options?: SharedPrivateLinkResourcesGetOptionalParams
): Promise<SharedPrivateLinkResourcesGetResponse>;
/**
* Initiates the deletion of the shared private link resource from the search service.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the
* Azure Cognitive Search service within the specified resource group.
* @param options The options parameters.
*/
beginDelete(
resourceGroupName: string,
searchServiceName: string,
sharedPrivateLinkResourceName: string,
options?: SharedPrivateLinkResourcesDeleteOptionalParams
): Promise<PollerLike<PollOperationState<void>, void>>;
/**
* Initiates the deletion of the shared private link resource from the search service.
* @param resourceGroupName The name of the resource group within the current subscription. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param searchServiceName The name of the Azure Cognitive Search service associated with the
* specified resource group.
* @param sharedPrivateLinkResourceName The name of the shared private link resource managed by the
* Azure Cognitive Search service within the specified resource group.
* @param options The options parameters.
*/
beginDeleteAndWait(
resourceGroupName: string,
searchServiceName: string,
sharedPrivateLinkResourceName: string,
options?: SharedPrivateLinkResourcesDeleteOptionalParams
): Promise<void>;
}

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

@ -1,49 +1,104 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
* 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.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import * as msRest from "@azure/ms-rest-js";
import * as Models from "./models";
import * as Mappers from "./models/mappers";
import * as operations from "./operations";
import { SearchManagementClientContext } from "./searchManagementClientContext";
import * as coreClient from "@azure/core-client";
import * as coreAuth from "@azure/core-auth";
import {
OperationsImpl,
AdminKeysImpl,
QueryKeysImpl,
ServicesImpl,
PrivateLinkResourcesImpl,
PrivateEndpointConnectionsImpl,
SharedPrivateLinkResourcesImpl
} from "./operations";
import {
Operations,
AdminKeys,
QueryKeys,
Services,
PrivateLinkResources,
PrivateEndpointConnections,
SharedPrivateLinkResources
} from "./operationsInterfaces";
import { SearchManagementClientOptionalParams } from "./models";
class SearchManagementClient extends SearchManagementClientContext {
// Operation groups
operations: operations.Operations;
adminKeys: operations.AdminKeys;
queryKeys: operations.QueryKeys;
services: operations.Services;
export class SearchManagementClient extends coreClient.ServiceClient {
$host: string;
apiVersion: string;
subscriptionId: string;
/**
* Initializes a new instance of the SearchManagementClient class.
* @param credentials Credentials needed for the client to connect to Azure.
* @param subscriptionId The unique identifier for a Microsoft Azure subscription. You can obtain
* this value from the Azure Resource Manager API or the portal.
* @param [options] The parameter options
* @param credentials Subscription credentials which uniquely identify client subscription.
* @param subscriptionId The unique identifier for a Microsoft Azure subscription. You can obtain this
* value from the Azure Resource Manager API or the portal.
* @param options The parameter options
*/
constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.SearchManagementClientOptions) {
super(credentials, subscriptionId, options);
this.operations = new operations.Operations(this);
this.adminKeys = new operations.AdminKeys(this);
this.queryKeys = new operations.QueryKeys(this);
this.services = new operations.Services(this);
constructor(
credentials: coreAuth.TokenCredential,
subscriptionId: string,
options?: SearchManagementClientOptionalParams
) {
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: SearchManagementClientOptionalParams = {
requestContentType: "application/json; charset=utf-8",
credential: credentials
};
const packageDetails = `azsdk-js-arm-search/1.0.0-beta.1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
: `${packageDetails}`;
if (!options.credentialScopes) {
options.credentialScopes = ["https://management.azure.com/.default"];
}
const optionsWithDefaults = {
...defaults,
...options,
userAgentOptions: {
userAgentPrefix
},
baseUri: options.endpoint || "https://management.azure.com"
};
super(optionsWithDefaults);
// Parameter assignments
this.subscriptionId = subscriptionId;
// Assigning values to Constant parameters
this.$host = options.$host || "https://management.azure.com";
this.apiVersion = options.apiVersion || "2020-08-01";
this.operations = new OperationsImpl(this);
this.adminKeys = new AdminKeysImpl(this);
this.queryKeys = new QueryKeysImpl(this);
this.services = new ServicesImpl(this);
this.privateLinkResources = new PrivateLinkResourcesImpl(this);
this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this);
this.sharedPrivateLinkResources = new SharedPrivateLinkResourcesImpl(this);
}
operations: Operations;
adminKeys: AdminKeys;
queryKeys: QueryKeys;
services: Services;
privateLinkResources: PrivateLinkResources;
privateEndpointConnections: PrivateEndpointConnections;
sharedPrivateLinkResources: SharedPrivateLinkResources;
}
// Operation Specifications
export {
SearchManagementClient,
SearchManagementClientContext,
Models as SearchManagementModels,
Mappers as SearchManagementMappers
};
export * from "./operations";

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

@ -1,63 +0,0 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
import * as Models from "./models";
import * as msRest from "@azure/ms-rest-js";
import * as msRestAzure from "@azure/ms-rest-azure-js";
const packageName = "@azure/arm-search";
const packageVersion = "0.1.0";
export class SearchManagementClientContext extends msRestAzure.AzureServiceClient {
credentials: msRest.ServiceClientCredentials;
subscriptionId: string;
apiVersion?: string;
/**
* Initializes a new instance of the SearchManagementClient class.
* @param credentials Credentials needed for the client to connect to Azure.
* @param subscriptionId The unique identifier for a Microsoft Azure subscription. You can obtain
* this value from the Azure Resource Manager API or the portal.
* @param [options] The parameter options
*/
constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.SearchManagementClientOptions) {
if (credentials == undefined) {
throw new Error('\'credentials\' cannot be null.');
}
if (subscriptionId == undefined) {
throw new Error('\'subscriptionId\' cannot be null.');
}
if (!options) {
options = {};
}
if(!options.userAgent) {
const defaultUserAgent = msRestAzure.getDefaultUserAgentValue();
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
}
super(credentials, options);
this.apiVersion = '2015-08-19';
this.acceptLanguage = 'en-US';
this.longRunningOperationRetryTimeout = 30;
this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";
this.requestContentType = "application/json; charset=utf-8";
this.credentials = credentials;
this.subscriptionId = subscriptionId;
if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
this.acceptLanguage = options.acceptLanguage;
}
if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout;
}
}
}

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

@ -0,0 +1,127 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import {
env,
record,
RecorderEnvironmentSetup,
Recorder,
delay,
isPlaybackMode
} from "@azure-tools/test-recorder";
import * as assert from "assert";
import { ClientSecretCredential } from "@azure/identity";
import { SearchManagementClient } from "../src/searchManagementClient";
const recorderEnvSetup: RecorderEnvironmentSetup = {
replaceableVariables: {
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"
},
customizationsOnRecordings: [
(recording: any): any =>
recording.replace(
/"access_token":"[^"]*"/g,
`"access_token":"access_token"`
)
],
queryParametersToSkip: []
};
export const testPollingOptions = {
updateIntervalInMs: isPlaybackMode() ? 0 : undefined,
};
describe("Search test", () => {
let recorder: Recorder;
let subscriptionId: string;
let client: SearchManagementClient;
let location: string;
let resourceGroup: string;
let searchServiceName: string;
let keyname: string;
beforeEach(async function() {
recorder = record(this, recorderEnvSetup);
subscriptionId = env.SUBSCRIPTION_ID;
// This is an example of how the environment variables are used
const credential = new ClientSecretCredential(
env.AZURE_TENANT_ID,
env.AZURE_CLIENT_ID,
env.AZURE_CLIENT_SECRET
);
client = new SearchManagementClient(credential, subscriptionId);
location = "eastus";
resourceGroup = "myjstest";
searchServiceName = "myjssearchservicexx"
keyname = "testjskey";
});
afterEach(async function() {
await recorder.stop();
});
it("services create test", async function() {
const res = await client.services.beginCreateOrUpdateAndWait(resourceGroup,searchServiceName,{
location: location,
replicaCount: 1,
partitionCount: 1,
hostingMode: "default",
sku: {
name: "standard"
}
});
assert.equal(res.name,searchServiceName);
});
it("services get test", async function() {
const res = await client.services.get(resourceGroup,searchServiceName);
assert.equal(res.name,searchServiceName);
});
it("services list test", async function() {
const resArray = new Array();
for await (let item of client.services.listByResourceGroup(resourceGroup)){
resArray.push(item);
}
assert.equal(resArray.length,1);
});
it("queryKeys create test", async function() {
const res = await client.queryKeys.create(resourceGroup,searchServiceName,keyname);
assert.notEqual(res.key,"");
});
it("queryKeys list test", async function() {
const resArray = new Array();
for await (let item of client.queryKeys.listBySearchService(resourceGroup,searchServiceName)){
resArray.push(item);
}
assert.equal(resArray.length,2);
});
it("queryKeys delete test", async function() {
const res = await client.queryKeys.delete(resourceGroup,searchServiceName,keyname);
const resArray = new Array();
for await (let item of client.queryKeys.listBySearchService(resourceGroup,searchServiceName)){
resArray.push(item);
}
assert.equal(resArray.length,2);
});
it("services delete test", async function() {
const res = await client.services.delete(resourceGroup,searchServiceName);
const resArray = new Array();
for await (let item of client.services.listByResourceGroup(resourceGroup)){
resArray.push(item);
}
assert.equal(resArray.length,0);
});
});

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

@ -3,17 +3,17 @@
"module": "es6",
"moduleResolution": "node",
"strict": true,
"target": "es5",
"target": "es6",
"sourceMap": true,
"declarationMap": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"lib": ["es6"],
"lib": ["es6", "dom"],
"declaration": true,
"outDir": "./esm",
"outDir": "./dist-esm",
"importHelpers": true
},
"include": ["./src/**/*.ts"],
"include": ["./src/**/*.ts", "./test/**/*.ts"],
"exclude": ["node_modules"]
}

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

@ -1,5 +1,4 @@
# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.
trigger:
branches:
include:
@ -9,7 +8,6 @@ trigger:
paths:
include:
- sdk/search/
pr:
branches:
include:
@ -17,10 +15,11 @@ pr:
- feature/*
- release/*
- hotfix/*
exclude:
- feature/v4
paths:
include:
- sdk/search/
extends:
template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml
parameters:
@ -28,3 +27,5 @@ extends:
Artifacts:
- name: azure-search-documents
safeName: azuresearchdocuments
- name: azure-arm-search
safeName: azurearmsearch