poppy.model module

class poppy.model.service.Service(service_id, name, domains, origins, flavor_id, caching=[], restrictions=[], log_delivery=None, operator_status='enabled', project_id='')

Bases: poppy.model.common.DictSerializableModel

Service Class.

caching

Get or set caching.

domains

Get or set domains.

flavor_id

Get or set flavor ref.

classmethod init_from_dict(project_id, input_dict)

Construct a model instance from a dictionary.

This is only meant to be used for converting a response model into a model. When converting a model into a request model, use to_dict.

log_delivery

Get log_delivery.

name

Get or set name.

operator_status

Get operator status.

origins

Get or set origins.

project_id

Get project id.

provider_details

Get or set provider details.

restrictions

Get or set restrictions.

service_id

Get service id.

status

Get or set status.

:returns boolean

to_dict()

Construct a model instance from a dictionary.

This is only meant to be used for converting a response model into a model. When converting a model into a request model, use to_dict.

class poppy.model.helpers.domain.Domain(domain, protocol='http', certificate=None)

Bases: poppy.model.common.DictSerializableModel

certificate

certificate option.

:returns certificate

domain

domain.

:returns domain

classmethod init_from_dict(dict_obj)

Construct a model instance from a dictionary.

This serves as a 2nd constructor

Parameters:dict_obj – dictionary object

:returns o

protocol
to_dict()
class poppy.model.helpers.origin.Origin(origin, hostheadertype='domain', hostheadervalue='-', port=80, ssl=False, rules=[])

Bases: poppy.model.common.DictSerializableModel

Origin.

hostheadertype

hostheadertype.

hostheadervalue

hostheadervalue.

classmethod init_from_dict(dict_obj)

Construct a model instance from a dictionary.

This serves as a 2nd constructor

Parameters:dict_obj – dictionary object

:returns o

origin

origin.

port

port.

:returns port

rules

rules.

:returns rules

ssl

self.

:returns ssl

to_dict()
class poppy.model.helpers.cachingrule.CachingRule(name, ttl, rules=[])

Bases: poppy.model.common.DictSerializableModel

Parameters:DictSerializableModel
classmethod init_from_dict(dict_obj)

Construct a model instance from a dictionary.

This serves as a 2nd constructor

Parameters:dict_obj – dictionary object

:returns o

name

name.

:returns name

rules

rules.

:returns rules

to_dict()
ttl

ttl.

:returns ttl

class poppy.model.helpers.restriction.Restriction(name, access='whitelist', rules=[])

Bases: poppy.model.common.DictSerializableModel

Restriction.

access

name.

:returns name

classmethod init_from_dict(dict_obj)

Construct a model instance from a dictionary.

This serves as a 2nd constructor

Parameters:dict_obj – dictionary object

:returns o

name

name.

:returns name

rules

rules.

:returns rules

to_dict()
class poppy.model.helpers.rule.Rule(name=None, referrer=None, http_host=None, client_ip=None, geography=None, http_method=None, request_url='/*')

Bases: poppy.model.common.DictSerializableModel

Rule.

client_ip
geography

http_host.

http_host

http_host.

http_method
name

name.

referrer
request_url