pyfarm.master.api.pathmaps module

Path Maps

API endpoints for viewing and managing path maps

class pyfarm.master.api.pathmaps.PathMapIndexAPI[source]

Bases: flask.views.MethodView

get()[source]

A GET to this endpoint will return a list of all registered path maps, with id. It can be made with a for_agent query parameter, in which case it will return only those path maps that apply to that agent.

GET /api/v1/pathmaps/ HTTP/1.1

Request

GET /api/v1/pathmaps/ HTTP/1.1
Accept: application/json

Response

HTTP/1.1 200 OK
Content-Type: application/json

[
    {
        "id": 1,
        "path_osx": "/mnt/nfs",
        "path_windows": "\\domains\cifs_server",
        "path_linux": "/mnt/nfs"
    },
    {
        "id": 7,
        "path_osx": "/renderout",
        "path_windows": "c:\renderout",
        "path_linux": "/renderout"
        "tag": "usual",
    }
]
Statuscode 200:no error
methods = ['GET', 'POST']
post()[source]

A POST to this endpoint will create a new path map.

A path map will list the equivalent path prefixes for all three supported families of operating systems, Linux, Windows and OS X. A path map can optionally be restricted to one tag, in which case it will only apply to agents with that tag. If a tag is specified that does not exist yet, that tag will be transparently created.

POST /api/v1/pathmaps/ HTTP/1.1

Request

POST /api/v1/pathmaps/ HTTP/1.1
Accept: application/json

{
    "path_linux": "/mnt/nfs",
    "path_windows": "\domain\cifs_server",
    "path_osx": "/mnt/nfs",
    "tag": "production"
}

Response

HTTP/1.1 201 CREATED
Content-Type: application/json

{
    "id": 1,
    "path_linux": "/mnt/nfs",
    "path_windows": "\domain\cifs_server",
    "path_osx": "/mnt/nfs",
    "tag": "production"
}
Statuscode 201:a new pathmap was created
Statuscode 400:there was something wrong with the request (such as invalid columns being included)
class pyfarm.master.api.pathmaps.SinglePathMapAPI[source]

Bases: flask.views.MethodView

delete(pathmap_id)[source]

A DELETE to this endpoint will remove the specified pathmap

DELETE /api/v1/pathmaps/<int:pathmap_id> HTTP/1.1

Request

DELETE /api/v1/pathmaps/1 HTTP/1.1
Accept: application/json

Response

HTTP/1.1 204 NO_CONTENT
Statuscode 204:the path map was deleted or did not exist in the first place
get(pathmap_id)[source]

A GET to this endpoint will return a single path map specified by pathmap_id

GET /api/v1/pathmaps/<int:pathmap_id> HTTP/1.1

Request

GET /api/v1/pathmaps/1 HTTP/1.1
Accept: application/json

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "id": 1,
    "path_osx": "/mnt/nfs",
    "path_windows": "\\domains\cifs_server",
    "path_linux": "/mnt/nfs"
}
Statuscode 200:no error
methods = ['DELETE', 'GET', 'POST']
post(pathmap_id)[source]

A POST to this endpoint will update an existing path map with new values.

Only the values included in the request will be updated. The rest will be left unchanged. The id column cannot be changed. Including it in the request will lead to an error.

POST /api/v1/pathmaps/<int:pathmap_id> HTTP/1.1

Request

POST /api/v1/pathmaps/1 HTTP/1.1
Accept: application/json

{
    "path_linux": "/mnt/smb"
}

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "id": 1,
    "path_linux": "/mnt/smb",
    "path_windows": "\domain\cifs_server",
    "path_osx": "/mnt/nfs",
    "tag": "production"
}
Statuscode 200:the specified pathmap was updated
Statuscode 404:the specified pathmap does not exist
Statuscode 400:there was something wrong with the request (such as invalid columns being included)
pyfarm.master.api.pathmaps.schema()[source]

Returns the basic schema of Agent

GET /api/v1/pathmaps/schema HTTP/1.1

Request

GET /api/v1/pathmaps/schema HTTP/1.1
Accept: application/json

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "id": "INTEGER",
    "path_linux": "VARCHAR(512)",
    "path_windows": "VARCHAR(512)",
    "path_osx": "VARCHAR(512)",
    "tag": "VARCHAR(64)"
}
Statuscode 200:no error