@origincloud/dns 0.0.0-stage → 0.15.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/LICENSE +202 -0
- package/README.md +23 -2
- package/dist/v1beta1/hosted_zone.d.ts +280 -0
- package/dist/v1beta1/hosted_zone.d.ts.map +1 -0
- package/dist/v1beta1/hosted_zone.js +196 -0
- package/dist/v1beta1/hosted_zone.js.map +1 -0
- package/dist/v1beta1/index.d.ts +4 -0
- package/dist/v1beta1/index.d.ts.map +1 -0
- package/dist/v1beta1/index.js +5 -0
- package/dist/v1beta1/index.js.map +1 -0
- package/dist/v1beta1/record_set.d.ts +265 -0
- package/dist/v1beta1/record_set.d.ts.map +1 -0
- package/dist/v1beta1/record_set.js +153 -0
- package/dist/v1beta1/record_set.js.map +1 -0
- package/dist/v1beta1/vpc_attachment.d.ts +122 -0
- package/dist/v1beta1/vpc_attachment.d.ts.map +1 -0
- package/dist/v1beta1/vpc_attachment.js +101 -0
- package/dist/v1beta1/vpc_attachment.js.map +1 -0
- package/package.json +40 -4
- package/src/v1beta1/hosted_zone.ts +395 -0
- package/src/v1beta1/index.ts +5 -0
- package/src/v1beta1/record_set.ts +379 -0
- package/src/v1beta1/vpc_attachment.ts +201 -0
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
// Code generated by the SDK's generator (generator/). DO NOT EDIT.
|
|
2
|
+
// source: origincloud/dns/v1beta1/hosted_zone.proto
|
|
3
|
+
import { newRequestId, pathValue, query, } from "@origincloud/core";
|
|
4
|
+
/**
|
|
5
|
+
* Calls HostedZoneService.
|
|
6
|
+
*
|
|
7
|
+
* Hosted zones: the domains a project's records are answered for.
|
|
8
|
+
*
|
|
9
|
+
* A public zone holds its name only once it proves control of it: until
|
|
10
|
+
* then it is `PENDING_VERIFICATION`, and any number of zones of any
|
|
11
|
+
* project may be pending for the same name. It proves control with a TXT
|
|
12
|
+
* record at `_origin-challenge.{dns_name}` holding the zone's token,
|
|
13
|
+
* answered by the name's current DNS. The first zone of a name to verify
|
|
14
|
+
* becomes `ACTIVE`, holds the name, and is answered from the platform's
|
|
15
|
+
* name servers once the name is delegated to them; the others stay
|
|
16
|
+
* pending. A zone that doesn't verify within its window is deleted with
|
|
17
|
+
* its record sets. The platform checks pending zones on its own, more
|
|
18
|
+
* rarely the longer they stay pending; `VerifyHostedZone` checks one now.
|
|
19
|
+
*
|
|
20
|
+
* An active public zone is checked again every day. It keeps its name
|
|
21
|
+
* while the name is delegated to the platform's name servers, or while the
|
|
22
|
+
* token still answers at the name's other name servers. After several
|
|
23
|
+
* checks in a row find the name delegated elsewhere without the token, it
|
|
24
|
+
* is `SUSPENDED`: no longer answered, its record sets kept, and its name
|
|
25
|
+
* free for another zone to verify. Verifying it again while its name is
|
|
26
|
+
* free makes it active again.
|
|
27
|
+
*
|
|
28
|
+
* A private zone is active from the start, and answers in the VPCs it is
|
|
29
|
+
* attached to.
|
|
30
|
+
*/
|
|
31
|
+
export class HostedZoneClient {
|
|
32
|
+
/**
|
|
33
|
+
* The endpoint the client sends its calls to, which also serves the
|
|
34
|
+
* operations its methods answer with.
|
|
35
|
+
*/
|
|
36
|
+
service;
|
|
37
|
+
/** A client of HostedZoneService that sends its calls through `client`. */
|
|
38
|
+
constructor(client) {
|
|
39
|
+
this.service = client.service("dns", false);
|
|
40
|
+
}
|
|
41
|
+
/** Returns a hosted zone. */
|
|
42
|
+
async getHostedZone(request, options) {
|
|
43
|
+
const p0 = pathValue("name", request.name, "projects/*/hostedZones/*");
|
|
44
|
+
return this.service.call({
|
|
45
|
+
method: "GET",
|
|
46
|
+
path: `/v1beta1/${p0}`,
|
|
47
|
+
query: query(request, ["name"]),
|
|
48
|
+
idempotent: true,
|
|
49
|
+
}, options);
|
|
50
|
+
}
|
|
51
|
+
/** Lists a project's hosted zones, oldest first. */
|
|
52
|
+
async listHostedZones(request, options) {
|
|
53
|
+
const p0 = pathValue("parent", request.parent, "projects/*");
|
|
54
|
+
return this.service.call({
|
|
55
|
+
method: "GET",
|
|
56
|
+
path: `/v1beta1/${p0}/hostedZones`,
|
|
57
|
+
query: query(request, ["parent"]),
|
|
58
|
+
idempotent: true,
|
|
59
|
+
}, options);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Iterates over everything listHostedZones lists from the request's page on,
|
|
63
|
+
* fetching the next page as the loop reaches it. A page that fails ends
|
|
64
|
+
* the iteration with its error.
|
|
65
|
+
*/
|
|
66
|
+
async *allHostedZones(request, options) {
|
|
67
|
+
for (let page = request;;) {
|
|
68
|
+
const response = await this.listHostedZones(page, options);
|
|
69
|
+
yield* response.hostedZones ?? [];
|
|
70
|
+
if (!response.nextPageToken)
|
|
71
|
+
return;
|
|
72
|
+
page = { ...page, pageToken: response.nextPageToken };
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Creates a hosted zone, empty. A public zone starts
|
|
77
|
+
* `PENDING_VERIFICATION`, with the token to publish in `challenge`; a
|
|
78
|
+
* private zone starts `ACTIVE`. Refused with `BAD_REQUEST` for a name the
|
|
79
|
+
* platform keeps for itself, or once the project's or organization's
|
|
80
|
+
* quota of zones is used up, and with `PAYMENT_METHOD_REQUIRED` while the
|
|
81
|
+
* project has no valid billing.
|
|
82
|
+
*/
|
|
83
|
+
async createHostedZone(request, options) {
|
|
84
|
+
if (!request.requestId)
|
|
85
|
+
request = { ...request, requestId: newRequestId() };
|
|
86
|
+
const p0 = pathValue("parent", request.parent, "projects/*");
|
|
87
|
+
return this.service.call({
|
|
88
|
+
method: "POST",
|
|
89
|
+
path: `/v1beta1/${p0}/hostedZones`,
|
|
90
|
+
body: request.hostedZone,
|
|
91
|
+
query: query(request, ["parent", "hostedZone"]),
|
|
92
|
+
idempotent: true,
|
|
93
|
+
}, options);
|
|
94
|
+
}
|
|
95
|
+
/** Changes a hosted zone's tags. */
|
|
96
|
+
async updateHostedZone(request, options) {
|
|
97
|
+
if (!request.requestId)
|
|
98
|
+
request = { ...request, requestId: newRequestId() };
|
|
99
|
+
const p0 = pathValue("hostedZone.name", request.hostedZone?.name, "projects/*/hostedZones/*");
|
|
100
|
+
return this.service.call({
|
|
101
|
+
method: "PATCH",
|
|
102
|
+
path: `/v1beta1/${p0}`,
|
|
103
|
+
body: request.hostedZone,
|
|
104
|
+
query: query(request, ["hostedZone.name", "hostedZone"]),
|
|
105
|
+
idempotent: true,
|
|
106
|
+
}, options);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Deletes a hosted zone. Refused with `CONFLICT` while it holds record
|
|
110
|
+
* sets or, for a private zone, VPC attachments: delete them first.
|
|
111
|
+
*/
|
|
112
|
+
async deleteHostedZone(request, options) {
|
|
113
|
+
if (!request.requestId)
|
|
114
|
+
request = { ...request, requestId: newRequestId() };
|
|
115
|
+
const p0 = pathValue("name", request.name, "projects/*/hostedZones/*");
|
|
116
|
+
return this.service.call({
|
|
117
|
+
method: "DELETE",
|
|
118
|
+
path: `/v1beta1/${p0}`,
|
|
119
|
+
query: query(request, ["name"]),
|
|
120
|
+
idempotent: true,
|
|
121
|
+
}, options);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Checks a public zone's challenge now, instead of waiting for the
|
|
125
|
+
* platform's next check, and returns the zone as it is then, with the
|
|
126
|
+
* check's outcome in `challenge.lastCheck`. A pending zone whose token
|
|
127
|
+
* answers becomes `ACTIVE`, and so does a suspended one while its name is
|
|
128
|
+
* free; otherwise the zone stays as it was. A call within 30 seconds of
|
|
129
|
+
* the zone's last check answers with that check's outcome and asks the
|
|
130
|
+
* name's DNS nothing. Refused with `NOT_FOUND` once a pending zone's
|
|
131
|
+
* window has ended, which deleted it, and with `SERVICE_UNAVAILABLE`,
|
|
132
|
+
* retryable, when the name's DNS didn't answer in time or too many checks
|
|
133
|
+
* are under way. A private zone has no challenge, and is refused with
|
|
134
|
+
* `BAD_REQUEST`. Checking an active zone changes nothing, so a client may
|
|
135
|
+
* repeat the call.
|
|
136
|
+
*/
|
|
137
|
+
async verifyHostedZone(request, options) {
|
|
138
|
+
const p0 = pathValue("name", request.name, "projects/*/hostedZones/*");
|
|
139
|
+
return this.service.call({
|
|
140
|
+
method: "POST",
|
|
141
|
+
path: `/v1beta1/${p0}:verify`,
|
|
142
|
+
body: request,
|
|
143
|
+
}, options);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
/** Where a zone is answered. */
|
|
147
|
+
export const HostedZone_Visibility = {
|
|
148
|
+
/** Not set. */
|
|
149
|
+
VISIBILITY_UNSPECIFIED: "VISIBILITY_UNSPECIFIED",
|
|
150
|
+
/** On the internet, from the platform's name servers. */
|
|
151
|
+
PUBLIC: "PUBLIC",
|
|
152
|
+
/** Only inside the VPCs it is attached to. */
|
|
153
|
+
PRIVATE: "PRIVATE",
|
|
154
|
+
};
|
|
155
|
+
/** Whether a zone is answered. */
|
|
156
|
+
export const HostedZone_State = {
|
|
157
|
+
/** Not set. */
|
|
158
|
+
STATE_UNSPECIFIED: "STATE_UNSPECIFIED",
|
|
159
|
+
/**
|
|
160
|
+
* A public zone that hasn't proved control of its name yet: not
|
|
161
|
+
* answered, and holding no name.
|
|
162
|
+
*/
|
|
163
|
+
PENDING_VERIFICATION: "PENDING_VERIFICATION",
|
|
164
|
+
/** Answered. A public zone in this state holds its name. */
|
|
165
|
+
ACTIVE: "ACTIVE",
|
|
166
|
+
/**
|
|
167
|
+
* A public zone that lost control of its name: not answered, its
|
|
168
|
+
* record sets kept, its name free for another zone.
|
|
169
|
+
*/
|
|
170
|
+
SUSPENDED: "SUSPENDED",
|
|
171
|
+
};
|
|
172
|
+
/** Why a zone was suspended. */
|
|
173
|
+
export const OwnershipChallenge_SuspensionReason = {
|
|
174
|
+
/** Not set. */
|
|
175
|
+
SUSPENSION_REASON_UNSPECIFIED: "SUSPENSION_REASON_UNSPECIFIED",
|
|
176
|
+
/**
|
|
177
|
+
* Several daily checks in a row found the name delegated to other name
|
|
178
|
+
* servers, without the zone's token.
|
|
179
|
+
*/
|
|
180
|
+
CHALLENGE_LOST: "CHALLENGE_LOST",
|
|
181
|
+
};
|
|
182
|
+
/** What a check of the challenge found. */
|
|
183
|
+
export const OwnershipChallenge_CheckOutcome = {
|
|
184
|
+
/** Not set. */
|
|
185
|
+
CHECK_OUTCOME_UNSPECIFIED: "CHECK_OUTCOME_UNSPECIFIED",
|
|
186
|
+
/** The token answers, and the zone holds its name: it is `ACTIVE`. */
|
|
187
|
+
OK: "OK",
|
|
188
|
+
/**
|
|
189
|
+
* The token doesn't answer at the TXT record's name, or the name's DNS
|
|
190
|
+
* can't be asked.
|
|
191
|
+
*/
|
|
192
|
+
NOT_FOUND: "NOT_FOUND",
|
|
193
|
+
/** The token answers, but another zone holds the name. */
|
|
194
|
+
NAME_HELD: "NAME_HELD",
|
|
195
|
+
};
|
|
196
|
+
//# sourceMappingURL=hosted_zone.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosted_zone.js","sourceRoot":"","sources":["../../src/v1beta1/hosted_zone.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,oDAAoD;AAEpD,OAAO,EAKL,YAAY,EACZ,SAAS,EACT,KAAK,GACN,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,OAAO,gBAAgB;IAC3B;;;OAGG;IACM,OAAO,CAAU;IAE1B,2EAA2E;IAC3E,YAAY,MAAc;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC9C,CAAC;IAED,6BAA6B;IAC7B,KAAK,CAAC,aAAa,CAAC,OAA6B,EAAE,OAAqB;QACtE,MAAM,EAAE,GAAG,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,0BAA0B,CAAC,CAAC;QACvE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE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AAW;IACtB,0DAA0D;IAC1D,SAAS,EAAE,WAAW;CACd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/v1beta1/index.ts"],"names":[],"mappings":"AAEA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1beta1/index.ts"],"names":[],"mappings":"AAAA,mEAAmE;AAEnE,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import { type CallOptions, type Client, type Empty, type Service } from "@origincloud/core";
|
|
2
|
+
/**
|
|
3
|
+
* Calls RecordSetService.
|
|
4
|
+
*
|
|
5
|
+
* Record sets: every record of one name and type in a hosted zone. A zone
|
|
6
|
+
* holds one record set per name and type, whatever its kind. A CNAME is
|
|
7
|
+
* alone at its name and never at the zone's apex. The apex's SOA and NS
|
|
8
|
+
* records are the platform's, written from the zone's name servers; they
|
|
9
|
+
* aren't record sets, and no NS record delegates a name below the apex.
|
|
10
|
+
*
|
|
11
|
+
* A change is recorded when its method answers, and answered wherever the
|
|
12
|
+
* zone is served. `BatchChangeRecordSets` makes several changes at once,
|
|
13
|
+
* all or none.
|
|
14
|
+
*/
|
|
15
|
+
export declare class RecordSetClient {
|
|
16
|
+
/**
|
|
17
|
+
* The endpoint the client sends its calls to, which also serves the
|
|
18
|
+
* operations its methods answer with.
|
|
19
|
+
*/
|
|
20
|
+
readonly service: Service;
|
|
21
|
+
/** A client of RecordSetService that sends its calls through `client`. */
|
|
22
|
+
constructor(client: Client);
|
|
23
|
+
/** Returns a record set. */
|
|
24
|
+
getRecordSet(request: GetRecordSetRequest, options?: CallOptions): Promise<RecordSet>;
|
|
25
|
+
/** Lists a zone's record sets by `dnsName`, then by `type`. */
|
|
26
|
+
listRecordSets(request: ListRecordSetsRequest, options?: CallOptions): Promise<ListRecordSetsResponse>;
|
|
27
|
+
/**
|
|
28
|
+
* Iterates over everything listRecordSets lists from the request's page on,
|
|
29
|
+
* fetching the next page as the loop reaches it. A page that fails ends
|
|
30
|
+
* the iteration with its error.
|
|
31
|
+
*/
|
|
32
|
+
allRecordSets(request: ListRecordSetsRequest, options?: CallOptions): AsyncGenerator<RecordSet, void, undefined>;
|
|
33
|
+
/**
|
|
34
|
+
* Creates a record set. Refused with `CONFLICT` when the zone holds a
|
|
35
|
+
* record set of that name and type, or when a CNAME would share its name.
|
|
36
|
+
* Refused with `BAD_REQUEST` for a name outside the zone, a value its
|
|
37
|
+
* type doesn't take, an alias to a Floating IP outside the zone's
|
|
38
|
+
* project, or once the project's or organization's quota of record sets
|
|
39
|
+
* is used up. An alias to a Floating IP that was created moments ago may
|
|
40
|
+
* be refused with `SERVICE_UNAVAILABLE`, retryable.
|
|
41
|
+
*/
|
|
42
|
+
createRecordSet(request: CreateRecordSetRequest, options?: CallOptions): Promise<RecordSet>;
|
|
43
|
+
/**
|
|
44
|
+
* Replaces a record set's TTL or what it answers with: `ttl`, `basic` or
|
|
45
|
+
* `alias`, or `*`. Naming one kind in `updateMask` replaces the kind the
|
|
46
|
+
* record set had. With `*`, a TTL left out keeps the record set's; naming
|
|
47
|
+
* `ttl` without one sets the default, 300 seconds. Its name and type
|
|
48
|
+
* stay; another type is a new record set.
|
|
49
|
+
*/
|
|
50
|
+
updateRecordSet(request: UpdateRecordSetRequest, options?: CallOptions): Promise<RecordSet>;
|
|
51
|
+
/** Deletes a record set. */
|
|
52
|
+
deleteRecordSet(request: DeleteRecordSetRequest, options?: CallOptions): Promise<Empty>;
|
|
53
|
+
/**
|
|
54
|
+
* Deletes, replaces and creates record sets of one zone together, all or
|
|
55
|
+
* none. The zone is checked as the changes leave it, not after each
|
|
56
|
+
* change, so a CNAME may take the place of the A record set it replaces
|
|
57
|
+
* in one call. A batch makes 1 to 1000 changes, and names a record set
|
|
58
|
+
* once at most across `deletions` and `updates`. Each change is refused
|
|
59
|
+
* as its own method would refuse it, naming the change; then none is
|
|
60
|
+
* made.
|
|
61
|
+
*/
|
|
62
|
+
batchChangeRecordSets(request: BatchChangeRecordSetsRequest, options?: CallOptions): Promise<BatchChangeRecordSetsResponse>;
|
|
63
|
+
}
|
|
64
|
+
/** Every record of one name and type in a hosted zone. */
|
|
65
|
+
export interface RecordSet {
|
|
66
|
+
/** The record set's resource name. */
|
|
67
|
+
name?: string;
|
|
68
|
+
/**
|
|
69
|
+
* The record set's URN, the identifier access policies and the audit log
|
|
70
|
+
* use.
|
|
71
|
+
*/
|
|
72
|
+
urn?: string;
|
|
73
|
+
/**
|
|
74
|
+
* The name the records answer for: the zone's `dnsName` or a name below
|
|
75
|
+
* it, written in full, such as `www.example.com`, without the final dot;
|
|
76
|
+
* answered in lowercase. Labels may hold `_` (`_dmarc.example.com`), and
|
|
77
|
+
* `*` only as the whole leftmost label, for a wildcard.
|
|
78
|
+
*/
|
|
79
|
+
dnsName?: string;
|
|
80
|
+
/** The records' type. An alias is `A`. */
|
|
81
|
+
type?: RecordSet_Type;
|
|
82
|
+
/**
|
|
83
|
+
* How long resolvers may keep the answer, from 30 seconds to 7 days, in
|
|
84
|
+
* whole seconds. 300 seconds when left out.
|
|
85
|
+
*/
|
|
86
|
+
ttl?: string;
|
|
87
|
+
/** Values of its own. */
|
|
88
|
+
basic?: BasicRecordData;
|
|
89
|
+
/** The address of a platform resource, followed as it changes. */
|
|
90
|
+
alias?: AliasRecordData;
|
|
91
|
+
/** When the record set was created. */
|
|
92
|
+
createTime?: string;
|
|
93
|
+
/** When the record set was last changed. */
|
|
94
|
+
updateTime?: string;
|
|
95
|
+
}
|
|
96
|
+
/** A record type. */
|
|
97
|
+
export declare const RecordSet_Type: {
|
|
98
|
+
/** Not set. */
|
|
99
|
+
readonly TYPE_UNSPECIFIED: "TYPE_UNSPECIFIED";
|
|
100
|
+
/** IPv4 addresses. */
|
|
101
|
+
readonly A: "A";
|
|
102
|
+
/** IPv6 addresses. */
|
|
103
|
+
readonly AAAA: "AAAA";
|
|
104
|
+
/** Another name this one is an alias of. */
|
|
105
|
+
readonly CNAME: "CNAME";
|
|
106
|
+
/** Text. */
|
|
107
|
+
readonly TXT: "TXT";
|
|
108
|
+
/** Mail exchangers. */
|
|
109
|
+
readonly MX: "MX";
|
|
110
|
+
/** Service locations. */
|
|
111
|
+
readonly SRV: "SRV";
|
|
112
|
+
/** The certificate authorities that may issue for the name. */
|
|
113
|
+
readonly CAA: "CAA";
|
|
114
|
+
};
|
|
115
|
+
/** A record type. */
|
|
116
|
+
export type RecordSet_Type = (typeof RecordSet_Type)[keyof typeof RecordSet_Type];
|
|
117
|
+
/** A record set's own values. */
|
|
118
|
+
export interface BasicRecordData {
|
|
119
|
+
/**
|
|
120
|
+
* The records' values, 1 to 100, each once, written as `type` says. Names
|
|
121
|
+
* are written in full without the final dot, and answered in lowercase.
|
|
122
|
+
* - `A`: an IPv4 address, `192.0.2.10`.
|
|
123
|
+
* - `AAAA`: an IPv6 address, `2001:db8::10`.
|
|
124
|
+
* - `CNAME`: one name, `www.example.net`.
|
|
125
|
+
* - `TXT`: the text as it is, printable ASCII, up to 4000 characters,
|
|
126
|
+
* without quotes; it is split into strings of 255 characters on the
|
|
127
|
+
* wire.
|
|
128
|
+
* - `MX`: `{preference} {exchange}`, `10 mail.example.com`. `0 .`, alone,
|
|
129
|
+
* says the name takes no mail.
|
|
130
|
+
* - `SRV`: `{priority} {weight} {port} {target}`,
|
|
131
|
+
* `10 5 5060 sip.example.com`. A target of `.`, alone, says the service
|
|
132
|
+
* isn't offered.
|
|
133
|
+
* - `CAA`: `{flags} {tag} {value}`, `0 issue letsencrypt.org`: flags 0 or
|
|
134
|
+
* 128, the value as it is, without quotes.
|
|
135
|
+
*
|
|
136
|
+
* A record set's records take at most 16 KiB on the wire.
|
|
137
|
+
*/
|
|
138
|
+
values?: string[];
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* An alias: the record set answers with a platform resource's address, and
|
|
142
|
+
* follows it as it changes.
|
|
143
|
+
*/
|
|
144
|
+
export interface AliasRecordData {
|
|
145
|
+
/**
|
|
146
|
+
* The Floating IP whose address the record set answers with, in the
|
|
147
|
+
* zone's project. A Floating IP's address is an IPv4 address, so the
|
|
148
|
+
* record set is of type `A`; an `AAAA` alias is refused.
|
|
149
|
+
*/
|
|
150
|
+
floatingIp?: string;
|
|
151
|
+
}
|
|
152
|
+
/** The request for GetRecordSet. */
|
|
153
|
+
export interface GetRecordSetRequest {
|
|
154
|
+
/** The record set to return. */
|
|
155
|
+
name?: string;
|
|
156
|
+
}
|
|
157
|
+
/** The request for ListRecordSets. */
|
|
158
|
+
export interface ListRecordSetsRequest {
|
|
159
|
+
/**
|
|
160
|
+
* The zone whose record sets to list,
|
|
161
|
+
* `projects/{project}/hostedZones/{hosted_zone}`.
|
|
162
|
+
*/
|
|
163
|
+
parent?: string;
|
|
164
|
+
/**
|
|
165
|
+
* The most record sets to return; the server clamps it, and 0 means its
|
|
166
|
+
* default.
|
|
167
|
+
*/
|
|
168
|
+
pageSize?: number;
|
|
169
|
+
/** A previous response's `nextPageToken`, for the page after it. */
|
|
170
|
+
pageToken?: string;
|
|
171
|
+
/**
|
|
172
|
+
* Only the record sets of this name, written as `dnsName` is; every
|
|
173
|
+
* name's when left empty.
|
|
174
|
+
*/
|
|
175
|
+
dnsName?: string;
|
|
176
|
+
/** Only the record sets of this type; every type's when left unset. */
|
|
177
|
+
type?: RecordSet_Type;
|
|
178
|
+
}
|
|
179
|
+
/** The response for ListRecordSets. */
|
|
180
|
+
export interface ListRecordSetsResponse {
|
|
181
|
+
/** The record sets on this page. */
|
|
182
|
+
recordSets?: RecordSet[];
|
|
183
|
+
/** The token for the next page; empty on the last one. */
|
|
184
|
+
nextPageToken?: string;
|
|
185
|
+
}
|
|
186
|
+
/** The request for CreateRecordSet. */
|
|
187
|
+
export interface CreateRecordSetRequest {
|
|
188
|
+
/**
|
|
189
|
+
* The zone to create the record set in,
|
|
190
|
+
* `projects/{project}/hostedZones/{hosted_zone}`.
|
|
191
|
+
*/
|
|
192
|
+
parent?: string;
|
|
193
|
+
/**
|
|
194
|
+
* The record set to create: its `dnsName`, `type`, optionally its
|
|
195
|
+
* `ttl`, and one of `basic` and `alias`.
|
|
196
|
+
*/
|
|
197
|
+
recordSet?: RecordSet;
|
|
198
|
+
/**
|
|
199
|
+
* A UUID; a repeat with the same id within a day returns the record set
|
|
200
|
+
* the first request created, as it is now, instead of being refused as a
|
|
201
|
+
* conflict.
|
|
202
|
+
*/
|
|
203
|
+
requestId?: string;
|
|
204
|
+
}
|
|
205
|
+
/** The request for UpdateRecordSet. */
|
|
206
|
+
export interface UpdateRecordSetRequest {
|
|
207
|
+
/** The record set, by its name, with the fields to change. */
|
|
208
|
+
recordSet?: RecordSet;
|
|
209
|
+
/** The fields to change: `ttl`, `basic`, `alias`, or `*`. */
|
|
210
|
+
updateMask?: string;
|
|
211
|
+
/**
|
|
212
|
+
* A UUID; a repeat with the same id within a day returns the record set
|
|
213
|
+
* as the first request left it, instead of changing it again.
|
|
214
|
+
*/
|
|
215
|
+
requestId?: string;
|
|
216
|
+
}
|
|
217
|
+
/** The request for DeleteRecordSet. */
|
|
218
|
+
export interface DeleteRecordSetRequest {
|
|
219
|
+
/** The record set to delete. */
|
|
220
|
+
name?: string;
|
|
221
|
+
/**
|
|
222
|
+
* A UUID; a repeat with the same id within a day succeeds as the first
|
|
223
|
+
* did, instead of answering `NOT_FOUND`.
|
|
224
|
+
*/
|
|
225
|
+
requestId?: string;
|
|
226
|
+
}
|
|
227
|
+
/** The request for BatchChangeRecordSets. */
|
|
228
|
+
export interface BatchChangeRecordSetsRequest {
|
|
229
|
+
/**
|
|
230
|
+
* The zone whose record sets to change,
|
|
231
|
+
* `projects/{project}/hostedZones/{hosted_zone}`.
|
|
232
|
+
*/
|
|
233
|
+
parent?: string;
|
|
234
|
+
/** The record sets to delete, by name. */
|
|
235
|
+
deletions?: string[];
|
|
236
|
+
/**
|
|
237
|
+
* The record sets to change, each with the fields to change, as
|
|
238
|
+
* `UpdateRecordSet` takes them.
|
|
239
|
+
*/
|
|
240
|
+
updates?: RecordSetUpdate[];
|
|
241
|
+
/** The record sets to create, as `CreateRecordSet` takes them. */
|
|
242
|
+
creations?: RecordSet[];
|
|
243
|
+
/**
|
|
244
|
+
* A UUID; a repeat with the same id within a day answers with the record
|
|
245
|
+
* sets the first request changed and created, as they are now, instead of
|
|
246
|
+
* making the changes again.
|
|
247
|
+
*/
|
|
248
|
+
requestId?: string;
|
|
249
|
+
}
|
|
250
|
+
/** One change of a `BatchChangeRecordSets` request. */
|
|
251
|
+
export interface RecordSetUpdate {
|
|
252
|
+
/** The record set, by its name, with the fields to change. */
|
|
253
|
+
recordSet?: RecordSet;
|
|
254
|
+
/** The fields to change: `ttl`, `basic`, `alias`, or `*`. */
|
|
255
|
+
updateMask?: string;
|
|
256
|
+
}
|
|
257
|
+
/** The response for BatchChangeRecordSets. */
|
|
258
|
+
export interface BatchChangeRecordSetsResponse {
|
|
259
|
+
/**
|
|
260
|
+
* The record sets changed, then those created, each in the order of the
|
|
261
|
+
* request.
|
|
262
|
+
*/
|
|
263
|
+
recordSets?: RecordSet[];
|
|
264
|
+
}
|
|
265
|
+
//# sourceMappingURL=record_set.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record_set.d.ts","sourceRoot":"","sources":["../../src/v1beta1/record_set.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,KAAK,EACV,KAAK,OAAO,EAIb,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;;;;;GAYG;AACH,qBAAa,eAAe;IAC1B;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B,0EAA0E;gBAC9D,MAAM,EA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,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,uCAAuC;AACvC,MAAM,WAAW,sBAAsB;IACrC,8DAA8D;IAC9D,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,uCAAuC;AACvC,MAAM,WAAW,sBAAsB;IACrC,gCAAgC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,6CAA6C;AAC7C,MAAM,WAAW,4BAA4B;IAC3C;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB;;;OAGG;IACH,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,kEAAkE;IAClE,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC;IACxB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,uDAAuD;AACvD,MAAM,WAAW,eAAe;IAC9B,8DAA8D;IAC9D,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,8CAA8C;AAC9C,MAAM,WAAW,6BAA6B;IAC5C;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;CAC1B"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
// Code generated by the SDK's generator (generator/). DO NOT EDIT.
|
|
2
|
+
// source: origincloud/dns/v1beta1/record_set.proto
|
|
3
|
+
import { newRequestId, pathValue, query, } from "@origincloud/core";
|
|
4
|
+
/**
|
|
5
|
+
* Calls RecordSetService.
|
|
6
|
+
*
|
|
7
|
+
* Record sets: every record of one name and type in a hosted zone. A zone
|
|
8
|
+
* holds one record set per name and type, whatever its kind. A CNAME is
|
|
9
|
+
* alone at its name and never at the zone's apex. The apex's SOA and NS
|
|
10
|
+
* records are the platform's, written from the zone's name servers; they
|
|
11
|
+
* aren't record sets, and no NS record delegates a name below the apex.
|
|
12
|
+
*
|
|
13
|
+
* A change is recorded when its method answers, and answered wherever the
|
|
14
|
+
* zone is served. `BatchChangeRecordSets` makes several changes at once,
|
|
15
|
+
* all or none.
|
|
16
|
+
*/
|
|
17
|
+
export class RecordSetClient {
|
|
18
|
+
/**
|
|
19
|
+
* The endpoint the client sends its calls to, which also serves the
|
|
20
|
+
* operations its methods answer with.
|
|
21
|
+
*/
|
|
22
|
+
service;
|
|
23
|
+
/** A client of RecordSetService that sends its calls through `client`. */
|
|
24
|
+
constructor(client) {
|
|
25
|
+
this.service = client.service("dns", false);
|
|
26
|
+
}
|
|
27
|
+
/** Returns a record set. */
|
|
28
|
+
async getRecordSet(request, options) {
|
|
29
|
+
const p0 = pathValue("name", request.name, "projects/*/hostedZones/*/recordSets/*");
|
|
30
|
+
return this.service.call({
|
|
31
|
+
method: "GET",
|
|
32
|
+
path: `/v1beta1/${p0}`,
|
|
33
|
+
query: query(request, ["name"]),
|
|
34
|
+
idempotent: true,
|
|
35
|
+
}, options);
|
|
36
|
+
}
|
|
37
|
+
/** Lists a zone's record sets by `dnsName`, then by `type`. */
|
|
38
|
+
async listRecordSets(request, options) {
|
|
39
|
+
const p0 = pathValue("parent", request.parent, "projects/*/hostedZones/*");
|
|
40
|
+
return this.service.call({
|
|
41
|
+
method: "GET",
|
|
42
|
+
path: `/v1beta1/${p0}/recordSets`,
|
|
43
|
+
query: query(request, ["parent"]),
|
|
44
|
+
idempotent: true,
|
|
45
|
+
}, options);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Iterates over everything listRecordSets lists from the request's page on,
|
|
49
|
+
* fetching the next page as the loop reaches it. A page that fails ends
|
|
50
|
+
* the iteration with its error.
|
|
51
|
+
*/
|
|
52
|
+
async *allRecordSets(request, options) {
|
|
53
|
+
for (let page = request;;) {
|
|
54
|
+
const response = await this.listRecordSets(page, options);
|
|
55
|
+
yield* response.recordSets ?? [];
|
|
56
|
+
if (!response.nextPageToken)
|
|
57
|
+
return;
|
|
58
|
+
page = { ...page, pageToken: response.nextPageToken };
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Creates a record set. Refused with `CONFLICT` when the zone holds a
|
|
63
|
+
* record set of that name and type, or when a CNAME would share its name.
|
|
64
|
+
* Refused with `BAD_REQUEST` for a name outside the zone, a value its
|
|
65
|
+
* type doesn't take, an alias to a Floating IP outside the zone's
|
|
66
|
+
* project, or once the project's or organization's quota of record sets
|
|
67
|
+
* is used up. An alias to a Floating IP that was created moments ago may
|
|
68
|
+
* be refused with `SERVICE_UNAVAILABLE`, retryable.
|
|
69
|
+
*/
|
|
70
|
+
async createRecordSet(request, options) {
|
|
71
|
+
if (!request.requestId)
|
|
72
|
+
request = { ...request, requestId: newRequestId() };
|
|
73
|
+
const p0 = pathValue("parent", request.parent, "projects/*/hostedZones/*");
|
|
74
|
+
return this.service.call({
|
|
75
|
+
method: "POST",
|
|
76
|
+
path: `/v1beta1/${p0}/recordSets`,
|
|
77
|
+
body: request.recordSet,
|
|
78
|
+
query: query(request, ["parent", "recordSet"]),
|
|
79
|
+
idempotent: true,
|
|
80
|
+
}, options);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Replaces a record set's TTL or what it answers with: `ttl`, `basic` or
|
|
84
|
+
* `alias`, or `*`. Naming one kind in `updateMask` replaces the kind the
|
|
85
|
+
* record set had. With `*`, a TTL left out keeps the record set's; naming
|
|
86
|
+
* `ttl` without one sets the default, 300 seconds. Its name and type
|
|
87
|
+
* stay; another type is a new record set.
|
|
88
|
+
*/
|
|
89
|
+
async updateRecordSet(request, options) {
|
|
90
|
+
if (!request.requestId)
|
|
91
|
+
request = { ...request, requestId: newRequestId() };
|
|
92
|
+
const p0 = pathValue("recordSet.name", request.recordSet?.name, "projects/*/hostedZones/*/recordSets/*");
|
|
93
|
+
return this.service.call({
|
|
94
|
+
method: "PATCH",
|
|
95
|
+
path: `/v1beta1/${p0}`,
|
|
96
|
+
body: request.recordSet,
|
|
97
|
+
query: query(request, ["recordSet.name", "recordSet"]),
|
|
98
|
+
idempotent: true,
|
|
99
|
+
}, options);
|
|
100
|
+
}
|
|
101
|
+
/** Deletes a record set. */
|
|
102
|
+
async deleteRecordSet(request, options) {
|
|
103
|
+
if (!request.requestId)
|
|
104
|
+
request = { ...request, requestId: newRequestId() };
|
|
105
|
+
const p0 = pathValue("name", request.name, "projects/*/hostedZones/*/recordSets/*");
|
|
106
|
+
return this.service.call({
|
|
107
|
+
method: "DELETE",
|
|
108
|
+
path: `/v1beta1/${p0}`,
|
|
109
|
+
query: query(request, ["name"]),
|
|
110
|
+
idempotent: true,
|
|
111
|
+
}, options);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Deletes, replaces and creates record sets of one zone together, all or
|
|
115
|
+
* none. The zone is checked as the changes leave it, not after each
|
|
116
|
+
* change, so a CNAME may take the place of the A record set it replaces
|
|
117
|
+
* in one call. A batch makes 1 to 1000 changes, and names a record set
|
|
118
|
+
* once at most across `deletions` and `updates`. Each change is refused
|
|
119
|
+
* as its own method would refuse it, naming the change; then none is
|
|
120
|
+
* made.
|
|
121
|
+
*/
|
|
122
|
+
async batchChangeRecordSets(request, options) {
|
|
123
|
+
if (!request.requestId)
|
|
124
|
+
request = { ...request, requestId: newRequestId() };
|
|
125
|
+
const p0 = pathValue("parent", request.parent, "projects/*/hostedZones/*");
|
|
126
|
+
return this.service.call({
|
|
127
|
+
method: "POST",
|
|
128
|
+
path: `/v1beta1/${p0}/recordSets:batchChange`,
|
|
129
|
+
body: request,
|
|
130
|
+
idempotent: true,
|
|
131
|
+
}, options);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/** A record type. */
|
|
135
|
+
export const RecordSet_Type = {
|
|
136
|
+
/** Not set. */
|
|
137
|
+
TYPE_UNSPECIFIED: "TYPE_UNSPECIFIED",
|
|
138
|
+
/** IPv4 addresses. */
|
|
139
|
+
A: "A",
|
|
140
|
+
/** IPv6 addresses. */
|
|
141
|
+
AAAA: "AAAA",
|
|
142
|
+
/** Another name this one is an alias of. */
|
|
143
|
+
CNAME: "CNAME",
|
|
144
|
+
/** Text. */
|
|
145
|
+
TXT: "TXT",
|
|
146
|
+
/** Mail exchangers. */
|
|
147
|
+
MX: "MX",
|
|
148
|
+
/** Service locations. */
|
|
149
|
+
SRV: "SRV",
|
|
150
|
+
/** The certificate authorities that may issue for the name. */
|
|
151
|
+
CAA: "CAA",
|
|
152
|
+
};
|
|
153
|
+
//# sourceMappingURL=record_set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record_set.js","sourceRoot":"","sources":["../../src/v1beta1/record_set.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,mDAAmD;AAEnD,OAAO,EAKL,YAAY,EACZ,SAAS,EACT,KAAK,GACN,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,eAAe;IAC1B;;;OAGG;IACM,OAAO,CAAU;IAE1B,0EAA0E;IAC1E,YAAY,MAAc;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC9C,CAAC;IAED,4BAA4B;IAC5B,KAAK,CAAC,YAAY,CAAC,OAA4B,EAAE,OAAqB;QACpE,MAAM,EAAE,GAAG,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,uCAAuC,CAAC,CAAC;QACpF,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,YAA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