Re-do changes (#20777)
This commit is contained in:
Родитель
5caf03eb29
Коммит
ecf036b583
|
@ -207,7 +207,6 @@ specifiers:
|
|||
'@rush-temp/identity-cache-persistence': file:./projects/identity-cache-persistence.tgz
|
||||
'@rush-temp/identity-vscode': file:./projects/identity-vscode.tgz
|
||||
'@rush-temp/iot-device-update': file:./projects/iot-device-update.tgz
|
||||
'@rush-temp/iot-device-update-1': file:./projects/iot-device-update-1.tgz
|
||||
'@rush-temp/iot-modelsrepository': file:./projects/iot-modelsrepository.tgz
|
||||
'@rush-temp/keyvault-admin': file:./projects/keyvault-admin.tgz
|
||||
'@rush-temp/keyvault-certificates': file:./projects/keyvault-certificates.tgz
|
||||
|
@ -478,7 +477,6 @@ dependencies:
|
|||
'@rush-temp/identity-cache-persistence': file:projects/identity-cache-persistence.tgz
|
||||
'@rush-temp/identity-vscode': file:projects/identity-vscode.tgz
|
||||
'@rush-temp/iot-device-update': file:projects/iot-device-update.tgz
|
||||
'@rush-temp/iot-device-update-1': file:projects/iot-device-update-1.tgz
|
||||
'@rush-temp/iot-modelsrepository': file:projects/iot-modelsrepository.tgz
|
||||
'@rush-temp/keyvault-admin': file:projects/keyvault-admin.tgz
|
||||
'@rush-temp/keyvault-certificates': file:projects/keyvault-certificates.tgz
|
||||
|
@ -12457,7 +12455,7 @@ packages:
|
|||
dev: false
|
||||
|
||||
file:projects/arm-rediscache.tgz:
|
||||
resolution: {integrity: sha512-lRPMNQ6X2zNGHkn4+nUXsiXRde6JISO5YjFzhycdJL/3NCg9F4m94x+VbYyNtbvW5a7oVbGmyu4lW+I8qlqszQ==, tarball: file:projects/arm-rediscache.tgz}
|
||||
resolution: {integrity: sha512-L96UyCle2mXUwU1QCXkofA0Yl4jBo8ElH3wdfGQBGHvDnDGkb1wNzcyuMsNncmPePr3fWsM50xCYuaMASfy0Ag==, tarball: file:projects/arm-rediscache.tgz}
|
||||
name: '@rush-temp/arm-rediscache'
|
||||
version: 0.0.0
|
||||
dependencies:
|
||||
|
@ -15315,32 +15313,6 @@ packages:
|
|||
- utf-8-validate
|
||||
dev: false
|
||||
|
||||
file:projects/iot-device-update-1.tgz:
|
||||
resolution: {integrity: sha512-Bk5qTBsWfWqB+pS/MoKu0LL6pdJt5dVZRGeWupzgnwhdJO1zAu+ORURESK54rlQiHiMBuiktW1+RnBNbknVWNQ==, tarball: file:projects/iot-device-update-1.tgz}
|
||||
name: '@rush-temp/iot-device-update-1'
|
||||
version: 0.0.0
|
||||
dependencies:
|
||||
'@azure/core-tracing': 1.0.0-preview.13
|
||||
'@azure/identity': 2.0.4
|
||||
'@microsoft/api-extractor': 7.19.4
|
||||
'@types/node': 12.20.43
|
||||
'@types/uuid': 8.3.4
|
||||
cross-env: 7.0.3
|
||||
dotenv: 8.6.0
|
||||
eslint: 7.32.0
|
||||
mkdirp: 1.0.4
|
||||
prettier: 2.5.1
|
||||
rimraf: 3.0.2
|
||||
source-map-support: 0.5.21
|
||||
tslib: 2.3.1
|
||||
typescript: 4.2.4
|
||||
uglify-js: 3.15.1
|
||||
uuid: 8.3.2
|
||||
transitivePeerDependencies:
|
||||
- debug
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
file:projects/iot-device-update.tgz:
|
||||
resolution: {integrity: sha512-6HV1NM9Lo62LnFyoV9psZqdV68+AXnSvcjrBzu2pylpsKh+7NVYKLiZFYysNg0qV0QjbxfeYHCcRiqRyt3YVXQ==, tarball: file:projects/iot-device-update.tgz}
|
||||
name: '@rush-temp/iot-device-update'
|
||||
|
|
|
@ -268,10 +268,6 @@
|
|||
"name": "attestation",
|
||||
"path": "sdk/attestation/attestation"
|
||||
},
|
||||
{
|
||||
"name": "iot-device-update",
|
||||
"path": "sdk/deviceupdate/iot-device-update"
|
||||
},
|
||||
{
|
||||
"path": "sdk/web-pubsub/web-pubsub"
|
||||
},
|
||||
|
|
|
@ -806,11 +806,6 @@
|
|||
"projectFolder": "sdk/mixedreality/mixed-reality-authentication",
|
||||
"versionPolicyName": "client"
|
||||
},
|
||||
{
|
||||
"packageName": "@azure/iot-device-update",
|
||||
"projectFolder": "sdk/deviceupdate/iot-device-update",
|
||||
"versionPolicyName": "client"
|
||||
},
|
||||
{
|
||||
"packageName": "@azure/web-pubsub",
|
||||
"projectFolder": "sdk/web-pubsub/web-pubsub",
|
||||
|
|
|
@ -27,7 +27,5 @@ extends:
|
|||
ServiceDirectory: deviceupdate
|
||||
IncludeRelease: true
|
||||
Artifacts:
|
||||
- name: azure-iot-device-update
|
||||
safeName: azureiotdeviceupdate
|
||||
- name: azure-rest-iot-device-update
|
||||
safeName: azurerestiotdeviceupdate
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
# Release History
|
||||
|
||||
## 1.0.0-beta.2 (Unreleased)
|
||||
|
||||
|
||||
## 1.0.0-beta.1 (2021-03-04)
|
||||
|
||||
- Initial Release
|
|
@ -1,21 +0,0 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
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
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -1,69 +0,0 @@
|
|||
# Azure Device Update for IoT Hub client library for JavaScript
|
||||
|
||||
The library provides access to the Device Update for IoT Hub service that enables customers to publish updates for their IoT devices to the cloud, and then deploy these updates to their devices (approve updates to groups of devices managed and provisioned in IoT Hub).
|
||||
|
||||
Key links:
|
||||
- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk)
|
||||
- [Product documentation](https://docs.microsoft.com/azure/iot-hub-device-update/understand-device-update)
|
||||
|
||||
## Getting started
|
||||
|
||||
### Currently supported environments
|
||||
|
||||
- [LTS versions of Node.js](https://nodejs.org/about/releases/)
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- Microsoft Azure Subscription: To call Microsoft Azure services, you need to create an [Azure subscription](https://azure.microsoft.com/free/)
|
||||
- Device Update for IoT Hub instance
|
||||
- Azure IoT Hub instance
|
||||
|
||||
### Install the `@azure/iot-device-update` package
|
||||
|
||||
Install the Azure Device Update for IoT Hub client library for JavaScript with `npm`:
|
||||
|
||||
```bash
|
||||
npm install @azure/iot-device-update
|
||||
```
|
||||
|
||||
## Key concepts
|
||||
|
||||
Device Update for IoT Hub is a managed service that enables you to deploy over-the-air updates for your IoT devices. The client library has three main components:
|
||||
|
||||
- **Updates**: update management (import, enumerate, delete, etc.)
|
||||
- **Devices**: device management (enumerate devices and retrieve device properties)
|
||||
- **Deployments**: deployment management (start and monitor update deployments to a set of devices)
|
||||
|
||||
You can learn more about Device Update for IoT Hub by visiting [Device Update for IoT Hub](https://github.com/azure/iot-hub-device-update).
|
||||
|
||||
## Examples
|
||||
|
||||
You can familiarize yourself with different APIs using [Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/deviceupdate/iot-device-update/samples).
|
||||
|
||||
## 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
|
||||
import { setLogLevel } from "@azure/logger";
|
||||
|
||||
setLogLevel("info");
|
||||
```
|
||||
|
||||
For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).
|
||||
|
||||
## Next steps
|
||||
|
||||
Get started with our [Device Update for IoT Hub samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/deviceupdate/iot-device-update/samples)
|
||||
|
||||
## Contributing
|
||||
|
||||
If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code.
|
||||
|
||||
## Related projects
|
||||
|
||||
- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)
|
||||
|
||||
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fdeviceupdate%2Fiot-device-update%2FREADME.png)
|
|
@ -1,18 +0,0 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
||||
"mainEntryPointFilePath": "types/src/index.d.ts",
|
||||
"docModel": { "enabled": true },
|
||||
"apiReport": { "enabled": true, "reportFolder": "./review" },
|
||||
"dtsRollup": {
|
||||
"enabled": true,
|
||||
"untrimmedFilePath": "",
|
||||
"publicTrimmedFilePath": "./types/iot-device-update.d.ts"
|
||||
},
|
||||
"messages": {
|
||||
"tsdocMessageReporting": { "default": { "logLevel": "none" } },
|
||||
"extractorMessageReporting": {
|
||||
"ae-missing-release-tag": { "logLevel": "none" },
|
||||
"ae-unresolved-link": { "logLevel": "none" }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,104 +0,0 @@
|
|||
{
|
||||
"name": "@azure/iot-device-update",
|
||||
"author": "Microsoft Corporation",
|
||||
"sdk-type": "client",
|
||||
"description": "Device Update for IoT Hub is an Azure service that enables customers to publish update for their IoT devices to the cloud, and then deploy that update to their devices (approve updates to groups of devices managed and provisioned in IoT Hub). It leverages the proven security and reliability of the Windows Update platform, optimized for IoT devices. It works globally and knows when and how to update devices, enabling customers to focus on their business goals and let Device Update for IoT Hub handle the updates.",
|
||||
"version": "1.0.0-beta.2",
|
||||
"dependencies": {
|
||||
"@azure/core-http": "^2.0.0",
|
||||
"@azure/core-paging": "^1.1.1",
|
||||
"@azure/core-tracing": "1.0.0-preview.13",
|
||||
"tslib": "^2.2.0"
|
||||
},
|
||||
"keywords": [
|
||||
"node",
|
||||
"azure",
|
||||
"typescript",
|
||||
"browser",
|
||||
"isomorphic",
|
||||
"cloud"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist-esm/src/index.js",
|
||||
"types": "./types/iot-device-update.d.ts",
|
||||
"devDependencies": {
|
||||
"@azure/dev-tool": "^1.0.0",
|
||||
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
|
||||
"@azure/identity": "^2.0.1",
|
||||
"@microsoft/api-extractor": "^7.18.11",
|
||||
"@types/node": "^12.0.0",
|
||||
"@types/uuid": "^8.0.0",
|
||||
"cross-env": "^7.0.2",
|
||||
"dotenv": "^8.2.0",
|
||||
"eslint": "^7.15.0",
|
||||
"mkdirp": "^1.0.4",
|
||||
"prettier": "^2.5.1",
|
||||
"rimraf": "^3.0.0",
|
||||
"source-map-support": "^0.5.9",
|
||||
"typescript": "~4.2.0",
|
||||
"uglify-js": "^3.4.9",
|
||||
"uuid": "^8.3.0"
|
||||
},
|
||||
"homepage": "https://github.com/Azure/azure-sdk-for-js",
|
||||
"repository": "github:Azure/azure-sdk-for-js",
|
||||
"bugs": {
|
||||
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
|
||||
},
|
||||
"files": [
|
||||
"dist/",
|
||||
"dist-esm/src/",
|
||||
"types/iot-device-update.d.ts",
|
||||
"README.md",
|
||||
"LICENSE"
|
||||
],
|
||||
"//metadata": {
|
||||
"constantPaths": [
|
||||
{
|
||||
"path": "src/deviceUpdateClientContext.ts",
|
||||
"prefix": "packageVersion"
|
||||
}
|
||||
]
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
},
|
||||
"//sampleConfiguration": {
|
||||
"productName": "Azure IoT Hub Device Update",
|
||||
"productSlugs": [
|
||||
"azure",
|
||||
"azure-iot"
|
||||
],
|
||||
"requiredResources": {
|
||||
"Azure Device Update for IoT Hub instance": "https://docs.microsoft.com/azure/iot-hub-device-update/understand-device-update"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
|
||||
"build:browser": "tsc -p . && dev-tool run bundle",
|
||||
"build:debug": "tsc -p . && dev-tool run bundle && api-extractor run --local",
|
||||
"build:node": "tsc -p . && dev-tool run bundle",
|
||||
"build:samples": "echo Obsolete.",
|
||||
"build:test": "echo skip",
|
||||
"build": "npm run clean && tsc -p . && dev-tool run bundle && api-extractor run --local",
|
||||
"check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\"",
|
||||
"clean": "rimraf dist dist-* temp types *.tgz *.log",
|
||||
"execute:samples": "dev-tool samples run samples-dev",
|
||||
"extract-api": "api-extractor run --local",
|
||||
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
|
||||
"integration-test:browser": "echo skip",
|
||||
"integration-test:node": "echo skip",
|
||||
"integration-test": "echo skip",
|
||||
"lint:fix": "echo skip",
|
||||
"lint": "echo skip",
|
||||
"pack": "npm pack 2>&1",
|
||||
"test:browser": "echo skip",
|
||||
"test:node": "echo skip",
|
||||
"test": "echo skip",
|
||||
"unit-test:browser": "echo skip",
|
||||
"unit-test:node": "echo skip",
|
||||
"unit-test": "echo skip"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"autoPublish": false
|
||||
}
|
|
@ -1,842 +0,0 @@
|
|||
## API Report File for "@azure/iot-device-update"
|
||||
|
||||
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
||||
|
||||
```ts
|
||||
|
||||
import * as coreHttp from '@azure/core-http';
|
||||
import { PagedAsyncIterableIterator } from '@azure/core-paging';
|
||||
|
||||
// @public
|
||||
export interface AccessCondition {
|
||||
ifNoneMatch?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface Compatibility {
|
||||
deviceManufacturer: string;
|
||||
deviceModel: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface Deployment {
|
||||
deploymentId: string;
|
||||
deploymentType: DeploymentType;
|
||||
deviceClassId?: string;
|
||||
deviceGroupDefinition: string[];
|
||||
deviceGroupType: DeviceGroupType;
|
||||
isCanceled?: boolean;
|
||||
isCompleted?: boolean;
|
||||
isRetried?: boolean;
|
||||
startDateTime: Date;
|
||||
updateId: UpdateId;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface DeploymentDeviceState {
|
||||
deviceId: string;
|
||||
deviceState: DeviceDeploymentState;
|
||||
movedOnToNewDeployment: boolean;
|
||||
retryCount: number;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface DeploymentDeviceStatesFilter {
|
||||
deviceId?: string;
|
||||
deviceState?: DeviceState;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface DeploymentFilter {
|
||||
name?: string;
|
||||
provider?: string;
|
||||
version?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type DeploymentsCancelDeploymentResponse = Deployment & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: Deployment;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export type DeploymentsCreateOrUpdateDeploymentResponse = Deployment & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: Deployment;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export interface DeploymentsGetAllDeploymentsNextOptionalParams extends coreHttp.OperationOptions {
|
||||
filter?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type DeploymentsGetAllDeploymentsNextResponse = PageableListOfDeployments & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: PageableListOfDeployments;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export interface DeploymentsGetAllDeploymentsOptionalParams extends coreHttp.OperationOptions {
|
||||
filter?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type DeploymentsGetAllDeploymentsResponse = PageableListOfDeployments & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: PageableListOfDeployments;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export interface DeploymentsGetDeploymentDevicesNextOptionalParams extends coreHttp.OperationOptions {
|
||||
filter?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type DeploymentsGetDeploymentDevicesNextResponse = PageableListOfDeploymentDeviceStates & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: PageableListOfDeploymentDeviceStates;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export interface DeploymentsGetDeploymentDevicesOptionalParams extends coreHttp.OperationOptions {
|
||||
filter?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type DeploymentsGetDeploymentDevicesResponse = PageableListOfDeploymentDeviceStates & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: PageableListOfDeploymentDeviceStates;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export type DeploymentsGetDeploymentResponse = Deployment & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: Deployment;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export type DeploymentsGetDeploymentStatusResponse = DeploymentStatus & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: DeploymentStatus;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export type DeploymentsRetryDeploymentResponse = Deployment & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: Deployment;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export type DeploymentState = string;
|
||||
|
||||
// @public
|
||||
export interface DeploymentStatus {
|
||||
deploymentState: DeploymentState;
|
||||
devicesCanceledCount?: number;
|
||||
devicesCompletedFailedCount?: number;
|
||||
devicesCompletedSucceededCount?: number;
|
||||
devicesIncompatibleCount?: number;
|
||||
devicesInProgressCount?: number;
|
||||
totalDevices?: number;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type DeploymentType = string;
|
||||
|
||||
// @public
|
||||
export interface Device {
|
||||
deploymentStatus?: DeviceDeploymentState;
|
||||
deviceClassId: string;
|
||||
deviceId: string;
|
||||
groupId?: string;
|
||||
installedUpdateId?: UpdateId | null;
|
||||
lastAttemptedUpdateId?: UpdateId | null;
|
||||
lastDeploymentId?: string;
|
||||
manufacturer: string;
|
||||
model: string;
|
||||
onLatestUpdate: boolean;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface DeviceClass {
|
||||
bestCompatibleUpdateId: UpdateId | null;
|
||||
deviceClassId: string;
|
||||
manufacturer: string;
|
||||
model: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type DeviceDeploymentState = string;
|
||||
|
||||
// @public
|
||||
export interface DeviceFilter {
|
||||
groupId?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type DeviceGroupType = string;
|
||||
|
||||
// @public
|
||||
export type DevicesCreateOrUpdateGroupResponse = Group & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: Group;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export type DevicesGetAllDeviceClassesNextResponse = PageableListOfDeviceClasses & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: PageableListOfDeviceClasses;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export type DevicesGetAllDeviceClassesResponse = PageableListOfDeviceClasses & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: PageableListOfDeviceClasses;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export interface DevicesGetAllDevicesNextOptionalParams extends coreHttp.OperationOptions {
|
||||
filter?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type DevicesGetAllDevicesNextResponse = PageableListOfDevices & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: PageableListOfDevices;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export interface DevicesGetAllDevicesOptionalParams extends coreHttp.OperationOptions {
|
||||
filter?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type DevicesGetAllDevicesResponse = PageableListOfDevices & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: PageableListOfDevices;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export type DevicesGetAllDeviceTagsNextResponse = PageableListOfDeviceTags & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: PageableListOfDeviceTags;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export type DevicesGetAllDeviceTagsResponse = PageableListOfDeviceTags & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: PageableListOfDeviceTags;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export type DevicesGetAllGroupsNextResponse = PageableListOfGroups & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: PageableListOfGroups;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export type DevicesGetAllGroupsResponse = PageableListOfGroups & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: PageableListOfGroups;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export type DevicesGetDeviceClassDeviceIdsNextResponse = PageableListOfStrings & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: PageableListOfStrings;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export type DevicesGetDeviceClassDeviceIdsResponse = PageableListOfStrings & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: PageableListOfStrings;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export type DevicesGetDeviceClassInstallableUpdatesNextResponse = PageableListOfUpdateIds & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: PageableListOfUpdateIds;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export type DevicesGetDeviceClassInstallableUpdatesResponse = PageableListOfUpdateIds & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: PageableListOfUpdateIds;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export type DevicesGetDeviceClassResponse = DeviceClass & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: DeviceClass;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export type DevicesGetDeviceResponse = Device & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: Device;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export type DevicesGetDeviceTagResponse = DeviceTag & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: DeviceTag;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export interface DevicesGetGroupBestUpdatesNextOptionalParams extends coreHttp.OperationOptions {
|
||||
filter?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type DevicesGetGroupBestUpdatesNextResponse = PageableListOfUpdatableDevices & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: PageableListOfUpdatableDevices;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export interface DevicesGetGroupBestUpdatesOptionalParams extends coreHttp.OperationOptions {
|
||||
filter?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type DevicesGetGroupBestUpdatesResponse = PageableListOfUpdatableDevices & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: PageableListOfUpdatableDevices;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export type DevicesGetGroupResponse = Group & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: Group;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export type DevicesGetGroupUpdateComplianceResponse = UpdateCompliance & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: UpdateCompliance;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export type DevicesGetUpdateComplianceResponse = UpdateCompliance & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: UpdateCompliance;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export type DeviceState = string;
|
||||
|
||||
// @public
|
||||
export interface DeviceTag {
|
||||
deviceCount: number;
|
||||
tagName: string;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export class DeviceUpdateClient extends DeviceUpdateClientContext {
|
||||
constructor(credentials: coreHttp.TokenCredential | coreHttp.ServiceClientCredentials, accountEndpoint: string, instanceId: string, options?: DeviceUpdateClientOptionalParams);
|
||||
// Warning: (ae-forgotten-export) The symbol "Deployments" needs to be exported by the entry point index.d.ts
|
||||
//
|
||||
// (undocumented)
|
||||
deployments: Deployments;
|
||||
// Warning: (ae-forgotten-export) The symbol "Devices" needs to be exported by the entry point index.d.ts
|
||||
//
|
||||
// (undocumented)
|
||||
devices: Devices;
|
||||
// Warning: (ae-forgotten-export) The symbol "Updates" needs to be exported by the entry point index.d.ts
|
||||
//
|
||||
// (undocumented)
|
||||
updates: Updates;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export class DeviceUpdateClientContext extends coreHttp.ServiceClient {
|
||||
constructor(credentials: coreHttp.TokenCredential | coreHttp.ServiceClientCredentials, accountEndpoint: string, instanceId: string, options?: DeviceUpdateClientOptionalParams);
|
||||
// (undocumented)
|
||||
accountEndpoint: string;
|
||||
// (undocumented)
|
||||
instanceId: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface DeviceUpdateClientOptionalParams extends coreHttp.ServiceClientOptions {
|
||||
endpoint?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface ErrorModel {
|
||||
code: string;
|
||||
details?: ErrorModel[];
|
||||
innererror?: InnerError;
|
||||
message: string;
|
||||
occurredDateTime?: Date;
|
||||
target?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface File {
|
||||
etag?: string;
|
||||
fileId: string;
|
||||
fileName: string;
|
||||
hashes: {
|
||||
[propertyName: string]: string;
|
||||
};
|
||||
mimeType?: string;
|
||||
sizeInBytes: number;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface FileImportMetadata {
|
||||
filename: string;
|
||||
url: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface Group {
|
||||
createdDateTime: string;
|
||||
deviceCount?: number;
|
||||
groupId: string;
|
||||
groupType: GroupType;
|
||||
tags: string[];
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface GroupBestUpdatesFilter {
|
||||
name?: string;
|
||||
provider?: string;
|
||||
version?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type GroupType = string;
|
||||
|
||||
// @public
|
||||
export interface ImportManifestMetadata {
|
||||
hashes: {
|
||||
[propertyName: string]: string;
|
||||
};
|
||||
sizeInBytes: number;
|
||||
url: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface ImportUpdateInput {
|
||||
files: FileImportMetadata[];
|
||||
importManifest: ImportManifestMetadata;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface InnerError {
|
||||
code: string;
|
||||
errorDetail?: string;
|
||||
innerError?: InnerError;
|
||||
message?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export const enum KnownDeploymentState {
|
||||
Active = "Active",
|
||||
Canceled = "Canceled",
|
||||
Superseded = "Superseded"
|
||||
}
|
||||
|
||||
// @public
|
||||
export const enum KnownDeploymentType {
|
||||
Complete = "Complete",
|
||||
Download = "Download",
|
||||
Install = "Install"
|
||||
}
|
||||
|
||||
// @public
|
||||
export const enum KnownDeviceDeploymentState {
|
||||
Canceled = "Canceled",
|
||||
Failed = "Failed",
|
||||
Incompatible = "Incompatible",
|
||||
InProgress = "InProgress",
|
||||
Succeeded = "Succeeded"
|
||||
}
|
||||
|
||||
// @public
|
||||
export const enum KnownDeviceGroupType {
|
||||
All = "All",
|
||||
DeviceGroupDefinitions = "DeviceGroupDefinitions",
|
||||
Devices = "Devices"
|
||||
}
|
||||
|
||||
// @public
|
||||
export const enum KnownDeviceState {
|
||||
AlreadyInDeployment = "AlreadyInDeployment",
|
||||
Canceled = "Canceled",
|
||||
Failed = "Failed",
|
||||
Incompatible = "Incompatible",
|
||||
InProgress = "InProgress",
|
||||
NotStarted = "NotStarted",
|
||||
Succeeded = "Succeeded"
|
||||
}
|
||||
|
||||
// @public
|
||||
export const enum KnownGroupType {
|
||||
IoTHubTag = "IoTHubTag"
|
||||
}
|
||||
|
||||
// @public
|
||||
export const enum KnownOperationFilterStatus {
|
||||
// (undocumented)
|
||||
NotStarted = "NotStarted",
|
||||
// (undocumented)
|
||||
Running = "Running"
|
||||
}
|
||||
|
||||
// @public
|
||||
export const enum KnownOperationStatus {
|
||||
Failed = "Failed",
|
||||
NotStarted = "NotStarted",
|
||||
Running = "Running",
|
||||
Succeeded = "Succeeded",
|
||||
Undefined = "Undefined"
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface Operation {
|
||||
createdDateTime: Date;
|
||||
error?: ErrorModel;
|
||||
etag?: string;
|
||||
lastActionDateTime: Date;
|
||||
operationId: string;
|
||||
resourceLocation?: string;
|
||||
status: OperationStatus;
|
||||
traceId?: string;
|
||||
updateId?: UpdateId;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface OperationFilter {
|
||||
status?: OperationFilterStatus;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type OperationFilterStatus = string;
|
||||
|
||||
// @public
|
||||
export type OperationStatus = string;
|
||||
|
||||
// @public
|
||||
export interface PageableListOfDeploymentDeviceStates {
|
||||
nextLink?: string;
|
||||
value?: DeploymentDeviceState[];
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface PageableListOfDeployments {
|
||||
nextLink?: string;
|
||||
value?: Deployment[];
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface PageableListOfDeviceClasses {
|
||||
nextLink?: string;
|
||||
value?: DeviceClass[];
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface PageableListOfDevices {
|
||||
nextLink?: string;
|
||||
value?: Device[];
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface PageableListOfDeviceTags {
|
||||
nextLink?: string;
|
||||
value?: DeviceTag[];
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface PageableListOfGroups {
|
||||
nextLink?: string;
|
||||
value?: Group[];
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface PageableListOfOperations {
|
||||
nextLink?: string;
|
||||
value?: Operation[];
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface PageableListOfStrings {
|
||||
nextLink?: string;
|
||||
value?: string[];
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface PageableListOfUpdatableDevices {
|
||||
nextLink?: string;
|
||||
value?: UpdatableDevices[];
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface PageableListOfUpdateIds {
|
||||
nextLink?: string;
|
||||
value?: UpdateId[];
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface UpdatableDevices {
|
||||
deviceCount: number;
|
||||
updateId: UpdateId;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface Update {
|
||||
compatibility: Compatibility[];
|
||||
createdDateTime: Date;
|
||||
etag?: string;
|
||||
importedDateTime: Date;
|
||||
installedCriteria: string;
|
||||
manifestVersion: string;
|
||||
updateId: UpdateId;
|
||||
updateType: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface UpdateCompliance {
|
||||
newUpdatesAvailableDeviceCount: number;
|
||||
onLatestUpdateDeviceCount: number;
|
||||
totalDeviceCount: number;
|
||||
updatesInProgressDeviceCount: number;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface UpdateId {
|
||||
name: string;
|
||||
provider: string;
|
||||
version: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface UpdatesDeleteUpdateHeaders {
|
||||
location?: string;
|
||||
operationLocation?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type UpdatesDeleteUpdateResponse = UpdatesDeleteUpdateHeaders & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
parsedHeaders: UpdatesDeleteUpdateHeaders;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export interface UpdatesGetFileOptionalParams extends coreHttp.OperationOptions {
|
||||
accessCondition?: AccessCondition;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type UpdatesGetFileResponse = File & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: File;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export type UpdatesGetFilesNextResponse = PageableListOfStrings & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: PageableListOfStrings;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export type UpdatesGetFilesResponse = PageableListOfStrings & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: PageableListOfStrings;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export type UpdatesGetNamesNextResponse = PageableListOfStrings & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: PageableListOfStrings;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export type UpdatesGetNamesResponse = PageableListOfStrings & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: PageableListOfStrings;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export interface UpdatesGetOperationHeaders {
|
||||
retryAfter?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface UpdatesGetOperationOptionalParams extends coreHttp.OperationOptions {
|
||||
accessCondition?: AccessCondition;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type UpdatesGetOperationResponse = UpdatesGetOperationHeaders & Operation & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: Operation;
|
||||
parsedHeaders: UpdatesGetOperationHeaders;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export interface UpdatesGetOperationsNextOptionalParams extends coreHttp.OperationOptions {
|
||||
filter?: string;
|
||||
top?: number;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type UpdatesGetOperationsNextResponse = PageableListOfOperations & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: PageableListOfOperations;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export interface UpdatesGetOperationsOptionalParams extends coreHttp.OperationOptions {
|
||||
filter?: string;
|
||||
top?: number;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type UpdatesGetOperationsResponse = PageableListOfOperations & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: PageableListOfOperations;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export type UpdatesGetProvidersNextResponse = PageableListOfStrings & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: PageableListOfStrings;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export type UpdatesGetProvidersResponse = PageableListOfStrings & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: PageableListOfStrings;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export interface UpdatesGetUpdateOptionalParams extends coreHttp.OperationOptions {
|
||||
accessCondition?: AccessCondition;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type UpdatesGetUpdateResponse = Update & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: Update;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export type UpdatesGetVersionsNextResponse = PageableListOfStrings & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: PageableListOfStrings;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export type UpdatesGetVersionsResponse = PageableListOfStrings & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
bodyAsText: string;
|
||||
parsedBody: PageableListOfStrings;
|
||||
};
|
||||
};
|
||||
|
||||
// @public
|
||||
export interface UpdatesImportUpdateHeaders {
|
||||
location?: string;
|
||||
operationLocation?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type UpdatesImportUpdateResponse = UpdatesImportUpdateHeaders & {
|
||||
_response: coreHttp.HttpResponse & {
|
||||
parsedHeaders: UpdatesImportUpdateHeaders;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
// (No @packageDocumentation comment for this package)
|
||||
|
||||
```
|
|
@ -1,13 +0,0 @@
|
|||
# Used in most samples. Retrieve these values from a IOT Device Update instance
|
||||
# in the Azure Portal.
|
||||
ACCOUNT_ENDPOINT=
|
||||
INSTANCE_ID=
|
||||
|
||||
# Used to authenticate using Azure AD as a service principal for role-based authentication
|
||||
# in the tokenAuth sample.
|
||||
#
|
||||
# See the documentation for `EnvironmentCredential` at the following link:
|
||||
# https://docs.microsoft.com/javascript/api/@azure/identity/environmentcredential
|
||||
AZURE_TENANT_ID=<AD tenant id or name>
|
||||
AZURE_CLIENT_ID=<ID of the user/service principal to authenticate as>
|
||||
AZURE_CLIENT_SECRET=<client secret used to authenticate to Azure AD>
|
|
@ -1,35 +0,0 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
/**
|
||||
* @summary Demonstrates the use of a DeviceUpdateClient to list all the update providers that have been imported to Device Update for IoT Hub
|
||||
* @azsdk-weight 40
|
||||
*/
|
||||
|
||||
import { DeviceUpdateClient } from "@azure/iot-device-update";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import { config } from "dotenv";
|
||||
|
||||
config();
|
||||
|
||||
const accountEndpoint = process.env["ACCOUNT_ENDPOINT"] || "<ACCOUNT_ENDPOINT>";
|
||||
const instanceId = process.env["INSTANCE_ID"] || "<INSTANCE_ID>";
|
||||
|
||||
/**
|
||||
* Get a list of all update providers that have been imported to Device Update for IoT Hub
|
||||
*/
|
||||
export async function main() {
|
||||
const credentials = new DefaultAzureCredential();
|
||||
const client = new DeviceUpdateClient(credentials, accountEndpoint, instanceId);
|
||||
|
||||
const providers = client.updates.listProviders();
|
||||
|
||||
for await (const provider of providers) {
|
||||
console.log(provider);
|
||||
}
|
||||
}
|
||||
|
||||
main().catch((error) => {
|
||||
console.error("An error occurred in the sample:", error);
|
||||
process.exit(1);
|
||||
});
|
|
@ -1,63 +0,0 @@
|
|||
---
|
||||
page_type: sample
|
||||
languages:
|
||||
- javascript
|
||||
products:
|
||||
- azure
|
||||
- azure-iot
|
||||
urlFragment: iot-device-update-javascript
|
||||
---
|
||||
|
||||
# Azure IoT Hub Device Update client library samples for JavaScript
|
||||
|
||||
These sample programs show how to use the JavaScript client libraries for Azure IoT Hub Device Update in some common scenarios.
|
||||
|
||||
| **File Name** | **Description** |
|
||||
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [updates.js][updates] | Demonstrates the use of a DeviceUpdateClient to list all the update providers that have been imported to Device Update for IoT Hub |
|
||||
|
||||
## Prerequisites
|
||||
|
||||
The sample programs are compatible with Node.js >=12.0.0.
|
||||
|
||||
You need [an Azure subscription][freesub] and the following Azure resources to run these sample programs:
|
||||
|
||||
- [Azure Device Update for IoT Hub instance][createinstance_azuredeviceupdateforiothubinstance]
|
||||
|
||||
Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function.
|
||||
|
||||
Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package].
|
||||
|
||||
## Setup
|
||||
|
||||
To run the samples using the published version of the package:
|
||||
|
||||
1. Install the dependencies using `npm`:
|
||||
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically.
|
||||
|
||||
3. Run whichever samples you like (note that some samples may require additional setup, see the table above):
|
||||
|
||||
```bash
|
||||
node updates.js
|
||||
```
|
||||
|
||||
Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform):
|
||||
|
||||
```bash
|
||||
npx cross-env ACCOUNT_ENDPOINT="<account endpoint>" INSTANCE_ID="<instance id>" node updates.js
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
|
||||
|
||||
[updates]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceupdate/iot-device-update/samples/v1/javascript/updates.js
|
||||
[apiref]: https://docs.microsoft.com/javascript/api/@azure/iot-device-update
|
||||
[freesub]: https://azure.microsoft.com/free/
|
||||
[createinstance_azuredeviceupdateforiothubinstance]: https://docs.microsoft.com/azure/iot-hub-device-update/understand-device-update
|
||||
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/deviceupdate/iot-device-update/README.md
|
|
@ -1,33 +0,0 @@
|
|||
{
|
||||
"name": "azure-iot-device-update-samples-js",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"description": "Azure IoT Hub Device Update client library samples for JavaScript",
|
||||
"engine": {
|
||||
"node": ">=12.0.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
|
||||
"directory": "sdk/deviceupdate/iot-device-update"
|
||||
},
|
||||
"keywords": [
|
||||
"node",
|
||||
"azure",
|
||||
"typescript",
|
||||
"browser",
|
||||
"isomorphic",
|
||||
"cloud"
|
||||
],
|
||||
"author": "Microsoft Corporation",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
|
||||
},
|
||||
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/deviceupdate/iot-device-update",
|
||||
"dependencies": {
|
||||
"@azure/iot-device-update": "next",
|
||||
"dotenv": "latest",
|
||||
"@azure/identity": "^2.0.1"
|
||||
}
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
# Used in most samples. Retrieve these values from a IOT Device Update instance
|
||||
# in the Azure Portal.
|
||||
ACCOUNT_ENDPOINT=
|
||||
INSTANCE_ID=
|
||||
|
||||
# Used to authenticate using Azure AD as a service principal for role-based authentication
|
||||
# in the tokenAuth sample.
|
||||
#
|
||||
# See the documentation for `EnvironmentCredential` at the following link:
|
||||
# https://docs.microsoft.com/javascript/api/@azure/identity/environmentcredential
|
||||
AZURE_TENANT_ID=<AD tenant id or name>
|
||||
AZURE_CLIENT_ID=<ID of the user/service principal to authenticate as>
|
||||
AZURE_CLIENT_SECRET=<client secret used to authenticate to Azure AD>
|
|
@ -1,30 +0,0 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
/**
|
||||
* @summary Demonstrates the use of a DeviceUpdateClient to list all the update providers that have been imported to Device Update for IoT Hub
|
||||
*/
|
||||
const { DeviceUpdateClient } = require("@azure/iot-device-update");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
const { config } = require("dotenv");
|
||||
|
||||
config();
|
||||
|
||||
const accountEndpoint = process.env["ACCOUNT_ENDPOINT"] || "<ACCOUNT_ENDPOINT>";
|
||||
const instanceId = process.env["INSTANCE_ID"] || "<INSTANCE_ID>";
|
||||
|
||||
/**
|
||||
* Get a list of all update providers that have been imported to Device Update for IoT Hub
|
||||
*/
|
||||
async function main() {
|
||||
const credentials = new DefaultAzureCredential();
|
||||
const client = new DeviceUpdateClient(credentials, accountEndpoint, instanceId);
|
||||
|
||||
const providers = client.updates.listProviders();
|
||||
|
||||
for await (const provider of providers) {
|
||||
console.log(provider);
|
||||
}
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -1,76 +0,0 @@
|
|||
---
|
||||
page_type: sample
|
||||
languages:
|
||||
- typescript
|
||||
products:
|
||||
- azure
|
||||
- azure-iot
|
||||
urlFragment: iot-device-update-typescript
|
||||
---
|
||||
|
||||
# Azure IoT Hub Device Update client library samples for TypeScript
|
||||
|
||||
These sample programs show how to use the TypeScript client libraries for Azure IoT Hub Device Update in some common scenarios.
|
||||
|
||||
| **File Name** | **Description** |
|
||||
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [updates.ts][updates] | Demonstrates the use of a DeviceUpdateClient to list all the update providers that have been imported to Device Update for IoT Hub |
|
||||
|
||||
## Prerequisites
|
||||
|
||||
The sample programs are compatible with Node.js >=12.0.0.
|
||||
|
||||
Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using:
|
||||
|
||||
```bash
|
||||
npm install -g typescript
|
||||
```
|
||||
|
||||
You need [an Azure subscription][freesub] and the following Azure resources to run these sample programs:
|
||||
|
||||
- [Azure Device Update for IoT Hub instance][createinstance_azuredeviceupdateforiothubinstance]
|
||||
|
||||
Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function.
|
||||
|
||||
Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package].
|
||||
|
||||
## Setup
|
||||
|
||||
To run the samples using the published version of the package:
|
||||
|
||||
1. Install the dependencies using `npm`:
|
||||
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
2. Compile the samples:
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically.
|
||||
|
||||
4. Run whichever samples you like (note that some samples may require additional setup, see the table above):
|
||||
|
||||
```bash
|
||||
node dist/updates.ts
|
||||
```
|
||||
|
||||
Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform):
|
||||
|
||||
```bash
|
||||
npx cross-env ACCOUNT_ENDPOINT="<account endpoint>" INSTANCE_ID="<instance id>" node dist/updates.js
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
|
||||
|
||||
[updates]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceupdate/iot-device-update/samples/v1/typescript/src/updates.ts
|
||||
[apiref]: https://docs.microsoft.com/javascript/api/@azure/iot-device-update
|
||||
[freesub]: https://azure.microsoft.com/free/
|
||||
[createinstance_azuredeviceupdateforiothubinstance]: https://docs.microsoft.com/azure/iot-hub-device-update/understand-device-update
|
||||
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/deviceupdate/iot-device-update/README.md
|
||||
[typescript]: https://www.typescriptlang.org/docs/home.html
|
|
@ -1,41 +0,0 @@
|
|||
{
|
||||
"name": "azure-iot-device-update-samples-ts",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"description": "Azure IoT Hub Device Update client library samples for TypeScript",
|
||||
"engine": {
|
||||
"node": ">=12.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"prebuild": "rimraf dist/"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
|
||||
"directory": "sdk/deviceupdate/iot-device-update"
|
||||
},
|
||||
"keywords": [
|
||||
"node",
|
||||
"azure",
|
||||
"typescript",
|
||||
"browser",
|
||||
"isomorphic",
|
||||
"cloud"
|
||||
],
|
||||
"author": "Microsoft Corporation",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
|
||||
},
|
||||
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/deviceupdate/iot-device-update",
|
||||
"dependencies": {
|
||||
"@azure/iot-device-update": "next",
|
||||
"dotenv": "latest",
|
||||
"@azure/identity": "^2.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "~4.2.0",
|
||||
"rimraf": "latest"
|
||||
}
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
# Used in most samples. Retrieve these values from a IOT Device Update instance
|
||||
# in the Azure Portal.
|
||||
ACCOUNT_ENDPOINT=
|
||||
INSTANCE_ID=
|
||||
|
||||
# Used to authenticate using Azure AD as a service principal for role-based authentication
|
||||
# in the tokenAuth sample.
|
||||
#
|
||||
# See the documentation for `EnvironmentCredential` at the following link:
|
||||
# https://docs.microsoft.com/javascript/api/@azure/identity/environmentcredential
|
||||
AZURE_TENANT_ID=<AD tenant id or name>
|
||||
AZURE_CLIENT_ID=<ID of the user/service principal to authenticate as>
|
||||
AZURE_CLIENT_SECRET=<client secret used to authenticate to Azure AD>
|
|
@ -1,30 +0,0 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
/**
|
||||
* @summary Demonstrates the use of a DeviceUpdateClient to list all the update providers that have been imported to Device Update for IoT Hub
|
||||
*/
|
||||
import { DeviceUpdateClient } from "@azure/iot-device-update";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import { config } from "dotenv";
|
||||
|
||||
config();
|
||||
|
||||
const accountEndpoint = process.env["ACCOUNT_ENDPOINT"] || "<ACCOUNT_ENDPOINT>";
|
||||
const instanceId = process.env["INSTANCE_ID"] || "<INSTANCE_ID>";
|
||||
|
||||
/**
|
||||
* Get a list of all update providers that have been imported to Device Update for IoT Hub
|
||||
*/
|
||||
export async function main() {
|
||||
const credentials = new DefaultAzureCredential();
|
||||
const client = new DeviceUpdateClient(credentials, accountEndpoint, instanceId);
|
||||
|
||||
const providers = client.updates.listProviders();
|
||||
|
||||
for await (const provider of providers) {
|
||||
console.log(provider);
|
||||
}
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -1,17 +0,0 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2018",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"resolveJsonModule": true,
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"strict": true,
|
||||
"alwaysStrict": true,
|
||||
"outDir": "dist",
|
||||
"rootDir": "src"
|
||||
},
|
||||
"include": [
|
||||
"src/**.ts"
|
||||
]
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
import * as coreHttp from "@azure/core-http";
|
||||
import { Updates, Devices, Deployments } from "./operations";
|
||||
import { DeviceUpdateClientContext } from "./deviceUpdateClientContext";
|
||||
import { DeviceUpdateClientOptionalParams } from "./models";
|
||||
|
||||
export class DeviceUpdateClient extends DeviceUpdateClientContext {
|
||||
/**
|
||||
* Initializes a new instance of the DeviceUpdateClient class.
|
||||
* @param credentials Subscription credentials which uniquely identify client subscription.
|
||||
* @param accountEndpoint Account endpoint.
|
||||
* @param instanceId Account instance identifier.
|
||||
* @param options The parameter options
|
||||
*/
|
||||
constructor(
|
||||
credentials: coreHttp.TokenCredential | coreHttp.ServiceClientCredentials,
|
||||
accountEndpoint: string,
|
||||
instanceId: string,
|
||||
options?: DeviceUpdateClientOptionalParams
|
||||
) {
|
||||
super(credentials, accountEndpoint, instanceId, options);
|
||||
this.updates = new Updates(this);
|
||||
this.devices = new Devices(this);
|
||||
this.deployments = new Deployments(this);
|
||||
}
|
||||
|
||||
updates: Updates;
|
||||
devices: Devices;
|
||||
deployments: Deployments;
|
||||
}
|
|
@ -1,66 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
import * as coreHttp from "@azure/core-http";
|
||||
import { DeviceUpdateClientOptionalParams } from "./models";
|
||||
|
||||
const packageName = "@azure/iot-device-update";
|
||||
const packageVersion = "1.0.0-beta.2";
|
||||
|
||||
export class DeviceUpdateClientContext extends coreHttp.ServiceClient {
|
||||
accountEndpoint: string;
|
||||
instanceId: string;
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the DeviceUpdateClientContext class.
|
||||
* @param credentials Subscription credentials which uniquely identify client subscription.
|
||||
* @param accountEndpoint Account endpoint.
|
||||
* @param instanceId Account instance identifier.
|
||||
* @param options The parameter options
|
||||
*/
|
||||
constructor(
|
||||
credentials: coreHttp.TokenCredential | coreHttp.ServiceClientCredentials,
|
||||
accountEndpoint: string,
|
||||
instanceId: string,
|
||||
options?: DeviceUpdateClientOptionalParams
|
||||
) {
|
||||
if (credentials === undefined) {
|
||||
throw new Error("'credentials' cannot be null");
|
||||
}
|
||||
if (accountEndpoint === undefined) {
|
||||
throw new Error("'accountEndpoint' cannot be null");
|
||||
}
|
||||
if (instanceId === undefined) {
|
||||
throw new Error("'instanceId' cannot be null");
|
||||
}
|
||||
|
||||
// Initializing default values for options
|
||||
if (!options) {
|
||||
options = {};
|
||||
}
|
||||
|
||||
if (!options.userAgent) {
|
||||
const defaultUserAgent = coreHttp.getDefaultUserAgentValue();
|
||||
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
|
||||
}
|
||||
|
||||
if (!options.credentialScopes) {
|
||||
options.credentialScopes = ["https://api.adu.microsoft.com/.default"];
|
||||
}
|
||||
|
||||
super(credentials, options);
|
||||
|
||||
this.requestContentType = "application/json; charset=utf-8";
|
||||
|
||||
this.baseUri = options.endpoint || "https://{accountEndpoint}";
|
||||
|
||||
// Parameter assignments
|
||||
this.accountEndpoint = accountEndpoint;
|
||||
this.instanceId = instanceId;
|
||||
}
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
/*
|
||||
* 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 { DeviceUpdateClient } from "./deviceUpdateClient";
|
||||
export { DeviceUpdateClientContext } from "./deviceUpdateClientContext";
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,269 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
import {
|
||||
OperationParameter,
|
||||
OperationURLParameter,
|
||||
OperationQueryParameter,
|
||||
} from "@azure/core-http";
|
||||
import {
|
||||
ImportUpdateInput as ImportUpdateInputMapper,
|
||||
Group as GroupMapper,
|
||||
Deployment as DeploymentMapper,
|
||||
} from "../models/mappers";
|
||||
|
||||
export const contentType: OperationParameter = {
|
||||
parameterPath: ["options", "contentType"],
|
||||
mapper: {
|
||||
defaultValue: "application/json",
|
||||
isConstant: true,
|
||||
serializedName: "Content-Type",
|
||||
type: {
|
||||
name: "String",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const updateToImport: OperationParameter = {
|
||||
parameterPath: "updateToImport",
|
||||
mapper: ImportUpdateInputMapper,
|
||||
};
|
||||
|
||||
export const accountEndpoint: OperationURLParameter = {
|
||||
parameterPath: "accountEndpoint",
|
||||
mapper: {
|
||||
serializedName: "accountEndpoint",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String",
|
||||
},
|
||||
},
|
||||
skipEncoding: true,
|
||||
};
|
||||
|
||||
export const instanceId: OperationURLParameter = {
|
||||
parameterPath: "instanceId",
|
||||
mapper: {
|
||||
serializedName: "instanceId",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String",
|
||||
},
|
||||
},
|
||||
skipEncoding: true,
|
||||
};
|
||||
|
||||
export const action: OperationQueryParameter = {
|
||||
parameterPath: "action",
|
||||
mapper: {
|
||||
defaultValue: "import",
|
||||
isConstant: true,
|
||||
serializedName: "action",
|
||||
type: {
|
||||
name: "String",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const accept: OperationParameter = {
|
||||
parameterPath: "accept",
|
||||
mapper: {
|
||||
defaultValue: "application/json",
|
||||
isConstant: true,
|
||||
serializedName: "Accept",
|
||||
type: {
|
||||
name: "String",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const provider: OperationURLParameter = {
|
||||
parameterPath: "provider",
|
||||
mapper: {
|
||||
serializedName: "provider",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const name: OperationURLParameter = {
|
||||
parameterPath: "name",
|
||||
mapper: {
|
||||
serializedName: "name",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const version: OperationURLParameter = {
|
||||
parameterPath: "version",
|
||||
mapper: {
|
||||
serializedName: "version",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const ifNoneMatch: OperationParameter = {
|
||||
parameterPath: ["options", "accessCondition", "ifNoneMatch"],
|
||||
mapper: {
|
||||
serializedName: "If-None-Match",
|
||||
type: {
|
||||
name: "String",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const fileId: OperationURLParameter = {
|
||||
parameterPath: "fileId",
|
||||
mapper: {
|
||||
serializedName: "fileId",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const filter: OperationQueryParameter = {
|
||||
parameterPath: ["options", "filter"],
|
||||
mapper: {
|
||||
serializedName: "$filter",
|
||||
type: {
|
||||
name: "String",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const top: OperationQueryParameter = {
|
||||
parameterPath: ["options", "top"],
|
||||
mapper: {
|
||||
serializedName: "$top",
|
||||
type: {
|
||||
name: "Number",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const operationId: OperationURLParameter = {
|
||||
parameterPath: "operationId",
|
||||
mapper: {
|
||||
serializedName: "operationId",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const nextLink: OperationURLParameter = {
|
||||
parameterPath: "nextLink",
|
||||
mapper: {
|
||||
serializedName: "nextLink",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String",
|
||||
},
|
||||
},
|
||||
skipEncoding: true,
|
||||
};
|
||||
|
||||
export const deviceClassId: OperationURLParameter = {
|
||||
parameterPath: "deviceClassId",
|
||||
mapper: {
|
||||
serializedName: "deviceClassId",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const deviceId: OperationURLParameter = {
|
||||
parameterPath: "deviceId",
|
||||
mapper: {
|
||||
serializedName: "deviceId",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const tagName: OperationURLParameter = {
|
||||
parameterPath: "tagName",
|
||||
mapper: {
|
||||
serializedName: "tagName",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const groupId: OperationURLParameter = {
|
||||
parameterPath: "groupId",
|
||||
mapper: {
|
||||
serializedName: "groupId",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const group: OperationParameter = {
|
||||
parameterPath: "group",
|
||||
mapper: GroupMapper,
|
||||
};
|
||||
|
||||
export const deploymentId: OperationURLParameter = {
|
||||
parameterPath: "deploymentId",
|
||||
mapper: {
|
||||
serializedName: "deploymentId",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const deployment: OperationParameter = {
|
||||
parameterPath: "deployment",
|
||||
mapper: DeploymentMapper,
|
||||
};
|
||||
|
||||
export const action1: OperationQueryParameter = {
|
||||
parameterPath: "action",
|
||||
mapper: {
|
||||
defaultValue: "cancel",
|
||||
isConstant: true,
|
||||
serializedName: "action",
|
||||
type: {
|
||||
name: "String",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const action2: OperationQueryParameter = {
|
||||
parameterPath: "action",
|
||||
mapper: {
|
||||
defaultValue: "retry",
|
||||
isConstant: true,
|
||||
serializedName: "action",
|
||||
type: {
|
||||
name: "String",
|
||||
},
|
||||
},
|
||||
};
|
|
@ -1,636 +0,0 @@
|
|||
/*
|
||||
* 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 { SpanStatusCode } from "@azure/core-tracing";
|
||||
import { createSpan } from "../tracing";
|
||||
import { PagedAsyncIterableIterator } from "@azure/core-paging";
|
||||
import * as coreHttp from "@azure/core-http";
|
||||
import * as Mappers from "../models/mappers";
|
||||
import * as Parameters from "../models/parameters";
|
||||
import { DeviceUpdateClientContext } from "../deviceUpdateClientContext";
|
||||
import {
|
||||
Deployment,
|
||||
DeploymentsGetAllDeploymentsNextOptionalParams,
|
||||
DeploymentsGetAllDeploymentsOptionalParams,
|
||||
DeploymentDeviceState,
|
||||
DeploymentsGetDeploymentDevicesNextOptionalParams,
|
||||
DeploymentsGetDeploymentDevicesOptionalParams,
|
||||
DeploymentsGetAllDeploymentsResponse,
|
||||
DeploymentsGetDeploymentResponse,
|
||||
DeploymentsCreateOrUpdateDeploymentResponse,
|
||||
DeploymentsGetDeploymentStatusResponse,
|
||||
DeploymentsGetDeploymentDevicesResponse,
|
||||
DeploymentsCancelDeploymentResponse,
|
||||
DeploymentsRetryDeploymentResponse,
|
||||
DeploymentsGetAllDeploymentsNextResponse,
|
||||
DeploymentsGetDeploymentDevicesNextResponse,
|
||||
} from "../models";
|
||||
|
||||
/** Class representing a Deployments. */
|
||||
export class Deployments {
|
||||
private readonly client: DeviceUpdateClientContext;
|
||||
|
||||
/**
|
||||
* Initialize a new instance of the class Deployments class.
|
||||
* @param client Reference to the service client
|
||||
*/
|
||||
constructor(client: DeviceUpdateClientContext) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a list of deployments.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
public listAllDeployments(
|
||||
options?: DeploymentsGetAllDeploymentsOptionalParams
|
||||
): PagedAsyncIterableIterator<Deployment> {
|
||||
const iter = this.getAllDeploymentsPagingAll(options);
|
||||
return {
|
||||
next() {
|
||||
return iter.next();
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return this;
|
||||
},
|
||||
byPage: () => {
|
||||
return this.getAllDeploymentsPagingPage(options);
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
private async *getAllDeploymentsPagingPage(
|
||||
options?: DeploymentsGetAllDeploymentsOptionalParams
|
||||
): AsyncIterableIterator<Deployment[]> {
|
||||
let result = await this._getAllDeployments(options);
|
||||
yield result.value || [];
|
||||
let continuationToken = result.nextLink;
|
||||
while (continuationToken) {
|
||||
result = await this._getAllDeploymentsNext(continuationToken, options);
|
||||
continuationToken = result.nextLink;
|
||||
yield result.value || [];
|
||||
}
|
||||
}
|
||||
|
||||
private async *getAllDeploymentsPagingAll(
|
||||
options?: DeploymentsGetAllDeploymentsOptionalParams
|
||||
): AsyncIterableIterator<Deployment> {
|
||||
for await (const page of this.getAllDeploymentsPagingPage(options)) {
|
||||
yield* page;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a list of devices in a deployment along with their state. Useful for getting a list of failed
|
||||
* devices.
|
||||
* @param deploymentId Deployment identifier.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
public listDeploymentDevices(
|
||||
deploymentId: string,
|
||||
options?: DeploymentsGetDeploymentDevicesOptionalParams
|
||||
): PagedAsyncIterableIterator<DeploymentDeviceState> {
|
||||
const iter = this.getDeploymentDevicesPagingAll(deploymentId, options);
|
||||
return {
|
||||
next() {
|
||||
return iter.next();
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return this;
|
||||
},
|
||||
byPage: () => {
|
||||
return this.getDeploymentDevicesPagingPage(deploymentId, options);
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
private async *getDeploymentDevicesPagingPage(
|
||||
deploymentId: string,
|
||||
options?: DeploymentsGetDeploymentDevicesOptionalParams
|
||||
): AsyncIterableIterator<DeploymentDeviceState[]> {
|
||||
let result = await this._getDeploymentDevices(deploymentId, options);
|
||||
yield result.value || [];
|
||||
let continuationToken = result.nextLink;
|
||||
while (continuationToken) {
|
||||
result = await this._getDeploymentDevicesNext(deploymentId, continuationToken, options);
|
||||
continuationToken = result.nextLink;
|
||||
yield result.value || [];
|
||||
}
|
||||
}
|
||||
|
||||
private async *getDeploymentDevicesPagingAll(
|
||||
deploymentId: string,
|
||||
options?: DeploymentsGetDeploymentDevicesOptionalParams
|
||||
): AsyncIterableIterator<DeploymentDeviceState> {
|
||||
for await (const page of this.getDeploymentDevicesPagingPage(deploymentId, options)) {
|
||||
yield* page;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a list of deployments.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
private async _getAllDeployments(
|
||||
options?: DeploymentsGetAllDeploymentsOptionalParams
|
||||
): Promise<DeploymentsGetAllDeploymentsResponse> {
|
||||
const { span, updatedOptions } = createSpan(
|
||||
"DeviceUpdateClient-_getAllDeployments",
|
||||
coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
||||
);
|
||||
const operationArguments: coreHttp.OperationArguments = {
|
||||
options: updatedOptions,
|
||||
};
|
||||
try {
|
||||
const result = await this.client.sendOperationRequest(
|
||||
operationArguments,
|
||||
getAllDeploymentsOperationSpec
|
||||
);
|
||||
return result as DeploymentsGetAllDeploymentsResponse;
|
||||
} catch (error) {
|
||||
span.setStatus({
|
||||
code: SpanStatusCode.ERROR,
|
||||
message: error.message,
|
||||
});
|
||||
throw error;
|
||||
} finally {
|
||||
span.end();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the properties of a deployment.
|
||||
* @param deploymentId Deployment identifier.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
async getDeployment(
|
||||
deploymentId: string,
|
||||
options?: coreHttp.OperationOptions
|
||||
): Promise<DeploymentsGetDeploymentResponse> {
|
||||
const { span, updatedOptions } = createSpan(
|
||||
"DeviceUpdateClient-getDeployment",
|
||||
coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
||||
);
|
||||
const operationArguments: coreHttp.OperationArguments = {
|
||||
deploymentId,
|
||||
options: updatedOptions,
|
||||
};
|
||||
try {
|
||||
const result = await this.client.sendOperationRequest(
|
||||
operationArguments,
|
||||
getDeploymentOperationSpec
|
||||
);
|
||||
return result as DeploymentsGetDeploymentResponse;
|
||||
} catch (error) {
|
||||
span.setStatus({
|
||||
code: SpanStatusCode.ERROR,
|
||||
message: error.message,
|
||||
});
|
||||
throw error;
|
||||
} finally {
|
||||
span.end();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates or updates a deployment.
|
||||
* @param deploymentId Deployment identifier.
|
||||
* @param deployment The deployment properties.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
async createOrUpdateDeployment(
|
||||
deploymentId: string,
|
||||
deployment: Deployment,
|
||||
options?: coreHttp.OperationOptions
|
||||
): Promise<DeploymentsCreateOrUpdateDeploymentResponse> {
|
||||
const { span, updatedOptions } = createSpan(
|
||||
"DeviceUpdateClient-createOrUpdateDeployment",
|
||||
coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
||||
);
|
||||
const operationArguments: coreHttp.OperationArguments = {
|
||||
deploymentId,
|
||||
deployment,
|
||||
options: updatedOptions,
|
||||
};
|
||||
try {
|
||||
const result = await this.client.sendOperationRequest(
|
||||
operationArguments,
|
||||
createOrUpdateDeploymentOperationSpec
|
||||
);
|
||||
return result as DeploymentsCreateOrUpdateDeploymentResponse;
|
||||
} catch (error) {
|
||||
span.setStatus({
|
||||
code: SpanStatusCode.ERROR,
|
||||
message: error.message,
|
||||
});
|
||||
throw error;
|
||||
} finally {
|
||||
span.end();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a deployment.
|
||||
* @param deploymentId Deployment identifier.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
async deleteDeployment(
|
||||
deploymentId: string,
|
||||
options?: coreHttp.OperationOptions
|
||||
): Promise<coreHttp.RestResponse> {
|
||||
const { span, updatedOptions } = createSpan(
|
||||
"DeviceUpdateClient-deleteDeployment",
|
||||
coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
||||
);
|
||||
const operationArguments: coreHttp.OperationArguments = {
|
||||
deploymentId,
|
||||
options: updatedOptions,
|
||||
};
|
||||
try {
|
||||
const result = await this.client.sendOperationRequest(
|
||||
operationArguments,
|
||||
deleteDeploymentOperationSpec
|
||||
);
|
||||
return result as coreHttp.RestResponse;
|
||||
} catch (error) {
|
||||
span.setStatus({
|
||||
code: SpanStatusCode.ERROR,
|
||||
message: error.message,
|
||||
});
|
||||
throw error;
|
||||
} finally {
|
||||
span.end();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the status of a deployment including a breakdown of how many devices in the deployment are in
|
||||
* progress, completed, or failed.
|
||||
* @param deploymentId Deployment identifier.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
async getDeploymentStatus(
|
||||
deploymentId: string,
|
||||
options?: coreHttp.OperationOptions
|
||||
): Promise<DeploymentsGetDeploymentStatusResponse> {
|
||||
const { span, updatedOptions } = createSpan(
|
||||
"DeviceUpdateClient-getDeploymentStatus",
|
||||
coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
||||
);
|
||||
const operationArguments: coreHttp.OperationArguments = {
|
||||
deploymentId,
|
||||
options: updatedOptions,
|
||||
};
|
||||
try {
|
||||
const result = await this.client.sendOperationRequest(
|
||||
operationArguments,
|
||||
getDeploymentStatusOperationSpec
|
||||
);
|
||||
return result as DeploymentsGetDeploymentStatusResponse;
|
||||
} catch (error) {
|
||||
span.setStatus({
|
||||
code: SpanStatusCode.ERROR,
|
||||
message: error.message,
|
||||
});
|
||||
throw error;
|
||||
} finally {
|
||||
span.end();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a list of devices in a deployment along with their state. Useful for getting a list of failed
|
||||
* devices.
|
||||
* @param deploymentId Deployment identifier.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
private async _getDeploymentDevices(
|
||||
deploymentId: string,
|
||||
options?: DeploymentsGetDeploymentDevicesOptionalParams
|
||||
): Promise<DeploymentsGetDeploymentDevicesResponse> {
|
||||
const { span, updatedOptions } = createSpan(
|
||||
"DeviceUpdateClient-_getDeploymentDevices",
|
||||
coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
||||
);
|
||||
const operationArguments: coreHttp.OperationArguments = {
|
||||
deploymentId,
|
||||
options: updatedOptions,
|
||||
};
|
||||
try {
|
||||
const result = await this.client.sendOperationRequest(
|
||||
operationArguments,
|
||||
getDeploymentDevicesOperationSpec
|
||||
);
|
||||
return result as DeploymentsGetDeploymentDevicesResponse;
|
||||
} catch (error) {
|
||||
span.setStatus({
|
||||
code: SpanStatusCode.ERROR,
|
||||
message: error.message,
|
||||
});
|
||||
throw error;
|
||||
} finally {
|
||||
span.end();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancels a deployment.
|
||||
* @param deploymentId Deployment identifier.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
async cancelDeployment(
|
||||
deploymentId: string,
|
||||
options?: coreHttp.OperationOptions
|
||||
): Promise<DeploymentsCancelDeploymentResponse> {
|
||||
const { span, updatedOptions } = createSpan(
|
||||
"DeviceUpdateClient-cancelDeployment",
|
||||
coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
||||
);
|
||||
const operationArguments: coreHttp.OperationArguments = {
|
||||
deploymentId,
|
||||
options: updatedOptions,
|
||||
};
|
||||
try {
|
||||
const result = await this.client.sendOperationRequest(
|
||||
operationArguments,
|
||||
cancelDeploymentOperationSpec
|
||||
);
|
||||
return result as DeploymentsCancelDeploymentResponse;
|
||||
} catch (error) {
|
||||
span.setStatus({
|
||||
code: SpanStatusCode.ERROR,
|
||||
message: error.message,
|
||||
});
|
||||
throw error;
|
||||
} finally {
|
||||
span.end();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retries a deployment with failed devices.
|
||||
* @param deploymentId Deployment identifier.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
async retryDeployment(
|
||||
deploymentId: string,
|
||||
options?: coreHttp.OperationOptions
|
||||
): Promise<DeploymentsRetryDeploymentResponse> {
|
||||
const { span, updatedOptions } = createSpan(
|
||||
"DeviceUpdateClient-retryDeployment",
|
||||
coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
||||
);
|
||||
const operationArguments: coreHttp.OperationArguments = {
|
||||
deploymentId,
|
||||
options: updatedOptions,
|
||||
};
|
||||
try {
|
||||
const result = await this.client.sendOperationRequest(
|
||||
operationArguments,
|
||||
retryDeploymentOperationSpec
|
||||
);
|
||||
return result as DeploymentsRetryDeploymentResponse;
|
||||
} catch (error) {
|
||||
span.setStatus({
|
||||
code: SpanStatusCode.ERROR,
|
||||
message: error.message,
|
||||
});
|
||||
throw error;
|
||||
} finally {
|
||||
span.end();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* GetAllDeploymentsNext
|
||||
* @param nextLink The nextLink from the previous successful call to the GetAllDeployments method.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
private async _getAllDeploymentsNext(
|
||||
nextLink: string,
|
||||
options?: DeploymentsGetAllDeploymentsNextOptionalParams
|
||||
): Promise<DeploymentsGetAllDeploymentsNextResponse> {
|
||||
const { span, updatedOptions } = createSpan(
|
||||
"DeviceUpdateClient-_getAllDeploymentsNext",
|
||||
coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
||||
);
|
||||
const operationArguments: coreHttp.OperationArguments = {
|
||||
nextLink,
|
||||
options: updatedOptions,
|
||||
};
|
||||
try {
|
||||
const result = await this.client.sendOperationRequest(
|
||||
operationArguments,
|
||||
getAllDeploymentsNextOperationSpec
|
||||
);
|
||||
return result as DeploymentsGetAllDeploymentsNextResponse;
|
||||
} catch (error) {
|
||||
span.setStatus({
|
||||
code: SpanStatusCode.ERROR,
|
||||
message: error.message,
|
||||
});
|
||||
throw error;
|
||||
} finally {
|
||||
span.end();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* GetDeploymentDevicesNext
|
||||
* @param deploymentId Deployment identifier.
|
||||
* @param nextLink The nextLink from the previous successful call to the GetDeploymentDevices method.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
private async _getDeploymentDevicesNext(
|
||||
deploymentId: string,
|
||||
nextLink: string,
|
||||
options?: DeploymentsGetDeploymentDevicesNextOptionalParams
|
||||
): Promise<DeploymentsGetDeploymentDevicesNextResponse> {
|
||||
const { span, updatedOptions } = createSpan(
|
||||
"DeviceUpdateClient-_getDeploymentDevicesNext",
|
||||
coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
||||
);
|
||||
const operationArguments: coreHttp.OperationArguments = {
|
||||
deploymentId,
|
||||
nextLink,
|
||||
options: updatedOptions,
|
||||
};
|
||||
try {
|
||||
const result = await this.client.sendOperationRequest(
|
||||
operationArguments,
|
||||
getDeploymentDevicesNextOperationSpec
|
||||
);
|
||||
return result as DeploymentsGetDeploymentDevicesNextResponse;
|
||||
} catch (error) {
|
||||
span.setStatus({
|
||||
code: SpanStatusCode.ERROR,
|
||||
message: error.message,
|
||||
});
|
||||
throw error;
|
||||
} finally {
|
||||
span.end();
|
||||
}
|
||||
}
|
||||
}
|
||||
// Operation Specifications
|
||||
const serializer = new coreHttp.Serializer(Mappers, /* isXml */ false);
|
||||
|
||||
const getAllDeploymentsOperationSpec: coreHttp.OperationSpec = {
|
||||
path: "/deviceupdate/{instanceId}/v2/management/deployments",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.PageableListOfDeployments,
|
||||
},
|
||||
},
|
||||
queryParameters: [Parameters.filter],
|
||||
urlParameters: [Parameters.accountEndpoint, Parameters.instanceId],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer,
|
||||
};
|
||||
const getDeploymentOperationSpec: coreHttp.OperationSpec = {
|
||||
path: "/deviceupdate/{instanceId}/v2/management/deployments/{deploymentId}",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.Deployment,
|
||||
},
|
||||
404: {
|
||||
isError: true,
|
||||
},
|
||||
},
|
||||
urlParameters: [Parameters.accountEndpoint, Parameters.instanceId, Parameters.deploymentId],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer,
|
||||
};
|
||||
const createOrUpdateDeploymentOperationSpec: coreHttp.OperationSpec = {
|
||||
path: "/deviceupdate/{instanceId}/v2/management/deployments/{deploymentId}",
|
||||
httpMethod: "PUT",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.Deployment,
|
||||
},
|
||||
404: {
|
||||
isError: true,
|
||||
},
|
||||
},
|
||||
requestBody: Parameters.deployment,
|
||||
urlParameters: [Parameters.accountEndpoint, Parameters.instanceId, Parameters.deploymentId],
|
||||
headerParameters: [Parameters.contentType, Parameters.accept],
|
||||
mediaType: "json",
|
||||
serializer,
|
||||
};
|
||||
const deleteDeploymentOperationSpec: coreHttp.OperationSpec = {
|
||||
path: "/deviceupdate/{instanceId}/v2/management/deployments/{deploymentId}",
|
||||
httpMethod: "DELETE",
|
||||
responses: {
|
||||
200: {},
|
||||
404: {
|
||||
isError: true,
|
||||
},
|
||||
},
|
||||
urlParameters: [Parameters.accountEndpoint, Parameters.instanceId, Parameters.deploymentId],
|
||||
serializer,
|
||||
};
|
||||
const getDeploymentStatusOperationSpec: coreHttp.OperationSpec = {
|
||||
path: "/deviceupdate/{instanceId}/v2/management/deployments/{deploymentId}/status",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.DeploymentStatus,
|
||||
},
|
||||
404: {
|
||||
isError: true,
|
||||
},
|
||||
},
|
||||
urlParameters: [Parameters.accountEndpoint, Parameters.instanceId, Parameters.deploymentId],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer,
|
||||
};
|
||||
const getDeploymentDevicesOperationSpec: coreHttp.OperationSpec = {
|
||||
path: "/deviceupdate/{instanceId}/v2/management/deployments/{deploymentId}/devicestates",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.PageableListOfDeploymentDeviceStates,
|
||||
},
|
||||
404: {
|
||||
isError: true,
|
||||
},
|
||||
},
|
||||
queryParameters: [Parameters.filter],
|
||||
urlParameters: [Parameters.accountEndpoint, Parameters.instanceId, Parameters.deploymentId],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer,
|
||||
};
|
||||
const cancelDeploymentOperationSpec: coreHttp.OperationSpec = {
|
||||
path: "/deviceupdate/{instanceId}/v2/management/deployments/{deploymentId}",
|
||||
httpMethod: "POST",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.Deployment,
|
||||
},
|
||||
404: {
|
||||
isError: true,
|
||||
},
|
||||
},
|
||||
queryParameters: [Parameters.action1],
|
||||
urlParameters: [Parameters.accountEndpoint, Parameters.instanceId, Parameters.deploymentId],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer,
|
||||
};
|
||||
const retryDeploymentOperationSpec: coreHttp.OperationSpec = {
|
||||
path: "/deviceupdate/{instanceId}/v2/management/deployments/{deploymentId}",
|
||||
httpMethod: "POST",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.Deployment,
|
||||
},
|
||||
404: {
|
||||
isError: true,
|
||||
},
|
||||
},
|
||||
queryParameters: [Parameters.action2],
|
||||
urlParameters: [Parameters.accountEndpoint, Parameters.instanceId, Parameters.deploymentId],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer,
|
||||
};
|
||||
const getAllDeploymentsNextOperationSpec: coreHttp.OperationSpec = {
|
||||
path: "{nextLink}",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.PageableListOfDeployments,
|
||||
},
|
||||
},
|
||||
queryParameters: [Parameters.filter],
|
||||
urlParameters: [Parameters.accountEndpoint, Parameters.instanceId, Parameters.nextLink],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer,
|
||||
};
|
||||
const getDeploymentDevicesNextOperationSpec: coreHttp.OperationSpec = {
|
||||
path: "{nextLink}",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.PageableListOfDeploymentDeviceStates,
|
||||
},
|
||||
404: {
|
||||
isError: true,
|
||||
},
|
||||
},
|
||||
queryParameters: [Parameters.filter],
|
||||
urlParameters: [
|
||||
Parameters.accountEndpoint,
|
||||
Parameters.instanceId,
|
||||
Parameters.nextLink,
|
||||
Parameters.deploymentId,
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer,
|
||||
};
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,11 +0,0 @@
|
|||
/*
|
||||
* 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 "./updates";
|
||||
export * from "./devices";
|
||||
export * from "./deployments";
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,14 +0,0 @@
|
|||
/*
|
||||
* 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 { createSpanFunction } from "@azure/core-http";
|
||||
|
||||
export const createSpan = createSpanFunction({
|
||||
namespace: "Azure.DeviceUpdate",
|
||||
packagePrefix: "Microsoft.DeviceUpdate",
|
||||
});
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"extends": "../../../tsconfig.package",
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist-esm",
|
||||
"declarationDir": "./types",
|
||||
"paths": {
|
||||
"@azure/iot-device-update": ["./src/index"]
|
||||
}
|
||||
},
|
||||
"include": ["src/**/*.ts", "samples-dev/**/*.ts"]
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json",
|
||||
"extends": ["../../../tsdoc.json"]
|
||||
}
|
Загрузка…
Ссылка в новой задаче