---
title: Rancher Container Action
slug: homologacao-atmosphere/rancher-container-action
description: Learn how to perform actions on any container using a powerful script. This document summarizes the script's requirements, including the Rancher API URL, access key, secret key, container ID, and desired action (e.g., restart or stop). Discover an example
docTags: 
createdAt: 2021-03-25T19:22:35.000Z
---

## Resumo

- Execute uma ação em qualquer contêiner.

## Parâmetros

| **Parâmetro**                    | **Tipo** | **Escolhas \| Valor Padrão**             | **Comentários**                 |
| -------------------------------- | -------- | ---------------------------------------- | ------------------------------- |
| url - *required*                 | string   |                                          | Url da API Rancher.             |
| access\_key - *required*         | string   |                                          | Chave de acesso da API Rancher. |
| secret\_key - *required*         | string   |                                          | Rancher Secret.                 |
| container\_id - *required&#x20;* | string   |                                          | ID do projeto.                  |
| action                           | string   | - "restart"<br />(default)<br />- "stop" | A ação a ser tomada.            |



## Exemplos

```yaml
# Exemplo: Restartar serviço Rancher
- rancher_container_action:
    url: http://url/api-version
    access_key: ACCESS_KEY
    secret_key: SECRET_KEY
    container_id: ID
    action: restart
```

