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à.
Utilizzare GetDistribution con una CLI
Gli esempi di codice seguenti mostrano come utilizzare GetDistribution.
Gli esempi di operazioni sono estratti di codice da programmi più grandi e devono essere eseguiti nel contesto. È possibile visualizzare questa operazione nel contesto nel seguente esempio di codice:
- CLI
-
- AWS CLI
-
Per ottenere una distribuzione CloudFront
L'
get-distributionesempio seguente ottiene la CloudFront distribuzione con l'IDEDFDVBD6EXAMPLE, incluso il relativoETag. L’ID distribuzione viene restituito nei comandi create-distribution e list-distribution.aws cloudfront get-distribution \ --idEDFDVBD6EXAMPLEOutput:
{ "ETag": "E2QWRUHEXAMPLE", "Distribution": { "Id": "EDFDVBD6EXAMPLE", "ARN": "arn:aws:cloudfront::123456789012:distribution/EDFDVBD6EXAMPLE", "Status": "Deployed", "LastModifiedTime": "2019-12-04T23:35:41.433Z", "InProgressInvalidationBatches": 0, "DomainName": "d111111abcdef8.cloudfront.net", "ActiveTrustedSigners": { "Enabled": false, "Quantity": 0 }, "DistributionConfig": { "CallerReference": "cli-example", "Aliases": { "Quantity": 0 }, "DefaultRootObject": "index.html", "Origins": { "Quantity": 1, "Items": [ { "Id": "amzn-s3-demo-bucket---s3.amazonaws.com.rproxy.govskope.ca-cli-example", "DomainName": "amzn-s3-demo-bucket.s3.amazonaws.com", "OriginPath": "", "CustomHeaders": { "Quantity": 0 }, "S3OriginConfig": { "OriginAccessIdentity": "" } } ] }, "OriginGroups": { "Quantity": 0 }, "DefaultCacheBehavior": { "TargetOriginId": "amzn-s3-demo-bucket---s3.amazonaws.com.rproxy.govskope.ca-cli-example", "ForwardedValues": { "QueryString": false, "Cookies": { "Forward": "none" }, "Headers": { "Quantity": 0 }, "QueryStringCacheKeys": { "Quantity": 0 } }, "TrustedSigners": { "Enabled": false, "Quantity": 0 }, "ViewerProtocolPolicy": "allow-all", "MinTTL": 0, "AllowedMethods": { "Quantity": 2, "Items": [ "HEAD", "GET" ], "CachedMethods": { "Quantity": 2, "Items": [ "HEAD", "GET" ] } }, "SmoothStreaming": false, "DefaultTTL": 86400, "MaxTTL": 31536000, "Compress": false, "LambdaFunctionAssociations": { "Quantity": 0 }, "FieldLevelEncryptionId": "" }, "CacheBehaviors": { "Quantity": 0 }, "CustomErrorResponses": { "Quantity": 0 }, "Comment": "", "Logging": { "Enabled": false, "IncludeCookies": false, "Bucket": "", "Prefix": "" }, "PriceClass": "PriceClass_All", "Enabled": true, "ViewerCertificate": { "CloudFrontDefaultCertificate": true, "MinimumProtocolVersion": "TLSv1", "CertificateSource": "cloudfront" }, "Restrictions": { "GeoRestriction": { "RestrictionType": "none", "Quantity": 0 } }, "WebACLId": "", "HttpVersion": "http2", "IsIPV6Enabled": true } } }-
Per i dettagli sull'API, consulta GetDistribution AWS CLI
Command Reference.
-
- PowerShell
-
- Strumenti per PowerShell V4
-
Esempio 1: recupera le informazioni relative a una distribuzione specifica.
Get-CFDistribution -Id EXAMPLE0000ID-
Per i dettagli sull'API, vedere GetDistributionin AWS Strumenti per PowerShell Cmdlet Reference (V4).
-
- Strumenti per V5 PowerShell
-
Esempio 1: recupera le informazioni relative a una distribuzione specifica.
Get-CFDistribution -Id EXAMPLE0000ID-
Per i dettagli sull'API, vedere GetDistributionin AWS Strumenti per PowerShell Cmdlet Reference (V5).
-
Per un elenco completo delle guide per sviluppatori AWS SDK e degli esempi di codice, vedere. Utilizzo di CloudFront con un SDK AWS Questo argomento include anche informazioni su come iniziare e dettagli sulle versioni precedenti dell’SDK.