@nutanix-scratch/objects-js-client 4.0.1 → 4.0.2
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/README.md +31 -18
- package/dist/Ntnx-Objects-js-client-prod.js +1 -1
- package/dist/Ntnx-Objects-js-client.js +283 -277
- package/dist/es/ApiClient.d.ts +35 -7
- package/dist/es/ApiClient.js +862 -684
- package/dist/es/Paginable.d.ts +1 -1
- package/dist/es/Paginable.js +144 -183
- package/dist/es/apis/objectstores-endpoints.d.ts +5 -69
- package/dist/es/apis/objectstores-endpoints.js +406 -479
- package/dist/es/apis/stats-endpoints.d.ts +1 -24
- package/dist/es/apis/stats-endpoints.js +73 -105
- package/dist/es/index.js +120 -120
- package/dist/es/models/common/v1/config/FQDN.d.ts +2 -7
- package/dist/es/models/common/v1/config/FQDN.js +141 -180
- package/dist/es/models/common/v1/config/Flag.d.ts +2 -8
- package/dist/es/models/common/v1/config/Flag.js +170 -211
- package/dist/es/models/common/v1/config/IPAddress.d.ts +2 -20
- package/dist/es/models/common/v1/config/IPAddress.js +170 -217
- package/dist/es/models/common/v1/config/IPv4Address.d.ts +2 -8
- package/dist/es/models/common/v1/config/IPv4Address.js +174 -215
- package/dist/es/models/common/v1/config/IPv6Address.d.ts +2 -8
- package/dist/es/models/common/v1/config/IPv6Address.js +174 -215
- package/dist/es/models/common/v1/config/KVPair.d.ts +2 -8
- package/dist/es/models/common/v1/config/KVPair.js +225 -270
- package/dist/es/models/common/v1/config/MapOfStringWrapper.d.ts +2 -7
- package/dist/es/models/common/v1/config/MapOfStringWrapper.js +139 -178
- package/dist/es/models/common/v1/config/Message.d.ts +2 -10
- package/dist/es/models/common/v1/config/Message.js +213 -258
- package/dist/es/models/common/v1/config/MessageSeverity.js +7 -9
- package/dist/es/models/common/v1/config/Metadata.d.ts +2 -11
- package/dist/es/models/common/v1/config/Metadata.js +261 -308
- package/dist/es/models/common/v1/config/TenantAwareModel.d.ts +5 -10
- package/dist/es/models/common/v1/config/TenantAwareModel.js +138 -178
- package/dist/es/models/common/v1/response/ApiLink.d.ts +2 -8
- package/dist/es/models/common/v1/response/ApiLink.js +165 -206
- package/dist/es/models/common/v1/response/ApiResponseMetadata.d.ts +2 -40
- package/dist/es/models/common/v1/response/ApiResponseMetadata.js +281 -344
- package/dist/es/models/common/v1/response/ExternalizableAbstractModel.d.ts +1 -15
- package/dist/es/models/common/v1/response/ExternalizableAbstractModel.js +155 -203
- package/dist/es/models/common/v1/stats/DownSamplingOperator.js +7 -9
- package/dist/es/models/common/v1/stats/TimeIntValuePair.d.ts +2 -8
- package/dist/es/models/common/v1/stats/TimeIntValuePair.js +165 -206
- package/dist/es/models/objects/v4/config/Certificate.d.ts +1 -58
- package/dist/es/models/objects/v4/config/Certificate.js +319 -381
- package/dist/es/models/objects/v4/config/CertificateProjection.d.ts +1 -1
- package/dist/es/models/objects/v4/config/CertificateProjection.js +73 -102
- package/dist/es/models/objects/v4/config/CreateCertificateApiResponse.d.ts +2 -45
- package/dist/es/models/objects/v4/config/CreateCertificateApiResponse.js +185 -240
- package/dist/es/models/objects/v4/config/CreateObjectstoreApiResponse.d.ts +2 -43
- package/dist/es/models/objects/v4/config/CreateObjectstoreApiResponse.js +185 -240
- package/dist/es/models/objects/v4/config/DeleteObjectstoreApiResponse.d.ts +2 -43
- package/dist/es/models/objects/v4/config/DeleteObjectstoreApiResponse.js +185 -240
- package/dist/es/models/objects/v4/config/GetCaApiResponse.d.ts +2 -43
- package/dist/es/models/objects/v4/config/GetCaApiResponse.js +185 -240
- package/dist/es/models/objects/v4/config/GetCertificateApiResponse.d.ts +2 -43
- package/dist/es/models/objects/v4/config/GetCertificateApiResponse.js +185 -240
- package/dist/es/models/objects/v4/config/GetObjectstoreApiResponse.d.ts +2 -45
- package/dist/es/models/objects/v4/config/GetObjectstoreApiResponse.js +185 -240
- package/dist/es/models/objects/v4/config/ListCertificatesApiResponse.d.ts +2 -43
- package/dist/es/models/objects/v4/config/ListCertificatesApiResponse.js +211 -266
- package/dist/es/models/objects/v4/config/ListObjectstoresApiResponse.d.ts +2 -43
- package/dist/es/models/objects/v4/config/ListObjectstoresApiResponse.js +211 -266
- package/dist/es/models/objects/v4/config/ObjectStore.d.ts +1 -96
- package/dist/es/models/objects/v4/config/ObjectStore.js +628 -711
- package/dist/es/models/objects/v4/config/ObjectStoreProjection.d.ts +1 -152
- package/dist/es/models/objects/v4/config/ObjectStoreProjection.js +221 -238
- package/dist/es/models/objects/v4/config/State.js +7 -9
- package/dist/es/models/objects/v4/config/UpdateObjectstoreApiResponse.d.ts +2 -43
- package/dist/es/models/objects/v4/config/UpdateObjectstoreApiResponse.js +185 -240
- package/dist/es/models/objects/v4/error/AppMessage.d.ts +5 -15
- package/dist/es/models/objects/v4/error/AppMessage.js +264 -313
- package/dist/es/models/objects/v4/error/ErrorResponse.d.ts +2 -7
- package/dist/es/models/objects/v4/error/ErrorResponse.js +174 -217
- package/dist/es/models/objects/v4/error/SchemaValidationError.d.ts +2 -18
- package/dist/es/models/objects/v4/error/SchemaValidationError.js +248 -299
- package/dist/es/models/objects/v4/error/SchemaValidationErrorMessage.d.ts +2 -9
- package/dist/es/models/objects/v4/error/SchemaValidationErrorMessage.js +190 -233
- package/dist/es/models/objects/v4/stats/GetObjectstoreStatsApiResponse.d.ts +2 -43
- package/dist/es/models/objects/v4/stats/GetObjectstoreStatsApiResponse.js +185 -240
- package/dist/es/models/objects/v4/stats/ObjectstoreStats.d.ts +1 -169
- package/dist/es/models/objects/v4/stats/ObjectstoreStats.js +957 -1129
- package/dist/es/models/objects/v4/stats/TimeFloatValuePair.d.ts +2 -8
- package/dist/es/models/objects/v4/stats/TimeFloatValuePair.js +165 -206
- package/dist/es/models/prism/v4/config/TaskReference.d.ts +5 -10
- package/dist/es/models/prism/v4/config/TaskReference.js +143 -182
- package/dist/es/models/validation/ValidationError.js +26 -42
- package/dist/es/models/validation/ValidationScopes.js +3 -3
- package/dist/es/utils/ValidationUtils.js +39 -69
- package/dist/lib/ApiClient.d.ts +35 -7
- package/dist/lib/ApiClient.js +862 -684
- package/dist/lib/Paginable.d.ts +1 -1
- package/dist/lib/Paginable.js +144 -183
- package/dist/lib/apis/objectstores-endpoints.d.ts +5 -69
- package/dist/lib/apis/objectstores-endpoints.js +406 -479
- package/dist/lib/apis/stats-endpoints.d.ts +1 -24
- package/dist/lib/apis/stats-endpoints.js +73 -105
- package/dist/lib/index.js +120 -120
- package/dist/lib/models/common/v1/config/FQDN.d.ts +2 -7
- package/dist/lib/models/common/v1/config/FQDN.js +141 -180
- package/dist/lib/models/common/v1/config/Flag.d.ts +2 -8
- package/dist/lib/models/common/v1/config/Flag.js +170 -211
- package/dist/lib/models/common/v1/config/IPAddress.d.ts +2 -20
- package/dist/lib/models/common/v1/config/IPAddress.js +170 -217
- package/dist/lib/models/common/v1/config/IPv4Address.d.ts +2 -8
- package/dist/lib/models/common/v1/config/IPv4Address.js +174 -215
- package/dist/lib/models/common/v1/config/IPv6Address.d.ts +2 -8
- package/dist/lib/models/common/v1/config/IPv6Address.js +174 -215
- package/dist/lib/models/common/v1/config/KVPair.d.ts +2 -8
- package/dist/lib/models/common/v1/config/KVPair.js +225 -270
- package/dist/lib/models/common/v1/config/MapOfStringWrapper.d.ts +2 -7
- package/dist/lib/models/common/v1/config/MapOfStringWrapper.js +139 -178
- package/dist/lib/models/common/v1/config/Message.d.ts +2 -10
- package/dist/lib/models/common/v1/config/Message.js +213 -258
- package/dist/lib/models/common/v1/config/MessageSeverity.js +7 -9
- package/dist/lib/models/common/v1/config/Metadata.d.ts +2 -11
- package/dist/lib/models/common/v1/config/Metadata.js +261 -308
- package/dist/lib/models/common/v1/config/TenantAwareModel.d.ts +5 -10
- package/dist/lib/models/common/v1/config/TenantAwareModel.js +138 -178
- package/dist/lib/models/common/v1/response/ApiLink.d.ts +2 -8
- package/dist/lib/models/common/v1/response/ApiLink.js +165 -206
- package/dist/lib/models/common/v1/response/ApiResponseMetadata.d.ts +2 -40
- package/dist/lib/models/common/v1/response/ApiResponseMetadata.js +281 -344
- package/dist/lib/models/common/v1/response/ExternalizableAbstractModel.d.ts +1 -15
- package/dist/lib/models/common/v1/response/ExternalizableAbstractModel.js +155 -203
- package/dist/lib/models/common/v1/stats/DownSamplingOperator.js +7 -9
- package/dist/lib/models/common/v1/stats/TimeIntValuePair.d.ts +2 -8
- package/dist/lib/models/common/v1/stats/TimeIntValuePair.js +165 -206
- package/dist/lib/models/objects/v4/config/Certificate.d.ts +1 -58
- package/dist/lib/models/objects/v4/config/Certificate.js +319 -381
- package/dist/lib/models/objects/v4/config/CertificateProjection.d.ts +1 -1
- package/dist/lib/models/objects/v4/config/CertificateProjection.js +73 -102
- package/dist/lib/models/objects/v4/config/CreateCertificateApiResponse.d.ts +2 -45
- package/dist/lib/models/objects/v4/config/CreateCertificateApiResponse.js +185 -240
- package/dist/lib/models/objects/v4/config/CreateObjectstoreApiResponse.d.ts +2 -43
- package/dist/lib/models/objects/v4/config/CreateObjectstoreApiResponse.js +185 -240
- package/dist/lib/models/objects/v4/config/DeleteObjectstoreApiResponse.d.ts +2 -43
- package/dist/lib/models/objects/v4/config/DeleteObjectstoreApiResponse.js +185 -240
- package/dist/lib/models/objects/v4/config/GetCaApiResponse.d.ts +2 -43
- package/dist/lib/models/objects/v4/config/GetCaApiResponse.js +185 -240
- package/dist/lib/models/objects/v4/config/GetCertificateApiResponse.d.ts +2 -43
- package/dist/lib/models/objects/v4/config/GetCertificateApiResponse.js +185 -240
- package/dist/lib/models/objects/v4/config/GetObjectstoreApiResponse.d.ts +2 -45
- package/dist/lib/models/objects/v4/config/GetObjectstoreApiResponse.js +185 -240
- package/dist/lib/models/objects/v4/config/ListCertificatesApiResponse.d.ts +2 -43
- package/dist/lib/models/objects/v4/config/ListCertificatesApiResponse.js +211 -266
- package/dist/lib/models/objects/v4/config/ListObjectstoresApiResponse.d.ts +2 -43
- package/dist/lib/models/objects/v4/config/ListObjectstoresApiResponse.js +211 -266
- package/dist/lib/models/objects/v4/config/ObjectStore.d.ts +1 -96
- package/dist/lib/models/objects/v4/config/ObjectStore.js +628 -711
- package/dist/lib/models/objects/v4/config/ObjectStoreProjection.d.ts +1 -152
- package/dist/lib/models/objects/v4/config/ObjectStoreProjection.js +221 -238
- package/dist/lib/models/objects/v4/config/State.js +7 -9
- package/dist/lib/models/objects/v4/config/UpdateObjectstoreApiResponse.d.ts +2 -43
- package/dist/lib/models/objects/v4/config/UpdateObjectstoreApiResponse.js +185 -240
- package/dist/lib/models/objects/v4/error/AppMessage.d.ts +5 -15
- package/dist/lib/models/objects/v4/error/AppMessage.js +264 -313
- package/dist/lib/models/objects/v4/error/ErrorResponse.d.ts +2 -7
- package/dist/lib/models/objects/v4/error/ErrorResponse.js +174 -217
- package/dist/lib/models/objects/v4/error/SchemaValidationError.d.ts +2 -18
- package/dist/lib/models/objects/v4/error/SchemaValidationError.js +248 -299
- package/dist/lib/models/objects/v4/error/SchemaValidationErrorMessage.d.ts +2 -9
- package/dist/lib/models/objects/v4/error/SchemaValidationErrorMessage.js +190 -233
- package/dist/lib/models/objects/v4/stats/GetObjectstoreStatsApiResponse.d.ts +2 -43
- package/dist/lib/models/objects/v4/stats/GetObjectstoreStatsApiResponse.js +185 -240
- package/dist/lib/models/objects/v4/stats/ObjectstoreStats.d.ts +1 -169
- package/dist/lib/models/objects/v4/stats/ObjectstoreStats.js +957 -1129
- package/dist/lib/models/objects/v4/stats/TimeFloatValuePair.d.ts +2 -8
- package/dist/lib/models/objects/v4/stats/TimeFloatValuePair.js +165 -206
- package/dist/lib/models/prism/v4/config/TaskReference.d.ts +5 -10
- package/dist/lib/models/prism/v4/config/TaskReference.js +143 -182
- package/dist/lib/models/validation/ValidationError.js +26 -42
- package/dist/lib/models/validation/ValidationScopes.js +3 -3
- package/dist/lib/utils/ValidationUtils.js +39 -69
- package/package.json +2 -2
package/dist/lib/Paginable.d.ts
CHANGED
package/dist/lib/Paginable.js
CHANGED
|
@@ -3,42 +3,33 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
var _ApiClient = require("./ApiClient");
|
|
8
|
-
|
|
9
|
-
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
10
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
11
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
12
|
-
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
13
|
-
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
14
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
15
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
16
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /*
|
|
8
|
+
/*
|
|
17
9
|
* Nutanix Objects Storage Management APIs
|
|
18
10
|
*
|
|
19
|
-
* OpenAPI spec version: 4.0.
|
|
11
|
+
* OpenAPI spec version: 4.0.2
|
|
20
12
|
*
|
|
21
13
|
* NOTE: This class is auto generated by the Open API Dev Platform.
|
|
22
14
|
*
|
|
23
|
-
* Open API Dev Platform Codegen version:
|
|
15
|
+
* Open API Dev Platform Codegen version: 17.5.0.10128-RELEASE
|
|
24
16
|
*
|
|
25
17
|
* Do not edit the class manually.
|
|
26
18
|
*
|
|
27
19
|
*/
|
|
20
|
+
|
|
28
21
|
/**
|
|
29
22
|
* A model that represents a paginable response from a list endpoint.
|
|
30
23
|
* @module Paginable
|
|
31
|
-
* @version 4.0.
|
|
24
|
+
* @version 4.0.2
|
|
32
25
|
*/
|
|
33
|
-
|
|
26
|
+
class Paginable {
|
|
34
27
|
/**
|
|
35
28
|
* Constructs a new <code>Paginable</code>.
|
|
36
29
|
* @alias module:Paginable
|
|
37
30
|
* @class
|
|
38
31
|
*/
|
|
39
|
-
|
|
40
|
-
_classCallCheck(this, Paginable);
|
|
41
|
-
}
|
|
32
|
+
constructor() {}
|
|
42
33
|
|
|
43
34
|
/**
|
|
44
35
|
* Constructs a <code>Paginable</code> from a plain Javascript object, optionally creating a new instance.
|
|
@@ -47,194 +38,164 @@ var Paginable = exports["default"] = /*#__PURE__*/function () {
|
|
|
47
38
|
* @param {module:Paginable} obj Optional instance to populate.
|
|
48
39
|
* @return {module:Paginable} The populated <code>Paginable</code> instance.
|
|
49
40
|
*/
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
41
|
+
static constructFromObject(metadata, obj) {
|
|
42
|
+
if (metadata) {
|
|
43
|
+
obj = obj || new Paginable();
|
|
44
|
+
if (metadata.hasOwnProperty('links') && metadata['links'] !== null && metadata['links'] !== undefined) {
|
|
45
|
+
for (const link of metadata['links']) {
|
|
46
|
+
if (link.hasOwnProperty('rel') && link.hasOwnProperty('href')) {
|
|
47
|
+
switch (link['rel']) {
|
|
48
|
+
case 'first':
|
|
49
|
+
obj.linkFirst = link['href'];
|
|
50
|
+
break;
|
|
51
|
+
case 'prev':
|
|
52
|
+
obj.linkPrev = link['href'];
|
|
53
|
+
break;
|
|
54
|
+
case 'next':
|
|
55
|
+
obj.linkNext = link['href'];
|
|
56
|
+
break;
|
|
57
|
+
case 'last':
|
|
58
|
+
obj.linkLast = link['href'];
|
|
59
|
+
break;
|
|
60
|
+
default:
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
61
65
|
}
|
|
62
|
-
if (
|
|
63
|
-
|
|
66
|
+
if (metadata.hasOwnProperty('totalAvailableResults')) {
|
|
67
|
+
obj.resultsTotal = metadata['totalAvailableResults'];
|
|
64
68
|
}
|
|
65
|
-
return this._getLink(this.linkFirst);
|
|
66
69
|
}
|
|
70
|
+
return obj;
|
|
71
|
+
}
|
|
67
72
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if (this.isFirstPage()) {
|
|
77
|
-
return Promise.reject('Cannot navigate to previous page : already on first page');
|
|
78
|
-
}
|
|
79
|
-
if (this.linkPrev === null) {
|
|
80
|
-
return Promise.reject('No link to previous page provided in previous API response');
|
|
81
|
-
}
|
|
82
|
-
return this._getLink(this.linkPrev);
|
|
73
|
+
/**
|
|
74
|
+
* Get the first page of the set, if any
|
|
75
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, resolves with another Paginable
|
|
76
|
+
* or rejects with error message if any issue (link not available, ...)
|
|
77
|
+
*/
|
|
78
|
+
getFirstPage() {
|
|
79
|
+
if (this.isFirstPage()) {
|
|
80
|
+
return Promise.reject('Cannot navigate to first page : already on first page');
|
|
83
81
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
* Get the next page of the set, if any
|
|
87
|
-
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, resolves with another Paginable
|
|
88
|
-
* or rejects with error message if any issue (link not available, ...)
|
|
89
|
-
*/
|
|
90
|
-
}, {
|
|
91
|
-
key: "getNextPage",
|
|
92
|
-
value: function getNextPage() {
|
|
93
|
-
if (this.isLastPage()) {
|
|
94
|
-
return Promise.reject('Cannot navigate to next page : already on last page');
|
|
95
|
-
}
|
|
96
|
-
if (this.linkNext === null) {
|
|
97
|
-
return Promise.reject('No link to next page provided in previous API response');
|
|
98
|
-
}
|
|
99
|
-
return this._getLink(this.linkNext);
|
|
82
|
+
if (this.linkFirst === null) {
|
|
83
|
+
return Promise.reject('No link to first page provided in previous API response');
|
|
100
84
|
}
|
|
85
|
+
return this._getLink(this.linkFirst);
|
|
86
|
+
}
|
|
101
87
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
if (this.isLastPage()) {
|
|
111
|
-
return Promise.reject('Cannot navigate to last page : already on last page');
|
|
112
|
-
}
|
|
113
|
-
if (this.linkLast === null) {
|
|
114
|
-
return Promise.reject('No link to last page provided in previous API response');
|
|
115
|
-
}
|
|
116
|
-
return this._getLink(this.linkLast);
|
|
88
|
+
/**
|
|
89
|
+
* Get the previous page of the set, if any
|
|
90
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, resolves with another Paginable
|
|
91
|
+
* or rejects with error message if any issue (link not available, ...)
|
|
92
|
+
*/
|
|
93
|
+
getPrevPage() {
|
|
94
|
+
if (this.isFirstPage()) {
|
|
95
|
+
return Promise.reject('Cannot navigate to previous page : already on first page');
|
|
117
96
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
* Get the current page number
|
|
121
|
-
* @return {Number} the current page number, starts at 0
|
|
122
|
-
*/
|
|
123
|
-
}, {
|
|
124
|
-
key: "currentPage",
|
|
125
|
-
value: function currentPage() {
|
|
126
|
-
if (this.page === null) {
|
|
127
|
-
return 0;
|
|
128
|
-
}
|
|
129
|
-
return this.page;
|
|
97
|
+
if (this.linkPrev === null) {
|
|
98
|
+
return Promise.reject('No link to previous page provided in previous API response');
|
|
130
99
|
}
|
|
100
|
+
return this._getLink(this.linkPrev);
|
|
101
|
+
}
|
|
131
102
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
return 1;
|
|
141
|
-
}
|
|
142
|
-
return Math.ceil(this.resultsTotal / this.resultsPerPage);
|
|
103
|
+
/**
|
|
104
|
+
* Get the next page of the set, if any
|
|
105
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, resolves with another Paginable
|
|
106
|
+
* or rejects with error message if any issue (link not available, ...)
|
|
107
|
+
*/
|
|
108
|
+
getNextPage() {
|
|
109
|
+
if (this.isLastPage()) {
|
|
110
|
+
return Promise.reject('Cannot navigate to next page : already on last page');
|
|
143
111
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
* Check if current page is first page
|
|
147
|
-
* @return {Boolean} True if current page is 0, false otherwise
|
|
148
|
-
*/
|
|
149
|
-
}, {
|
|
150
|
-
key: "isFirstPage",
|
|
151
|
-
value: function isFirstPage() {
|
|
152
|
-
return this.currentPage() === 0;
|
|
112
|
+
if (this.linkNext === null) {
|
|
113
|
+
return Promise.reject('No link to next page provided in previous API response');
|
|
153
114
|
}
|
|
115
|
+
return this._getLink(this.linkNext);
|
|
116
|
+
}
|
|
154
117
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
return
|
|
118
|
+
/**
|
|
119
|
+
* Get the last page of the set, if any
|
|
120
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, resolves with another Paginable
|
|
121
|
+
* or rejects with error message if any issue (link not available, ...)
|
|
122
|
+
*/
|
|
123
|
+
getLastPage() {
|
|
124
|
+
if (this.isLastPage()) {
|
|
125
|
+
return Promise.reject('Cannot navigate to last page : already on last page');
|
|
163
126
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
value: function populatePaginationMetadata(apiClient, page, resultsPerPage) {
|
|
167
|
-
this.apiClient = apiClient;
|
|
168
|
-
this.page = page;
|
|
169
|
-
this.resultsPerPage = resultsPerPage;
|
|
127
|
+
if (this.linkLast === null) {
|
|
128
|
+
return Promise.reject('No link to last page provided in previous API response');
|
|
170
129
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
var headerParams = {};
|
|
182
|
-
var formParams = {};
|
|
183
|
-
var authNames = [];
|
|
184
|
-
var contentTypes = [];
|
|
185
|
-
var accepts = ['application/json'];
|
|
186
|
-
var returnType = this.constructor;
|
|
187
|
-
return this.apiClient.callApi(path, 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType);
|
|
130
|
+
return this._getLink(this.linkLast);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Get the current page number
|
|
135
|
+
* @return {Number} the current page number, starts at 0
|
|
136
|
+
*/
|
|
137
|
+
currentPage() {
|
|
138
|
+
if (this.page === null) {
|
|
139
|
+
return 0;
|
|
188
140
|
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
var link = _step.value;
|
|
200
|
-
if (link.hasOwnProperty('rel') && link.hasOwnProperty('href')) {
|
|
201
|
-
switch (link['rel']) {
|
|
202
|
-
case 'first':
|
|
203
|
-
obj.linkFirst = link['href'];
|
|
204
|
-
break;
|
|
205
|
-
case 'prev':
|
|
206
|
-
obj.linkPrev = link['href'];
|
|
207
|
-
break;
|
|
208
|
-
case 'next':
|
|
209
|
-
obj.linkNext = link['href'];
|
|
210
|
-
break;
|
|
211
|
-
case 'last':
|
|
212
|
-
obj.linkLast = link['href'];
|
|
213
|
-
break;
|
|
214
|
-
default:
|
|
215
|
-
break;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
} catch (err) {
|
|
220
|
-
_iterator.e(err);
|
|
221
|
-
} finally {
|
|
222
|
-
_iterator.f();
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
if (metadata.hasOwnProperty('totalAvailableResults')) {
|
|
226
|
-
obj.resultsTotal = metadata['totalAvailableResults'];
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
return obj;
|
|
141
|
+
return this.page;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Get the total number of pages
|
|
146
|
+
* @return {Number} the total number of pages available
|
|
147
|
+
*/
|
|
148
|
+
countPages() {
|
|
149
|
+
if (this.resultsPerPage === null || this.resultsTotal === null || this.resultsPerPage === 0) {
|
|
150
|
+
return 1;
|
|
230
151
|
}
|
|
231
|
-
|
|
232
|
-
}
|
|
152
|
+
return Math.ceil(this.resultsTotal / this.resultsPerPage);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Check if current page is first page
|
|
157
|
+
* @return {Boolean} True if current page is 0, false otherwise
|
|
158
|
+
*/
|
|
159
|
+
isFirstPage() {
|
|
160
|
+
return this.currentPage() === 0;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Check if current page is last page
|
|
165
|
+
* @return {Boolean} True if current page is countPages()-1, false otherwise
|
|
166
|
+
*/
|
|
167
|
+
isLastPage() {
|
|
168
|
+
return this.currentPage() === this.countPages() - 1;
|
|
169
|
+
}
|
|
170
|
+
populatePaginationMetadata(apiClient, page, resultsPerPage) {
|
|
171
|
+
this.apiClient = apiClient;
|
|
172
|
+
this.page = page;
|
|
173
|
+
this.resultsPerPage = resultsPerPage;
|
|
174
|
+
}
|
|
175
|
+
_getLink(path) {
|
|
176
|
+
// If no ApiClient defined, instantiate default one
|
|
177
|
+
if (this.apiClient === null) {
|
|
178
|
+
this.apiClient = _ApiClient.ApiClient.instance;
|
|
179
|
+
}
|
|
180
|
+
const postBody = {};
|
|
181
|
+
const pathParams = {};
|
|
182
|
+
const queryParams = {};
|
|
183
|
+
const headerParams = {};
|
|
184
|
+
const formParams = {};
|
|
185
|
+
const authNames = [];
|
|
186
|
+
const contentTypes = [];
|
|
187
|
+
const accepts = ['application/json'];
|
|
188
|
+
const returnType = this.constructor;
|
|
189
|
+
return this.apiClient.callApi(path, 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
233
193
|
/**
|
|
234
194
|
* The link to first page, if any
|
|
235
195
|
* @type {String}
|
|
236
196
|
* @memberOf Paginable
|
|
237
197
|
*/
|
|
198
|
+
exports.default = Paginable;
|
|
238
199
|
Paginable.prototype.linkFirst = null;
|
|
239
200
|
|
|
240
201
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ObjectStores service.
|
|
3
|
-
* @version 4.0.
|
|
3
|
+
* @version 4.0.2
|
|
4
4
|
* @class ObjectStoresApi
|
|
5
5
|
*/
|
|
6
6
|
export class ObjectStoresApi {
|
|
@@ -79,16 +79,8 @@ export class ObjectStoresApi {
|
|
|
79
79
|
* @param { Number } opts.$limit A URL query parameter that specifies the total number of records returned in the result set. Must be a positive integer between 1 and 100. Any number out of this range will lead to a validation error. If the limit is not provided, a default value of 50 records will be returned in the result set.
|
|
80
80
|
|
|
81
81
|
* @param { String } opts.$filter A URL query parameter that allows clients to filter a collection of resources. The expression specified with $filter is evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the response. Expression specified with the $filter must conform to the [OData V4.01](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html) URL conventions.<br>
|
|
82
|
-
* For example, filter '$filter=name eq 'karbon-ntnx-1.0' would filter the result on cluster name 'karbon-ntnx1.0', filter '$filter=startswith(name, 'C')' would filter on cluster name starting with 'C'
|
|
83
|
-
* The filter can be applied to the following fields:<br>
|
|
84
|
-
* - alternateFqdns/value<br>
|
|
85
|
-
* - alternateIps/ipv4/value
|
|
82
|
+
* For example, filter '$filter=name eq 'karbon-ntnx-1.0' would filter the result on cluster name 'karbon-ntnx1.0', filter '$filter=startswith(name, 'C')' would filter on cluster name starting with 'C'.
|
|
86
83
|
* @param { String } opts.$select A URL query parameter that allows clients to request a specific set of properties for each entity or complex type. Expression specified with the $select must conform to the [OData V4.01](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html) URL conventions. If a $select expression consists of a single select item that is an asterisk (i.e., *), then all properties on the matching resource will be returned.
|
|
87
|
-
- alternateFqdns
|
|
88
|
-
- alternateFqdns/value
|
|
89
|
-
- alternateIps
|
|
90
|
-
- alternateIps/ipv4/value
|
|
91
|
-
|
|
92
84
|
* @param {Object} args Additional Arguments
|
|
93
85
|
* @return {Promise<ListCertificatesApiResponse>} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link ListCertificatesApiResponse } and HTTP response
|
|
94
86
|
*/
|
|
@@ -107,66 +99,10 @@ export class ObjectStoresApi {
|
|
|
107
99
|
* @param { Number } opts.$limit A URL query parameter that specifies the total number of records returned in the result set. Must be a positive integer between 1 and 100. Any number out of this range will lead to a validation error. If the limit is not provided, a default value of 50 records will be returned in the result set.
|
|
108
100
|
|
|
109
101
|
* @param { String } opts.$filter A URL query parameter that allows clients to filter a collection of resources. The expression specified with $filter is evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the response. Expression specified with the $filter must conform to the [OData V4.01](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html) URL conventions.<br>
|
|
110
|
-
* For example, filter '$filter=name eq 'karbon-ntnx-1.0' would filter the result on cluster name 'karbon-ntnx1.0', filter '$filter=startswith(name, 'C')' would filter on cluster name starting with 'C'
|
|
111
|
-
*
|
|
112
|
-
* -
|
|
113
|
-
* - clusterExtId<br>
|
|
114
|
-
* - creationTime<br>
|
|
115
|
-
* - deploymentVersion<br>
|
|
116
|
-
* - description<br>
|
|
117
|
-
* - domain<br>
|
|
118
|
-
* - lastUpdateTime<br>
|
|
119
|
-
* - name<br>
|
|
120
|
-
* - numWorkerNodes<br>
|
|
121
|
-
* - publicNetworkIps/ipv4/value<br>
|
|
122
|
-
* - publicNetworkIps/ipv6/value<br>
|
|
123
|
-
* - publicNetworkReference<br>
|
|
124
|
-
* - region<br>
|
|
125
|
-
* - storageNetworkDnsIp/ipv4/value<br>
|
|
126
|
-
* - storageNetworkDnsIp/ipv6/value<br>
|
|
127
|
-
* - storageNetworkReference<br>
|
|
128
|
-
* - storageNetworkVip/ipv4/value<br>
|
|
129
|
-
* - storageNetworkVip/ipv6/value<br>
|
|
130
|
-
* - totalCapacityGiB
|
|
131
|
-
* @param { String } opts.$orderby A URL query parameter that allows clients to specify the sort criteria for the returned list of objects. Resources can be sorted in ascending order using asc or descending order using desc. If asc or desc are not specified, the resources will be sorted in ascending order by default. For example, '$orderby=templateName desc' would get all templates sorted by templateName in descending order.<br>
|
|
132
|
-
* The orderby can be applied to the following fields:<br>
|
|
133
|
-
* - clusterExtId<br>
|
|
134
|
-
* - creationTime<br>
|
|
135
|
-
* - deploymentVersion<br>
|
|
136
|
-
* - description<br>
|
|
137
|
-
* - domain<br>
|
|
138
|
-
* - lastUpdateTime<br>
|
|
139
|
-
* - name<br>
|
|
140
|
-
* - numWorkerNodes<br>
|
|
141
|
-
* - publicNetworkReference<br>
|
|
142
|
-
* - region<br>
|
|
143
|
-
* - storageNetworkReference<br>
|
|
144
|
-
* - totalCapacityGiB
|
|
145
|
-
* @param { String } opts.$expand A URL query parameter that allows clients to request related resources when a resource that satisfies a particular request is retrieved. Each expanded item is evaluated relative to the entity containing the property being expanded. Other query options can be applied to an expanded property by appending a semicolon-separated list of query options, enclosed in parentheses, to the property name. Permissible system query options are $filter, $select and $orderby. The following expansion keys are supported.
|
|
146
|
-
- certificates
|
|
147
|
-
|
|
102
|
+
* For example, filter '$filter=name eq 'karbon-ntnx-1.0' would filter the result on cluster name 'karbon-ntnx1.0', filter '$filter=startswith(name, 'C')' would filter on cluster name starting with 'C'.
|
|
103
|
+
* @param { String } opts.$orderby A URL query parameter that allows clients to specify the sort criteria for the returned list of objects. Resources can be sorted in ascending order using asc or descending order using desc. If asc or desc are not specified, the resources will be sorted in ascending order by default. For example, '$orderby=templateName desc' would get all templates sorted by templateName in descending order.
|
|
104
|
+
* @param { String } opts.$expand A URL query parameter that allows clients to request related resources when a resource that satisfies a particular request is retrieved. Each expanded item is evaluated relative to the entity containing the property being expanded. Other query options can be applied to an expanded property by appending a semicolon-separated list of query options, enclosed in parentheses, to the property name. Permissible system query options are $filter, $select and $orderby.
|
|
148
105
|
* @param { String } opts.$select A URL query parameter that allows clients to request a specific set of properties for each entity or complex type. Expression specified with the $select must conform to the [OData V4.01](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html) URL conventions. If a $select expression consists of a single select item that is an asterisk (i.e., *), then all properties on the matching resource will be returned.
|
|
149
|
-
- certificateExtIds
|
|
150
|
-
- clusterExtId
|
|
151
|
-
- creationTime
|
|
152
|
-
- deploymentVersion
|
|
153
|
-
- description
|
|
154
|
-
- domain
|
|
155
|
-
- lastUpdateTime
|
|
156
|
-
- name
|
|
157
|
-
- numWorkerNodes
|
|
158
|
-
- publicNetworkIps
|
|
159
|
-
- publicNetworkIps/ipv4/value
|
|
160
|
-
- publicNetworkReference
|
|
161
|
-
- region
|
|
162
|
-
- state
|
|
163
|
-
- storageNetworkDnsIp
|
|
164
|
-
- storageNetworkDnsIp/ipv4/value
|
|
165
|
-
- storageNetworkReference
|
|
166
|
-
- storageNetworkVip
|
|
167
|
-
- storageNetworkVip/ipv4/value
|
|
168
|
-
- totalCapacityGiB
|
|
169
|
-
|
|
170
106
|
* @param {Object} args Additional Arguments
|
|
171
107
|
* @return {Promise<ListObjectstoresApiResponse>} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link ListObjectstoresApiResponse } and HTTP response
|
|
172
108
|
*/
|