Extraer archivos de configuración de la aplicación

OBTENER /groups/{groupId}/apps/{appId}/pull

Descarga la configuración actual de la aplicación. Puede elegir descargar en dos formatos diferentes:

  • Un archivo zip comprimido que contiene el directorio de archivos de configuración. Esto es más útil cuando trabajas con la CLI, un sistema de control de versiones o en otro entorno basado en el sistema de archivos.

  • Un solo objeto JSON que contiene toda la configuración. Esto es más útil cuando se trabaja con la API u otro entorno que puede parsear JSON.

You specify which format to download by setting the Accept header.

Parámetros de path

Respuestas

  • Extracción exitosa

    Ocultar atributos de respuesta Mostrar los atributos de respuesta Objeto
    • Nombre string Requerido

      El nombre de la aplicación.

    • provider_region string Requerido

      Uno de los siguientes:

      Los valores son aws-us-east-1, aws-us-west-2, aws-us-east-2, aws-eu-central-1, aws-eu-west-1, aws-eu-west-2, aws-ap-southeast-1, aws-ap-southeast-2, aws-ap-south-1 o aws-sa-east-1.

      Los valores son azure-eastus2, azure-westus, azure-westeurope, azure-eastasia o azure-southeastasia.

      Los valores son gcp-us-central1, gcp-us-east4, gcp-us-west1, gcp-europe-west1 o gcp-asia-south1.

    • deployment_model string Requerido

      An application deployment model.

      Los valores son GLOBAL o LOCAL.

    • entorno string

      The application's environment.

      Los valores son development, testing, qa o production.

    • proveedores_de_autenticación arreglo[objeto] Requerido
      Cualquiera de:
    • custom_user_data objeto | nulo
      Ocultar los atributos custom_user_data Show custom_user_data attributes objeto | nulo
      • database_name string

        El nombre de la base de datos que contiene datos de usuario personalizados.

      • nombre_colección string

        The name of the collection that contains custom user data.

      • user_id_field string

        El nombre de un campo que aparece en cada documento de datos de usuario personalizado y que contiene el ID de cuenta de usuario correspondiente a cada documento.

      • habilitado booleano

        If true, custom user data is enabled.

      • mongo_service_name string Requerido

        The name of the linked MongoDB data source that contains custom user data.

      • on_user_creation_function_name string

        The name of a user creation function that runs whenever a new user registers.

    • data_api_config objeto | nulo
      Hide data_api_config attributes Show data_api_config attributes objeto | nulo
      • inhabilitado booleano Requerido
      • versiones array[string] Requerido

        A supported version of the Data API.

        El valor es v1.

      • return_type string Requerido

        A data format supported by the Data API & custom endpoints.

        Los valores son JSON o EJSON.

      • create_user_on_auth booleano
      • run_as_user_id string

        An application user's account ID. If defined, endpoints will always run as the specified user.

      • run_as_user_id_script_source string

        Código fuente convertido en string para una función que retorna el ID de cuenta de un usuario de la aplicación. Si se define, los endpoints ejecutan la función en cada solicitud y se ejecutan como el usuario con el ID retornado por la función.

      • método_de_validación string Requerido

        Los valores son NO_VALIDATION, SECRET_AS_QUERY_PARAM o VERIFY_PAYLOAD.

      • secret_name string

        Si validation_method está establecido en "SECRET_AS_QUERY_PARAM" o "VERIFY_PAYLOAD", este es el name del Secreto que autoriza las solicitudes.

      • can_evaluate Objeto

        Una expresión JSON que evalúa a true si se permite que un endpoint se ejecute en respuesta a una solicitud entrante.

    • data_sources arreglo[objeto] Requerido
      Uno de los siguientes:
    • puntos finales arreglo[objeto] Requerido
      Ocultar atributos de los endpoints Mostrar atributos de los puntos finales Objeto
      • route string Requerido
      • http_method string Requerido

        Los valores son GET, POST, PUT, PATCH, DELETE o *.

      • function_id string Requerido
      • método_de_validación string Requerido

        Los valores son NO_VALIDATION, SECRET_AS_QUERY_PARAM o VERIFY_PAYLOAD.

      • secret_id string

        Si validation_method está establecido en "SECRET_AS_QUERY_PARAM" o "VERIFY_PAYLOAD", este es el _id del Secreto que autoriza las solicitudes.

      • return_type string Requerido

        A data format supported by the Data API & custom endpoints.

        Los valores son JSON o EJSON.

      • respond_result booleano Requerido
      • fetch_custom_user_data booleano
      • create_user_on_auth booleano
      • inhabilitado booleano Requerido
      • function_name string Requerido

        The endpoint functions's name.

    • environments Objeto Requerido
      Hide environments attribute Show environments attribute Objeto
      • values Objeto

        An object that maps each possible environment name to definitions of the environment values available in that environment.

        Hide values attributes Show values attributes Objeto
        • Ninguno Objeto
          Hide none attribute Show none attribute Objeto
          • values Objeto
        • development Objeto
          Ocultar atributo de desarrollo Show development attribute Objeto
          • values Objeto
        • testing Objeto
          Hide testing attribute Mostrar atributo de prueba Objeto
          • values Objeto
        • qa Objeto
          Hide qa attribute Mostrar el atributo qa Objeto
          • values Objeto
        • Producción Objeto
          Hide production attribute Show production attribute Objeto
          • values Objeto
    • Funciones arreglo[objeto] Requerido
      Hide functions attributes Show functions attributes Objeto
      • can_evaluate Objeto

        A JSON expression that evaluates to true if the Function is allowed to run in response to an incoming request.

      • Nombre string Requerido

        Un nombre único para la función.

      • privado booleano Requerido

        If true, the function is hidden from client applications. You can still call a private function from JSON expressions and other functions, including incoming webhooks and triggers.

      • Origen string Requerido

        El código fuente convertido en string para la función. El código debe ser un ES6 válido.

      • run_as_system booleano

        Si true, la función se ejecuta con todos los privilegios, omitiendo las reglas en todos los servicios.

      • run_as_user_id string

        El ID de cuenta de un usuario de la aplicación. Si está definido, los endpoints siempre se ejecutarán como el usuario especificado. No puede usarse con run_as_user_id_script_source.

      • run_as_user_id_script_source string

        The stringified source code for a function that returns an application user's account ID. If defined, endpoints execute the function on every request and run as the user with the ID returned from the function. Cannot be used with run_as_user_id.

    • graphql Objeto Requerido
      Ocultar atributos graphql Mostrar atributos graphql Objeto
      • config Objeto Requerido
        Ocultar atributos de configuración Show config attributes Objeto
        • use_natural_pluralization booleano

          If true, generated schema type names use common English pluralization whenever possible.

          Si false, o si no se puede determinar una pluralización natural, entonces los tipos plurales usan el nombre del tipo singular con una "s" añadida al final.

          No puedes cambiar este valor después de crear tu aplicación. Este valor es true para todas las aplicaciones nuevas.

        • disable_schema_introspection booleano

          Si true, la API de GraphQL bloquea consultas de introspección de clientes.

      • validation_settings Objeto Requerido
        Ocultar los atributos validation_settings Show validation_settings attributes Objeto
        • read_validation_action string

          Los valores son ERROR o WARN.

        • read_validation_level string

          Los valores son STRICT o OFF.

        • write_validation_action string

          Los valores son ERROR o WARN.

        • write_validation_level string

          Los valores son STRICT o OFF.

      • custom_resolvers arreglo[objeto] Requerido
        Hide custom_resolvers attributes Mostrar atributos custom_resolvers Objeto
        • on_type string Requerido

          The name of the resolver's parent type. This can be "Query", "Mutation", or the name of a generated type if this is a computed property.

        • field_name string Requerido

          The name of the custom resolver field that appears in the GraphQL schema.

        • input_type string | objeto

          The type of the custom resolver's input parameter. This can be a scalar, the name of an existing generated type, or a custom JSON schema object. If undefined, the resolver does not accept an input.

        • input_type_format string

          El tipo de entrada que utiliza el resolvedor personalizado. Este valor debe corresponder al valor de input_type:

          • Un tipo de entrada escalar debe usar "scalar" o "scalar-list"
          • Un tipo de input generado debe usar "generated" o "generated-list"
          • Un tipo de entrada personalizado debe utilizar "custom"

          If undefined, the resolver does not accept an input.

          Los valores son scalar, scalar-list, generated, generated-list o custom.

        • payload_type string | objeto

          The type of the value returned by the custom resolver. This can be a scalar, the name of an existing generated type, or a custom JSON schema object.

          Si no se define, el resolver devuelve un objeto DefaultPayload:

          type DefaultPayload {
            status: String!
          }
          
        • payload_type_format string

          El tipo de carga útil que utiliza el resolvedor personalizado. Este valor debe corresponder al valor de payload_type:

          • A scalar payload type must use "scalar" or "scalar-list"
          • A generated payload type must use "generated" or "generated-list"
          • Un tipo de carga útil personalizada debe usar "custom"

          If undefined, the resolver returns a DefaultPayload object.

          Los valores son scalar, scalar-list, generated, generated-list o custom.

        • function_name string Requerido

          El nombre de la función resolver.

    • hosting Objeto Requerido
      Hide hosting attributes Show hosting attributes Objeto
      • habilitado booleano Requerido
      • custom_domain string
      • default_error_path string
      • default_error_code string
    • https_endpoints arreglo[objeto] Requerido

      [Deprecated] A list of legacy HTTP services. This is for backwards compatibility only.

      Ocultar atributos https_endpoints Show https_endpoints attributes Objeto
      • Nombre string

        The service name.

      • tipo string

        El tipo de servicio.

        Los valores son aws, twilio, github, gcm o http.

      • incoming_webhooks arreglo[objeto]
        Ocultar atributos de incoming_webhooks Mostrar los atributos incoming_webhooks Objeto
        • Nombre string Requerido
        • function_source string Requerido
        • respond_result booleano Requerido
        • opciones Objeto
          Ocultar atributos de opciones Mostrar atributos de opciones Objeto
          • secreto string
          • secretAsQueryParam booleano
      • Versión entero
    • log_forwarders arreglo[objeto] Requerido
      Hide log_forwarders attributes Show log_forwarders attributes Objeto
      • Nombre string Requerido
      • inhabilitado booleano Requerido
      • log_types array[string] Requerido

        Los valores son auth, endpoint, function, graphql, push, schema, service, sync, trigger o trigger_error_handler.

      • log_statuses array[string] Requerido

        Los valores son error o success.

      • policy Objeto Requerido
        Ocultar atributo de política Mostrar atributo de política Objeto
        • tipo string

          Los valores son single o batch.

      • acción Objeto Requerido
        Hide action attributes Show action attributes Objeto
        • tipo string

          Los valores son collection o function.

        • Nombre string
        • data_source string
        • database string
        • Colección string
    • schemas arreglo[objeto] Requerido
      Hide schemas attributes Show schemas attributes Objeto
      • metadata Objeto

        Metadata that describes which linked collection the schema applies to.

        Hide metadata attributes Mostrar los atributos de metadatos Objeto
        • data_source string

          The data source name.

        • database string

          El nombre de la base de datos.

        • Colección string

          El nombre de la colección.

      • Esquema Objeto

        A valid schema for the collection.

        Ocultar atributos del esquema Show schema attributes Objeto
        • bsonType string

          The BSON type of the field.

          Los valores son object, array, string, number, int, long, double, decimal, date, timestamp, bool, null, regex, objectId, binary, uuid, function, javascript, symbol, minKey o maxKey.

        • título string

          A human-readable title for the schema.

        • Requerido array[string]

          Para los esquemas object, un arreglo de nombres de campos que son obligatorios en instancias del objeto.

        • Propiedades Objeto

          An object where each field name is a property in the schema. The corresponding value is a schema definition for that field.

          Hide properties attribute Mostrar atributo de propiedades Objeto
          • * Objeto

            A valid schema for the collection.

      • relación Objeto

        Relationships to foreign collections. Each field name is a property in the schema. The corresponding value is a relationship definition for that field.

        Ocultar el atributo de relaciones Show relationships attribute Objeto
        • * Objeto Propiedades adicionales

          A relationship definition.

          Ocultar * atributos Mostrar * atributos Objeto
          • ref string

            Una string de referencia para la colección externa.

          • foreign_key string

            The name of the field in the foreign collection that the relationship points to.

          • is_list booleano

            En caso de que true:

            • the relationship may point to many foreign documents.
            • the local field must be defined as an array in the collection schema.
    • Servicios arreglo[objeto] Requerido

      [Deprecated] A list of legacy third-party non-HTTP services. This is for backwards compatibility only.

      Hide services attributes Show services attributes Objeto
      • Nombre string

        The service name.

      • tipo string

        El tipo de servicio.

        Los valores son aws, twilio, github, gcm o http.

      • incoming_webhooks arreglo[objeto]
        Ocultar atributos de incoming_webhooks Mostrar los atributos incoming_webhooks Objeto
        • Nombre string Requerido
        • function_source string Requerido
        • respond_result booleano Requerido
        • opciones Objeto
          Ocultar atributos de opciones Mostrar atributos de opciones Objeto
          • secreto string
          • secretAsQueryParam booleano
      • Versión entero
    • sincronizar Objeto Requerido
      Ocultar atributos de sincronización Show sync attributes Objeto
      • Estado string Requerido

        El estado del servicio de sincronización ("enabled", "disabled", o vacío si Sync no está configurado).

      • database_name string

        The name of a database in the synced cluster where App Services stores data in Development Mode. App Services automatically generates a schema for each synced type and maps each object type to a collection within the database.

      • queryable_fields_names array[string]

        Un arreglo de nombres de campos consultables en cualquier colección.

      • indexed_queryable_fields_names array[string]

        Una lista de nombres de campos para usar como campo indexado consultable. Aunque esta propiedad es un arreglo, Sincronización actualmente soporta solo un campo indexado consultable. Por lo tanto, este arreglo puede contener como máximo un elemento.

        El campo consultable indexado debe estar presente en el esquema y ser del mismo tipo de campo elegible en todas las colecciones que sincronices. El nombre del campo indexado consultable también debe aparecer en queryable_fields_names ya que este es un campo consultable global.

      • collection_queryable_fields_names Objeto

        Un arreglo de nombres de campos consultables en la colección especificada.

        Hide collection_queryable_fields_names attribute Show collection_queryable_fields_names attribute Objeto
        • * Objeto Propiedades adicionales
          Hide * attribute Mostrar * atributo Objeto
          • * string Propiedades adicionales

            El nombre del campo consultable.

      • permisos Objeto

        Obsoleto

      • last_disabled string

        La última vez que se desactivó la sincronización, representada por el número de segundos desde la Unix epoch.

      • client_max_offline_days entero

        The number of days the client can be offline before a client reset is required.

      • is_recovery_mode_disabled booleano

        Especifica si el modo de restablecimiento del cliente está deshabilitado. De forma predeterminada, el modo de restablecimiento del cliente está habilitado y este valor es false.

      • asymmetric_tables array[string]

        An array of the names of collections that are defined as asymmetric with Data Ingest, where clients can write data but not read.

    • Activadores arreglo[objeto] Requerido
      Uno de los siguientes:
    • values arreglo[objeto] Requerido
      Hide values attributes Show values attributes Objeto
      • Nombre string Requerido
      • privado booleano Requerido
      • from_secret booleano Requerido

        Si true, el valor es una referencia por nombre a un Secret.

    A zip file containing the App configuration file directory

  • 400

    Invalid request

  • 500

    Error pulling configuration

