Commit 46483ccf authored by Huaqiao Zhang's avatar Huaqiao Zhang Committed by badboy-huaqiao
Browse files

feat: Update device service update method to match edgex updated

Signed-off-by: default avatarHuaqiao Zhang <huaqiaoz@vmware.com>
parent c5ba63b7
main dependabot/go_modules/github.com/eclipse/paho.mqtt.golang-1.3.3 dependabot/go_modules/github.com/eclipse/paho.mqtt.golang-1.3.4 dependabot/go_modules/github.com/edgexfoundry/go-mod-configuration/v2-2.0.0 dependabot/go_modules/github.com/edgexfoundry/go-mod-core-contracts/v2-2.0.0 dependabot/go_modules/github.com/edgexfoundry/go-mod-core-contracts/v2-2.0.0-dev.100 dependabot/go_modules/github.com/edgexfoundry/go-mod-core-contracts/v2-2.0.0-dev.101 dependabot/go_modules/github.com/edgexfoundry/go-mod-core-contracts/v2-2.0.0-dev.102 dependabot/go_modules/github.com/edgexfoundry/go-mod-core-contracts/v2-2.0.0-dev.103 dependabot/go_modules/github.com/edgexfoundry/go-mod-core-contracts/v2-2.0.0-dev.61 dependabot/go_modules/github.com/edgexfoundry/go-mod-core-contracts/v2-2.0.0-dev.62 dependabot/go_modules/github.com/edgexfoundry/go-mod-core-contracts/v2-2.0.0-dev.64 dependabot/go_modules/github.com/edgexfoundry/go-mod-core-contracts/v2-2.0.0-dev.66 dependabot/go_modules/github.com/edgexfoundry/go-mod-core-contracts/v2-2.0.0-dev.67 dependabot/go_modules/github.com/edgexfoundry/go-mod-core-contracts/v2-2.0.0-dev.69 dependabot/go_modules/github.com/edgexfoundry/go-mod-core-contracts/v2-2.0.0-dev.71 dependabot/go_modules/github.com/edgexfoundry/go-mod-core-contracts/v2-2.0.0-dev.73 dependabot/go_modules/github.com/edgexfoundry/go-mod-core-contracts/v2-2.0.0-dev.74 dependabot/go_modules/github.com/edgexfoundry/go-mod-core-contracts/v2-2.0.0-dev.76 dependabot/go_modules/github.com/edgexfoundry/go-mod-core-contracts/v2-2.0.0-dev.77 dependabot/go_modules/github.com/edgexfoundry/go-mod-core-contracts/v2-2.0.0-dev.78 dependabot/go_modules/github.com/edgexfoundry/go-mod-core-contracts/v2-2.0.0-dev.80 dependabot/go_modules/github.com/edgexfoundry/go-mod-core-contracts/v2-2.0.0-dev.82 dependabot/go_modules/github.com/edgexfoundry/go-mod-core-contracts/v2-2.0.0-dev.83 dependabot/go_modules/github.com/edgexfoundry/go-mod-core-contracts/v2-2.0.0-dev.84 dependabot/go_modules/github.com/edgexfoundry/go-mod-core-contracts/v2-2.0.0-dev.87 dependabot/go_modules/github.com/edgexfoundry/go-mod-core-contracts/v2-2.0.0-dev.89 dependabot/go_modules/github.com/edgexfoundry/go-mod-core-contracts/v2-2.0.0-dev.90 dependabot/go_modules/github.com/edgexfoundry/go-mod-core-contracts/v2-2.0.0-dev.91 dependabot/go_modules/github.com/edgexfoundry/go-mod-core-contracts/v2-2.0.0-dev.93 dependabot/go_modules/github.com/edgexfoundry/go-mod-core-contracts/v2-2.0.0-dev.94 dependabot/go_modules/github.com/edgexfoundry/go-mod-core-contracts/v2-2.0.0-dev.95 dependabot/go_modules/github.com/edgexfoundry/go-mod-core-contracts/v2-2.0.0-dev.97 dependabot/go_modules/github.com/edgexfoundry/go-mod-core-contracts/v2-2.0.0-dev.98 dependabot/go_modules/github.com/edgexfoundry/go-mod-core-contracts/v2-2.0.0-dev.99 dependabot/go_modules/github.com/edgexfoundry/go-mod-core-contracts/v2-2.1.0 dependabot/go_modules/github.com/edgexfoundry/go-mod-registry/v2-2.0.1-dev.5 dependabot/go_modules/github.com/edgexfoundry/go-mod-registry/v2-2.0.1-dev.6 dependabot/go_modules/github.com/edgexfoundry/go-mod-registry/v2-2.0.1-dev.7 dependabot/go_modules/github.com/edgexfoundry/go-mod-registry/v2-2.0.1-dev.8 dependabot/go_modules/github.com/edgexfoundry/go-mod-registry/v2-2.0.1-dev.9 dependabot/go_modules/github.com/edgexfoundry/go-mod-registry/v2-2.1.0 dependabot/go_modules/github.com/pelletier/go-toml-1.9.0 dependabot/go_modules/github.com/pelletier/go-toml-1.9.1 dependabot/go_modules/github.com/pelletier/go-toml-1.9.2 dependabot/go_modules/github.com/pelletier/go-toml-1.9.3 dependabot/go_modules/github.com/pelletier/go-toml-1.9.4 dependabot/npm_and_yarn/web/engine.io-4.1.2 dependabot/npm_and_yarn/web/follow-redirects-1.14.7 dependabot/npm_and_yarn/web/follow-redirects-1.14.8 dependabot/npm_and_yarn/web/karma-6.3.14 dependabot/npm_and_yarn/web/karma-6.3.16 dependabot/npm_and_yarn/web/nanoid-3.2.0 dependabot/npm_and_yarn/web/url-parse-1.5.10 master v2.1.1-dev.15 v2.1.1-dev.14 v2.1.1-dev.13 v2.1.1-dev.12 v2.1.1-dev.11 v2.1.1-dev.10 v2.1.1-dev.9 v2.1.1-dev.8 v2.1.1-dev.7 v2.1.1-dev.6 v2.1.1-dev.5 v2.1.1-dev.4 v2.1.1-dev.3 v2.1.1-dev.2 v2.1.1-dev.1 v2.1.0 v2.0.1-dev.33 v2.0.1-dev.32 v2.0.1-dev.31 v2.0.1-dev.30 v2.0.1-dev.29 v2.0.1-dev.28 v2.0.1-dev.27 v2.0.1-dev.26 v2.0.1-dev.25 v2.0.1-dev.24 v2.0.1-dev.23 v2.0.1-dev.22 v2.0.1-dev.21 v2.0.1-dev.20 v2.0.1-dev.19 v2.0.1-dev.18 v2.0.1-dev.17 v2.0.1-dev.16 v2.0.1-dev.15 v2.0.1-dev.14 v2.0.1-dev.13 v2.0.1-dev.12 v2.0.1-dev.11 v2.0.1-dev.10 v2.0.1-dev.9 v2.0.1-dev.8 v2.0.1-dev.7 v2.0.1-dev.6 v2.0.1-dev.5 v2.0.1-dev.4 v2.0.1-dev.3 v2.0.1-dev.2 v2.0.1-dev.1 v2.0.0 v2.0.0-dev.87 v2.0.0-dev.86 v2.0.0-dev.85 v2.0.0-dev.84 v2.0.0-dev.83 v2.0.0-dev.82 v2.0.0-dev.81 v2.0.0-dev.80 v2.0.0-dev.79 v2.0.0-dev.78 v2.0.0-dev.77 v2.0.0-dev.76 v2.0.0-dev.75 v2.0.0-dev.74 v2.0.0-dev.73 v2.0.0-dev.72 v2.0.0-dev.71 v2.0.0-dev.70 v2.0.0-dev.69 v2.0.0-dev.68 v2.0.0-dev.67 v2.0.0-dev.66 v2.0.0-dev.65 v2.0.0-dev.64 v2.0.0-dev.63 v2.0.0-dev.62 v2.0.0-dev.61 v2.0.0-dev.60 v2.0.0-dev.59 v2.0.0-dev.58 v2.0.0-dev.57 v2.0.0-dev.56 v2.0.0-dev.55 v2.0.0-dev.54 v2.0.0-dev.53 v2.0.0-dev.52 v2.0.0-dev.51 v2.0.0-dev.50 v2.0.0-dev.49 v2.0.0-dev.48 v2.0.0-dev.47 v2.0.0-dev.46 v2.0.0-dev.45 v2.0.0-dev.44 v2.0.0-dev.43 v2.0.0-dev.42 v2.0.0-dev.41 v2.0.0-dev.40 v2.0.0-dev.39 v2.0.0-dev.38 v2.0.0-dev.37 v2.0.0-dev.36 v2.0.0-dev.35 v2.0.0-dev.34 v2.0.0-dev.33 v2.0.0-dev.32 v2.0.0-dev.31 v2.0.0-dev.30 v2.0.0-dev.29 v2.0.0-dev.28 v2.0.0-dev.27 v2.0.0-dev.26 v2.0.0-dev.25
No related merge requests found
Showing with 22 additions and 3 deletions
+22 -3
/*******************************************************************************
* Copyright © 2021-2022 VMware, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*
* @author: Huaqiao Zhang, <huaqiaoz@vmware.com>
*******************************************************************************/
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
......@@ -10,6 +26,7 @@ import { DeviceRequest } from '../contracts/v2/requests/device-request';
import { MultiDeviceProfileResponse,DeviceProfileResponse } from '../contracts/v2/responses/device-profile-response';
import { DeviceProfile } from '../contracts/v2/device-profile';
import { DeviceService } from '../contracts/v2/device-service';
import { DeviceServiceRequest } from '../contracts/v2/requests/device-service-request';
import { DeviceServiceResponse,MultiDeviceServiceResponse } from '../contracts/v2/responses/device-service-response';
import { ErrorService } from './error.service';
......@@ -40,8 +57,6 @@ export class MetadataService {
findDeviceServiceByIdUrl: string = `${this.urlPrefix}/deviceservice/id/`;
findDeviceServiceByNameUrl: string = `${this.urlPrefix}/deviceservice/name/`;
deviceProfilesListUrl: string = `${this.urlPrefix}/deviceprofile/all`;
findProfilesByIdUrl: string = `${this.urlPrefix}/deviceprofile`;
findProfilesByNameUrl: string = `${this.urlPrefix}/deviceprofile/name/`;
......@@ -184,7 +199,11 @@ export class MetadataService {
updateDeviceService(deviceService: DeviceService): Observable<BaseResponse> {
let url = `${this.updateDeviceServiceUrl}`;
return this.http.patch<BaseResponse>(url, deviceService, this.httpPostOrPutJSONOptions).pipe(
let data: DeviceServiceRequest[] = [{
apiVersion: "v2",
service: deviceService
}]
return this.http.patch<BaseResponse>(url, JSON.stringify(data), this.httpPostOrPutJSONOptions).pipe(
catchError(error => this.errorSvc.handleError(error))
)
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment