@origincloud/pvs 0.0.0-stage → 0.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/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md CHANGED
@@ -1,3 +1,31 @@
1
- # Temporary Holding Version
1
+ # @origincloud/pvs
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The client of Origin Cloud's persistent volume service (PVS): volumes,
4
+ snapshots and storage classes. Part of the
5
+ [Origin Cloud SDK for TypeScript](https://github.com/origincloudhq/sdk-typescript),
6
+ generated from the API definitions in
7
+ [origincloudhq/api](https://github.com/origincloudhq/api).
8
+
9
+ ```ts
10
+ import { Client } from "@origincloud/core";
11
+ import { VolumeClient } from "@origincloud/pvs/v1beta1";
12
+
13
+ const volumes = new VolumeClient(new Client());
14
+ const volume = await (
15
+ await volumes.createVolume({
16
+ parent: "projects/my-project-123/zones/eu-central1-az1",
17
+ volume: { sizeGib: 10 },
18
+ })
19
+ ).wait();
20
+ ```
21
+
22
+ | Import | API |
23
+ |---|---|
24
+ | `@origincloud/pvs/v1beta1` | Volumes, snapshots and storage classes |
25
+ | `@origincloud/pvs/longrunning/v1beta1` | PVS operations, for resuming one by name |
26
+
27
+ `v1beta1` is a preview version and may change in incompatible ways, like the
28
+ API itself. See the [repository's README](https://github.com/origincloudhq/sdk-typescript#readme)
29
+ for credentials and behaviour.
30
+
31
+ Apache License 2.0.
@@ -0,0 +1,2 @@
1
+ export * from "./operations.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/longrunning/v1beta1/index.ts"],"names":[],"mappings":"AAEA,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,3 @@
1
+ // Code generated by the SDK's generator (generator/). DO NOT EDIT.
2
+ export * from "./operations.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/longrunning/v1beta1/index.ts"],"names":[],"mappings":"AAAA,mEAAmE;AAEnE,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,63 @@
1
+ import { type CallOptions, type Client, type LongrunningOperation, type Service } from "@origincloud/core";
2
+ /**
3
+ * Calls OperationService.
4
+ *
5
+ * The long-running operations of a service: what its creates, updates and
6
+ * deletes answer with, until their resource settles. Every service serves
7
+ * this at its own host, for the operations its own methods return.
8
+ *
9
+ * An operation is done when its resource reaches the state its method
10
+ * promises, or failed when it can't get there; that outcome never changes
11
+ * afterwards, whatever later happens to the resource. It can be read for a
12
+ * day after it is done.
13
+ */
14
+ export declare class OperationClient {
15
+ /**
16
+ * The endpoint the client sends its calls to, which also serves the
17
+ * operations its methods answer with.
18
+ */
19
+ readonly service: Service;
20
+ /**
21
+ * A client of OperationService at the pvs host, which serves the
22
+ * operations the pvs methods answer with.
23
+ */
24
+ constructor(client: Client);
25
+ /** Returns an operation as it is now. */
26
+ getOperation(request: GetOperationRequest, options?: CallOptions): Promise<LongrunningOperation>;
27
+ /**
28
+ * Waits until an operation is done or `timeout` has passed, whichever
29
+ * comes first, and returns it as it is then. It only reads, so a client
30
+ * may repeat it after a transport error.
31
+ */
32
+ waitOperation(request: WaitOperationRequest, options?: CallOptions): Promise<LongrunningOperation>;
33
+ }
34
+ /** The request for GetOperation. */
35
+ export interface GetOperationRequest {
36
+ /**
37
+ * The operation to return, `projects/{project}/zones/{zone}/operations/{operation}`,
38
+ * exactly as a method returned it.
39
+ */
40
+ name?: string;
41
+ }
42
+ /** The request for WaitOperation. */
43
+ export interface WaitOperationRequest {
44
+ /** The operation to wait for, exactly as a method returned it. */
45
+ name?: string;
46
+ /** The longest to wait, at most a minute; a minute when not set. */
47
+ timeout?: string;
48
+ }
49
+ /** What an operation is about. */
50
+ export interface OperationMetadata {
51
+ /** The resource the operation acts on. */
52
+ target?: string;
53
+ /**
54
+ * What it does, as the method that started it names it: for example
55
+ * `create`, `update` or `delete`.
56
+ */
57
+ verb?: string;
58
+ /** When it was accepted. */
59
+ createTime?: string;
60
+ /** When it finished; empty while it hasn't. */
61
+ endTime?: string;
62
+ }
63
+ //# sourceMappingURL=operations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../src/longrunning/v1beta1/operations.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,oBAAoB,EACzB,KAAK,OAAO,EAGb,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;;;;GAWG;AACH,qBAAa,eAAe;IAC1B;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B;;;OAGG;gBACS,MAAM,EAAE,MAAM;IAI1B,yCAAyC;IACnC,YAAY,CAAC,OAAO,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAatG;;;;OAIG;IACG,aAAa,CAAC,OAAO,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAYzG;AAED,oCAAoC;AACpC,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,qCAAqC;AACrC,MAAM,WAAW,oBAAoB;IACnC,kEAAkE;IAClE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,kCAAkC;AAClC,MAAM,WAAW,iBAAiB;IAChC,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4BAA4B;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
@@ -0,0 +1,54 @@
1
+ // Code generated by the SDK's generator (generator/). DO NOT EDIT.
2
+ // source: origincloud/longrunning/v1beta1/operations.proto
3
+ import { pathValue, query, } from "@origincloud/core";
4
+ /**
5
+ * Calls OperationService.
6
+ *
7
+ * The long-running operations of a service: what its creates, updates and
8
+ * deletes answer with, until their resource settles. Every service serves
9
+ * this at its own host, for the operations its own methods return.
10
+ *
11
+ * An operation is done when its resource reaches the state its method
12
+ * promises, or failed when it can't get there; that outcome never changes
13
+ * afterwards, whatever later happens to the resource. It can be read for a
14
+ * day after it is done.
15
+ */
16
+ export class OperationClient {
17
+ /**
18
+ * The endpoint the client sends its calls to, which also serves the
19
+ * operations its methods answer with.
20
+ */
21
+ service;
22
+ /**
23
+ * A client of OperationService at the pvs host, which serves the
24
+ * operations the pvs methods answer with.
25
+ */
26
+ constructor(client) {
27
+ this.service = client.service("pvs", true);
28
+ }
29
+ /** Returns an operation as it is now. */
30
+ async getOperation(request, options) {
31
+ const p0 = pathValue("name", request.name, "projects/*/zones/*/operations/*");
32
+ return this.service.call({
33
+ method: "GET",
34
+ path: `/v1beta1/${p0}`,
35
+ query: query(request, ["name"]),
36
+ idempotent: true,
37
+ }, options);
38
+ }
39
+ /**
40
+ * Waits until an operation is done or `timeout` has passed, whichever
41
+ * comes first, and returns it as it is then. It only reads, so a client
42
+ * may repeat it after a transport error.
43
+ */
44
+ async waitOperation(request, options) {
45
+ const p0 = pathValue("name", request.name, "projects/*/zones/*/operations/*");
46
+ return this.service.call({
47
+ method: "POST",
48
+ path: `/v1beta1/${p0}:wait`,
49
+ body: request,
50
+ idempotent: true,
51
+ }, options);
52
+ }
53
+ }
54
+ //# sourceMappingURL=operations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../src/longrunning/v1beta1/operations.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,2DAA2D;AAE3D,OAAO,EAKL,SAAS,EACT,KAAK,GACN,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,eAAe;IAC1B;;;OAGG;IACM,OAAO,CAAU;IAE1B;;;OAGG;IACH,YAAY,MAAc;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED,yCAAyC;IACzC,KAAK,CAAC,YAAY,CAAC,OAA4B,EAAE,OAAqB;QACpE,MAAM,EAAE,GAAG,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,iCAAiC,CAAC,CAAC;QAC9E,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,YAAY,EAAE,EAAE;YACtB,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC;YAC/B,UAAU,EAAE,IAAI;SACjB,EACD,OAAO,CACR,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,aAAa,CAAC,OAA6B,EAAE,OAAqB;QACtE,MAAM,EAAE,GAAG,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,iCAAiC,CAAC,CAAC;QAC9E,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,YAAY,EAAE,OAAO;YAC3B,IAAI,EAAE,OAAO;YACb,UAAU,EAAE,IAAI;SACjB,EACD,OAAO,CACR,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,4 @@
1
+ export * from "./snapshot.js";
2
+ export * from "./storage_class.js";
3
+ export * from "./volume.js";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/v1beta1/index.ts"],"names":[],"mappings":"AAEA,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC"}
@@ -0,0 +1,5 @@
1
+ // Code generated by the SDK's generator (generator/). DO NOT EDIT.
2
+ export * from "./snapshot.js";
3
+ export * from "./storage_class.js";
4
+ export * from "./volume.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1beta1/index.ts"],"names":[],"mappings":"AAAA,mEAAmE;AAEnE,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC"}
@@ -0,0 +1,222 @@
1
+ import { type CallOptions, type Client, type Empty, Operation, type Service } from "@origincloud/core";
2
+ import type { OperationMetadata } from "../longrunning/v1beta1/operations.js";
3
+ /**
4
+ * Calls SnapshotService.
5
+ *
6
+ * Snapshots: point-in-time copies of a volume, in the volume's zone. A
7
+ * protected, completed snapshot is the source of new volumes and images.
8
+ */
9
+ export declare class SnapshotClient {
10
+ /**
11
+ * The endpoint the client sends its calls to, which also serves the
12
+ * operations its methods answer with.
13
+ */
14
+ readonly service: Service;
15
+ /** A client of SnapshotService that sends its calls through `client`. */
16
+ constructor(client: Client);
17
+ /** Returns a snapshot. */
18
+ getSnapshot(request: GetSnapshotRequest, options?: CallOptions): Promise<Snapshot>;
19
+ /**
20
+ * Lists the snapshots in a zone, oldest first. Deleted snapshots aren't
21
+ * listed. For every zone's snapshots, list the zones whose `services` name
22
+ * `pvs` with the location service (`location.origincloudapis.eu`), then
23
+ * each zone's snapshots.
24
+ */
25
+ listSnapshots(request: ListSnapshotsRequest, options?: CallOptions): Promise<ListSnapshotsResponse>;
26
+ /**
27
+ * Iterates over everything listSnapshots lists from the request's page on,
28
+ * fetching the next page as the loop reaches it. A page that fails ends
29
+ * the iteration with its error.
30
+ */
31
+ allSnapshots(request: ListSnapshotsRequest, options?: CallOptions): AsyncGenerator<Snapshot, void, undefined>;
32
+ /**
33
+ * Takes a snapshot of a volume. The operation is done once the copy is
34
+ * `COMPLETED`, or failed once it is `ERROR`.
35
+ *
36
+ * It answers with an operation to wait on, whose result is the Snapshot.
37
+ */
38
+ createSnapshot(request: CreateSnapshotRequest, options?: CallOptions): Promise<Operation<Snapshot, OperationMetadata>>;
39
+ /** Changes a snapshot's tags. */
40
+ updateSnapshot(request: UpdateSnapshotRequest, options?: CallOptions): Promise<Snapshot>;
41
+ /**
42
+ * Deletes a snapshot. It must be `COMPLETED` or `ERROR`, and unprotected.
43
+ * The operation is done once the snapshot is `DELETED`.
44
+ *
45
+ * It answers with an operation to wait on, which has no result.
46
+ */
47
+ deleteSnapshot(request: DeleteSnapshotRequest, options?: CallOptions): Promise<Operation<Empty, OperationMetadata>>;
48
+ /**
49
+ * Protects a snapshot, so it can be the source of volumes and images and
50
+ * can't be deleted. The operation is done once it is `PROTECTED`.
51
+ *
52
+ * It answers with an operation to wait on, whose result is the Snapshot.
53
+ */
54
+ protectSnapshot(request: ProtectSnapshotRequest, options?: CallOptions): Promise<Operation<Snapshot, OperationMetadata>>;
55
+ /**
56
+ * Unprotects a snapshot, so it can be deleted. Refused with
57
+ * `FAILED_PRECONDITION` while an image is built from it or a volume not
58
+ * `DELETED` was created from it; delete those first. The operation is
59
+ * done once it is `UNPROTECTED`.
60
+ *
61
+ * It answers with an operation to wait on, whose result is the Snapshot.
62
+ */
63
+ unprotectSnapshot(request: UnprotectSnapshotRequest, options?: CallOptions): Promise<Operation<Snapshot, OperationMetadata>>;
64
+ }
65
+ /** A point-in-time copy of a volume. */
66
+ export interface Snapshot {
67
+ /** The snapshot's resource name. */
68
+ name?: string;
69
+ /**
70
+ * The snapshot's URN, the identifier access policies and the audit log
71
+ * use.
72
+ */
73
+ urn?: string;
74
+ /** The volume copied, in the same project and zone. */
75
+ sourceVolume?: string;
76
+ /**
77
+ * The source volume's size in GiB when it was copied: the least a volume
78
+ * created from the snapshot holds.
79
+ */
80
+ sourceSizeGib?: number;
81
+ /** Where the copy is. */
82
+ state?: Snapshot_State;
83
+ /** Why the snapshot is in `ERROR`; empty otherwise. */
84
+ stateReason?: string;
85
+ /** Whether it is protected. */
86
+ protectionState?: Snapshot_ProtectionState;
87
+ /**
88
+ * Why the last protection change failed, when `protectionState` is
89
+ * `PROTECTION_FAILED`.
90
+ */
91
+ protectionReason?: string;
92
+ /**
93
+ * The principal that took the snapshot, such as `user:<id>` or
94
+ * `service_account:<id>`.
95
+ */
96
+ creator?: string;
97
+ /**
98
+ * Labels of your own, at most 50. The `origin:name` tag is the name the
99
+ * console shows.
100
+ */
101
+ tags?: Record<string, string>;
102
+ }
103
+ /** Where the copy is. */
104
+ export declare const Snapshot_State: {
105
+ /** Not set. */
106
+ readonly STATE_UNSPECIFIED: "STATE_UNSPECIFIED";
107
+ /** Being copied. */
108
+ readonly PENDING: "PENDING";
109
+ /** Copied. */
110
+ readonly COMPLETED: "COMPLETED";
111
+ /** Being deleted. */
112
+ readonly DELETING: "DELETING";
113
+ /** Deleted. Readable by name for a day, never listed. */
114
+ readonly DELETED: "DELETED";
115
+ /**
116
+ * The copy or its removal failed; `stateReason` says which. There is
117
+ * no usable copy behind it: delete it.
118
+ */
119
+ readonly ERROR: "ERROR";
120
+ };
121
+ /** Where the copy is. */
122
+ export type Snapshot_State = (typeof Snapshot_State)[keyof typeof Snapshot_State];
123
+ /** Whether the snapshot is protected, independently of `state`. */
124
+ export declare const Snapshot_ProtectionState: {
125
+ /** Not set. */
126
+ readonly PROTECTION_STATE_UNSPECIFIED: "PROTECTION_STATE_UNSPECIFIED";
127
+ /** Not protected: it can be deleted, and is no source. */
128
+ readonly UNPROTECTED: "UNPROTECTED";
129
+ /** Becoming protected. */
130
+ readonly PROTECTING: "PROTECTING";
131
+ /** Protected: a source of volumes and images, and can't be deleted. */
132
+ readonly PROTECTED: "PROTECTED";
133
+ /** Becoming unprotected. */
134
+ readonly UNPROTECTING: "UNPROTECTING";
135
+ /**
136
+ * The last change couldn't be applied; `protectionReason` says why.
137
+ * Protect or unprotect it again.
138
+ */
139
+ readonly PROTECTION_FAILED: "PROTECTION_FAILED";
140
+ };
141
+ /** Whether the snapshot is protected, independently of `state`. */
142
+ export type Snapshot_ProtectionState = (typeof Snapshot_ProtectionState)[keyof typeof Snapshot_ProtectionState];
143
+ /** The request for GetSnapshot. */
144
+ export interface GetSnapshotRequest {
145
+ /** The snapshot to return. */
146
+ name?: string;
147
+ }
148
+ /** The request for ListSnapshots. */
149
+ export interface ListSnapshotsRequest {
150
+ /** The zone whose snapshots to list, `projects/{project}/zones/{zone}`. */
151
+ parent?: string;
152
+ /**
153
+ * The most snapshots to return; the server clamps it, and 0 means its
154
+ * default.
155
+ */
156
+ pageSize?: number;
157
+ /** A previous response's `nextPageToken`, for the page after it. */
158
+ pageToken?: string;
159
+ }
160
+ /** The response for ListSnapshots. */
161
+ export interface ListSnapshotsResponse {
162
+ /** The snapshots on this page. */
163
+ snapshots?: Snapshot[];
164
+ /** The token for the next page; empty on the last one. */
165
+ nextPageToken?: string;
166
+ }
167
+ /** The request for CreateSnapshot. */
168
+ export interface CreateSnapshotRequest {
169
+ /** The zone of the volume to copy, `projects/{project}/zones/{zone}`. */
170
+ parent?: string;
171
+ /** The snapshot to take: its source volume, and optionally its tags. */
172
+ snapshot?: Snapshot;
173
+ /**
174
+ * A UUID; a repeat with the same id returns the first request's
175
+ * operation instead of taking a second snapshot.
176
+ */
177
+ requestId?: string;
178
+ }
179
+ /** The request for UpdateSnapshot. */
180
+ export interface UpdateSnapshotRequest {
181
+ /** The snapshot, by its name, with the tags to set. */
182
+ snapshot?: Snapshot;
183
+ /**
184
+ * The fields to change: `tags`, the only field that changes. `*` is the
185
+ * same.
186
+ */
187
+ updateMask?: string;
188
+ }
189
+ /** The request for DeleteSnapshot. */
190
+ export interface DeleteSnapshotRequest {
191
+ /** The snapshot to delete. */
192
+ name?: string;
193
+ /**
194
+ * A UUID; a repeat with the same id returns the first request's
195
+ * operation.
196
+ */
197
+ requestId?: string;
198
+ }
199
+ /** The request for ProtectSnapshot. */
200
+ export interface ProtectSnapshotRequest {
201
+ /** The snapshot to protect; it must be `COMPLETED`. */
202
+ name?: string;
203
+ /**
204
+ * A UUID; a repeat with the same id returns the first request's
205
+ * operation.
206
+ */
207
+ requestId?: string;
208
+ }
209
+ /** The request for UnprotectSnapshot. */
210
+ export interface UnprotectSnapshotRequest {
211
+ /**
212
+ * The snapshot to unprotect; it must be `COMPLETED`, or `ERROR` so that
213
+ * it can then be deleted.
214
+ */
215
+ name?: string;
216
+ /**
217
+ * A UUID; a repeat with the same id returns the first request's
218
+ * operation.
219
+ */
220
+ requestId?: string;
221
+ }
222
+ //# sourceMappingURL=snapshot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../../src/v1beta1/snapshot.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,KAAK,EAEV,SAAS,EACT,KAAK,OAAO,EAIb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAE9E;;;;;GAKG;AACH,qBAAa,cAAc;IACzB;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B,yEAAyE;gBAC7D,MAAM,EAAE,MAAM;IAI1B,0BAA0B;IACpB,WAAW,CAAC,OAAO,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC;IAaxF;;;;;OAKG;IACG,aAAa,CAAC,OAAO,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAazG;;;;OAIG;IACI,YAAY,CAAC,OAAO,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,cAAc,CAAC,QAAQ,EAAE,IAAI,EAAE,SA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