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.

Managing Repositories URL
Get a repository object by ID GET /api/v2/lcm/repositories/{id}
Get a list of repositories GET /api/v2/lcm/repositories/
Create a repository POST /api/v2/lcm/repositories/
Update a repository PUT /api/v2/lcm/repositories/{id}
Delete a repository DELETE /api/v2/lcm/repositories/{id}

Managing Repositories

Repository
{
    "id": <value>,
    "name": <value>,
    "repo-key-url": <value>,
    "repo-url": <value>,
    "username": <value>,
    "password": <value>
    "use-proxy": <value>,
    "deb-dist": <value>,
    "deb-components": <value>,
    "manual-repository-setup": <value>,
    "comment": <value>
}
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 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’.
manual-repository-setup If set to true, LCM does not attempt to add any repositories to the target nodes. The only fields that are used if this value is true are id, name, and comment.
comment A generic field for user comments.
GET /api/v2/lcm/repositories/{id}

Gets a specific repository record by ID.

Path arguments:id – A Repository ID.

Returns a Repository object.

Example:

curl http://localhost:8888/api/v2/lcm/repositories/8aaf4048-4744-486e-9f96-22a51dcd12af

Output:

{
    "use-proxy": true,
    "created-on": "2016-06-15T17:53:38.568Z",
    "repo-key-url": null,
    "type": "repository",
    "related-resources": {
             "clusters": "http://localhost:8888/api/v2/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,
    "manual-repository-setup": false,
    "comment": "public repo for dse",
    "id": "00dada1f-b93e-4846-bf01-83ca4b6a3145",
    "href": "http://localhost:8888/api/v2/lcm/repositories/00dada1f-b93e-4846-bf01-83ca4b6a3145",
    "deb-dist": null,
    "created-by": "system",
    "username": "johndoe",
    "deb-components": null
}
GET /api/v2/lcm/repositories/

Gets a paginated list of all Repository records. See Paginated Results for an overview of the query string parameters that can be used.

Example:

curl http://localhost:8888/api/v2/lcm/repositories/

Output:

{
    "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/v2/lcm/repositories/00dada1f-b93e-4846-bf01-83ca4b6a3145/clusters/"
            },
            "modified-on": "2016-06-15T17:53:38.568Z",
            "name": "dse repo",
            "repo-url": null,
            "manual-repository-setup": false,
            "comment": "public repo for dse",
            "id": "00dada1f-b93e-4846-bf01-83ca4b6a3145",
            "href": "http://localhost:8888/api/v2/lcm/repositories/00dada1f-b93e-4846-bf01-83ca4b6a3145",
            "deb-dist": null,
            "username": "johndoe",
            "deb-components": null
        }
    ]
}
POST /api/v2/lcm/repositories/

Creates a new repository object.

Body:A Repository object (with no id property).

Returns the newly created Repository object.

Example:

Input:

{
    "use-proxy":true,
    "name":"dse repo",
    "username":"johndoe",
    "password":"foo"
}
curl -X POST -d '<example input>' http://localhost:8888/api/v2/lcm/repositories/

Output:

{
    "use-proxy": true,
    "created-on": "2016-06-15T17:53:38.568Z",
    "repo-key-url": null,
    "type": "repository",
    "related-resources": {"clusters": "http://localhost:8888/api/v2/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,
    "manual-repository-setup": false,
    "comment": "public repo for dse",
    "id": "00dada1f-b93e-4846-bf01-83ca4b6a3145",
    "href": "http://localhost:8888/api/v2/lcm/repositories/00dada1f-b93e-4846-bf01-83ca4b6a3145",
    "deb-dist": null,
    "created-by": "system",
    "username": "johndoe",
    "deb-components": null
}
PUT /api/v2/lcm/repositories/{id}

Updates an existing repository record by ID.

Path arguments:id – A Repository ID.

Returns the updated Repository object.

Example:

Input:

{
    "use-proxy":true,
    "name":"dse repo",
    "comment":"DataStax Repo",
    "id":"00dada1f-b93e-4846-bf01-83ca4b6a3145",
    "username":"johndoe",
    "password":"bar"
}
curl -X PUT -d '<example input>' \
     http://localhost:8888/api/v2/lcm/repositories/06663424-fba8-4f4c-96e3-260f90c7b020

Output:

{
    "use-proxy": true,
    "created-on": "2016-06-15T17:53:38.568Z",
    "repo-key-url": null,
    "type": "repository",
    "related-resources": {
             "clusters": "http://localhost:8888/api/v2/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,
    "manual-repository-setup": false,
    "comment": "DataStax Repo",
    "id": "00dada1f-b93e-4846-bf01-83ca4b6a3145",
    "href": "http://localhost:8888/api/v2/lcm/repositories/00dada1f-b93e-4846-bf01-83ca4b6a3145",
    "deb-dist": null, "
    created-by": "system",
    "username": "johndoe",
    "deb-components": null
}
DELETE /api/v2/lcm/repositories/{id}

Deletes an existing repository record by ID. This is subject to foreign key constraint violations.

Path arguments:id – A Repository ID.

Returns the IDs of the deleted objects.

Example:

curl -X DELETE http://localhost:8888/api/v2/lcm/repositories/c59b30dd-c956-4644-a0bb-8ff2bd8b9b41

Output:

{"deleted": {"repository": ["e3c9ef74-a1ee-4dcc-ad01-d09de0d65ce6"]}}