@devopness/sdk-js 3.2.0 → 3.2.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.
@@ -12,6 +12,7 @@
12
12
  import { ApiBaseService } from "../../../services/ApiBaseService";
13
13
  import { ApiResponse } from "../../../common/ApiResponse";
14
14
  import { Subnet } from '../../generated/models';
15
+ import { SubnetRelation } from '../../generated/models';
15
16
  /**
16
17
  * SubnetsApiService - Auto-generated
17
18
  */
@@ -28,4 +29,12 @@ export declare class SubnetsApiService extends ApiBaseService {
28
29
  * @param {number} subnetId The ID of the subnet.
29
30
  */
30
31
  getSubnet(subnetId: number): Promise<ApiResponse<Subnet>>;
32
+ /**
33
+ *
34
+ * @summary Return a list of all subnets belonging to an environment
35
+ * @param {number} environmentId The ID of the environment.
36
+ * @param {number} [page] Number of the page to be retrieved
37
+ * @param {number} [perPage] Number of items returned per page
38
+ */
39
+ listEnvironmentSubnets(environmentId: number, page?: number, perPage?: number): Promise<ApiResponse<Array<SubnetRelation>>>;
31
40
  }
@@ -61,5 +61,30 @@ class SubnetsApiService extends ApiBaseService_1.ApiBaseService {
61
61
  return new ApiResponse_1.ApiResponse(response);
62
62
  });
63
63
  }
64
+ /**
65
+ *
66
+ * @summary Return a list of all subnets belonging to an environment
67
+ * @param {number} environmentId The ID of the environment.
68
+ * @param {number} [page] Number of the page to be retrieved
69
+ * @param {number} [perPage] Number of items returned per page
70
+ */
71
+ listEnvironmentSubnets(environmentId, page, perPage) {
72
+ return __awaiter(this, void 0, void 0, function* () {
73
+ if (environmentId === null || environmentId === undefined) {
74
+ throw new Exceptions_1.ArgumentNullException('environmentId', 'listEnvironmentSubnets');
75
+ }
76
+ let queryString = '';
77
+ const queryParams = { page: page, per_page: perPage, };
78
+ for (const key in queryParams) {
79
+ if (queryParams[key] === undefined || queryParams[key] === null) {
80
+ continue;
81
+ }
82
+ queryString += (queryString ? '&' : '') + `${key}=${encodeURI(queryParams[key])}`;
83
+ }
84
+ const requestUrl = '/environments/{environment_id}/subnets' + (queryString ? `?${queryString}` : '');
85
+ const response = yield this.get(requestUrl.replace(`{${"environment_id"}}`, encodeURIComponent(String(environmentId))));
86
+ return new ApiResponse_1.ApiResponse(response);
87
+ });
88
+ }
64
89
  }
65
90
  exports.SubnetsApiService = SubnetsApiService;
@@ -9,6 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
+ import { NetworkRelation } from './network-relation';
12
13
  import { SubnetProvisionInput } from './subnet-provision-input';
13
14
  import { SubnetType } from './subnet-type';
14
15
  /**
@@ -42,11 +43,11 @@ export interface SubnetRelation {
42
43
  */
43
44
  created_by: number;
44
45
  /**
45
- * Numeric ID of the network to which the subnet belongs to
46
- * @type {number}
46
+ *
47
+ * @type {NetworkRelation}
47
48
  * @memberof SubnetRelation
48
49
  */
49
- network_id: number;
50
+ network: NetworkRelation | null;
50
51
  /**
51
52
  * The subnet\'s name
52
53
  * @type {string}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@devopness/sdk-js",
4
- "version": "3.2.0",
4
+ "version": "3.2.1",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -70,7 +70,7 @@
70
70
  },
71
71
  "dependencies": {
72
72
  "@types/parse-link-header": "^2.0.3",
73
- "axios": "^1.13.4",
73
+ "axios": "^1.13.6",
74
74
  "parse-link-header": "^2.0.0"
75
75
  }
76
76
  }