@azure/arm-containerinstance 8.1.1-alpha.20220421.1 → 8.2.0

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/CHANGELOG.md CHANGED
@@ -1,15 +1,12 @@
1
1
  # Release History
2
+
3
+ ## 8.2.0 (2022-07-11)
4
+
5
+ **Features**
2
6
 
3
- ## 8.1.1 (Unreleased)
4
-
5
- ### Features Added
6
-
7
- ### Breaking Changes
8
-
9
- ### Bugs Fixed
10
-
11
- ### Other Changes
12
-
7
+ - Added Interface ContainerGroup
8
+
9
+
13
10
  ## 8.1.0 (2022-04-06)
14
11
 
15
12
  **Features**
package/dist/index.js CHANGED
@@ -2,8 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var coreClient = require('@azure/core-client');
6
5
  var tslib = require('tslib');
6
+ var coreClient = require('@azure/core-client');
7
+ var coreRestPipeline = require('@azure/core-rest-pipeline');
7
8
  var coreLro = require('@azure/core-lro');
8
9
 
9
10
  function _interopNamespace(e) {
@@ -25,6 +26,7 @@ function _interopNamespace(e) {
25
26
  }
26
27
 
27
28
  var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
29
+ var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipeline);
28
30
 
29
31
  /*
30
32
  * Copyright (c) Microsoft Corporation.
@@ -36,72 +38,99 @@ var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
36
38
  /** Known values of {@link ContainerNetworkProtocol} that the service accepts. */
37
39
  exports.KnownContainerNetworkProtocol = void 0;
38
40
  (function (KnownContainerNetworkProtocol) {
41
+ /** TCP */
39
42
  KnownContainerNetworkProtocol["TCP"] = "TCP";
43
+ /** UDP */
40
44
  KnownContainerNetworkProtocol["UDP"] = "UDP";
41
45
  })(exports.KnownContainerNetworkProtocol || (exports.KnownContainerNetworkProtocol = {}));
42
46
  /** Known values of {@link GpuSku} that the service accepts. */
43
47
  exports.KnownGpuSku = void 0;
44
48
  (function (KnownGpuSku) {
49
+ /** K80 */
45
50
  KnownGpuSku["K80"] = "K80";
51
+ /** P100 */
46
52
  KnownGpuSku["P100"] = "P100";
53
+ /** V100 */
47
54
  KnownGpuSku["V100"] = "V100";
48
55
  })(exports.KnownGpuSku || (exports.KnownGpuSku = {}));
49
56
  /** Known values of {@link Scheme} that the service accepts. */
50
57
  exports.KnownScheme = void 0;
51
58
  (function (KnownScheme) {
59
+ /** Http */
52
60
  KnownScheme["Http"] = "http";
61
+ /** Https */
53
62
  KnownScheme["Https"] = "https";
54
63
  })(exports.KnownScheme || (exports.KnownScheme = {}));
55
64
  /** Known values of {@link ContainerGroupRestartPolicy} that the service accepts. */
56
65
  exports.KnownContainerGroupRestartPolicy = void 0;
57
66
  (function (KnownContainerGroupRestartPolicy) {
67
+ /** Always */
58
68
  KnownContainerGroupRestartPolicy["Always"] = "Always";
69
+ /** OnFailure */
59
70
  KnownContainerGroupRestartPolicy["OnFailure"] = "OnFailure";
71
+ /** Never */
60
72
  KnownContainerGroupRestartPolicy["Never"] = "Never";
61
73
  })(exports.KnownContainerGroupRestartPolicy || (exports.KnownContainerGroupRestartPolicy = {}));
62
74
  /** Known values of {@link ContainerGroupNetworkProtocol} that the service accepts. */
63
75
  exports.KnownContainerGroupNetworkProtocol = void 0;