GET /groups/{groupId}/apps/{appId}/pull
curl \
 --request GET 'https://services.cloud.mongodb.com/api/admin/v3.0/groups/{groupId}/apps/{appId}/pull' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
Ejemplos de respuesta (200)
{
  "name": "string",
  "provider_region": "aws-us-east-1",
  "deployment_model": "GLOBAL",
  "environment": "production",
  "auth_providers": [
    {
      "name": "anon-user",
      "type": "anon-user",
      "disabled": true
    }
  ],
  "custom_user_data": {
    "database_name": "myapp",
    "collection_name": "users",
    "user_id_field": "user_account_id",
    "enabled": true,
    "mongo_service_name": "mongodb-atlas",
    "on_user_creation_function_name": "myFunction"
  },
  "data_api_config": {
    "disabled": true,
    "versions": [
      "v1"
    ],
    "return_type": "JSON",
    "create_user_on_auth": true,
    "run_as_user_id": "string",
    "run_as_user_id_script_source": "string",
    "validation_method": "NO_VALIDATION",
    "secret_name": "string",
    "can_evaluate": {}
  },
  "data_sources": [
    {
      "name": "string",
      "type": "string",
      "config": {
        "clusterName": "Cluster0",
        "readPreference": "primary",
        "readPreferenceTagSets": [
          "server1"
        ],
        "wireProtocolEnabled": true
      },
      "default_rule": {
        "roles": [
          {
            "document_filters": {
              "read": {},
              "write": {}
            },
            "name": "string",
            "apply_when": {},
            "read": {},
            "write": {},
            "insert": {},
            "delete": {},
            "search": {},
            "fields": {},
            "additional_fields": {
              "read": {},
              "write": {}
            }
          }
        ],
        "filters": [
          {
            "name": "string",
            "apply_when": {},
            "query": {},
            "projection": {
              "additionalProperty1": 0,
              "additionalProperty2": 0
            }
          }
        ]
      },
      "rules": [
        {
          "database": "string",
          "collection": "string",
          "roles": [
            {
              "document_filters": {
                "read": {},
                "write": {}
              },
              "name": "string",
              "apply_when": {},
              "read": {},
              "write": {},
              "insert": {},
              "delete": {},
              "search": {},
              "fields": {},
              "additional_fields": {
                "read": {},
                "write": {}
              }
            }
          ],
          "filters": [
            {
              "name": "string",
              "apply_when": {},
              "query": {},
              "projection": {
                "additionalProperty1": 0,
                "additionalProperty2": 0
              }
            }
          ]
        }
      ]
    }
  ],
  "endpoints": [
    {
      "route": "string",
      "http_method": "GET",
      "function_id": "string",
      "validation_method": "NO_VALIDATION",
      "secret_id": "string",
      "return_type": "JSON",
      "respond_result": true,
      "fetch_custom_user_data": true,
      "create_user_on_auth": true,
      "disabled": true,
      "function_name": "string"
    }
  ],
  "environments": {
    "values": {
      "none": {
        "values": {}
      },
      "development": {
        "values": {}
      },
      "testing": {
        "values": {}
      },
      "qa": {
        "values": {}
      },
      "production": {
        "values": {}
      }
    }
  },
  "functions": [
    {
      "can_evaluate": {},
      "name": "string",
      "private": true,
      "source": "string",
      "run_as_system": true,
      "run_as_user_id": "string",
      "run_as_user_id_script_source": "string"
    }
  ],
  "graphql": {
    "config": {
      "use_natural_pluralization": true,
      "disable_schema_introspection": true
    },
    "validation_settings": {
      "read_validation_action": "ERROR",
      "read_validation_level": "STRICT",
      "write_validation_action": "ERROR",
      "write_validation_level": "STRICT"
    },
    "custom_resolvers": [
      {
        "on_type": "string",
        "field_name": "string",
        "input_type": "string",
        "input_type_format": "scalar",
        "payload_type": "string",
        "payload_type_format": "scalar",
        "function_name": "string"
      }
    ]
  },
  "hosting": {
    "enabled": true,
    "custom_domain": "example.com",
    "default_error_path": "/404.html",
    "default_error_code": "404"
  },
  "https_endpoints": [
    {
      "name": "string",
      "type": "aws",
      "incoming_webhooks": [
        {
          "name": "string",
          "function_source": "string",
          "respond_result": true,
          "options": {
            "secret": "string",
            "secretAsQueryParam": true
          }
        }
      ],
      "version": 42
    }
  ],
  "log_forwarders": [
    {
      "name": "string",
      "disabled": true,
      "log_types": [
        "auth"
      ],
      "log_statuses": [
        "error"
      ],
      "policy": {
        "type": "single"
      },
      "action": {
        "type": "collection",
        "name": "string",
        "data_source": "string",
        "database": "string",
        "collection": "string"
      }
    }
  ],
  "schemas": [
    {
      "metadata": {
        "data_source": "string",
        "database": "string",
        "collection": "string"
      },
      "schema": {
        "bsonType": "object",
        "title": "string",
        "required": [
          "string"
        ],
        "properties": {
          "*": {}
        }
      },
      "relationships": {
        "additionalProperty1": {
          "ref": "string",
          "foreign_key": "string",
          "is_list": true
        },
        "additionalProperty2": {
          "ref": "string",
          "foreign_key": "string",
          "is_list": true
        }
      }
    }
  ],
  "services": [
    {
      "name": "string",
      "type": "aws",
      "incoming_webhooks": [
        {
          "name": "string",
          "function_source": "string",
          "respond_result": true,
          "options": {
            "secret": "string",
            "secretAsQueryParam": true
          }
        }
      ],
      "version": 42
    }
  ],
  "sync": {
    "state": "string",
    "database_name": "string",
    "queryable_fields_names": [
      "string"
    ],
    "indexed_queryable_fields_names": [
      "string"
    ],
    "collection_queryable_fields_names": {
      "additionalProperty1": {
        "additionalProperty1": "string",
        "additionalProperty2": "string"
      },
      "additionalProperty2": {
        "additionalProperty1": "string",
        "additionalProperty2": "string"
      }
    },
    "permissions": {},
    "last_disabled": "string",
    "client_max_offline_days": 42,
    "is_recovery_mode_disabled": true,
    "asymmetric_tables": [
      "string"
    ]
  },
  "triggers": [
    {
      "name": "onNewEmployee",
      "type": "DATABASE",
      "function_id": "5eea9ca4ca0e356e2c2a148a",
      "config": {
        "operation_types": [
          "INSERT"
        ],
        "database": "HR",
        "collection": "employees",
        "service_id": "5adeb649b8b998486770ae7c",
        "match": {},
        "project": {},
        "full_document": true
      },
      "event_processors": {
        "FUNCTION": {
          "config": {
            "function_id": "6841b8d3e71dc81bed89dbba",
            "function_name": "Atlas_Triggers_DatabaseInsert_1749137618"
          }
        }
      }
    }
  ],
  "values": [
    {
      "name": "string",
      "private": true,
      "from_secret": true
    }
  ]
}