# Gestion des versions

## 📦 Applications

{% openapi src="<https://api.edgegap.com/swagger.json>" path="/v1/app" method="post" %}
<https://api.edgegap.com/swagger.json>
{% endopenapi %}

{% openapi src="<https://api.edgegap.com/swagger.json>" path="/v1/app/{app\_name}" method="patch" %}
<https://api.edgegap.com/swagger.json>
{% endopenapi %}

{% openapi src="<https://api.edgegap.com/swagger.json>" path="/v1/app/{app\_name}" method="get" %}
<https://api.edgegap.com/swagger.json>
{% endopenapi %}

{% openapi src="<https://api.edgegap.com/swagger.json>" path="/v1/app/{app\_name}" method="delete" %}
<https://api.edgegap.com/swagger.json>
{% endopenapi %}

{% openapi src="<https://api.edgegap.com/swagger.json>" path="/v1/app/{app\_name}/version" method="post" %}
<https://api.edgegap.com/swagger.json>
{% endopenapi %}

{% openapi src="<https://api.edgegap.com/swagger.json>" path="/v1/app/{app\_name}/version/{version\_name}" method="delete" %}
<https://api.edgegap.com/swagger.json>
{% endopenapi %}

{% openapi src="<https://api.edgegap.com/swagger.json>" path="/v1/app/{app\_name}/version/{version\_name}" method="get" %}
<https://api.edgegap.com/swagger.json>
{% endopenapi %}

{% openapi src="<https://api.edgegap.com/swagger.json>" path="/v1/app/{app\_name}/version/{version\_name}" method="patch" %}
<https://api.edgegap.com/swagger.json>
{% endopenapi %}

{% openapi src="<https://api.edgegap.com/swagger.json>" path="/v1/app/{app\_name}/versions" method="get" %}
<https://api.edgegap.com/swagger.json>
{% endopenapi %}

{% openapi src="<https://api.edgegap.com/swagger.json>" path="/v1/apps" method="get" %}
<https://api.edgegap.com/swagger.json>
{% endopenapi %}

## 💾 Registre de conteneurs

{% openapi src="<https://api.edgegap.com/swagger.json>" path="/v1/container-registry/images/{image\_name}/tags" method="get" %}
<https://api.edgegap.com/swagger.json>
{% endopenapi %}

{% openapi src="<https://api.edgegap.com/swagger.json>" path="/v1/container-registry/images/{image\_name}/tags/{tag\_name}" method="delete" %}
<https://api.edgegap.com/swagger.json>
{% endopenapi %}

## Create a New Pull Profile

> Create a pull profile. Pull profile will upload data from an endpoint storage to a deployment container on boot. You must link the application version to the pull profile first.

```json
{"openapi":"3.1.1","info":{"title":"Edgegap V1","version":"0.0.0"},"tags":[{"name":"Endpoint Storage","description":"Endpoint Storage Control API - Please refer to <a href='https://docs.edgegap.com/docs/deployment/endpoint-storage' target='_blank'>this documentation</a> to get started with storage."}],"servers":[{"url":"https://api.edgegap.com"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"authorization","description":"To access Edgegap API, generate (and view) your secret tokens in Dashboard - User Settings / Tokens. Add your secret token with each API request as an HTTP header (include the word token): `Authorization: token xxxxxxxx-e458-4592-b607-c2c28afd8b62`"}},"schemas":{"PullProfilePostResponse":{"required":["destination","name","source","source_type"],"properties":{"name":{"type":"string","description":"Name of the pull profile"},"source":{"type":"string","description":"Source in the S3 bucket to fetch from"},"source_type":{"type":"string","description":"If the source is a File or a Directory","enum":["File","Folder"]},"destination":{"type":"string","description":"Destination path where your source will be uploaded in your container. Make sure to avoid protected destinations, such as `/etc/`, as this will prevent the files from being copied to your deployment, and will make your deployment fail. Make sure a normal user can write to the destination folder."},"create_time":{"type":"string","description":"UTC time of pull profile creation"},"last_updated":{"type":"string","description":"UTC time of pull profile last update"}},"type":"object"},"Error":{"required":["message"],"properties":{"message":{"type":"string","description":"A message depending of the request termination"}},"type":"object"},"PullProfilePostPayload":{"required":["destination","name","source","source_type"],"properties":{"name":{"type":"string","description":"Name of the pull profile"},"source":{"type":"string","description":"Source in the S3 bucket to fetch from"},"source_type":{"type":"string","description":"If the source is a File or a Directory","enum":["File","Folder"]},"destination":{"type":"string","description":"Destination path where your source will be uploaded in your container. Make sure to avoid protected destinations, such as `/etc/`, as this will prevent the files from being copied to your deployment, and will make your deployment fail. Make sure a normal user can write to the destination folder."}},"type":"object"}}},"paths":{"/v1/storage/endpoint/{endpoint_name}/pull-profile":{"post":{"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PullProfilePostResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"summary":"Create a New Pull Profile","description":"Create a pull profile. Pull profile will upload data from an endpoint storage to a deployment container on boot. You must link the application version to the pull profile first.","operationId":"pull-profile-create","tags":["Endpoint Storage"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PullProfilePostPayload"}}},"required":true}}}}}
```

