Sono disponibili altri esempi AWS SDK nel repository AWS Doc SDK
Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.
WorkDocs Esempi di utilizzo di Amazon AWS CLI
I seguenti esempi di codice mostrano come eseguire azioni e implementare scenari comuni utilizzando il AWS Command Line Interface con Amazon WorkDocs.
Le operazioni sono estratti di codice da programmi più grandi e devono essere eseguite nel contesto. Sebbene le operazioni mostrino come richiamare le singole funzioni del servizio, è possibile visualizzarle contestualizzate negli scenari correlati.
Ogni esempio include un collegamento al codice sorgente completo, dove puoi trovare istruzioni su come configurare ed eseguire il codice nel contesto.
Argomenti
Operazioni
Il seguente esempio di codice mostra come utilizzareabort-document-version-upload
.
- AWS CLI
-
Per interrompere il caricamento della versione di un documento
Questo esempio interrompe il caricamento di una versione del documento avviato in precedenza.
Comando:
aws workdocs abort-document-version-upload --document-id
feaba64d4efdf271c2521b60a2a44a8f057e84beaabbe22f01267313209835f2
--version-id1536773972914-ddb67663e782e7ce8455ebc962217cf9f9e47b5a9a702e5c84dcccd417da9313
Output:
None
-
Per i dettagli sull'API, consultate AbortDocumentVersionUpload AWS CLI
Command Reference.
-
Il seguente esempio di codice mostra come utilizzareactivate-user
.
- AWS CLI
-
Per attivare un utente
Questo esempio attiva un utente inattivo.
Comando:
aws workdocs activate-user --user-id
"S-1-1-11-1111111111-2222222222-3333333333-3333&d-926726012c"
Output:
{ "User": { "Id": "S-1-1-11-1111111111-2222222222-3333333333-3333&d-926726012c", "Username": "exampleUser", "EmailAddress": "exampleUser@site.awsapps.com", "GivenName": "Example", "Surname": "User", "OrganizationId": "d-926726012c", "RootFolderId": "75f67c183aa1217409ac87576a45c03a5df5e6d8c51c35c01669970538e86cd0", "RecycleBinFolderId": "642b7dd3e60b14204534f3df7b1959e01b5d170f8c2707f410e40a8149120a57", "Status": "ACTIVE", "Type": "MINIMALUSER", "CreatedTimestamp": 1521226107.747, "ModifiedTimestamp": 1525297406.462, "Storage": { "StorageUtilizedInBytes": 0, "StorageRule": { "StorageAllocatedInBytes": 0, "StorageType": "QUOTA" } } } }
-
Per i dettagli sull'API, consulta AWS CLI Command ActivateUser
Reference.
-
Il seguente esempio di codice mostra come utilizzareadd-resource-permissions
.
- AWS CLI
-
Per aggiungere autorizzazioni per una risorsa
Questo esempio aggiunge le autorizzazioni alla risorsa per i principali specificati.
Comando:
aws workdocs add-resource-permissions --resource-id
d90d93c1fe44bad0c8471e973ebaab339090401a95e777cffa58e977d2983b65
--principalsId=anonymous,Type=ANONYMOUS,Role=VIEWER
Output:
{ "ShareResults": [ { "PrincipalId": "anonymous", "Role": "VIEWER", "Status": "SUCCESS", "ShareId": "d90d93c1fe44bad0c8471e973ebaab339090401a95e777cffa58e977d2983b65", "StatusMessage": "" } ] }
-
Per i dettagli sull'API, vedere AddResourcePermissions
in AWS CLI Command Reference.
-
Il seguente esempio di codice mostra come utilizzarecreate-comment
.
- AWS CLI
-
Per aggiungere un nuovo commento
Questo esempio aggiunge un nuovo commento alla versione del documento specificata.
Comando:
aws workdocs create-comment --document-id
15df51e0335cfcc6a2e4de9dd8be9f22ee40545ad9176f54758dcf903be982d3
--version-id1521672507741-9f7df0ea5dd0b121c4f3564a0c7c0b4da95cd12c635d3c442af337a88e297920
--text"This is a comment."
Output:
{ "Comment": { "CommentId": "1534799058197-c7f5c84de9115875bbca93e0367bbebac609541d461636b760849b88b1609dd5", "ThreadId": "1534799058197-c7f5c84de9115875bbca93e0367bbebac609541d461636b760849b88b1609dd5", "Text": "This is a comment.", "Contributor": { "Id": "arn:aws:iam::123456789123:user/exampleUser", "Username": "exampleUser", "GivenName": "Example", "Surname": "User", "Status": "ACTIVE" }, "CreatedTimestamp": 1534799058.197, "Status": "PUBLISHED", "Visibility": "PUBLIC" } }
-
Per i dettagli sull'API, vedere CreateComment
in AWS CLI Command Reference.
-
Il seguente esempio di codice mostra come utilizzarecreate-custom-metadata
.
- AWS CLI
-
Per creare metadati personalizzati
Questo esempio crea metadati personalizzati per il documento specificato.
Comando:
aws workdocs create-custom-metadata --resource-id
d90d93c1fe44bad0c8471e973ebaab339090401a95e777cffa58e977d2983b65
--custom-metadataKeyName1=example,KeyName2=example2
Output:
None
-
Per i dettagli sull'API, consultate CreateCustomMetadata AWS CLI
Command Reference.
-
Il seguente esempio di codice mostra come utilizzarecreate-folder
.
- AWS CLI
-
Per creare una cartella
Questo esempio crea una cartella.
Comando:
aws workdocs create-folder --name
documents
--parent-folder-id1ece93e5fe75315c7407c4967918b4fd9da87ddb2a588e67b7fdaf4a98fde678
Output:
{ "Metadata": { "Id": "50893c0af679524d1a0e0651130ed6d073e1a05f95bd12c42dcde5d35634ed08", "Name": "documents", "CreatorId": "S-1-1-11-1111111111-2222222222-3333333333-3333&d-926726012c", "ParentFolderId": "1ece93e5fe75315c7407c4967918b4fd9da87ddb2a588e67b7fdaf4a98fde678", "CreatedTimestamp": 1534450467.622, "ModifiedTimestamp": 1534450467.622, "ResourceState": "ACTIVE", "Signature": "", "Size": 0, "LatestVersionSize": 0 } }
-
Per i dettagli sull'API, consulta CreateFolder AWS CLI
Command Reference.
-
Il seguente esempio di codice mostra come utilizzarecreate-labels
.
- AWS CLI
-
Per creare etichette
Questo esempio crea una serie di etichette per un documento.
Comando:
aws workdocs create-labels --resource-id
d90d93c1fe44bad0c8471e973ebaab339090401a95e777cffa58e977d2983b65
--labels"documents"
"examples"
"my_documents"
Output:
None
-
Per i dettagli sull'API, vedere CreateLabels
in AWS CLI Command Reference.
-
Il seguente esempio di codice mostra come utilizzarecreate-notification-subscription
.
- AWS CLI
-
Per creare una sottoscrizione alle notifiche
L'
create-notification-subscription
esempio seguente configura un abbonamento alle notifiche per l' WorkDocs organizzazione Amazon specificata.aws workdocs create-notification-subscription \ --organization-id
d-123456789c
\ --protocolHTTPS
\ --subscription-typeALL
\ --notification-endpoint"https://example.com/example"
Output:
{ "Subscription": { "SubscriptionId": "123ab4c5-678d-901e-f23g-45h6789j0123", "EndPoint": "https://example.com/example", "Protocol": "HTTPS" } }
Per ulteriori informazioni, consulta Abbonarsi alle notifiche nell'Amazon WorkDocs Developer Guide.
-
Per i dettagli sull'API, consulta CreateNotificationSubscription AWS CLI
Command Reference.
-
Il seguente esempio di codice mostra come utilizzarecreate-user
.
- AWS CLI
-
Per creare un nuovo utente
Questo esempio crea un nuovo utente in una directory Simple AD o Microsoft AD.
Comando:
aws workdocs create-user --organization-id
d-926726012c
--usernameexampleUser2
--email-addressexampleUser2@site.awsapps.com
--given-nameexample2Name
--surnameexample2Surname
--passwordexamplePa$$w0rd
Output:
{ "User": { "Id": "S-1-1-11-1111111111-2222222222-3333333333-3333&d-926726012c", "Username": "exampleUser2", "EmailAddress": "exampleUser2@site.awsapps.com", "GivenName": "example2Name", "Surname": "example2Surname", "OrganizationId": "d-926726012c", "RootFolderId": "35b886cb17198cbd547655e58b025dff0cf34aaed638be52009567e23dc67390", "RecycleBinFolderId": "9858c3e9ed4c2460dde9aadb4c69fde998070dd46e5e985bd08ec6169ea249ff", "Status": "ACTIVE", "Type": "MINIMALUSER", "CreatedTimestamp": 1535478836.584, "ModifiedTimestamp": 1535478836.584, "Storage": { "StorageUtilizedInBytes": 0, "StorageRule": { "StorageAllocatedInBytes": 0, "StorageType": "QUOTA" } } } }
-
Per i dettagli sull'API, vedere CreateUser
in AWS CLI Command Reference.
-
Il seguente esempio di codice mostra come utilizzaredeactivate-user
.
- AWS CLI
-
Per disattivare un utente
Questo esempio disattiva un utente attivo.
Comando:
aws workdocs deactivate-user --user-id
"S-1-1-11-1111111111-2222222222-3333333333-3333&d-926726012c"
Output:
None
-
Per i dettagli sull'API, consulta AWS CLI Command DeactivateUser
Reference.
-
Il seguente esempio di codice mostra come utilizzaredelete-comment
.
- AWS CLI
-
Per eliminare un commento specificato da una versione del documento
Questo esempio elimina il commento specificato dalla versione del documento specificata.
Comando:
aws workdocs delete-comment --document-id
15df51e0335cfcc6a2e4de9dd8be9f22ee40545ad9176f54758dcf903be982d3
--version-id1521672507741-9f7df0ea5dd0b121c4f3564a0c7c0b4da95cd12c635d3c442af337a88e297920
--comment-id1534799058197-c7f5c84de9115875bbca93e0367bbebac609541d461636b760849b88b1609dd5
Output:
None
-
Per i dettagli sull'API, vedere DeleteComment
in AWS CLI Command Reference.
-
Il seguente esempio di codice mostra come utilizzaredelete-custom-metadata
.
- AWS CLI
-
Per eliminare i metadati personalizzati da una risorsa
Questo esempio elimina tutti i metadati personalizzati dalla risorsa specificata.
Comando:
aws workdocs delete-custom-metadata --resource-id
d90d93c1fe44bad0c8471e973ebaab339090401a95e777cffa58e977d2983b65
--delete-allOutput:
None
-
Per i dettagli sull'API, consultate AWS CLI Command DeleteCustomMetadata
Reference.
-
Il seguente esempio di codice mostra come utilizzaredelete-document
.
- AWS CLI
-
Per eliminare un documento
Questo esempio elimina il documento specificato.
Comando:
aws workdocs delete-document --document-id
b83ed5e5b167b65ef69de9d597627ff1a0d4f07a45e67f1fab7d26b54427de0a
Output:
None
-
Per i dettagli sull'API, vedere DeleteDocument
in AWS CLI Command Reference.
-
Il seguente esempio di codice mostra come utilizzaredelete-folder-contents
.
- AWS CLI
-
Per eliminare il contenuto di una cartella
Questo esempio elimina il contenuto della cartella specificata.
Comando:
aws workdocs delete-folder-contents --folder-id
26fa8aa4ba2071447c194f7b150b07149dbdb9e1c8a301872dcd93a4735ce65d
Output:
None
-
Per i dettagli sull'API, vedere DeleteFolderContents
in AWS CLI Command Reference.
-
Il seguente esempio di codice mostra come utilizzaredelete-folder
.
- AWS CLI
-
Per eliminare una cartella
Questo esempio elimina la cartella specificata.
Comando:
aws workdocs delete-folder --folder-id
26fa8aa4ba2071447c194f7b150b07149dbdb9e1c8a301872dcd93a4735ce65d
Output:
None
-
Per i dettagli sull'API, vedere DeleteFolder
in AWS CLI Command Reference.
-
Il seguente esempio di codice mostra come utilizzaredelete-labels
.
- AWS CLI
-
Per eliminare le etichette
Questo esempio elimina le etichette specificate da un documento.
Comando:
aws workdocs delete-labels --resource-id
d90d93c1fe44bad0c8471e973ebaab339090401a95e777cffa58e977d2983b65
--labels"documents"
"examples"
Output:
None
-
Per i dettagli sull'API, vedere DeleteLabels
in AWS CLI Command Reference.
-
Il seguente esempio di codice mostra come utilizzaredelete-notification-subscription
.
- AWS CLI
-
Per eliminare una sottoscrizione alle notifiche
L'
delete-notification-subscription
esempio seguente elimina la sottoscrizione di notifica specificata.aws workdocs delete-notification-subscription \ --subscription-id
123ab4c5-678d-901e-f23g-45h6789j0123
\ --organization-idd-123456789c
Questo comando non produce alcun output.
Per ulteriori informazioni, consulta Abbonarsi alle notifiche nell'Amazon WorkDocs Developer Guide.
-
Per i dettagli sull'API, consulta DeleteNotificationSubscription AWS CLI
Command Reference.
-
Il seguente esempio di codice mostra come utilizzaredelete-user
.
- AWS CLI
-
Per eliminare un utente
Questo esempio elimina un utente.
Comando:
aws workdocs delete-user --user-id
"S-1-1-11-1111111111-2222222222-3333333333-3333&d-926726012c"
Output:
None
-
Per i dettagli sull'API, consulta DeleteUser AWS CLI
Command Reference.
-
Il seguente esempio di codice mostra come utilizzaredescribe-activities
.
- AWS CLI
-
Per ottenere un elenco delle attività degli utenti
Questo esempio restituisce un elenco delle attività utente più recenti per l'organizzazione specificata, con un limite impostato per le ultime due attività.
Comando:
aws workdocs describe-activities --organization-id
d-926726012c
--limit2
Output:
{ "UserActivities": [ { "Type": "DOCUMENT_VERSION_DOWNLOADED", "TimeStamp": 1534800122.17, "Initiator": { "Id": "arn:aws:iam::123456789123:user/exampleUser" }, "ResourceMetadata": { "Type": "document", "Name": "updatedDoc", "Id": "15df51e0335cfcc6a2e4de9dd8be9f22ee40545ad9176f54758dcf903be982d3", "Owner": { "Id": "S-1-1-11-1111111111-2222222222-3333333333-3333&d-926726012c", "GivenName": "exampleName", "Surname": "exampleSurname" } } }, { "Type": "DOCUMENT_VERSION_VIEWED", "TimeStamp": 1534799079.207, "Initiator": { "Id": "S-1-1-11-1111111111-2222222222-3333333333-3333&d-926726012c", "GivenName": "exampleName", "Surname": "exampleSurname" }, "ResourceMetadata": { "Type": "document", "Name": "updatedDoc", "Id": "15df51e0335cfcc6a2e4de9dd8be9f22ee40545ad9176f54758dcf903be982d3", "Owner": { "Id": "S-1-1-11-1111111111-2222222222-3333333333-3333&d-926726012c", "GivenName": "exampleName", "Surname": "exampleSurname" } } } ], "Marker": "DnF1ZXJ5VGhlbkZldGNoAgAAAAAAAAS7FmlTaU1OdlFTU1h1UU00VVFIbDlRWHcAAAAAAAAJTRY3bWh5eUgzaVF1ZXN2RUE5Wm8tTTdR" }
-
Per i dettagli sull'API, consulta DescribeActivities AWS CLI
Command Reference.
-
Il seguente esempio di codice mostra come utilizzaredescribe-comments
.
- AWS CLI
-
Per elencare tutti i commenti per una versione del documento specificata
Questo esempio elenca tutti i commenti per la versione del documento specificata.
Comando:
aws workdocs describe-comments --document-id
15df51e0335cfcc6a2e4de9dd8be9f22ee40545ad9176f54758dcf903be982d3
--version-id1521672507741-9f7df0ea5dd0b121c4f3564a0c7c0b4da95cd12c635d3c442af337a88e297920
Output:
{ "Comments": [ { "CommentId": "1534799058197-c7f5c84de9115875bbca93e0367bbebac609541d461636b760849b88b1609dd5", "ThreadId": "1534799058197-c7f5c84de9115875bbca93e0367bbebac609541d461636b760849b88b1609dd5", "Text": "This is a comment.", "Contributor": { "Username": "arn:aws:iam::123456789123:user/exampleUser", "Type": "USER" }, "CreatedTimestamp": 1534799058.197, "Status": "PUBLISHED", "Visibility": "PUBLIC" } ] }
-
Per i dettagli sull'API, vedere DescribeComments
in AWS CLI Command Reference.
-
Il seguente esempio di codice mostra come utilizzaredescribe-document-versions
.
- AWS CLI
-
Per recuperare le versioni di un documento
Questo esempio recupera le versioni del documento specificato, incluse le versioni inizializzate e un URL per il documento di origine.
Comando:
aws workdocs describe-document-versions --document-id
d90d93c1fe44bad0c8471e973ebaab339090401a95e777cffa58e977d2983b65
--fieldsSOURCE
Output:
{ "DocumentVersions": [ { "Id": "1534452029587-15e129dfc187505c407588df255be83de2920d733859f1d2762411d22a83e3ef", "Name": "exampleDoc.docx", "ContentType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "Size": 13922, "Signature": "1a23456b78901c23d4ef56gh7EXAMPLE", "Status": "ACTIVE", "CreatedTimestamp": 1534452029.587, "ModifiedTimestamp": 1534452029.849, "CreatorId": "S-1-1-11-1111111111-2222222222-3333333333-3333&d-926726012c", "Source": { "ORIGINAL": "https://gb-us-west-2-prod-doc-source.s3.us-west-2.amazonaws.com/d90d93c1fe44bad0c8471e973ebaab339090401a95e777cffa58e977d2983b65/1534452029587-15e129dfc187505c407588df255be83de2920d733859f1d2762411d22a83e3ef?response-content-disposition=attachment%3B%20filename%2A%3DUTF-8%27%27exampleDoc29.docx&X-Amz-Algorithm=AWS1-ABCD-EFG234&X-Amz-Date=20180816T204149Z&X-Amz-SignedHeaders=host&X-Amz-Expires=900&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20180816%2Fus-west-2%2Fs3%2Faws1_request&X-Amz-Signature=01Ab2c34d567e8f90123g456hi78j901k2345678l901234mno56pqr78EXAMPLE" } }, { "Id": "1529005196082-bb75fa19abc287699cb07147f75816dce43a53a10f28dc001bf61ef2fab01c59", "Name": "exampleDoc.pdf", "ContentType": "application/pdf", "Size": 425916, "Signature": "1a23456b78901c23d4ef56gh7EXAMPLE", "Status": "ACTIVE", "CreatedTimestamp": 1529005196.082, "ModifiedTimestamp": 1529005196.796, "CreatorId": "S-1-1-11-1111111111-2222222222-3333333333-3333&d-926726012c", "Source": { "ORIGINAL": "https://gb-us-west-2-prod-doc-source.s3.us-west-2.amazonaws.com/d90d93c1fe44bad0c8471e973ebaab339090401a95e777cffa58e977d2983b65/1529005196082-bb75fa19abc287699cb07147f75816dce43a53a10f28dc001bf61ef2fab01c59?response-content-disposition=attachment%3B%20filename%2A%3DUTF-8%27%27exampleDoc29.pdf&X-Amz-Algorithm=AWS1-ABCD-EFG234&X-Amz-Date=20180816T204149Z&X-Amz-SignedHeaders=host&X-Amz-Expires=900&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20180816%2Fus-west-2%2Fs3%2Faws1_request&X-Amz-Signature=01Ab2c34d567e8f90123g456hi78j901k2345678l901234mno56pqr78EXAMPLE" } } ] }
-
Per i dettagli sull'API, consultate AWS CLI Command DescribeDocumentVersions
Reference.
-
Il seguente esempio di codice mostra come utilizzaredescribe-folder-contents
.
- AWS CLI
-
Per descrivere il contenuto di una cartella
Questo esempio descrive tutti i contenuti attivi della cartella specificata, inclusi i documenti e le sottocartelle, ordinati per data in ordine crescente.
Comando:
aws workdocs describe-folder-contents --folder-id
1ece93e5fe75315c7407c4967918b4fd9da87ddb2a588e67b7fdaf4a98fde678
--sortDATE
--orderASCENDING
--typeALL
Output:
{ "Folders": [ { "Id": "50893c0af679524d1a0e0651130ed6d073e1a05f95bd12c42dcde5d35634ed08", "Name": "testing", "CreatorId": "S-1-1-11-1111111111-2222222222-3333333333-3333&d-926726012c", "ParentFolderId": "1ece93e5fe75315c7407c4967918b4fd9da87ddb2a588e67b7fdaf4a98fde678", "CreatedTimestamp": 1534450467.622, "ModifiedTimestamp": 1534451113.504, "ResourceState": "ACTIVE", "Signature": "1a23456b78901c23d4ef56gh7EXAMPLE", "Size": 23019, "LatestVersionSize": 11537 } ], "Documents": [ { "Id": "d90d93c1fe44bad0c8471e973ebaab339090401a95e777cffa58e977d2983b65", "CreatorId": "S-1-1-11-1111111111-2222222222-3333333333-3333&d-926726012c", "ParentFolderId": "1ece93e5fe75315c7407c4967918b4fd9da87ddb2a588e67b7fdaf4a98fde678", "CreatedTimestamp": 1529005196.082, "ModifiedTimestamp": 1534452483.01, "LatestVersionMetadata": { "Id": "1534452029587-15e129dfc187505c407588df255be83de2920d733859f1d2762411d22a83e3ef", "Name": "exampleDoc.docx", "ContentType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "Size": 13922, "Signature": "1a23456b78901c23d4ef56gh7EXAMPLE", "Status": "ACTIVE", "CreatedTimestamp": 1534452029.587, "ModifiedTimestamp": 1534452029.587, "CreatorId": "S-1-1-11-1111111111-2222222222-3333333333-3333&d-926726012c" }, "ResourceState": "ACTIVE" } ] }
-
Per i dettagli sull'API, vedere DescribeFolderContents
in AWS CLI Command Reference.
-
Il seguente esempio di codice mostra come utilizzaredescribe-groups
.
- AWS CLI
-
Per recuperare un elenco di gruppi
L'
describe-groups
esempio seguente elenca i gruppi associati all' WorkDocs organizzazione Amazon specificata.aws workdocs d
e
scribe-groups \ --search-query "e" \ --organization-idd-123456789c
Output:
{ "Groups": [ { "Id": "S-1-1-11-1122222222-2222233333-3333334444-4444&d-123456789c", "Name": "Example Group 1" }, { "Id": "S-1-1-11-1122222222-2222233333-3333334444-5555&d-123456789c", "Name": "Example Group 2" } ] }
Per ulteriori informazioni, consulta la sezione Getting Started with Amazon WorkDocs nella Amazon WorkDocs Administration Guide.
-
Per i dettagli sull'API, consulta DescribeGroups AWS CLI
Command Reference.
-
Il seguente esempio di codice mostra come utilizzaredescribe-notification-subscriptions
.
- AWS CLI
-
Per recuperare un elenco di sottoscrizioni alle notifiche
L'
describe-notification-subscriptions
esempio seguente recupera gli abbonamenti alle notifiche per l'organizzazione Amazon WorkDocs specificata.aws workdocs describe-notification-subscriptions \ --organization-id
d-123456789c
Output:
{ "Subscriptions": [ { "SubscriptionId": "123ab4c5-678d-901e-f23g-45h6789j0123", "EndPoint": "https://example.com/example", "Protocol": "HTTPS" } ] }
Per ulteriori informazioni, consulta Abbonarsi alle notifiche nell'Amazon WorkDocs Developer Guide.
-
Per i dettagli sull'API, consulta DescribeNotificationSubscriptions AWS CLI
Command Reference.
-
Il seguente esempio di codice mostra come utilizzaredescribe-resource-permissions
.
- AWS CLI
-
Per ottenere un elenco di autorizzazioni per una risorsa
Questo esempio restituisce un elenco delle autorizzazioni per la risorsa specificata (documento o cartella).
Comando:
aws workdocs describe-resource-permissions --resource-id
15df51e0335cfcc6a2e4de9dd8be9f22ee40545ad9176f54758dcf903be982d3
Output:
{ "Principals": [ { "Id": "anonymous", "Type": "ANONYMOUS", "Roles": [ { "Role": "VIEWER", "Type": "DIRECT" } ] }, { "Id": "S-1-1-11-1111111111-2222222222-3333333333-3333&d-926726012c", "Type": "USER", "Roles": [ { "Role": "OWNER", "Type": "DIRECT" } ] }, { "Id": "d-926726012c", "Type": "ORGANIZATION", "Roles": [ { "Role": "VIEWER", "Type": "INHERITED" } ] } ] }
-
Per i dettagli sull'API, vedere DescribeResourcePermissions
in AWS CLI Command Reference.
-
Il seguente esempio di codice mostra come utilizzaredescribe-users
.
- AWS CLI
-
Per recuperare i dettagli per utenti specifici
Questo esempio recupera i dettagli per tutti gli utenti dell'organizzazione specificata.
Comando:
aws workdocs describe-users --organization-id
d-926726012c
Output:
{ "Users": [ { "Id": "S-1-1-11-1111111111-2222222222-3333333333-3333&d-926726012c", "Username": "example1User", "OrganizationId": "d-926726012c", "RootFolderId": "3c0e3f849dd20a9771d937b9bbcc97e18796150ae56c26d64a4fa0320a2dedc9", "RecycleBinFolderId": "c277f4c4d647be1f5147b3184ffa96e1e2bf708278b696cacba68ba13b91f4fe", "Status": "INACTIVE", "Type": "USER", "CreatedTimestamp": 1535478999.452, "ModifiedTimestamp": 1535478999.452 }, { "Id": "S-1-1-11-1111111111-2222222222-3333333333-4444&d-926726012c", "Username": "example2User", "EmailAddress": "example2User@site.awsapps.com", "GivenName": "example2Name", "Surname": "example2Surname", "OrganizationId": "d-926726012c", "RootFolderId": "35b886cb17198cbd547655e58b025dff0cf34aaed638be52009567e23dc67390", "RecycleBinFolderId": "9858c3e9ed4c2460dde9aadb4c69fde998070dd46e5e985bd08ec6169ea249ff", "Status": "ACTIVE", "Type": "MINIMALUSER", "CreatedTimestamp": 1535478836.584, "ModifiedTimestamp": 1535478836.584 } ] }
-
Per i dettagli sull'API, vedere DescribeUsers
in AWS CLI Command Reference.
-
Il seguente esempio di codice mostra come utilizzareget-document-path
.
- AWS CLI
-
Per recuperare le informazioni sul percorso di un documento
Questo esempio recupera le informazioni sul percorso (gerarchia dalla cartella principale) per il documento specificato e include i nomi delle cartelle principali.
Comando:
aws workdocs get-document-path --document-id
d90d93c1fe44bad0c8471e973ebaab339090401a95e777cffa58e977d2983b65
--fieldsNAME
Output:
{ "Path": { "Components": [ { "Id": "a43d29cbb8e7c4d25cfee8b803a504b0dc63e760b55ad0c611c6b87691eb6ff3", "Name": "/" }, { "Id": "1ece93e5fe75315c7407c4967918b4fd9da87ddb2a588e67b7fdaf4a98fde678", "Name": "Top Level Folder" }, { "Id": "d90d93c1fe44bad0c8471e973ebaab339090401a95e777cffa58e977d2983b65", "Name": "exampleDoc.docx" } ] } }
-
Per i dettagli sull'API, vedere GetDocumentPath
in AWS CLI Command Reference.
-
Il seguente esempio di codice mostra come utilizzareget-document-version
.
- AWS CLI
-
Per recuperare i metadati della versione per un documento specificato
Questo esempio recupera i metadati della versione per il documento specificato, inclusi un URL di origine e metadati personalizzati.
Comando:
aws workdocs get-document-version --document-id
15df51e0335cfcc6a2e4de9dd8be9f22ee40545ad9176f54758dcf903be982d3
--version-id1521672507741-9f7df0ea5dd0b121c4f3564a0c7c0b4da95cd12c635d3c442af337a88e297920
--fieldsSOURCE
--include-custom-metadataOutput:
{ "Metadata": { "Id": "1521672507741-9f7df0ea5dd0b121c4f3564a0c7c0b4da95cd12c635d3c442af337a88e297920", "Name": "exampleDoc", "ContentType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "Size": 11537, "Signature": "1a23456b78901c23d4ef56gh7EXAMPLE", "Status": "ACTIVE", "CreatedTimestamp": 1521672507.741, "ModifiedTimestamp": 1534451113.504, "CreatorId": "S-1-1-11-1111111111-2222222222-3333333333-3333&d-926726012c", "Source": { "ORIGINAL": "https://gb-us-west-2-prod-doc-source.s3.us-west-2.amazonaws.com/15df51e0335cfcc6a2e4de9dd8be9f22ee40545ad9176f54758dcf903be982d3/1521672507741-9f7df0ea5dd0b121c4f3564a0c7c0b4da95cd12c635d3c442af337a88e297920?response-content-disposition=attachment%3B%20filename%2A%3DUTF-8%27%27exampleDoc&X-Amz-Algorithm=AWS1-ABCD-EFG234&X-Amz-Date=20180820T212202Z&X-Amz-SignedHeaders=host&X-Amz-Expires=900&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20180820%2Fus-west-2%2Fs3%2Faws1_request&X-Amz-Signature=01Ab2c34d567e8f90123g456hi78j901k2345678l901234mno56pqr78EXAMPLE" } } }
-
Per i dettagli sull'API, consultate Command GetDocumentVersion
Reference AWS CLI .
-
Il seguente esempio di codice mostra come utilizzareget-document
.
- AWS CLI
-
Per recuperare i dettagli del documento
Questo esempio recupera i dettagli del documento specificato.
Comando:
aws workdocs get-document --document-id
d90d93c1fe44bad0c8471e973ebaab339090401a95e777cffa58e977d2983b65
Output:
{ "Metadata": { "Id": "d90d93c1fe44bad0c8471e973ebaab339090401a95e777cffa58e977d2983b65", "CreatorId": "S-1-1-11-1111111111-2222222222-3333333333-3333&d-926726012c", "ParentFolderId": "1ece93e5fe75315c7407c4967918b4fd9da87ddb2a588e67b7fdaf4a98fde678", "CreatedTimestamp": 1529005196.082, "ModifiedTimestamp": 1534452483.01, "LatestVersionMetadata": { "Id": "1534452029587-15e129dfc187505c407588df255be83de2920d733859f1d2762411d22a83e3ef", "Name": "exampleDoc.docx", "ContentType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "Size": 13922, "Signature": "1a23456b78901c23d4ef56gh7EXAMPLE", "Status": "ACTIVE", "CreatedTimestamp": 1534452029.587, "ModifiedTimestamp": 1534452029.587, "CreatorId": "S-1-1-11-1111111111-2222222222-3333333333-3333&d-926726012c" }, "ResourceState": "ACTIVE" } }
-
Per i dettagli sull'API, vedere GetDocument
in AWS CLI Command Reference.
-
Il seguente esempio di codice mostra come utilizzareget-folder-path
.
- AWS CLI
-
Per recuperare le informazioni sul percorso di una cartella
Questo esempio recupera le informazioni sul percorso (gerarchia dalla cartella principale) per la cartella specificata e include i nomi delle cartelle principali.
Comando:
aws workdocs get-folder-path --folder-id
50893c0af679524d1a0e0651130ed6d073e1a05f95bd12c42dcde5d35634ed08
--fieldsNAME
Output:
{ "Path": { "Components": [ { "Id": "a43d29cbb8e7c4d25cfee8b803a504b0dc63e760b55ad0c611c6b87691eb6ff3", "Name": "/" }, { "Id": "1ece93e5fe75315c7407c4967918b4fd9da87ddb2a588e67b7fdaf4a98fde678", "Name": "Top Level Folder" }, { "Id": "50893c0af679524d1a0e0651130ed6d073e1a05f95bd12c42dcde5d35634ed08", "Name": "Sublevel Folder" } ] } }
-
Per i dettagli sull'API, vedere GetFolderPath
in AWS CLI Command Reference.
-
Il seguente esempio di codice mostra come utilizzareget-folder
.
- AWS CLI
-
Per recuperare i metadati di una cartella
Questo esempio recupera i metadati per la cartella specificata.
Comando:
aws workdocs get-folder --folder-id
50893c0af679524d1a0e0651130ed6d073e1a05f95bd12c42dcde5d35634ed08
Output:
{ "Metadata": { "Id": "50893c0af679524d1a0e0651130ed6d073e1a05f95bd12c42dcde5d35634ed08", "Name": "exampleFolder", "CreatorId": "S-1-1-11-1111111111-2222222222-3333333333-3333&d-926726012c", "ParentFolderId": "1ece93e5fe75315c7407c4967918b4fd9da87ddb2a588e67b7fdaf4a98fde678", "CreatedTimestamp": 1534450467.622, "ModifiedTimestamp": 1534451113.504, "ResourceState": "ACTIVE", "Signature": "1a23456b78901c23d4ef56gh7EXAMPLE", "Size": 23019, "LatestVersionSize": 11537 } }
-
Per i dettagli sull'API, consultate AWS CLI Command GetFolder
Reference.
-
Il seguente esempio di codice mostra come utilizzareget-resources
.
- AWS CLI
-
Per recuperare risorse condivise
L'
get-resources
esempio seguente recupera le risorse condivise con l' WorkDocs utente Amazon specificato.aws workdocs get-resources \ --user-id
"S-1-1-11-1111111111-2222222222-3333333333-3333"
\ --collection-typeSHARED_WITH_ME
Output:
{ "Folders": [], "Documents": [] }
Per ulteriori informazioni, consulta Sharing Files and Folders nella Amazon WorkDocs User Guide.
-
Per i dettagli sull'API, consulta GetResources AWS CLI
Command Reference.
-
Il seguente esempio di codice mostra come utilizzareinitiate-document-version-upload
.
- AWS CLI
-
Per avviare il caricamento di una versione del documento
L'
initiate-document-upload
esempio seguente crea un nuovo oggetto documento e un nuovo oggetto versione.aws workdocs initiate-document-version-upload \ --name
exampledocname
\ --parent-folder-ideacd546d952531c633452ed67cac23161aa0d5df2e8061223a59e8f67e7b6189
Output:
{ "Metadata": { "Id": "feaba64d4efdf271c2521b60a2a44a8f057e84beaabbe22f01267313209835f2", "CreatorId": "S-1-1-11-1111111111-2222222222-3333333333-3333&d-926726012c", "ParentFolderId": "eacd546d952531c633452ed67cac23161aa0d5df2e8061223a59e8f67e7b6189", "CreatedTimestamp": 1536773972.914, "ModifiedTimestamp": 1536773972.914, "LatestVersionMetadata": { "Id": "1536773972914-ddb67663e782e7ce8455ebc962217cf9f9e47b5a9a702e5c84dcccd417da9313", "Name": "exampledocname", "ContentType": "application/octet-stream", "Size": 0, "Status": "INITIALIZED", "CreatedTimestamp": 1536773972.914, "ModifiedTimestamp": 1536773972.914, "CreatorId": "arn:aws:iam::123456789123:user/EXAMPLE" }, "ResourceState": "ACTIVE" }, "UploadMetadata": { "UploadUrl": "https://gb-us-west-2-prod-doc-source.s3.us-west-2.amazonaws.com/feaba64d4efdf271c2521b60a2a44a8f057e84beaabbe22f01267313209835f2/1536773972914-ddb67663e782e7ce8455ebc962217cf9f9e47b5a9a702e5c84dcccd417da9313?X-Amz-Algorithm=AWS1-ABCD-EFG234&X-Amz-Date=20180912T173932Z&X-Amz-SignedHeaders=content-type%3Bhost%3Bx-amz-server-side-encryption&X-Amz-Expires=899&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20180912%2Fus-west-2%2Fs3%2Faws1_request&X-Amz-Signature=01Ab2c34d567e8f90123g456hi78j901k2345678l901234mno56pqr78EXAMPLE", "SignedHeaders": { "Content-Type": "application/octet-stream", "x-amz-server-side-encryption": "ABC123" } } }
-
Per i dettagli sull'API, consultate InitiateDocumentVersionUpload AWS CLI
Command Reference.
-
Il seguente esempio di codice mostra come utilizzareremove-all-resource-permissions
.
- AWS CLI
-
Per rimuovere tutte le autorizzazioni da una risorsa specificata
Questo esempio rimuove tutte le autorizzazioni dalla risorsa specificata.
Comando:
aws workdocs remove-all-resource-permissions --resource-id
1ece93e5fe75315c7407c4967918b4fd9da87ddb2a588e67b7fdaf4a98fde678
Output:
None
-
Per i dettagli sull'API, vedere RemoveAllResourcePermissions
in AWS CLI Command Reference.
-
Il seguente esempio di codice mostra come utilizzareremove-resource-permission
.
- AWS CLI
-
Per rimuovere le autorizzazioni da una risorsa
Questo esempio rimuove le autorizzazioni dalla risorsa per il principale specificato.
Comando:
aws workdocs remove-resource-permission --resource-id
1ece93e5fe75315c7407c4967918b4fd9da87ddb2a588e67b7fdaf4a98fde678
--principal-idanonymous
Output:
None
-
Per i dettagli sull'API, vedere RemoveResourcePermission
in AWS CLI Command Reference.
-
Il seguente esempio di codice mostra come utilizzareupdate-document-version
.
- AWS CLI
-
Per modificare lo stato della versione di un documento in Attivo
In questo esempio lo stato della versione del documento viene impostato su Attivo.
Comando:
aws workdocs update-document-version --document-id
15df51e0335cfcc6a2e4de9dd8be9f22ee40545ad9176f54758dcf903be982d3
--version-id1521672507741-9f7df0ea5dd0b121c4f3564a0c7c0b4da95cd12c635d3c442af337a88e297920
--version-statusACTIVE
Output:
None
-
Per i dettagli sull'API, consulta UpdateDocumentVersion AWS CLI
Command Reference.
-
Il seguente esempio di codice mostra come utilizzareupdate-document
.
- AWS CLI
-
Per aggiornare un documento
Questo esempio aggiorna il nome e la cartella principale di un documento.
Comando:
aws workdocs update-document --document-id
15df51e0335cfcc6a2e4de9dd8be9f22ee40545ad9176f54758dcf903be982d3
--nameupdatedDoc
--parent-folder-id50893c0af679524d1a0e0651130ed6d073e1a05f95bd12c42dcde5d35634ed08
Output:
None
-
Per i dettagli sull'API, consulta UpdateDocument AWS CLI
Command Reference.
-
Il seguente esempio di codice mostra come utilizzareupdate-folder
.
- AWS CLI
-
Per aggiornare una cartella
Questo esempio aggiorna il nome e la cartella principale di una cartella.
Comando:
aws workdocs update-folder --folder-id
50893c0af679524d1a0e0651130ed6d073e1a05f95bd12c42dcde5d35634ed08
--nameexampleFolder1
--parent-folder-id1ece93e5fe75315c7407c4967918b4fd9da87ddb2a588e67b7fdaf4a98fde678
Output:
None
-
Per i dettagli sull'API, consulta UpdateFolder AWS CLI
Command Reference.
-
Il seguente esempio di codice mostra come utilizzareupdate-user
.
- AWS CLI
-
Per aggiornare un utente
Questo esempio aggiorna il fuso orario per l'utente specificato.
Comando:
aws workdocs update-user --user-id
"S-1-1-11-1111111111-2222222222-3333333333-3333&d-926726012c"
--time-zone-id"America/Los_Angeles"
Output:
{ "User": { "Id": "S-1-1-11-1111111111-2222222222-3333333333-3333&d-926726012c", "Username": "exampleUser", "EmailAddress": "exampleUser@site.awsapps.com", "GivenName": "Example", "Surname": "User", "OrganizationId": "d-926726012c", "RootFolderId": "c5eceb5e1a2d1d460c9d1af8330ae117fc8d39bb1d3ed6acd0992d5ff192d986", "RecycleBinFolderId": "6ca20102926ad15f04b1d248d6d6e44f2449944eda5c758f9a1e9df6a6b7fa66", "Status": "ACTIVE", "Type": "USER", "TimeZoneId": "America/Los_Angeles", "Storage": { "StorageUtilizedInBytes": 0, "StorageRule": { "StorageAllocatedInBytes": 53687091200, "StorageType": "QUOTA" } } } }
-
Per i dettagli sull'API, vedere UpdateUser
in AWS CLI Command Reference.
-