Skip to content

Commit 0606e2a

Browse files
authored
docs(secret): update documentation (#105)
1 parent c843566 commit 0606e2a

File tree

4 files changed

+296
-256
lines changed

4 files changed

+296
-256
lines changed

scaleway-async/scaleway_async/secret/v1alpha1/api.py

Lines changed: 83 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@
3939

4040
class SecretV1Alpha1API(API):
4141
"""
42-
Secret API (beta).
42+
Secret Manager API documentation.
4343
4444
This API allows you to conveniently store, access and share sensitive data.
45-
Secret API (beta).
45+
Secret Manager API documentation.
4646
"""
4747

4848
async def create_secret(
@@ -55,12 +55,13 @@ async def create_secret(
5555
description: Optional[str] = None,
5656
) -> Secret:
5757
"""
58-
Create a Secret containing no versions.
58+
Create a secret.
59+
You must sepcify the `region` to create a secret.
5960
:param region: Region to target. If none is passed will use default region from the config.
60-
:param project_id: ID of the project containing the Secret.
61-
:param name: Name of the Secret.
62-
:param tags: List of tags associated to this Secret.
63-
:param description: Description of the Secret.
61+
:param project_id: ID of the Project containing the secret.
62+
:param name: Name of the secret.
63+
:param tags: List of the secret's tags.
64+
:param description: Description of the secret.
6465
:return: :class:`Secret <Secret>`
6566
6667
Usage:
@@ -98,9 +99,10 @@ async def get_secret(
9899
region: Optional[Region] = None,
99100
) -> Secret:
100101
"""
101-
Get metadata of a Secret.
102+
Get metadata using the secret's name.
103+
Retrieve the metadata of a secret specified by the `region` and the `secret_name` parameters.
102104
:param region: Region to target. If none is passed will use default region from the config.
103-
:param secret_id: ID of the Secret.
105+
:param secret_id: ID of the secret.
104106
:return: :class:`Secret <Secret>`
105107
106108
Usage:
@@ -129,9 +131,10 @@ async def get_secret_by_name(
129131
region: Optional[Region] = None,
130132
) -> Secret:
131133
"""
132-
Get metadata of a Secret by name.
134+
Get metadata using the secret's ID.
135+
Retrieve the metadata of a secret specified by the `region` and the `secret_id` parameters.
133136
:param region: Region to target. If none is passed will use default region from the config.
134-
:param secret_name: Name of the Secret.
137+
:param secret_name: Name of the secret.
135138
:return: :class:`Secret <Secret>`
136139
137140
Usage:
@@ -163,12 +166,13 @@ async def update_secret(
163166
description: Optional[str] = None,
164167
) -> Secret:
165168
"""
166-
Update metadata of a Secret.
169+
Update metadata of a secret.
170+
Edit a secret's metadata such as name, tag(s) and description. The secret to update is specified by the `secret_id` and `region` parameters.
167171
:param region: Region to target. If none is passed will use default region from the config.
168-
:param secret_id: ID of the Secret.
169-
:param name: New name of the Secret (optional).
170-
:param tags: New list of tags associated to this Secret (optional).
171-
:param description: Description of the Secret.
172+
:param secret_id: ID of the secret.
173+
:param name: Secret's updated name (optional).
174+
:param tags: Secret's updated list of tags (optional).
175+
:param description: Description of the secret.
172176
:return: :class:`Secret <Secret>`
173177
174178
Usage:
@@ -213,11 +217,12 @@ async def list_secrets(
213217
page_size: Optional[int] = None,
214218
) -> ListSecretsResponse:
215219
"""
216-
List Secrets.
220+
List secrets.
221+
Retrieve the list of secrets created within an Organization and/or Project. You must specify either the `organization_id` or the `project_id` and the `region`.
217222
:param region: Region to target. If none is passed will use default region from the config.
218-
:param organization_id: ID of an organization to filter on (optional).
219-
:param project_id: ID of a project to filter on (optional).
220-
:param name: Secret name to filter on (optional).
223+
:param organization_id: Filter by Organization ID (optional).
224+
:param project_id: Filter by Project ID (optional).
225+
:param name: Filter by secret name (optional).
221226
:param tags: List of tags to filter on (optional).
222227
:param order_by:
223228
:param page:
@@ -265,11 +270,12 @@ async def list_secrets_all(
265270
page_size: Optional[int] = None,
266271
) -> List[Secret]:
267272
"""
268-
List Secrets.
273+
List secrets.
274+
Retrieve the list of secrets created within an Organization and/or Project. You must specify either the `organization_id` or the `project_id` and the `region`.
269275
:param region: Region to target. If none is passed will use default region from the config.
270-
:param organization_id: ID of an organization to filter on (optional).
271-
:param project_id: ID of a project to filter on (optional).
272-
:param name: Secret name to filter on (optional).
276+
:param organization_id: Filter by Organization ID (optional).
277+
:param project_id: Filter by Project ID (optional).
278+
:param name: Filter by secret name (optional).
273279
:param tags: List of tags to filter on (optional).
274280
:param order_by:
275281
:param page:
@@ -305,9 +311,10 @@ async def delete_secret(
305311
region: Optional[Region] = None,
306312
) -> Optional[None]:
307313
"""
308-
Delete a Secret.
314+
Delete a secret.
315+
Delete a given secret specified by the `region` and `secret_id` parameters.
309316
:param region: Region to target. If none is passed will use default region from the config.
310-
:param secret_id: ID of the Secret.
317+
:param secret_id: ID of the secret.
311318
312319
Usage:
313320
::
@@ -337,11 +344,12 @@ async def create_secret_version(
337344
description: Optional[str] = None,
338345
) -> SecretVersion:
339346
"""
340-
Create a SecretVersion.
347+
Create a version.
348+
Create a version of a given secret specified by the `region` and `secret_id` parameters.
341349
:param region: Region to target. If none is passed will use default region from the config.
342-
:param secret_id: ID of the Secret.
343-
:param data: The base64-encoded secret payload of the SecretVersion.
344-
:param description: Description of the SecretVersion.
350+
:param secret_id: ID of the secret.
351+
:param data: The base64-encoded secret payload of the version.
352+
:param description: Description of the version.
345353
:return: :class:`SecretVersion <SecretVersion>`
346354
347355
Usage:
@@ -383,10 +391,11 @@ async def get_secret_version(
383391
region: Optional[Region] = None,
384392
) -> SecretVersion:
385393
"""
386-
Get metadata of a SecretVersion.
394+
Get metadata of a secret's version using the secret's ID.
395+
Retrieve the metadata of a secret's given version specified by the `region`, `secret_id` and `revision` parameters.
387396
:param region: Region to target. If none is passed will use default region from the config.
388-
:param secret_id: ID of the Secret.
389-
:param revision: Revision of the SecretVersion (may be a number or "latest").
397+
:param secret_id: ID of the secret.
398+
:param revision: Version number. The first version of the secret is numbered 1, and all subsequent revisions augment by 1. Value can be a number or "latest".
390399
:return: :class:`SecretVersion <SecretVersion>`
391400
392401
Usage:
@@ -420,10 +429,11 @@ async def get_secret_version_by_name(
420429
region: Optional[Region] = None,
421430
) -> SecretVersion:
422431
"""
423-
Get metadata of a SecretVersion by name.
432+
Get metadata of a secret's version using the secret's name.
433+
Retrieve the metadata of a secret's given version specified by the `region`, `secret_name` and `revision` parameters.
424434
:param region: Region to target. If none is passed will use default region from the config.
425-
:param secret_name: Name of the Secret.
426-
:param revision: Revision of the SecretVersion (may be a number or "latest").
435+
:param secret_name: Name of the secret.
436+
:param revision: Version number. The first version of the secret is numbered 1, and all subsequent revisions augment by 1. Value can be a number or "latest".
427437
:return: :class:`SecretVersion <SecretVersion>`
428438
429439
Usage:
@@ -458,11 +468,12 @@ async def update_secret_version(
458468
description: Optional[str] = None,
459469
) -> SecretVersion:
460470
"""
461-
Update metadata of a SecretVersion.
471+
Update metadata of a version.
472+
Edit the metadata of a secret's given version, specified by the `region`, `secret_id` and `revision` parameters.
462473
:param region: Region to target. If none is passed will use default region from the config.
463-
:param secret_id: ID of the Secret.
464-
:param revision: Revision of the SecretVersion (may be a number or "latest").
465-
:param description: Description of the SecretVersion.
474+
:param secret_id: ID of the secret.
475+
:param revision: Version number. The first version of the secret is numbered 1, and all subsequent revisions augment by 1. Value can be a number or "latest".
476+
:param description: Description of the version.
466477
:return: :class:`SecretVersion <SecretVersion>`
467478
468479
Usage:
@@ -507,9 +518,10 @@ async def list_secret_versions(
507518
status: Optional[List[SecretVersionStatus]] = None,
508519
) -> ListSecretVersionsResponse:
509520
"""
510-
List versions of a Secret, not returning any sensitive data.
521+
List versions of a secret using the secret's ID.
522+
Retrieve the list of a given secret's versions specified by the `secret_id` and `region` parameters.
511523
:param region: Region to target. If none is passed will use default region from the config.
512-
:param secret_id: ID of the Secret.
524+
:param secret_id: ID of the secret.
513525
:param page:
514526
:param page_size:
515527
:param status: Filter results by status.
@@ -549,9 +561,10 @@ async def list_secret_versions_all(
549561
status: Optional[List[SecretVersionStatus]] = None,
550562
) -> List[SecretVersion]:
551563
"""
552-
List versions of a Secret, not returning any sensitive data.
564+
List versions of a secret using the secret's ID.
565+
Retrieve the list of a given secret's versions specified by the `secret_id` and `region` parameters.
553566
:param region: Region to target. If none is passed will use default region from the config.
554-
:param secret_id: ID of the Secret.
567+
:param secret_id: ID of the secret.
555568
:param page:
556569
:param page_size:
557570
:param status: Filter results by status.
@@ -586,9 +599,10 @@ async def list_secret_versions_by_name(
586599
status: Optional[List[SecretVersionStatus]] = None,
587600
) -> ListSecretVersionsResponse:
588601
"""
589-
List versions of a Secret by name, not returning any sensitive data.
602+
List versions of a secret using the secret's name.
603+
Retrieve the list of a given secret's versions specified by the `secret_name` and `region` parameters.
590604
:param region: Region to target. If none is passed will use default region from the config.
591-
:param secret_name: Name of the Secret.
605+
:param secret_name: Name of the secret.
592606
:param page:
593607
:param page_size:
594608
:param status: Filter results by status.
@@ -628,9 +642,10 @@ async def list_secret_versions_by_name_all(
628642
status: Optional[List[SecretVersionStatus]] = None,
629643
) -> List[SecretVersion]:
630644
"""
631-
List versions of a Secret by name, not returning any sensitive data.
645+
List versions of a secret using the secret's name.
646+
Retrieve the list of a given secret's versions specified by the `secret_name` and `region` parameters.
632647
:param region: Region to target. If none is passed will use default region from the config.
633-
:param secret_name: Name of the Secret.
648+
:param secret_name: Name of the secret.
634649
:param page:
635650
:param page_size:
636651
:param status: Filter results by status.
@@ -663,10 +678,11 @@ async def destroy_secret_version(
663678
region: Optional[Region] = None,
664679
) -> SecretVersion:
665680
"""
666-
Destroy a SecretVersion, permanently destroying the sensitive data.
681+
Delete a version.
682+
Delete a secret's version and the sensitive data contained in it. Deleting a version is permanent and cannot be undone.
667683
:param region: Region to target. If none is passed will use default region from the config.
668-
:param secret_id: ID of the Secret.
669-
:param revision: Revision of the SecretVersion (may be a number or "latest").
684+
:param secret_id: ID of the secret.
685+
:param revision: Version number. The first version of the secret is numbered 1, and all subsequent revisions augment by 1. Value can be a number or "latest".
670686
:return: :class:`SecretVersion <SecretVersion>`
671687
672688
Usage:
@@ -700,10 +716,11 @@ async def enable_secret_version(
700716
region: Optional[Region] = None,
701717
) -> SecretVersion:
702718
"""
703-
Enable a SecretVersion.
719+
Enable a version.
720+
Make a specific version accessible. You must specify the `region`, `secret_id` and `revision` parameters.
704721
:param region: Region to target. If none is passed will use default region from the config.
705-
:param secret_id: ID of the Secret.
706-
:param revision: Revision of the SecretVersion (may be a number or "latest").
722+
:param secret_id: ID of the secret.
723+
:param revision: Version number. The first version of the secret is numbered 1, and all subsequent revisions augment by 1. Value can be a number or "latest".
707724
:return: :class:`SecretVersion <SecretVersion>`
708725
709726
Usage:
@@ -737,10 +754,11 @@ async def disable_secret_version(
737754
region: Optional[Region] = None,
738755
) -> SecretVersion:
739756
"""
740-
Disable a SecretVersion.
757+
Disable a version.
758+
Make a specific version inaccessible. You must specify the `region`, `secret_id` and `revision` parameters.
741759
:param region: Region to target. If none is passed will use default region from the config.
742-
:param secret_id: ID of the Secret.
743-
:param revision: Revision of the SecretVersion (may be a number or "latest").
760+
:param secret_id: ID of the secret.
761+
:param revision: Version number. The first version of the secret is numbered 1, and all subsequent revisions augment by 1. Value can be a number or "latest".
744762
:return: :class:`SecretVersion <SecretVersion>`
745763
746764
Usage:
@@ -774,10 +792,11 @@ async def access_secret_version(
774792
region: Optional[Region] = None,
775793
) -> AccessSecretVersionResponse:
776794
"""
777-
Access a SecretVersion, returning the sensitive data.
795+
Access a secret's version using the secret's ID.
796+
Access sensitive data in a secret's version specified by the `region`, `secret_id` and `revision` parameters.
778797
:param region: Region to target. If none is passed will use default region from the config.
779-
:param secret_id: ID of the Secret.
780-
:param revision: Revision of the SecretVersion (may be a number or "latest").
798+
:param secret_id: ID of the secret.
799+
:param revision: Version number. The first version of the secret is numbered 1, and all subsequent revisions augment by 1. Value can be a number or "latest".
781800
:return: :class:`AccessSecretVersionResponse <AccessSecretVersionResponse>`
782801
783802
Usage:
@@ -811,10 +830,11 @@ async def access_secret_version_by_name(
811830
region: Optional[Region] = None,
812831
) -> AccessSecretVersionResponse:
813832
"""
814-
Access a SecretVersion by name, returning the sensitive data.
833+
Access a secret's version using the secret's name.
834+
Access sensitive data in a secret's version specified by the `region`, `secret_name` and `revision` parameters.
815835
:param region: Region to target. If none is passed will use default region from the config.
816-
:param secret_name: Name of the Secret.
817-
:param revision: Revision of the SecretVersion (may be a number or "latest").
836+
:param secret_name: Name of the secret.
837+
:param revision: Version number. The first version of the secret is numbered 1, and all subsequent revisions augment by 1. Value can be a number or "latest".
818838
:return: :class:`AccessSecretVersionResponse <AccessSecretVersionResponse>`
819839
820840
Usage:

0 commit comments

Comments
 (0)