oci-cloudbridge 2.99.0 → 2.100.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/client.d.ts CHANGED
@@ -39,6 +39,7 @@ export declare class CommonClient {
39
39
  protected "_region": common.Region;
40
40
  protected _lastSetRegionOrRegionId: string;
41
41
  protected _httpClient: common.HttpClient;
42
+ protected _authProvider: common.AuthenticationDetailsProvider | undefined;
42
43
  constructor(params: common.AuthParams, clientConfiguration?: common.ClientConfiguration);
43
44
  /**
44
45
  * Get the endpoint that is being used to call (ex, https://www.example.com).
@@ -88,6 +89,10 @@ export declare class CommonClient {
88
89
  * Shutdown the circuit breaker used by the client when it is no longer needed
89
90
  */
90
91
  shutdownCircuitBreaker(): void;
92
+ /**
93
+ * Close the provider if possible which in turn shuts down any associated circuit breaker
94
+ */
95
+ closeProvider(): void;
91
96
  /**
92
97
  * Close the client once it is no longer needed
93
98
  */
@@ -162,6 +167,7 @@ export declare class DiscoveryClient {
162
167
  protected "_region": common.Region;
163
168
  protected _lastSetRegionOrRegionId: string;
164
169
  protected _httpClient: common.HttpClient;
170
+ protected _authProvider: common.AuthenticationDetailsProvider | undefined;
165
171
  constructor(params: common.AuthParams, clientConfiguration?: common.ClientConfiguration);
166
172
  /**
167
173
  * Get the endpoint that is being used to call (ex, https://www.example.com).
@@ -211,6 +217,10 @@ export declare class DiscoveryClient {
211
217
  * Shutdown the circuit breaker used by the client when it is no longer needed
212
218
  */
213
219
  shutdownCircuitBreaker(): void;
220
+ /**
221
+ * Close the provider if possible which in turn shuts down any associated circuit breaker
222
+ */
223
+ closeProvider(): void;
214
224
  /**
215
225
  * Close the client once it is no longer needed
216
226
  */
@@ -375,6 +385,7 @@ export declare class InventoryClient {
375
385
  protected "_region": common.Region;
376
386
  protected _lastSetRegionOrRegionId: string;
377
387
  protected _httpClient: common.HttpClient;
388
+ protected _authProvider: common.AuthenticationDetailsProvider | undefined;
378
389
  constructor(params: common.AuthParams, clientConfiguration?: common.ClientConfiguration);
379
390
  /**
380
391
  * Get the endpoint that is being used to call (ex, https://www.example.com).
@@ -424,6 +435,10 @@ export declare class InventoryClient {
424
435
  * Shutdown the circuit breaker used by the client when it is no longer needed
425
436
  */
426
437
  shutdownCircuitBreaker(): void;
438
+ /**
439
+ * Close the provider if possible which in turn shuts down any associated circuit breaker
440
+ */
441
+ closeProvider(): void;
427
442
  /**
428
443
  * Close the client once it is no longer needed
429
444
  */
@@ -598,6 +613,7 @@ export declare class OcbAgentSvcClient {
598
613
  protected "_region": common.Region;
599
614
  protected _lastSetRegionOrRegionId: string;
600
615
  protected _httpClient: common.HttpClient;
616
+ protected _authProvider: common.AuthenticationDetailsProvider | undefined;
601
617
  constructor(params: common.AuthParams, clientConfiguration?: common.ClientConfiguration);
602
618
  /**
603
619
  * Get the endpoint that is being used to call (ex, https://www.example.com).
@@ -647,6 +663,10 @@ export declare class OcbAgentSvcClient {
647
663
  * Shutdown the circuit breaker used by the client when it is no longer needed
648
664
  */
649
665
  shutdownCircuitBreaker(): void;
666
+ /**
667
+ * Close the provider if possible which in turn shuts down any associated circuit breaker
668
+ */
669
+ closeProvider(): void;
650
670
  /**
651
671
  * Close the client once it is no longer needed
652
672
  */
@@ -856,5 +876,14 @@ export declare class OcbAgentSvcClient {
856
876
  * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/latest/cloudbridge/UpdateEnvironment.ts.html |here} to see how to use UpdateEnvironment API.
857
877
  */
858
878
  updateEnvironment(updateEnvironmentRequest: requests.UpdateEnvironmentRequest): Promise<responses.UpdateEnvironmentResponse>;
879
+ /**
880
+ * Updates the plugin.
881
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
882
+ * @param UpdatePluginRequest
883
+ * @return UpdatePluginResponse
884
+ * @throws OciError when an error occurs
885
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/latest/cloudbridge/UpdatePlugin.ts.html |here} to see how to use UpdatePlugin API.
886
+ */
887
+ updatePlugin(updatePluginRequest: requests.UpdatePluginRequest): Promise<responses.UpdatePluginResponse>;
859
888
  }
860
889
  export {};
package/lib/client.js CHANGED
@@ -72,6 +72,7 @@ class CommonClient {
72
72
  const requestSigner = params.authenticationDetailsProvider
73
73
  ? new common.DefaultRequestSigner(params.authenticationDetailsProvider)
74
74
  : null;
75
+ this._authProvider = params.authenticationDetailsProvider;
75
76
  if (clientConfiguration) {
76
77
  this._clientConfiguration = clientConfiguration;
77
78
  this._circuitBreaker = clientConfiguration.circuitBreaker
@@ -193,11 +194,21 @@ class CommonClient {
193
194
  this._circuitBreaker.shutdown();
194
195
  }
195
196
  }
197
+ /**
198
+ * Close the provider if possible which in turn shuts down any associated circuit breaker
199
+ */
200
+ closeProvider() {
201
+ if (this._authProvider) {
202
+ if (this._authProvider instanceof common.AbstractRequestingAuthenticationDetailsProvider)
203
+ (this._authProvider).closeProvider();
204
+ }
205
+ }
196
206
  /**
197
207
  * Close the client once it is no longer needed
198
208
  */
199
209
  close() {
200
210
  this.shutdownCircuitBreaker();
211
+ this.closeProvider();
201
212
  }
202
213
  /**
203
214
  * Cancels the work request with the given ID.
@@ -555,6 +566,7 @@ class DiscoveryClient {
555
566
  const requestSigner = params.authenticationDetailsProvider
556
567
  ? new common.DefaultRequestSigner(params.authenticationDetailsProvider)
557
568
  : null;
569
+ this._authProvider = params.authenticationDetailsProvider;
558
570
  if (clientConfiguration) {
559
571
  this._clientConfiguration = clientConfiguration;
560
572
  this._circuitBreaker = clientConfiguration.circuitBreaker
@@ -676,11 +688,21 @@ class DiscoveryClient {
676
688
  this._circuitBreaker.shutdown();
677
689
  }
678
690
  }
691
+ /**
692
+ * Close the provider if possible which in turn shuts down any associated circuit breaker
693
+ */
694
+ closeProvider() {
695
+ if (this._authProvider) {
696
+ if (this._authProvider instanceof common.AbstractRequestingAuthenticationDetailsProvider)
697
+ (this._authProvider).closeProvider();
698
+ }
699
+ }
679
700
  /**
680
701
  * Close the client once it is no longer needed
681
702
  */
682
703
  close() {
683
704
  this.shutdownCircuitBreaker();
705
+ this.closeProvider();
684
706
  }
685
707
  /**
686
708
  * Moves a resource into a different compartment. When provided, If-Match is checked against ETag values of the resource.
@@ -1660,6 +1682,7 @@ class InventoryClient {
1660
1682
  const requestSigner = params.authenticationDetailsProvider
1661
1683
  ? new common.DefaultRequestSigner(params.authenticationDetailsProvider)
1662
1684
  : null;
1685
+ this._authProvider = params.authenticationDetailsProvider;
1663
1686
  if (clientConfiguration) {
1664
1687
  this._clientConfiguration = clientConfiguration;
1665
1688
  this._circuitBreaker = clientConfiguration.circuitBreaker
@@ -1781,11 +1804,21 @@ class InventoryClient {
1781
1804
  this._circuitBreaker.shutdown();
1782
1805
  }
1783
1806
  }
1807
+ /**
1808
+ * Close the provider if possible which in turn shuts down any associated circuit breaker
1809
+ */
1810
+ closeProvider() {
1811
+ if (this._authProvider) {
1812
+ if (this._authProvider instanceof common.AbstractRequestingAuthenticationDetailsProvider)
1813
+ (this._authProvider).closeProvider();
1814
+ }
1815
+ }
1784
1816
  /**
1785
1817
  * Close the client once it is no longer needed
1786
1818
  */
1787
1819
  close() {
1788
1820
  this.shutdownCircuitBreaker();
1821
+ this.closeProvider();
1789
1822
  }
1790
1823
  /**
1791
1824
  * Returns an aggregation of assets. Aggregation groups are sorted by groupBy property.
@@ -2845,6 +2878,7 @@ class OcbAgentSvcClient {
2845
2878
  const requestSigner = params.authenticationDetailsProvider
2846
2879
  ? new common.DefaultRequestSigner(params.authenticationDetailsProvider)
2847
2880
  : null;
2881
+ this._authProvider = params.authenticationDetailsProvider;
2848
2882
  if (clientConfiguration) {
2849
2883
  this._clientConfiguration = clientConfiguration;
2850
2884
  this._circuitBreaker = clientConfiguration.circuitBreaker
@@ -2966,11 +3000,21 @@ class OcbAgentSvcClient {
2966
3000
  this._circuitBreaker.shutdown();
2967
3001
  }
2968
3002
  }
3003
+ /**
3004
+ * Close the provider if possible which in turn shuts down any associated circuit breaker
3005
+ */
3006
+ closeProvider() {
3007
+ if (this._authProvider) {
3008
+ if (this._authProvider instanceof common.AbstractRequestingAuthenticationDetailsProvider)
3009
+ (this._authProvider).closeProvider();
3010
+ }
3011
+ }
2969
3012
  /**
2970
3013
  * Close the client once it is no longer needed
2971
3014
  */
2972
3015
  close() {
2973
3016
  this.shutdownCircuitBreaker();
3017
+ this.closeProvider();
2974
3018
  }
2975
3019
  /**
2976
3020
  * Add a dependency to the environment. When provided, If-Match is checked against ETag values of the resource.
@@ -4379,6 +4423,68 @@ class OcbAgentSvcClient {
4379
4423
  }
4380
4424
  });
4381
4425
  }
4426
+ /**
4427
+ * Updates the plugin.
4428
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
4429
+ * @param UpdatePluginRequest
4430
+ * @return UpdatePluginResponse
4431
+ * @throws OciError when an error occurs
4432
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/latest/cloudbridge/UpdatePlugin.ts.html |here} to see how to use UpdatePlugin API.
4433
+ */
4434
+ updatePlugin(updatePluginRequest) {
4435
+ return __awaiter(this, void 0, void 0, function* () {
4436
+ if (this.logger)
4437
+ this.logger.debug("Calling operation OcbAgentSvcClient#updatePlugin.");
4438
+ const operationName = "updatePlugin";
4439
+ const apiReferenceLink = "";
4440
+ const pathParams = {
4441
+ "{agentId}": updatePluginRequest.agentId,
4442
+ "{pluginName}": updatePluginRequest.pluginName
4443
+ };
4444
+ const queryParams = {};
4445
+ let headerParams = {
4446
+ "Content-Type": common.Constants.APPLICATION_JSON,
4447
+ "if-match": updatePluginRequest.ifMatch,
4448
+ "opc-request-id": updatePluginRequest.opcRequestId
4449
+ };
4450
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
4451
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, updatePluginRequest.retryConfiguration, specRetryConfiguration);
4452
+ if (this.logger)
4453
+ retrier.logger = this.logger;
4454
+ const request = yield oci_common_1.composeRequest({
4455
+ baseEndpoint: this._endpoint,
4456
+ defaultHeaders: this._defaultHeaders,
4457
+ path: "/agents/{agentId}/plugins/{pluginName}",
4458
+ method: "PUT",
4459
+ bodyContent: common.ObjectSerializer.serialize(updatePluginRequest.updatePluginDetails, "UpdatePluginDetails", model.UpdatePluginDetails.getJsonObj),
4460
+ pathParams: pathParams,
4461
+ headerParams: headerParams,
4462
+ queryParams: queryParams
4463
+ });
4464
+ try {
4465
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
4466
+ const sdkResponse = oci_common_1.composeResponse({
4467
+ responseObject: {},
4468
+ responseHeaders: [
4469
+ {
4470
+ value: response.headers.get("opc-request-id"),
4471
+ key: "opcRequestId",
4472
+ dataType: "string"
4473
+ },
4474
+ {
4475
+ value: response.headers.get("opc-work-request-id"),
4476
+ key: "opcWorkRequestId",
4477
+ dataType: "string"
4478
+ }
4479
+ ]
4480
+ });
4481
+ return sdkResponse;
4482
+ }
4483
+ catch (err) {
4484
+ throw err;
4485
+ }
4486
+ });
4487
+ }
4382
4488
  }
4383
4489
  exports.OcbAgentSvcClient = OcbAgentSvcClient;
4384
4490
  OcbAgentSvcClient.serviceEndpointTemplate = "https://cloudbridge.{region}.oci.{secondLevelDomain}";