## Get a Pull Profile

> Retrieve a pull profile and its specifications.

```json
{"openapi":"3.1.1","info":{"title":"Edgegap V1","version":"0.0.0"},"tags":[{"name":"Endpoint Storage","description":"Endpoint Storage Control API - Please refer to <a href='https://docs.edgegap.com/docs/deployment/endpoint-storage' target='_blank'>this documentation</a> to get started with storage."}],"servers":[{"url":"https://api.edgegap.com"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"authorization","description":"To access Edgegap API, generate (and view) your secret tokens in Dashboard - User Settings / Tokens. Add your secret token with each API request as an HTTP header (include the word token): `Authorization: token xxxxxxxx-e458-4592-b607-c2c28afd8b62`"}},"schemas":{"PullProfileGetResponse":{"required":["destination","name","source","source_type"],"properties":{"name":{"type":"string","description":"Name of the pull profile"},"source":{"type":"string","description":"Source in the S3 bucket to fetch from"},"source_type":{"type":"string","description":"If the source is a File or a Directory","enum":["File","Folder"]},"destination":{"type":"string","description":"Destination path where your source will be uploaded in your container. Make sure to avoid protected destinations, such as `/etc/`, as this will prevent the files from being copied to your deployment, and will make your deployment fail. Make sure a normal user can write to the destination folder."},"create_time":{"type":"string","description":"UTC time of pull profile creation"},"last_updated":{"type":"string","description":"UTC time of pull profile last update"}},"type":"object"},"Error":{"required":["message"],"properties":{"message":{"type":"string","description":"A message depending of the request termination"}},"type":"object"}}},"paths":{"/v1/storage/endpoint/{endpoint_name}/pull-profile/{pull_profile_name}":{"get":{"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PullProfileGetResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"summary":"Get a Pull Profile","description":"Retrieve a pull profile and its specifications.","operationId":"pull-profile-get","tags":["Endpoint Storage"]}}}}
```

## Update a Pull Profile

> Update a pull profile with new specifications.

```json
{"openapi":"3.1.1","info":{"title":"Edgegap V1","version":"0.0.0"},"tags":[{"name":"Endpoint Storage","description":"Endpoint Storage Control API - Please refer to <a href='https://docs.edgegap.com/docs/deployment/endpoint-storage' target='_blank'>this documentation</a> to get started with storage."}],"servers":[{"url":"https://api.edgegap.com"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"authorization","description":"To access Edgegap API, generate (and view) your secret tokens in Dashboard - User Settings / Tokens. Add your secret token with each API request as an HTTP header (include the word token): `Authorization: token xxxxxxxx-e458-4592-b607-c2c28afd8b62`"}},"schemas":{"PulloProfilePatchResponse":{"properties":{"name":{"type":"string","description":"Name of the pull profile"},"source":{"type":"string","description":"Source in the S3 bucket to fetch from"},"source_type":{"type":"string","description":"If the source is a File or a Directory","enum":["File","Folder"]},"destination":{"type":"string","description":"Destination path where your source will be uploaded in your container. Make sure to avoid protected destinations, such as `/etc/`, as this will prevent the files from being copied to your deployment, and will make your deployment fail. Make sure a normal user can write to the destination folder."},"create_time":{"type":"string","description":"UTC time of pull profile creation"},"last_updated":{"type":"string","description":"UTC time of pull profile last update"}},"type":"object"},"Error":{"required":["message"],"properties":{"message":{"type":"string","description":"A message depending of the request termination"}},"type":"object"},"PullProfilePatchPayload":{"properties":{"name":{"type":"string","description":"Name of the pull profile"},"source":{"type":"string","description":"Source in the S3 bucket to fetch from"},"source_type":{"type":"string","description":"If the source is a File or a Directory","enum":["File","Folder"]},"destination":{"type":"string","description":"Destination path where your source will be uploaded in your container. Make sure to avoid protected destinations, such as `/etc/`, as this will prevent the files from being copied to your deployment, and will make your deployment fail. Make sure a normal user can write to the destination folder."}},"type":"object"}}},"paths":{"/v1/storage/endpoint/{endpoint_name}/pull-profile/{pull_profile_name}":{"patch":{"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PulloProfilePatchResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"summary":"Update a Pull Profile","description":"Update a pull profile with new specifications.","operationId":"pull-profile-update","tags":["Endpoint Storage"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PullProfilePatchPayload"}}},"required":true}}}}}
```

