

Avviso di fine del supporto: il 13 novembre 2025, il supporto per Amazon Elastic Transcoder AWS verrà interrotto. Dopo il 13 novembre 2025, non potrai più accedere alla console Elastic Transcoder o alle risorse Elastic Transcoder.

[Per ulteriori informazioni sulla transizione a, consulta questo post del blog AWS Elemental MediaConvert.](https://aws.amazon.com/blogs/media/how-to-migrate-workflows-from-amazon-elastic-transcoder-to-aws-elemental-mediaconvert/)

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à.

# Ruolo di test
<a name="test-pipeline-role"></a>

**Topics**
+ [Descrizione](#test-pipeline-role-description)
+ [Richieste](#test-pipeline-role-requests)
+ [Risposte](#test-pipeline-role-responses)
+ [Errori](#test-pipeline-role-response-errors)
+ [Esempi](#test-pipeline-role-examples)

## Descrizione
<a name="test-pipeline-role-description"></a>

Per testare le impostazioni di una pipeline per garantire che Elastic Transcoder possa creare ed elaborare lavori, invia una richiesta POST alla risorsa. `/2012-09-25/roleTests`

## Richieste
<a name="test-pipeline-role-requests"></a>

### Sintassi
<a name="test-pipeline-role-request-syntax"></a>

```
POST /2012-09-25/roleTests HTTP/1.1
Content-Type: application/json; charset=UTF-8
Accept: */*
Host: elastictranscoder.Elastic Transcoder endpoint.amazonaws.com:443
x-amz-date: 20130114T174952Z
Authorization: AWS4-HMAC-SHA256 
               Credential=AccessKeyID/request-date/Elastic Transcoder endpoint/elastictranscoder/aws4_request,
               SignedHeaders=host;x-amz-date;x-amz-target,
               Signature=calculated-signature
Content-Length: number of characters in the JSON string
{
   "InputBucket":"Amazon S3 bucket that contains files to transcode",
   "OutputBucket":"Amazon S3 bucket in which to save transcoded files",
   "Role":"IAM ARN for the role to test",
   "Topics": [
      "ARN of SNS topic to test"
   ]
}
```

### Parametri della richiesta
<a name="test-pipeline-role-request-parameters"></a>

Questa operazione non utilizza parametri richiesta.

### Intestazioni di richiesta
<a name="test-pipeline-role-request-headers"></a>

Questa operazione utilizza solo le intestazioni richiesta che sono comuni a tutte le operazioni. Per informazioni sulle intestazioni richiesta comuni, consulta [Contenuti nell'intestazione HTTP](making-http-requests.md#http-request-header).

### Corpo della richiesta
<a name="test-pipeline-role-request-body"></a>

La stringa JSON nel corpo della richiesta contiene gli oggetti descritti di seguito. 

**InputBucket**  
Il bucket Amazon S3 in cui hai salvato i file multimediali che desideri transcodificare. `Test Role`prova a leggere da questo bucket. 

**OutputBucket**  
Il bucket Amazon S3 in cui desideri che Elastic Transcoder salvi i file transcodificati. `Test Role`prova a leggere da questo bucket.

**Ruolo**  
L'IAM Amazon Resource Name (ARN) per il ruolo che desideri che Elastic Transcoder utilizzi per transcodificare i lavori. `Test Role`tenta di assumere il ruolo specificato.

**Argomenti**  
Uno o più argomenti ARNs di Amazon Simple Notification Service (Amazon SNS) a cui `Test Role` desideri inviare notifiche di test. Se non utilizzi le notifiche di Amazon SNS, puoi specificare un elenco vuoto. 

## Risposte
<a name="test-pipeline-role-responses"></a>

### Sintassi
<a name="test-pipeline-role-response-syntax"></a>

```
Status: 200 OK
x-amzn-RequestId: c321ec43-378e-11e2-8e4c-4d5b971203e9
Content-Type: application/json
Content-Length: number of characters in the response
Date: Mon, 14 Jan 2013 06:01:47 GMT

{
   "Messages": [
      "error messages, if any"
   ],
   "Success": "true | false"
}
```

### Intestazioni di risposta
<a name="test-pipeline-role-response-headers"></a>

Questa operazione utilizza solo le intestazioni di risposta che sono comuni alla maggior parte delle risposte. Per informazioni sulle intestazioni di risposta comuni, consulta [Risposte HTTP](making-http-requests.md#http-response-header).

### Corpo della risposta
<a name="test-pipeline-role-response-body"></a>

Quando testate le impostazioni per una pipeline, Elastic Transcoder restituisce i seguenti valori.

**Messaggi**  
Se il valore di `Success` è `false`, `Messages` contiene un array di uno o più messaggi che indicano i test non riusciti.

**Riuscito**  
Se l'operazione viene eseguita correttamente, questo valore è `true`. In caso contrario, il valore è `false`.

## Errori
<a name="test-pipeline-role-response-errors"></a>

Per informazioni sulle eccezioni e sui messaggi di errore di Elastic Transcoder, consulta. [Gestione degli errori in Elastic Transcoder](error-handling.md)

## Esempi
<a name="test-pipeline-role-examples"></a>

### Richiesta di esempio
<a name="test-pipeline-role-examples-sample-request"></a>

```
POST /2012-09-25/roleTests HTTP/1.1
Content-Type: application/json; charset=UTF-8
Accept: */*
Host: elastictranscoder.Elastic Transcoder endpoint.amazonaws.com:443
x-amz-date: 20130114T174952Z
Authorization: AWS4-HMAC-SHA256 
               Credential=AccessKeyID/request-date/Elastic Transcoder endpoint/elastictranscoder/aws4_request,
               SignedHeaders=host;x-amz-date;x-amz-target,
               Signature=calculated-signature
Content-Length: number of characters in the JSON string
{
   "InputBucket":"salesoffice.example.com-source",
   "OutputBucket":"salesoffice.example.com-public-promos",
   "Role":"arn:aws:iam::123456789012:role/transcode-service",
   "Topics": 
      ["arn:aws:sns:us-east-1:111222333444:ETS_Errors", 
       "arn:aws:sns:us-east-1:111222333444:ETS_Progressing"]
}
```

### Risposta di esempio
<a name="test-pipeline-role-examples-sample-response"></a>

```
Status: 201 Created
x-amzn-RequestId: c321ec43-378e-11e2-8e4c-4d5b971203e9
Content-Type: application/json
Content-Length: number of characters in the response
Date: Mon, 14 Jan 2013 06:01:47 GMT
{
   "Messages":[
      "The role arn:aws:iam::123456789012:role/transcode-service does not have access to the bucket: salesoffice.example.com-source",
      "The role arn:aws:iam::123456789012:role/transcode-service does not have access to the topic: arn:aws:sns:us-east-1:111222333444:ETS_Errors"
   ], 
   "Success": "false"
}
```