Upload or replace a hosted asset Obsoleto

PUT /groups/{groupId}/apps/{appId}/hosting/assets/asset

Cargar o reemplazar un activo alojado en una ruta de recursos específica.

Parámetros de path

Parámetros de query

  • ruta string Requerido

    La ruta de recursos de un activo alojado.

aplicación/json

Cuerpo Requerido

The hosted asset file and its metadata. (Must use Content-Type: multipart/mixed)

  • meta Objeto
    Ocultar atributos meta Mostrar atributos meta Objeto
    • ruta string

      The resource path of the asset

    • tamaño entero

      El tamaño del activo en bytes

    • attrs arreglo[objeto]

      An array of documents that each describe a metadata attribute that applies to the asset.

      Ocultar atributos attrs Show attrs attributes Objeto
    • hash string

      El hash de suma de verificación MD5 para el activo

  • Archivo string(binary)

    The asset file to upload (encoded as binary).

Respuestas

  • 204

    Successfully added/replaced the hosted asset.

  • 400 aplicación/json

    There is an error in the request.

    Ocultar atributos de respuesta Mostrar los atributos de respuesta Objeto
    • Error string

      Un mensaje que describe el error.

    • error_code string

      El tipo de error.

PUT /groups/{groupId}/apps/{appId}/hosting/assets/asset
curl \
 --request PUT 'https://services.cloud.mongodb.com/api/admin/v3.0/groups/{groupId}/apps/{appId}/hosting/assets/asset?path=string' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"meta":{"path":"string","size":42,"attrs":[{"name":"string","value":"string"}],"hash":"string"},"file":"@file"}'
Solicitar ejemplos
{
  "meta": {
    "path": "string",
    "size": 42,
    "attrs": [
      {
        "name": "string",
        "value": "string"
      }
    ],
    "hash": "string"
  },
  "file": "@file"
}
Ejemplos de respuestas (400)
{
  "error": "string",
  "error_code": "string"
}