.. _lcm-repository: Repository ========== Repositories contain the Debian or RPM packages that LCM uses to install DSE. DataStax public repos can be used, or you can setup your own package repositories. .. container:: api-toc ============================== ==================================== :ref:`managing-repositories` URL ============================== ==================================== Get a repository object by ID :http:method:`get-repository-object` Get a list of repositories :http:method:`get-repository-list` Create a repository :http:method:`post-repository-object` Update a repository :http:method:`put-repository-object` Delete a repository :http:method:`delete-repository-object` ============================== ==================================== .. _managing-repositories: Managing Repositories --------------------- .. http:response:: Repository .. code-block:: js { "id": , "name": , "repo-key-url": , "repo-url": , "username": , "password": "use-proxy": , "deb-dist": , "deb-components": , "comment": } ================================== =================================================== Property Description of Values ================================== =================================================== id A UUID for the Repository. name A user-defined name for the Repository. Required. repo-key-url The URL to the repository key for verifying package signatures. Defaults to DataStax repo if null. repo-url The URL to the package repository. Defaults to DataStax repo if null. username The username for basic auth credentials (if required by the repo). password The password for basic auth credentials. use-proxy A boolean flag indicating whether to use the http proxy (set in the :ref:`lcm-config-profile`). deb-dist Specifies the Debian distribution part of the Apt configuration line. Defaults to 'stable'. For Apt repositories only. deb-components A comma-separated string of the Debian components part of the Apt configuration line. Defaults to 'main'. comment A generic field for user comments. ================================== =================================================== .. http:method:: GET /api/v1/lcm/repositories/{id} :label-name: get-repository-object :title: GET /api/v1/lcm/repositories/{id} Get a specific repository record by ID. :arg id: A :http:response:`repository` ID. Returns a :http:response:`repository` object. **Example**: .. code-block:: bash curl http://localhost:8888/api/v1/lcm/repositories/8aaf4048-4744-486e-9f96-22a51dcd12af Output: .. code-block:: js { "use-proxy": true, "created-on": "2016-06-15T17:53:38.568Z", "repo-key-url": null, "type": "repository", "related-resources": { "clusters": "http://localhost:8888/api/v1/lcm/repositories/00dada1f-b93e-4846-bf01-83ca4b6a3145/clusters/" }, "modified-by": "system", "modified-on": "2016-06-15T17:53:38.568Z", "name": "dse repo", "repo-url": null, "comment": "public repo for dse", "id": "00dada1f-b93e-4846-bf01-83ca4b6a3145", "href": "http://localhost:8888/api/v1/lcm/repositories/00dada1f-b93e-4846-bf01-83ca4b6a3145", "deb-dist": null, "created-by": "system", "username": "johndoe", "deb-components": null } .. http:method:: GET /api/v1/lcm/repositories/ :label-name: get-repository-list :title: GET /api/v1/lcm/repositories/ Gets a paginated list of all :http:response:`repository` records. See :ref:`lcm-pagination` for an overview of the query string parameters that can be used. **Example**: .. code-block:: bash curl http://localhost:8888/api/v1/lcm/repositories/ Output: .. code-block:: js { "next": null, "previous": null, "last": 1, "count": 1, "per-page": 50, "current": 1, "results": [ { "use-proxy": true, "created-on": "2016-06-15T17:53:38.568Z", "repo-key-url": null, "type": "repository", "related-resources": { "clusters": "http://localhost:8888/api/v1/lcm/repositories/00dada1f-b93e-4846-bf01-83ca4b6a3145/clusters/" }, "modified-on": "2016-06-15T17:53:38.568Z", "name": "dse repo", "repo-url": null, "comment": "public repo for dse", "id": "00dada1f-b93e-4846-bf01-83ca4b6a3145", "href": "http://localhost:8888/api/v1/lcm/repositories/00dada1f-b93e-4846-bf01-83ca4b6a3145", "deb-dist": null, "username": "johndoe", "deb-components": null } ] } .. http:method:: POST /api/v1/lcm/repositories/ :label-name: post-repository-object :title: POST /api/v1/lcm/repositories/ Create a new repository object. :body: A :http:response:`repository` object (with no ``id`` property). Returns the newly created :http:response:`repository` object. **Example**: Input: .. code-block:: js { "use-proxy":true, "name":"dse repo", "username":"johndoe", "password":"foo" } .. code-block:: bash curl -X POST -d '' http://localhost:8888/api/v1/lcm/repositories/ Output: .. code-block:: js { "use-proxy": true, "created-on": "2016-06-15T17:53:38.568Z", "repo-key-url": null, "type": "repository", "related-resources": {"clusters": "http://localhost:8888/api/v1/lcm/repositories/00dada1f-b93e-4846-bf01-83ca4b6a3145/clusters/"}, "modified-by": "system", "modified-on": "2016-06-15T17:53:38.568Z", "name": "dse repo", "repo-url": null, "comment": "public repo for dse", "id": "00dada1f-b93e-4846-bf01-83ca4b6a3145", "href": "http://localhost:8888/api/v1/lcm/repositories/00dada1f-b93e-4846-bf01-83ca4b6a3145", "deb-dist": null, "created-by": "system", "username": "johndoe", "deb-components": null } .. http:method:: PUT /api/v1/lcm/repositories/{id} :label-name: put-repository-object :title: PUT /api/v1/lcm/repositories/{id} Update an existing repository record by ID. :arg id: A :http:response:`repository` ID. Returns the updated :http:response:`repository` object. **Example**: Input: .. code-block:: js { "use-proxy":true, "name":"dse repo", "comment":"DataStax Repo", "id":"00dada1f-b93e-4846-bf01-83ca4b6a3145", "username":"johndoe", "password":"bar" } .. code-block:: bash curl -X PUT -d '' \ http://localhost:8888/api/v1/lcm/repositories/06663424-fba8-4f4c-96e3-260f90c7b020 Output: .. code-block:: js { "use-proxy": true, "created-on": "2016-06-15T17:53:38.568Z", "repo-key-url": null, "type": "repository", "related-resources": { "clusters": "http://localhost:8888/api/v1/lcm/repositories/00dada1f-b93e-4846-bf01-83ca4b6a3145/clusters/" }, "modified-by": "system", "modified-on": "2016-06-15T19:29:20.750Z", "name": "dse repo", "repo-url": null, "comment": "DataStax Repo", "id": "00dada1f-b93e-4846-bf01-83ca4b6a3145", "href": "http://localhost:8888/api/v1/lcm/repositories/00dada1f-b93e-4846-bf01-83ca4b6a3145", "deb-dist": null, " created-by": "system", "username": "johndoe", "deb-components": null } .. http:method:: DELETE /api/v1/lcm/repositories/{id} :label-name: delete-repository-object :title: DELETE /api/v1/lcm/repositories/{id} Delete an existing repository record by ID. This is subject to foreign key constraint violations. :arg id: A :http:response:`repository` ID. Returns the IDs of the deleted objects. **Example**: .. code-block:: bash curl -X DELETE http://localhost:8888/api/v1/lcm/repositories/c59b30dd-c956-4644-a0bb-8ff2bd8b9b41 Output: .. code-block:: js {"deleted": {"repository": ["e3c9ef74-a1ee-4dcc-ad01-d09de0d65ce6"]}}