domains Package¶
models
Module¶
-
class
lemur.domains.models.
Domain
(**kwargs) Bases:
sqlalchemy.ext.declarative.api.Model
-
certificate
-
id
-
name
-
sensitive
-
service
Module¶
-
lemur.domains.service.
create
(name, sensitive) Create a new domain
- Parameters
name –
sensitive –
- Returns
-
lemur.domains.service.
get
(domain_id) Fetches one domain
- Parameters
domain_id –
- Returns
-
lemur.domains.service.
get_all
() Fetches all domains
- Returns
-
lemur.domains.service.
get_by_name
(name) Fetches domain by its name
- Parameters
name –
- Returns
-
lemur.domains.service.
is_domain_sensitive
(name) Return True if domain is marked sensitive
- Parameters
name –
- Returns
-
lemur.domains.service.
render
(args) Helper to parse REST Api requests
- Parameters
args –
- Returns
-
lemur.domains.service.
update
(domain_id, name, sensitive) Update an existing domain
- Parameters
domain_id –
name –
sensitive –
- Returns
views
Module¶
-
class
lemur.domains.views.
CertificateDomains
Bases:
lemur.auth.service.AuthenticatedResource
Defines the ‘domains’ endpoint
-
endpoint
= 'certificateDomains'
-
get
(certificate_id) -
GET
/certificates/1/domains
¶ The current domain list
Example request:
GET /domains HTTP/1.1 Host: example.com Accept: application/json, text/javascript
Example response:
HTTP/1.1 200 OK Vary: Accept Content-Type: text/javascript { "items": [ { "id": 1, "name": "www.example.com", "sensitive": false }, { "id": 2, "name": "www.example2.com", "sensitive": false } ] "total": 2 }
- Query Parameters
sortBy – field to sort on
sortDir – asc or desc
page – int default is 1
filter – key value pair format is k;v
count – count number default is 10
- Request Headers
Authorization – OAuth token to authenticate
- Status Codes
200 OK – no error
403 Forbidden – unauthenticated
-
-
mediatypes
()
-
methods
= {'GET'}
-
-
class
lemur.domains.views.
Domains
Bases:
lemur.auth.service.AuthenticatedResource
-
endpoint
= 'domain'
-
get
(domain_id) -
GET
/domains/1
¶ Fetch one domain
Example request:
GET /domains HTTP/1.1 Host: example.com Accept: application/json, text/javascript
Example response:
HTTP/1.1 200 OK Vary: Accept Content-Type: text/javascript { "id": 1, "name": "www.example.com", "sensitive": false }
- Request Headers
Authorization – OAuth token to authenticate
- Status Codes
200 OK – no error
403 Forbidden – unauthenticated
-
-
mediatypes
()
-
methods
= {'GET', 'PUT'}
-
put
(domain_id, data=None) -
GET
/domains/1
¶ update one domain
Example request:
GET /domains HTTP/1.1 Host: example.com Accept: application/json, text/javascript { "name": "www.example.com", "sensitive": false }
Example response:
HTTP/1.1 200 OK Vary: Accept Content-Type: text/javascript { "id": 1, "name": "www.example.com", "sensitive": false }
- Request Headers
Authorization – OAuth token to authenticate
- Status Codes
200 OK – no error
403 Forbidden – unauthenticated
-
-
-
class
lemur.domains.views.
DomainsList
Bases:
lemur.auth.service.AuthenticatedResource
Defines the ‘domains’ endpoint
-
endpoint
= 'domains'
-
get
() -
GET
/domains
¶ The current domain list
Example request:
GET /domains HTTP/1.1 Host: example.com Accept: application/json, text/javascript
Example response:
HTTP/1.1 200 OK Vary: Accept Content-Type: text/javascript { "items": [ { "id": 1, "name": "www.example.com", "sensitive": false }, { "id": 2, "name": "www.example2.com", "sensitive": false } ] "total": 2 }
- Query Parameters
sortBy – field to sort on
sortDir – asc or desc
page – int default is 1
filter – key value pair format is k;v
count – count number. default is 10
- Request Headers
Authorization – OAuth token to authenticate
- Status Codes
200 OK – no error
403 Forbidden – unauthenticated
-
-
mediatypes
()
-
methods
= {'GET', 'POST'}
-
post
(data=None) -
POST
/domains
¶ The current domain list
Example request:
GET /domains HTTP/1.1 Host: example.com Accept: application/json, text/javascript { "name": "www.example.com", "sensitive": false }
Example response:
HTTP/1.1 200 OK Vary: Accept Content-Type: text/javascript { "id": 1, "name": "www.example.com", "sensitive": false }
- Query Parameters
sortBy – field to sort on
sortDir – asc or desc
page – int default is 1
filter – key value pair format is k;v
count – count number default is 10
- Request Headers
Authorization – OAuth token to authenticate
- Status Codes
200 OK – no error
403 Forbidden – unauthenticated
-
-