# Updating Assets¶

## Workflow¶

There are two steps in order to update the assets volume for a repository:

1. Start the Assets deployment. This deployment works just like any other deployments. The main difference is that once this deployment is decommissioned Squash will generate a new Assets snapshot and use it for new deployments moving forward.
2. Stop the Assets deployment. This step is optional. If you don’t explicitly stop a deployment it will be automatically decommissioned after its expire time.

## Assets Synchronization¶

It may take from several minutes to up to 2 hours for an assets snapshot to be fully completed. This depends on the number and size of the files updated within the assets folder.

## API Call: Start Assets Update Deployment¶

### API Specs¶

https://api.squash.io/a/assets/start/?repository=<repository_name>
HTTP Method: GET
Success Response Code: 200
Success Response Body: JSON data


$curl -i -H 'Squash-Key: B6mtwX0htEW0HaFp9X25UtJsiX1uBNHNsxAptnum2VxgXVwmrJfmd74En1a8MwFe' \ https://api.squash.io/a/assets/start/?repository=acme-repo  ### Response Sample¶ {"status": "ready", "ssh_port": "6512", "ssh_ip": "18.118.25.254", "deployment_url": "https://cart-v2-i3fg1.squash.io", "execution_id": "0f0d8890-ad2f-4c38-8457-b166c36bffe3", "msg": "deployment is starting up" }  • status has the following options: “pending”, “ready” and “error” • pending: the deployment has started successfully and is in progress • ready: the deployment start up process is ready and you can now connect to the server through SSH. • error: an error message and error code are included within the msg field • ssh_port: only available when status is ready • ssh_ip: only available when status is ready • deployment_url: This is the Squash URL of this deployment that you can use for testing • execution_id: This is a long unique identifier that represents an specific deployment run • msg: Squash will display status or error messages in this field ## API Call: Stop Deployment¶ ### API Specs¶ https://api.squash.io/a/stop/?deployment_id=<deployment_unique_id> HTTP Method: GET Success Response Code: 200 Success Response Body: JSON data  The deployment_unique_id argument can be found in regular deployment URLs, you will also find it within the deployment_url field of the Start Assets Update Deployment above. For more information see Squash unique deployment identifier. ### Sample Request¶ $ curl -i -H 'Squash-Key: B6mtwX0htEW0HaFp9X25UtJsiX1uBNHNsxAptnum2VxgXVwmrJfmd74En1a8MwFe' \
https://api.squash.io/a/stop/?deployment_id=a3pgx


### Response Sample¶

{"status":"pending",
"msg":"Deployment is shutting down"}

• status has the following options: “pending”, “ready” and “error”
• pending: the deployment shut down process has initiated successfully and is in progress
• ready: the deployment has been decommissioned
• error: an error message and error code are included within the msg field
• msg: Squash will display status or error messages in this field