64
76
  (function (KnownContainerGroupNetworkProtocol) {
77
+ /** TCP */
65
78
  KnownContainerGroupNetworkProtocol["TCP"] = "TCP";
79
+ /** UDP */
66
80
  KnownContainerGroupNetworkProtocol["UDP"] = "UDP";
67
81
  })(exports.KnownContainerGroupNetworkProtocol || (exports.KnownContainerGroupNetworkProtocol = {}));
68
82
  /** Known values of {@link ContainerGroupIpAddressType} that the service accepts. */
69
83
  exports.KnownContainerGroupIpAddressType = void 0;
70
84
  (function (KnownContainerGroupIpAddressType) {
85
+ /** Public */
71
86
  KnownContainerGroupIpAddressType["Public"] = "Public";
87
+ /** Private */
72
88
  KnownContainerGroupIpAddressType["Private"] = "Private";
73
89
  })(exports.KnownContainerGroupIpAddressType || (exports.KnownContainerGroupIpAddressType = {}));
74
90
  /** Known values of {@link AutoGeneratedDomainNameLabelScope} that the service accepts. */
75
91
  exports.KnownAutoGeneratedDomainNameLabelScope = void 0;
76
92
  (function (KnownAutoGeneratedDomainNameLabelScope) {
93
+ /** Unsecure */
77
94
  KnownAutoGeneratedDomainNameLabelScope["Unsecure"] = "Unsecure";
95
+ /** TenantReuse */
78
96
  KnownAutoGeneratedDomainNameLabelScope["TenantReuse"] = "TenantReuse";
97
+ /** SubscriptionReuse */
79
98
  KnownAutoGeneratedDomainNameLabelScope["SubscriptionReuse"] = "SubscriptionReuse";
99
+ /** ResourceGroupReuse */
80
100
  KnownAutoGeneratedDomainNameLabelScope["ResourceGroupReuse"] = "ResourceGroupReuse";
101
+ /** Noreuse */
81
102
  KnownAutoGeneratedDomainNameLabelScope["Noreuse"] = "Noreuse";
82
103
  })(exports.KnownAutoGeneratedDomainNameLabelScope || (exports.KnownAutoGeneratedDomainNameLabelScope = {}));
83
104
  /** Known values of {@link OperatingSystemTypes} that the service accepts. */
84
105
  exports.KnownOperatingSystemTypes = void 0;
85
106
  (function (KnownOperatingSystemTypes) {
107
+ /** Windows */
86
108
  KnownOperatingSystemTypes["Windows"] = "Windows";
109
+ /** Linux */
87
110
  KnownOperatingSystemTypes["Linux"] = "Linux";
88
111
  })(exports.KnownOperatingSystemTypes || (exports.KnownOperatingSystemTypes = {}));
89
112
  /** Known values of {@link LogAnalyticsLogType} that the service accepts. */
90
113
  exports.KnownLogAnalyticsLogType = void 0;
91
114
  (function (KnownLogAnalyticsLogType) {
115
+ /** ContainerInsights */
92
116
  KnownLogAnalyticsLogType["ContainerInsights"] = "ContainerInsights";
117
+ /** ContainerInstanceLogs */
93
118
  KnownLogAnalyticsLogType["ContainerInstanceLogs"] = "ContainerInstanceLogs";
94
119
  })(exports.KnownLogAnalyticsLogType || (exports.KnownLogAnalyticsLogType = {}));
95
120
  /** Known values of {@link ContainerGroupSku} that the service accepts. */
96
121
  exports.KnownContainerGroupSku = void 0;
97
122
  (function (KnownContainerGroupSku) {
123
+ /** Standard */
98
124
  KnownContainerGroupSku["Standard"] = "Standard";
125
+ /** Dedicated */
99
126
  KnownContainerGroupSku["Dedicated"] = "Dedicated";
100
127
  })(exports.KnownContainerGroupSku || (exports.KnownContainerGroupSku = {}));
101
128
  /** Known values of {@link ContainerInstanceOperationsOrigin} that the service accepts. */