## Delete a Pull Profile

> Delete a pull profile. All the application versions linked won't receive the data upload anymore. It will not delete your endpoint storage.

```json
{"openapi":"3.1.1","info":{"title":"Edgegap V1","version":"0.0.0"},"tags":[{"name":"Endpoint Storage","description":"Endpoint Storage Control API - Please refer to <a href='https://docs.edgegap.com/docs/deployment/endpoint-storage' target='_blank'>this documentation</a> to get started with storage."}],"servers":[{"url":"https://api.edgegap.com"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"authorization","description":"To access Edgegap API, generate (and view) your secret tokens in Dashboard - User Settings / Tokens. Add your secret token with each API request as an HTTP header (include the word token): `Authorization: token xxxxxxxx-e458-4592-b607-c2c28afd8b62`"}},"schemas":{"Error":{"required":["message"],"properties":{"message":{"type":"string","description":"A message depending of the request termination"}},"type":"object"}}},"paths":{"/v1/storage/endpoint/{endpoint_name}/pull-profile/{pull_profile_name}":{"delete":{"responses":{"204":{"description":"No Content"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"summary":"Delete a Pull Profile","description":"Delete a pull profile. All the application versions linked won't receive the data upload anymore. It will not delete your endpoint storage.","operationId":"pull-profile-delete","tags":["Endpoint Storage"]}}}}
```

## List All Pull Profile of an Endpoint Storage

> List all pull profiles of an endpoint storage.

```json
{"openapi":"3.1.1","info":{"title":"Edgegap V1","version":"0.0.0"},"tags":[{"name":"Endpoint Storage","description":"Endpoint Storage Control API - Please refer to <a href='https://docs.edgegap.com/docs/deployment/endpoint-storage' target='_blank'>this documentation</a> to get started with storage."}],"servers":[{"url":"https://api.edgegap.com"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"authorization","description":"To access Edgegap API, generate (and view) your secret tokens in Dashboard - User Settings / Tokens. Add your secret token with each API request as an HTTP header (include the word token): `Authorization: token xxxxxxxx-e458-4592-b607-c2c28afd8b62`"}},"schemas":{"PullProfilesListResponse":{"properties":{"pull_profiles":{"type":"array","items":{"$ref":"#/components/schemas/PullProfileGetResponse"}},"pagination":{"description":"Pagination Object","$ref":"#/components/schemas/Pagination"}},"type":"object"},"PullProfileGetResponse":{"required":["destination","name","source","source_type"],"properties":{"name":{"type":"string","description":"Name of the pull profile"},"source":{"type":"string","description":"Source in the S3 bucket to fetch from"},"source_type":{"type":"string","description":"If the source is a File or a Directory","enum":["File","Folder"]},"destination":{"type":"string","description":"Destination path where your source will be uploaded in your container. Make sure to avoid protected destinations, such as `/etc/`, as this will prevent the files from being copied to your deployment, and will make your deployment fail. Make sure a normal user can write to the destination folder."},"create_time":{"type":"string","description":"UTC time of pull profile creation"},"last_updated":{"type":"string","description":"UTC time of pull profile last update"}},"type":"object"},"Pagination":{"properties":{"number":{"type":"integer","description":"Current page number"},"next_page_number":{"type":"integer","description":"Next page number"},"previous_page_number":{"type":"integer","description":"Previous page number"},"paginator":{"$ref":"#/components/schemas/Paginator"},"has_next":{"type":"boolean","description":"If there is a next page"},"has_previous":{"type":"boolean","description":"If there is a previous page"}},"type":"object"},"Paginator":{"properties":{"num_pages":{"type":"integer","description":"Total pages count"}},"type":"object"},"Error":{"required":["message"],"properties":{"message":{"type":"string","description":"A message depending of the request termination"}},"type":"object"}}},"paths":{"/v1/storage/endpoint/{endpoint_name}/pull-profiles":{"get":{"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PullProfilesListResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"summary":"List All Pull Profile of an Endpoint Storage","description":"List all pull profiles of an endpoint storage.","operationId":"pull-profile-list","parameters":[{"schema":{"type":"integer","default":1},"name":"page","in":"query","description":"Page number for pagination"},{"schema":{"type":"integer","default":10},"name":"limit","in":"query","description":"Limit of pull profiles for each page"}],"tags":["Endpoint Storage"]}}}}
```

