Skip to content

Commit 4244c4a

Browse files
Merge pull request #112 from IBM/pdns_update_public
feat(Dns Svcs):List resource records query by type and name and forwarding rule pagination
2 parents 2ce6521 + 9b29cd4 commit 4244c4a

File tree

4 files changed

+2734
-1786
lines changed

4 files changed

+2734
-1786
lines changed

dns-svcs/v1.ts

Lines changed: 76 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2022.
2+
* (C) Copyright IBM Corp. 2023.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -106,6 +106,7 @@ class DnsSvcsV1 extends BaseService {
106106
* @param {string} [params.xCorrelationId] - Uniquely identifying a request.
107107
* @param {number} [params.offset] - Specify how many resources to skip over, the default value is 0.
108108
* @param {number} [params.limit] - Specify maximum resources might be returned.
109+
* @param {string} [params.vpcId] - Specify the VPC ID.
109110
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
110111
* @returns {Promise<DnsSvcsV1.Response<DnsSvcsV1.ListDnszones>>}
111112
*/
@@ -114,7 +115,7 @@ class DnsSvcsV1 extends BaseService {
114115
): Promise<DnsSvcsV1.Response<DnsSvcsV1.ListDnszones>> {
115116
const _params = { ...params };
116117
const _requiredParams = ['instanceId'];
117-
const _validParams = ['instanceId', 'xCorrelationId', 'offset', 'limit', 'headers'];
118+
const _validParams = ['instanceId', 'xCorrelationId', 'offset', 'limit', 'vpcId', 'headers'];
118119
const _validationErrors = validateParams(_params, _requiredParams, _validParams);
119120
if (_validationErrors) {
120121
return Promise.reject(_validationErrors);
@@ -123,6 +124,7 @@ class DnsSvcsV1 extends BaseService {
123124
const query = {
124125
'offset': _params.offset,
125126
'limit': _params.limit,
127+
'vpc_id': _params.vpcId,
126128
};
127129

128130
const path = {
@@ -413,6 +415,8 @@ class DnsSvcsV1 extends BaseService {
413415
* @param {string} [params.xCorrelationId] - Uniquely identifying a request.
414416
* @param {number} [params.offset] - Specify how many resources to skip over, the default value is 0.
415417
* @param {number} [params.limit] - Specify maximum resources might be returned.
418+
* @param {string} [params.type] - Specify the type of resource record to query.
419+
* @param {string} [params.name] - Specify the name of resource record to query.
416420
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
417421
* @returns {Promise<DnsSvcsV1.Response<DnsSvcsV1.ListResourceRecords>>}
418422
*/
@@ -421,7 +425,7 @@ class DnsSvcsV1 extends BaseService {
421425
): Promise<DnsSvcsV1.Response<DnsSvcsV1.ListResourceRecords>> {
422426
const _params = { ...params };
423427
const _requiredParams = ['instanceId', 'dnszoneId'];
424-
const _validParams = ['instanceId', 'dnszoneId', 'xCorrelationId', 'offset', 'limit', 'headers'];
428+
const _validParams = ['instanceId', 'dnszoneId', 'xCorrelationId', 'offset', 'limit', 'type', 'name', 'headers'];
425429
const _validationErrors = validateParams(_params, _requiredParams, _validParams);
426430
if (_validationErrors) {
427431
return Promise.reject(_validationErrors);
@@ -430,6 +434,8 @@ class DnsSvcsV1 extends BaseService {
430434
const query = {
431435
'offset': _params.offset,
432436
'limit': _params.limit,
437+
'type': _params.type,
438+
'name': _params.name,
433439
};
434440

435441
const path = {
@@ -862,6 +868,8 @@ class DnsSvcsV1 extends BaseService {
862868
* @param {Object} params - The parameters to send to the service.
863869
* @param {string} params.instanceId - The unique identifier of a service instance.
864870
* @param {string} params.dnszoneId - The unique identifier of a DNS zone.
871+
* @param {string} [params.accounts] - The account identifiers of the owner zone and linked zones in the format of
872+
* "?account=account1,account2,account3". Maximum 5 accounts are allowed.
865873
* @param {string} [params.xCorrelationId] - Uniquely identifying a request.
866874
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
867875
* @returns {Promise<DnsSvcsV1.Response<DnsSvcsV1.ListPermittedNetworks>>}
@@ -871,12 +879,16 @@ class DnsSvcsV1 extends BaseService {
871879
): Promise<DnsSvcsV1.Response<DnsSvcsV1.ListPermittedNetworks>> {
872880
const _params = { ...params };
873881
const _requiredParams = ['instanceId', 'dnszoneId'];
874-
const _validParams = ['instanceId', 'dnszoneId', 'xCorrelationId', 'headers'];
882+
const _validParams = ['instanceId', 'dnszoneId', 'accounts', 'xCorrelationId', 'headers'];
875883
const _validationErrors = validateParams(_params, _requiredParams, _validParams);
876884
if (_validationErrors) {
877885
return Promise.reject(_validationErrors);
878886
}
879887

888+
const query = {
889+
'accounts': _params.accounts,
890+
};
891+
880892
const path = {
881893
'instance_id': _params.instanceId,
882894
'dnszone_id': _params.dnszoneId,
@@ -892,6 +904,7 @@ class DnsSvcsV1 extends BaseService {
892904
options: {
893905
url: '/instances/{instance_id}/dnszones/{dnszone_id}/permitted_networks',
894906
method: 'GET',
907+
qs: query,
895908
path,
896909
},
897910
defaultOptions: extend(true, {}, this.baseOptions, {
@@ -920,6 +933,8 @@ class DnsSvcsV1 extends BaseService {
920933
* @param {string} params.dnszoneId - The unique identifier of a DNS zone.
921934
* @param {string} [params.type] - The type of a permitted network.
922935
* @param {PermittedNetworkVpc} [params.permittedNetwork] - Permitted network data for VPC.
936+
* @param {string} [params.accounts] - The account identifiers of the owner zone and linked zones in the format of
937+
* "?account=account1,account2,account3". Maximum 5 accounts are allowed.
923938
* @param {string} [params.xCorrelationId] - Uniquely identifying a request.
924939
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
925940
* @returns {Promise<DnsSvcsV1.Response<DnsSvcsV1.PermittedNetwork>>}
@@ -929,7 +944,7 @@ class DnsSvcsV1 extends BaseService {
929944
): Promise<DnsSvcsV1.Response<DnsSvcsV1.PermittedNetwork>> {
930945
const _params = { ...params };
931946
const _requiredParams = ['instanceId', 'dnszoneId'];
932-
const _validParams = ['instanceId', 'dnszoneId', 'type', 'permittedNetwork', 'xCorrelationId', 'headers'];
947+
const _validParams = ['instanceId', 'dnszoneId', 'type', 'permittedNetwork', 'accounts', 'xCorrelationId', 'headers'];
933948
const _validationErrors = validateParams(_params, _requiredParams, _validParams);
934949
if (_validationErrors) {
935950
return Promise.reject(_validationErrors);
@@ -940,6 +955,10 @@ class DnsSvcsV1 extends BaseService {
940955
'permitted_network': _params.permittedNetwork,
941956
};
942957

958+
const query = {
959+
'accounts': _params.accounts,
960+
};
961+
943962
const path = {
944963
'instance_id': _params.instanceId,
945964
'dnszone_id': _params.dnszoneId,
@@ -956,6 +975,7 @@ class DnsSvcsV1 extends BaseService {
956975
url: '/instances/{instance_id}/dnszones/{dnszone_id}/permitted_networks',
957976
method: 'POST',
958977
body,
978+
qs: query,
959979
path,
960980
},
961981
defaultOptions: extend(true, {}, this.baseOptions, {
@@ -2704,6 +2724,8 @@ class DnsSvcsV1 extends BaseService {
27042724
* @param {string} params.instanceId - The unique identifier of a service instance.
27052725
* @param {string} params.resolverId - The unique identifier of a custom resolver.
27062726
* @param {string} [params.xCorrelationId] - Uniquely identifying a request.
2727+
* @param {number} [params.offset] - Specify how many resources to skip over, the default value is 0.
2728+
* @param {number} [params.limit] - Specify maximum resources might be returned.
27072729
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
27082730
* @returns {Promise<DnsSvcsV1.Response<DnsSvcsV1.ForwardingRuleList>>}
27092731
*/
@@ -2712,12 +2734,17 @@ class DnsSvcsV1 extends BaseService {
27122734
): Promise<DnsSvcsV1.Response<DnsSvcsV1.ForwardingRuleList>> {
27132735
const _params = { ...params };
27142736
const _requiredParams = ['instanceId', 'resolverId'];
2715-
const _validParams = ['instanceId', 'resolverId', 'xCorrelationId', 'headers'];
2737+
const _validParams = ['instanceId', 'resolverId', 'xCorrelationId', 'offset', 'limit', 'headers'];
27162738
const _validationErrors = validateParams(_params, _requiredParams, _validParams);
27172739
if (_validationErrors) {
27182740
return Promise.reject(_validationErrors);
27192741
}
27202742

2743+
const query = {
2744+
'offset': _params.offset,
2745+
'limit': _params.limit,
2746+
};
2747+
27212748
const path = {
27222749
'instance_id': _params.instanceId,
27232750
'resolver_id': _params.resolverId,
@@ -2733,6 +2760,7 @@ class DnsSvcsV1 extends BaseService {
27332760
options: {
27342761
url: '/instances/{instance_id}/custom_resolvers/{resolver_id}/forwarding_rules',
27352762
method: 'GET',
2763+
qs: query,
27362764
path,
27372765
},
27382766
defaultOptions: extend(true, {}, this.baseOptions, {
@@ -4103,6 +4131,8 @@ namespace DnsSvcsV1 {
41034131
offset?: number;
41044132
/** Specify maximum resources might be returned. */
41054133
limit?: number;
4134+
/** Specify the VPC ID. */
4135+
vpcId?: string;
41064136
headers?: OutgoingHttpHeaders;
41074137
}
41084138

@@ -4170,6 +4200,10 @@ namespace DnsSvcsV1 {
41704200
offset?: number;
41714201
/** Specify maximum resources might be returned. */
41724202
limit?: number;
4203+
/** Specify the type of resource record to query. */
4204+
type?: string;
4205+
/** Specify the name of resource record to query. */
4206+
name?: string;
41734207
headers?: OutgoingHttpHeaders;
41744208
}
41754209

@@ -4291,6 +4325,10 @@ namespace DnsSvcsV1 {
42914325
instanceId: string;
42924326
/** The unique identifier of a DNS zone. */
42934327
dnszoneId: string;
4328+
/** The account identifiers of the owner zone and linked zones in the format of
4329+
* "?account=account1,account2,account3". Maximum 5 accounts are allowed.
4330+
*/
4331+
accounts?: string;
42944332
/** Uniquely identifying a request. */
42954333
xCorrelationId?: string;
42964334
headers?: OutgoingHttpHeaders;
@@ -4306,6 +4344,10 @@ namespace DnsSvcsV1 {
43064344
type?: CreatePermittedNetworkConstants.Type | string;
43074345
/** Permitted network data for VPC. */
43084346
permittedNetwork?: PermittedNetworkVpc;
4347+
/** The account identifiers of the owner zone and linked zones in the format of
4348+
* "?account=account1,account2,account3". Maximum 5 accounts are allowed.
4349+
*/
4350+
accounts?: string;
43094351
/** Uniquely identifying a request. */
43104352
xCorrelationId?: string;
43114353
headers?: OutgoingHttpHeaders;
@@ -4863,6 +4905,10 @@ namespace DnsSvcsV1 {
48634905
resolverId: string;
48644906
/** Uniquely identifying a request. */
48654907
xCorrelationId?: string;
4908+
/** Specify how many resources to skip over, the default value is 0. */
4909+
offset?: number;
4910+
/** Specify maximum resources might be returned. */
4911+
limit?: number;
48664912
headers?: OutgoingHttpHeaders;
48674913
}
48684914

@@ -5327,13 +5373,13 @@ namespace DnsSvcsV1 {
53275373
export interface Dnszone {
53285374
/** Unique identifier of a DNS zone. */
53295375
id?: string;
5330-
/** the time when a DNS zone is created. */
5376+
/** The time when a DNS zone is created. */
53315377
created_on?: string;
5332-
/** the recent time when a DNS zone is modified. */
5378+
/** The recent time when a DNS zone is modified. */
53335379
modified_on?: string;
53345380
/** Unique identifier of a service instance. */
53355381
instance_id?: string;
5336-
/** Name of DNS zone. */
5382+
/** Name of the DNS zone. Must be a fully qualified domain name. */
53375383
name?: string;
53385384
/** The text describing the purpose of a DNS zone. */
53395385
description?: string;
@@ -5364,7 +5410,23 @@ namespace DnsSvcsV1 {
53645410
/** List of forwarding rules. */
53655411
export interface ForwardingRuleList {
53665412
/** An array of forwarding rules. */
5367-
forwarding_rules?: ForwardingRule[];
5413+
forwarding_rules: ForwardingRule[];
5414+
/** The number of resources to skip over. */
5415+
offset: number;
5416+
/** The maximum number of resources might be returned. */
5417+
limit: number;
5418+
/** The number of resources are returned. */
5419+
count: number;
5420+
/** Total number of resources. */
5421+
total_count: number;
5422+
/** href. */
5423+
first: PaginationRef;
5424+
/** href. */
5425+
last: PaginationRef;
5426+
/** href. */
5427+
previous?: PaginationRef;
5428+
/** href. */
5429+
next?: PaginationRef;
53685430
}
53695431

53705432
/** The HTTP header of health check request. */
@@ -5703,6 +5765,8 @@ namespace DnsSvcsV1 {
57035765
type?: string;
57045766
/** The state of a permitted network. */
57055767
state?: string;
5768+
/** Unique identifier of a linked zone through which the permitted network was added. */
5769+
linked_zone_id?: string;
57065770
}
57075771

57085772
/** Permitted network data for VPC. */
@@ -5786,9 +5850,9 @@ namespace DnsSvcsV1 {
57865850
export interface ResourceRecord {
57875851
/** Identifier of the resource record. */
57885852
id?: string;
5789-
/** the time when a resource record is created. */
5853+
/** The time when a resource record is created. */
57905854
created_on?: string;
5791-
/** the recent time when a resource record is modified. */
5855+
/** The recent time when a resource record is modified. */
57925856
modified_on?: string;
57935857
/** Name of the resource record. */
57945858
name?: string;

dns.env.enc

368 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)