102
129
  exports.KnownContainerInstanceOperationsOrigin = void 0;
103
130
  (function (KnownContainerInstanceOperationsOrigin) {
131
+ /** User */
104
132
  KnownContainerInstanceOperationsOrigin["User"] = "User";
133
+ /** System */
105
134
  KnownContainerInstanceOperationsOrigin["System"] = "System";
106
135
  })(exports.KnownContainerInstanceOperationsOrigin || (exports.KnownContainerInstanceOperationsOrigin = {}));
107
136
 
@@ -758,7 +787,6 @@ const ImageRegistryCredential = {
758
787
  },
759
788
  username: {
760
789
  serializedName: "username",
761
- required: true,
762
790
  type: {
763
791
  name: "String"
764
792
  }
@@ -3372,7 +3400,7 @@ class ContainerInstanceManagementClient extends coreClient__namespace.ServiceCli
3372
3400
  requestContentType: "application/json; charset=utf-8",
3373
3401
  credential: credentials
3374
3402
  };
3375
- const packageDetails = `azsdk-js-arm-containerinstance/8.1.1`;
3403
+ const packageDetails = `azsdk-js-arm-containerinstance/8.2.0`;
3376
3404
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
3377
3405
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
3378
3406
  : `${packageDetails}`;
@@ -3383,6 +3411,27 @@ class ContainerInstanceManagementClient extends coreClient__namespace.ServiceCli
3383
3411
  userAgentPrefix
3384
3412
  }, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
3385
3413
  super(optionsWithDefaults);
3414
+ let bearerTokenAuthenticationPolicyFound = false;
3415
+ if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
3416
+ const pipelinePolicies = options.pipeline.getOrderedPolicies();
3417
+ bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
3418
+ coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);
3419
+ }
3420
+ if (!options ||
3421
+ !options.pipeline ||
3422
+ options.pipeline.getOrderedPolicies().length == 0 ||
3423
+ !bearerTokenAuthenticationPolicyFound) {
3424
+ this.pipeline.removePolicy({
3425
+ name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
3426
+ });
3427
+ this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
3428
+ credential: credentials,
3429
+ scopes: `${optionsWithDefaults.credentialScopes}`,
3430
+ challengeCallbacks: {
3431
+ authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
3432
+ }
3433
+ }));
3434
+ }
3386
3435
  // Parameter assignments
3387
3436
  this.subscriptionId = subscriptionId;
3388
3437
  // Assigning values to Constant parameters
@@ -3392,6 +3441,34 @@ class ContainerInstanceManagementClient extends coreClient__namespace.ServiceCli
3392
3441
  this.operations = new OperationsImpl(this);
3393
3442
  this.location = new LocationImpl(this);
3394
3443
  this.containers = new ContainersImpl(this);
3444
+ this.addCustomApiVersionPolicy(options.apiVersion);
3445
+ }
3446
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
3447
+ addCustomApiVersionPolicy(apiVersion) {
3448
+ if (!apiVersion) {
3449
+ return;
3450
+ }
3451
+ const apiVersionPolicy = {
3452
+ name: "CustomApiVersionPolicy",
3453
+ sendRequest(request, next) {
3454
+ return tslib.__awaiter(this, void 0, void 0, function* () {
3455
+ const param = request.url.split("?");
3456
+ if (param.length > 1) {
3457
+ const newParams = param[1].split("&").map((item) => {
3458
+ if (item.indexOf("api-version") > -1) {
3459
+ return "api-version=" + apiVersion;
3460
+ }
3461
+ else {
3462
+ return item;
3463
+ }
3464
+ });
3465
+ request.url = param[0] + "?" + newParams.join("&");
3466
+ }
3467
+ return next(request);
3468
+ });
3469
+ }
3470
+ };
3471
+ this.pipeline.addPolicy(apiVersionPolicy);
3395
3472
  }
3396
3473
  }
3397
3474