## Link a Pull Profile to an Application Version

> Link a pull profile to an app version. Without a link, the pull profile by itself will do nothing.

```json
{"openapi":"3.1.1","info":{"title":"Edgegap V1","version":"0.0.0"},"tags":[{"name":"Endpoint Storage","description":"Endpoint Storage Control API - Please refer to <a href='https://docs.edgegap.com/docs/deployment/endpoint-storage' target='_blank'>this documentation</a> to get started with storage."}],"servers":[{"url":"https://api.edgegap.com"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"authorization","description":"To access Edgegap API, generate (and view) your secret tokens in Dashboard - User Settings / Tokens. Add your secret token with each API request as an HTTP header (include the word token): `Authorization: token xxxxxxxx-e458-4592-b607-c2c28afd8b62`"}},"schemas":{"PullProfileAppVersionLinkResponse":{"required":["app","app_version","endpoint","pull_profile"],"properties":{"app":{"type":"string","description":"Name of the linked app of the linked version"},"app_version":{"type":"string","description":"Name of the linked app version."},"endpoint":{"type":"string","description":"Name of the endpoint storage"},"pull_profile":{"type":"string","description":"Name of the pull profile the app version is linked to."},"create_time":{"type":"string","description":"UTC time of link creation"},"last_updated":{"type":"string","description":"UTC time of link last update"}},"type":"object"},"Error":{"required":["message"],"properties":{"message":{"type":"string","description":"A message depending of the request termination"}},"type":"object"}}},"paths":{"/v1/storage/endpoint/{endpoint_name}/pull-profile/{pull_profile_name}/app/{app_name}/version/{version_name}":{"put":{"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PullProfileAppVersionLinkResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"summary":"Link a Pull Profile to an Application Version","description":"Link a pull profile to an app version. Without a link, the pull profile by itself will do nothing.","operationId":"pull-profile-link-app-version","tags":["Endpoint Storage"]}}}}
```

## Unlink a Pull Profile From an Application Version

> Unlink a pull profile from an app version. It will not delete the pull profile.

```json
{"openapi":"3.1.1","info":{"title":"Edgegap V1","version":"0.0.0"},"tags":[{"name":"Endpoint Storage","description":"Endpoint Storage Control API - Please refer to <a href='https://docs.edgegap.com/docs/deployment/endpoint-storage' target='_blank'>this documentation</a> to get started with storage."}],"servers":[{"url":"https://api.edgegap.com"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"authorization","description":"To access Edgegap API, generate (and view) your secret tokens in Dashboard - User Settings / Tokens. Add your secret token with each API request as an HTTP header (include the word token): `Authorization: token xxxxxxxx-e458-4592-b607-c2c28afd8b62`"}},"schemas":{"Error":{"required":["message"],"properties":{"message":{"type":"string","description":"A message depending of the request termination"}},"type":"object"}}},"paths":{"/v1/storage/endpoint/{endpoint_name}/pull-profile/{pull_profile_name}/app/{app_name}/version/{version_name}":{"delete":{"responses":{"204":{"description":"Success"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"summary":"Unlink a Pull Profile From an Application Version","description":"Unlink a pull profile from an app version. It will not delete the pull profile.","operationId":"pull-profile-unlink-app-version","tags":["Endpoint Storage"]}}}}
```

## 🗒️ Stockage des journaux

{% openapi src="<https://api.edgegap.com/swagger.json>" path="/v1/storage/endpoint" method="post" %}
<https://api.edgegap.com/swagger.json>
{% endopenapi %}

{% openapi src="<https://api.edgegap.com/swagger.json>" path="/v1/storage/endpoint/{endpoint\_name}" method="delete" %}
<https://api.edgegap.com/swagger.json>
{% endopenapi %}

{% openapi src="<https://api.edgegap.com/swagger.json>" path="/v1/storage/endpoints" method="get" %}
<https://api.edgegap.com/swagger.json>
{% endopenapi %}

{% openapi src="<https://api.edgegap.com/swagger.json>" path="/v1/storage/endpoint/{endpoint\_name}" method="get" %}
<https://api.edgegap.com/swagger.json>
{% endopenapi %}

{% openapi src="<https://api.edgegap.com/swagger.json>" path="/v1/storage/endpoint/{endpoint\_name}" method="patch" %}
<https://api.edgegap.com/swagger.json>
{% endopenapi %}
