Sono disponibili altri esempi di AWS SDK nel repository AWS Doc SDK Examples.
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à.
AWS Cloud9 esempi di utilizzo di Tools for V5 PowerShell
I seguenti esempi di codice mostrano come eseguire azioni e implementare scenari comuni utilizzando AWS Strumenti per PowerShell V5 con. AWS Cloud9
Le azioni sono estratti di codice da programmi più grandi e devono essere eseguite nel contesto. Sebbene le azioni mostrino come richiamare le singole funzioni del servizio, è possibile visualizzarle contestualizzate negli scenari correlati.
Ogni esempio include un link al codice sorgente completo, in cui vengono fornite le istruzioni su come configurare ed eseguire il codice nel contesto.
Argomenti
Azioni
L’esempio di codice seguente mostra come utilizzare Get-C9EnvironmentData.
- Strumenti per PowerShell V5
-
Esempio 1: questo esempio ottiene informazioni sugli ambienti di sviluppo AWS Cloud9 specificati.
Get-C9EnvironmentData -EnvironmentId 685f892f431b45c2b28cb69eadcdb0EX,1980b80e5f584920801c09086667f0EXOutput:
Arn : arn:aws:cloud9:us-east-1:123456789012:environment:685f892f431b45c2b28cb69eadcdb0EX Description : Created from CodeStar. Id : 685f892f431b45c2b28cb69eadcdb0EX Lifecycle : Amazon.Cloud9.Model.EnvironmentLifecycle Name : my-demo-ec2-env OwnerArn : arn:aws:iam::123456789012:user/MyDemoUser Type : ec2 Arn : arn:aws:cloud9:us-east-1:123456789012:environment:1980b80e5f584920801c09086667f0EX Description : Id : 1980b80e5f584920801c09086667f0EX Lifecycle : Amazon.Cloud9.Model.EnvironmentLifecycle Name : my-demo-ssh-env OwnerArn : arn:aws:iam::123456789012:user/MyDemoUser Type : sshEsempio 2: questo esempio ottiene informazioni sullo stato del ciclo di vita dell'ambiente di sviluppo AWS Cloud9 specificato.
(Get-C9EnvironmentData -EnvironmentId 685f892f431b45c2b28cb69eadcdb0EX).LifecycleOutput:
FailureResource Reason Status --------------- ------ ------ CREATED-
Per i dettagli sull'API, vedere DescribeEnvironments in AWS Strumenti per PowerShell Cmdlet Reference (V5).
-
L’esempio di codice seguente mostra come utilizzare Get-C9EnvironmentList.
- Strumenti per V5 PowerShell
-
Esempio 1: questo esempio ottiene un elenco degli identificatori dell'ambiente di sviluppo AWS Cloud9 disponibili.
Get-C9EnvironmentListOutput:
685f892f431b45c2b28cb69eadcdb0EX 1980b80e5f584920801c09086667f0EX-
Per i dettagli sull'API, vedere ListEnvironments in AWS Strumenti per PowerShell Cmdlet Reference (V5).
-
L’esempio di codice seguente mostra come utilizzare Get-C9EnvironmentMembershipList.
- Strumenti per V5 PowerShell
-
Esempio 1: questo esempio ottiene informazioni sui membri dell'ambiente per l'ambiente di sviluppo AWS Cloud9 specificato.
Get-C9EnvironmentMembershipList -EnvironmentId ffd88420d4824eeeaeaa8a04bfde8cEXOutput:
EnvironmentId : ffd88420d4824eeeaeaa8a04bfde8cEX LastAccess : 1/1/0001 12:00:00 AM Permissions : read-write UserArn : arn:aws:iam::123456789012:user/AnotherDemoUser UserId : AIDAJ3BA6O2FMJWCWXHEX EnvironmentId : ffd88420d4824eeeaeaa8a04bfde8cEX LastAccess : 1/1/0001 12:00:00 AM Permissions : owner UserArn : arn:aws:iam::123456789012:user/MyDemoUser UserId : AIDAJ3LOROMOUXTBSU6EXEsempio 2: questo esempio ottiene informazioni sul proprietario dell'ambiente di sviluppo AWS Cloud9 specificato.
Get-C9EnvironmentMembershipList -EnvironmentId ffd88420d4824eeeaeaa8a04bfde8cEX -Permission ownerOutput:
EnvironmentId : ffd88420d4824eeeaeaa8a04bfde8cEX LastAccess : 1/1/0001 12:00:00 AM Permissions : owner UserArn : arn:aws:iam::123456789012:user/MyDemoUser UserId : AIDAJ3LOROMOUXTBSU6EXEsempio 3: questo esempio ottiene informazioni sul membro dell'ambiente specificato per più ambienti di sviluppo AWS Cloud9.
Get-C9EnvironmentMembershipList -UserArn arn:aws:iam::123456789012:user/MyDemoUserOutput:
EnvironmentId : ffd88420d4824eeeaeaa8a04bfde8cEX LastAccess : 1/17/2018 7:48:14 PM Permissions : owner UserArn : arn:aws:iam::123456789012:user/MyDemoUser UserId : AIDAJ3LOROMOUXTBSU6EX EnvironmentId : 1980b80e5f584920801c09086667f0EX LastAccess : 1/16/2018 11:21:24 PM Permissions : owner UserArn : arn:aws:iam::123456789012:user/MyDemoUser UserId : AIDAJ3LOROMOUXTBSU6EX-
Per i dettagli sull'API, vedere DescribeEnvironmentMemberships in AWS Strumenti per PowerShell Cmdlet Reference (V5).
-
L’esempio di codice seguente mostra come utilizzare Get-C9EnvironmentStatus.
- Strumenti per V5 PowerShell
-
Esempio 1: questo esempio ottiene informazioni sullo stato dell'ambiente di sviluppo AWS Cloud9 specificato.
Get-C9EnvironmentStatus -EnvironmentId 349c86d4579e4e7298d500ff57a6b2EXOutput:
Message Status ------- ------ Environment is ready to use ready-
Per i dettagli sull'API, vedere DescribeEnvironmentStatus in AWS Strumenti per PowerShell Cmdlet Reference (V5).
-
L’esempio di codice seguente mostra come utilizzare New-C9EnvironmentEC2.
- Strumenti per V5 PowerShell
-
Esempio 1: questo esempio crea un ambiente di sviluppo AWS Cloud9 con le impostazioni specificate, avvia un'istanza Amazon Elastic Compute Cloud (Amazon EC2) e quindi si connette dall'istanza all'ambiente.
New-C9EnvironmentEC2 -Name my-demo-env -AutomaticStopTimeMinutes 60 -Description "My demonstration development environment." -InstanceType t2.micro -OwnerArn arn:aws:iam::123456789012:user/MyDemoUser -SubnetId subnet-d43a46EXOutput:
ffd88420d4824eeeaeaa8a04bfde8cEX-
Per i dettagli sull'API, vedere CreateEnvironmentEc2 in AWS Strumenti per PowerShell Cmdlet Reference (V5).
-
L’esempio di codice seguente mostra come utilizzare New-C9EnvironmentMembership.
- Strumenti per V5 PowerShell
-
Esempio 1: questo esempio aggiunge il membro dell'ambiente specificato all'ambiente di sviluppo AWS Cloud9 specificato.
New-C9EnvironmentMembership -UserArn arn:aws:iam::123456789012:user/AnotherDemoUser -EnvironmentId ffd88420d4824eeeaeaa8a04bfde8cEX -Permission read-writeOutput:
EnvironmentId : ffd88420d4824eeeaeaa8a04bfde8cEX LastAccess : 1/1/0001 12:00:00 AM Permissions : read-write UserArn : arn:aws:iam::123456789012:user/AnotherDemoUser UserId : AIDAJ3BA6O2FMJWCWXHEX-
Per i dettagli sull'API, vedere CreateEnvironmentMembership in AWS Strumenti per PowerShell Cmdlet Reference (V5).
-
L’esempio di codice seguente mostra come utilizzare Remove-C9Environment.
- Strumenti per V5 PowerShell
-
Esempio 1: questo esempio elimina l'ambiente di sviluppo AWS Cloud9 specificato. Se l’istanza EC2 è connessa all’ambiente, anche l’istanza viene terminata.
Remove-C9Environment -EnvironmentId ffd88420d4824eeeaeaa8a04bfde8cEX-
Per i dettagli sull'API, vedere DeleteEnvironment in AWS Strumenti per PowerShell Cmdlet Reference (V5).
-
L’esempio di codice seguente mostra come utilizzare Remove-C9EnvironmentMembership.
- Strumenti per V5 PowerShell
-
Esempio 1: questo esempio elimina il membro dell'ambiente specificato dall'ambiente di sviluppo AWS Cloud9 specificato.
Remove-C9EnvironmentMembership -UserArn arn:aws:iam::123456789012:user/AnotherDemoUser -EnvironmentId ffd88420d4824eeeaeaa8a04bfde8cEX-
Per i dettagli sull'API, vedere DeleteEnvironmentMembership in AWS Strumenti per PowerShell Cmdlet Reference (V5).
-
L’esempio di codice seguente mostra come utilizzare Update-C9Environment.
- Strumenti per V5 PowerShell
-
Esempio 1: questo esempio modifica le impostazioni specificate dell'ambiente di sviluppo AWS Cloud9 esistente specificato.
Update-C9Environment -EnvironmentId ffd88420d4824eeeaeaa8a04bfde8cEX -Description "My changed demonstration development environment." -Name my-changed-demo-env-
Per i dettagli sull'API, vedere UpdateEnvironment in AWS Strumenti per PowerShell Cmdlet Reference (V5).
-
L’esempio di codice seguente mostra come utilizzare Update-C9EnvironmentMembership.
- Strumenti per V5 PowerShell
-
Esempio 1: questo esempio modifica le impostazioni del membro dell'ambiente esistente specificato per l'ambiente di sviluppo AWS Cloud9 specificato.
Update-C9EnvironmentMembership -UserArn arn:aws:iam::123456789012:user/AnotherDemoUser -EnvironmentId ffd88420d4824eeeaeaa8a04bfde8cEX -Permission read-onlyOutput:
EnvironmentId : ffd88420d4824eeeaeaa8a04bfde8cEX LastAccess : 1/1/0001 12:00:00 AM Permissions : read-only UserArn : arn:aws:iam::123456789012:user/AnotherDemoUser UserId : AIDAJ3BA6O2FMJWCWXHEX-
Per i dettagli sull'API, vedere UpdateEnvironmentMembership in AWS Strumenti per PowerShell Cmdlet Reference (V5).
-