repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_documentation_string stringlengths 1 47.2k | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|
croach/Flask-Fixtures | flask_fixtures/utils.py | print_msg | def print_msg(msg, header, file=sys.stdout):
"""Prints a boardered message to the screen"""
DEFAULT_MSG_BLOCK_WIDTH = 60
# Calculate the length of the boarder on each side of the header and the
# total length of the bottom boarder
side_boarder_length = (DEFAULT_MSG_BLOCK_WIDTH - (len(header) + 2)) ... | python | def print_msg(msg, header, file=sys.stdout):
"""Prints a boardered message to the screen"""
DEFAULT_MSG_BLOCK_WIDTH = 60
# Calculate the length of the boarder on each side of the header and the
# total length of the bottom boarder
side_boarder_length = (DEFAULT_MSG_BLOCK_WIDTH - (len(header) + 2)) ... | Prints a boardered message to the screen | https://github.com/croach/Flask-Fixtures/blob/b34597d165b33cc47cdd632ac0f3cf8a07428675/flask_fixtures/utils.py#L20-L60 |
croach/Flask-Fixtures | flask_fixtures/utils.py | can_persist_fixtures | def can_persist_fixtures():
"""Returns True if it's possible to persist fixtures across tests.
Flask-Fixtures uses the setUpClass and tearDownClass methods to persist
fixtures across tests. These methods were added to unittest.TestCase in
python 2.7. So, we can only persist fixtures when using python 2... | python | def can_persist_fixtures():
"""Returns True if it's possible to persist fixtures across tests.
Flask-Fixtures uses the setUpClass and tearDownClass methods to persist
fixtures across tests. These methods were added to unittest.TestCase in
python 2.7. So, we can only persist fixtures when using python 2... | Returns True if it's possible to persist fixtures across tests.
Flask-Fixtures uses the setUpClass and tearDownClass methods to persist
fixtures across tests. These methods were added to unittest.TestCase in
python 2.7. So, we can only persist fixtures when using python 2.7.
However, the nose and py.te... | https://github.com/croach/Flask-Fixtures/blob/b34597d165b33cc47cdd632ac0f3cf8a07428675/flask_fixtures/utils.py#L65-L84 |
shichao-an/twitter-photos | twphotos/photos.py | TwitterPhotos.get | def get(self, count=None, since_id=None, silent=False):
"""
Get all photos from the user or members of the list
:param count: Number of tweets to try and retrieve. If None, return
all photos since `since_id`
:param since_id: An integer specifying the oldest tweet id
"... | python | def get(self, count=None, since_id=None, silent=False):
"""
Get all photos from the user or members of the list
:param count: Number of tweets to try and retrieve. If None, return
all photos since `since_id`
:param since_id: An integer specifying the oldest tweet id
"... | Get all photos from the user or members of the list
:param count: Number of tweets to try and retrieve. If None, return
all photos since `since_id`
:param since_id: An integer specifying the oldest tweet id | https://github.com/shichao-an/twitter-photos/blob/32de6e8805edcbb431d08af861e9d2f0ab221106/twphotos/photos.py#L62-L84 |
shichao-an/twitter-photos | twphotos/increment.py | read_since_ids | def read_since_ids(users):
"""
Read max ids of the last downloads
:param users: A list of users
Return a dictionary mapping users to ids
"""
since_ids = {}
for user in users:
if config.has_option(SECTIONS['INCREMENTS'], user):
since_ids[user] = config.getint(SECTIONS['I... | python | def read_since_ids(users):
"""
Read max ids of the last downloads
:param users: A list of users
Return a dictionary mapping users to ids
"""
since_ids = {}
for user in users:
if config.has_option(SECTIONS['INCREMENTS'], user):
since_ids[user] = config.getint(SECTIONS['I... | Read max ids of the last downloads
:param users: A list of users
Return a dictionary mapping users to ids | https://github.com/shichao-an/twitter-photos/blob/32de6e8805edcbb431d08af861e9d2f0ab221106/twphotos/increment.py#L19-L31 |
shichao-an/twitter-photos | twphotos/increment.py | set_max_ids | def set_max_ids(max_ids):
"""
Set max ids of the current downloads
:param max_ids: A dictionary mapping users to ids
"""
config.read(CONFIG)
for user, max_id in max_ids.items():
config.set(SECTIONS['INCREMENTS'], user, str(max_id))
with open(CONFIG, 'w') as f:
config.write(f... | python | def set_max_ids(max_ids):
"""
Set max ids of the current downloads
:param max_ids: A dictionary mapping users to ids
"""
config.read(CONFIG)
for user, max_id in max_ids.items():
config.set(SECTIONS['INCREMENTS'], user, str(max_id))
with open(CONFIG, 'w') as f:
config.write(f... | Set max ids of the current downloads
:param max_ids: A dictionary mapping users to ids | https://github.com/shichao-an/twitter-photos/blob/32de6e8805edcbb431d08af861e9d2f0ab221106/twphotos/increment.py#L34-L44 |
davedoesdev/dxf | dxf/__init__.py | hash_bytes | def hash_bytes(buf):
"""
Hash bytes using the same method the registry uses (currently SHA-256).
:param buf: Bytes to hash
:type buf: binary str
:rtype: str
:returns: Hex-encoded hash of file's content (prefixed by ``sha256:``)
"""
sha256 = hashlib.sha256()
sha256.update(buf)
r... | python | def hash_bytes(buf):
"""
Hash bytes using the same method the registry uses (currently SHA-256).
:param buf: Bytes to hash
:type buf: binary str
:rtype: str
:returns: Hex-encoded hash of file's content (prefixed by ``sha256:``)
"""
sha256 = hashlib.sha256()
sha256.update(buf)
r... | Hash bytes using the same method the registry uses (currently SHA-256).
:param buf: Bytes to hash
:type buf: binary str
:rtype: str
:returns: Hex-encoded hash of file's content (prefixed by ``sha256:``) | https://github.com/davedoesdev/dxf/blob/63fad55e0f0086e5f6d3511670db1ef23b5298f6/dxf/__init__.py#L43-L55 |
davedoesdev/dxf | dxf/__init__.py | hash_file | def hash_file(filename):
"""
Hash a file using the same method the registry uses (currently SHA-256).
:param filename: Name of file to hash
:type filename: str
:rtype: str
:returns: Hex-encoded hash of file's content (prefixed by ``sha256:``)
"""
sha256 = hashlib.sha256()
with open... | python | def hash_file(filename):
"""
Hash a file using the same method the registry uses (currently SHA-256).
:param filename: Name of file to hash
:type filename: str
:rtype: str
:returns: Hex-encoded hash of file's content (prefixed by ``sha256:``)
"""
sha256 = hashlib.sha256()
with open... | Hash a file using the same method the registry uses (currently SHA-256).
:param filename: Name of file to hash
:type filename: str
:rtype: str
:returns: Hex-encoded hash of file's content (prefixed by ``sha256:``) | https://github.com/davedoesdev/dxf/blob/63fad55e0f0086e5f6d3511670db1ef23b5298f6/dxf/__init__.py#L57-L71 |
davedoesdev/dxf | dxf/__init__.py | DXFBase.authenticate | def authenticate(self,
username=None, password=None,
actions=None, response=None,
authorization=None):
# pylint: disable=too-many-arguments,too-many-locals
"""
Authenticate to the registry using a username and password,
an au... | python | def authenticate(self,
username=None, password=None,
actions=None, response=None,
authorization=None):
# pylint: disable=too-many-arguments,too-many-locals
"""
Authenticate to the registry using a username and password,
an au... | Authenticate to the registry using a username and password,
an authorization header or otherwise as the anonymous user.
:param username: User name to authenticate as.
:type username: str
:param password: User's password.
:type password: str
:param actions: If you know ... | https://github.com/davedoesdev/dxf/blob/63fad55e0f0086e5f6d3511670db1ef23b5298f6/dxf/__init__.py#L228-L312 |
davedoesdev/dxf | dxf/__init__.py | DXFBase.list_repos | def list_repos(self, batch_size=None, iterate=False):
"""
List all repositories in the registry.
:param batch_size: Number of repository names to ask the server for at a time.
:type batch_size: int
:param iterate: Whether to return iterator over the names or a list of all the n... | python | def list_repos(self, batch_size=None, iterate=False):
"""
List all repositories in the registry.
:param batch_size: Number of repository names to ask the server for at a time.
:type batch_size: int
:param iterate: Whether to return iterator over the names or a list of all the n... | List all repositories in the registry.
:param batch_size: Number of repository names to ask the server for at a time.
:type batch_size: int
:param iterate: Whether to return iterator over the names or a list of all the names.
:type iterate: bool
:rtype: list or iterator of str... | https://github.com/davedoesdev/dxf/blob/63fad55e0f0086e5f6d3511670db1ef23b5298f6/dxf/__init__.py#L314-L330 |
davedoesdev/dxf | dxf/__init__.py | DXF.push_blob | def push_blob(self,
filename=None,
progress=None,
data=None, digest=None,
check_exists=True):
# pylint: disable=too-many-arguments
"""
Upload a file to the registry and return its (SHA-256) hash.
The registry is con... | python | def push_blob(self,
filename=None,
progress=None,
data=None, digest=None,
check_exists=True):
# pylint: disable=too-many-arguments
"""
Upload a file to the registry and return its (SHA-256) hash.
The registry is con... | Upload a file to the registry and return its (SHA-256) hash.
The registry is content-addressable so the file's content (aka blob)
can be retrieved later by passing the hash to :meth:`pull_blob`.
:param filename: File to upload.
:type filename: str
:param data: Data to upload i... | https://github.com/davedoesdev/dxf/blob/63fad55e0f0086e5f6d3511670db1ef23b5298f6/dxf/__init__.py#L378-L435 |
davedoesdev/dxf | dxf/__init__.py | DXF.pull_blob | def pull_blob(self, digest, size=False, chunk_size=None):
"""
Download a blob from the registry given the hash of its content.
:param digest: Hash of the blob's content (prefixed by ``sha256:``).
:type digest: str
:param size: Whether to return the size of the blob too.
... | python | def pull_blob(self, digest, size=False, chunk_size=None):
"""
Download a blob from the registry given the hash of its content.
:param digest: Hash of the blob's content (prefixed by ``sha256:``).
:type digest: str
:param size: Whether to return the size of the blob too.
... | Download a blob from the registry given the hash of its content.
:param digest: Hash of the blob's content (prefixed by ``sha256:``).
:type digest: str
:param size: Whether to return the size of the blob too.
:type size: bool
:param chunk_size: Number of bytes to download at a... | https://github.com/davedoesdev/dxf/blob/63fad55e0f0086e5f6d3511670db1ef23b5298f6/dxf/__init__.py#L438-L467 |
davedoesdev/dxf | dxf/__init__.py | DXF.blob_size | def blob_size(self, digest):
"""
Return the size of a blob in the registry given the hash of its content.
:param digest: Hash of the blob's content (prefixed by ``sha256:``).
:type digest: str
:rtype: long
:returns: Whether the blob exists.
"""
r = self.... | python | def blob_size(self, digest):
"""
Return the size of a blob in the registry given the hash of its content.
:param digest: Hash of the blob's content (prefixed by ``sha256:``).
:type digest: str
:rtype: long
:returns: Whether the blob exists.
"""
r = self.... | Return the size of a blob in the registry given the hash of its content.
:param digest: Hash of the blob's content (prefixed by ``sha256:``).
:type digest: str
:rtype: long
:returns: Whether the blob exists. | https://github.com/davedoesdev/dxf/blob/63fad55e0f0086e5f6d3511670db1ef23b5298f6/dxf/__init__.py#L469-L480 |
davedoesdev/dxf | dxf/__init__.py | DXF.set_manifest | def set_manifest(self, alias, manifest_json):
"""
Give a name (alias) to a manifest.
:param alias: Alias name
:type alias: str
:param manifest_json: A V2 Schema 2 manifest JSON string
:type digests: list
"""
self._request('put',
'ma... | python | def set_manifest(self, alias, manifest_json):
"""
Give a name (alias) to a manifest.
:param alias: Alias name
:type alias: str
:param manifest_json: A V2 Schema 2 manifest JSON string
:type digests: list
"""
self._request('put',
'ma... | Give a name (alias) to a manifest.
:param alias: Alias name
:type alias: str
:param manifest_json: A V2 Schema 2 manifest JSON string
:type digests: list | https://github.com/davedoesdev/dxf/blob/63fad55e0f0086e5f6d3511670db1ef23b5298f6/dxf/__init__.py#L512-L525 |
davedoesdev/dxf | dxf/__init__.py | DXF.set_alias | def set_alias(self, alias, *digests):
# pylint: disable=too-many-locals
"""
Give a name (alias) to a set of blobs. Each blob is specified by
the hash of its content.
:param alias: Alias name
:type alias: str
:param digests: List of blob hashes (prefixed by ``sha... | python | def set_alias(self, alias, *digests):
# pylint: disable=too-many-locals
"""
Give a name (alias) to a set of blobs. Each blob is specified by
the hash of its content.
:param alias: Alias name
:type alias: str
:param digests: List of blob hashes (prefixed by ``sha... | Give a name (alias) to a set of blobs. Each blob is specified by
the hash of its content.
:param alias: Alias name
:type alias: str
:param digests: List of blob hashes (prefixed by ``sha256:``).
:type digests: list of strings
:rtype: str
:returns: The registry ... | https://github.com/davedoesdev/dxf/blob/63fad55e0f0086e5f6d3511670db1ef23b5298f6/dxf/__init__.py#L527-L553 |
davedoesdev/dxf | dxf/__init__.py | DXF.get_manifest_and_response | def get_manifest_and_response(self, alias):
"""
Request the manifest for an alias and return the manifest and the
response.
:param alias: Alias name.
:type alias: str
:rtype: tuple
:returns: Tuple containing the manifest as a string (JSON) and the `requests.Resp... | python | def get_manifest_and_response(self, alias):
"""
Request the manifest for an alias and return the manifest and the
response.
:param alias: Alias name.
:type alias: str
:rtype: tuple
:returns: Tuple containing the manifest as a string (JSON) and the `requests.Resp... | Request the manifest for an alias and return the manifest and the
response.
:param alias: Alias name.
:type alias: str
:rtype: tuple
:returns: Tuple containing the manifest as a string (JSON) and the `requests.Response <http://docs.python-requests.org/en/master/api/#requests.Re... | https://github.com/davedoesdev/dxf/blob/63fad55e0f0086e5f6d3511670db1ef23b5298f6/dxf/__init__.py#L555-L570 |
davedoesdev/dxf | dxf/__init__.py | DXF.get_alias | def get_alias(self,
alias=None,
manifest=None,
verify=True,
sizes=False,
dcd=None):
# pylint: disable=too-many-arguments
"""
Get the blob hashes assigned to an alias.
:param alias: Alias name. You ... | python | def get_alias(self,
alias=None,
manifest=None,
verify=True,
sizes=False,
dcd=None):
# pylint: disable=too-many-arguments
"""
Get the blob hashes assigned to an alias.
:param alias: Alias name. You ... | Get the blob hashes assigned to an alias.
:param alias: Alias name. You almost definitely will only need to pass this argument.
:type alias: str
:param manifest: If you previously obtained a manifest, specify it here instead of ``alias``. You almost definitely won't need to do this.
:t... | https://github.com/davedoesdev/dxf/blob/63fad55e0f0086e5f6d3511670db1ef23b5298f6/dxf/__init__.py#L630-L658 |
davedoesdev/dxf | dxf/__init__.py | DXF.get_digest | def get_digest(self,
alias=None,
manifest=None,
verify=True,
dcd=None):
"""
(v2 schema only) Get the hash of an alias's configuration blob.
For an alias created using ``dxf``, this is the hash of the first blob
... | python | def get_digest(self,
alias=None,
manifest=None,
verify=True,
dcd=None):
"""
(v2 schema only) Get the hash of an alias's configuration blob.
For an alias created using ``dxf``, this is the hash of the first blob
... | (v2 schema only) Get the hash of an alias's configuration blob.
For an alias created using ``dxf``, this is the hash of the first blob
assigned to the alias.
For a Docker image tag, this is the same as
``docker inspect alias --format='{{.Id}}'``.
:param alias: Alias name. You ... | https://github.com/davedoesdev/dxf/blob/63fad55e0f0086e5f6d3511670db1ef23b5298f6/dxf/__init__.py#L660-L689 |
davedoesdev/dxf | dxf/__init__.py | DXF._get_dcd | def _get_dcd(self, alias):
"""
Get the Docker-Content-Digest header for an alias.
:param alias: Alias name.
:type alias: str
:rtype: str
:returns: DCD header for the alias.
"""
# https://docs.docker.com/registry/spec/api/#deleting-an-image
# Note... | python | def _get_dcd(self, alias):
"""
Get the Docker-Content-Digest header for an alias.
:param alias: Alias name.
:type alias: str
:rtype: str
:returns: DCD header for the alias.
"""
# https://docs.docker.com/registry/spec/api/#deleting-an-image
# Note... | Get the Docker-Content-Digest header for an alias.
:param alias: Alias name.
:type alias: str
:rtype: str
:returns: DCD header for the alias. | https://github.com/davedoesdev/dxf/blob/63fad55e0f0086e5f6d3511670db1ef23b5298f6/dxf/__init__.py#L691-L710 |
davedoesdev/dxf | dxf/__init__.py | DXF.del_alias | def del_alias(self, alias):
"""
Delete an alias from the registry. The blobs it points to won't be deleted. Use :meth:`del_blob` for that.
.. Note::
On private registry, garbage collection might need to be run manually; see:
https://docs.docker.com/registry/garbage-collect... | python | def del_alias(self, alias):
"""
Delete an alias from the registry. The blobs it points to won't be deleted. Use :meth:`del_blob` for that.
.. Note::
On private registry, garbage collection might need to be run manually; see:
https://docs.docker.com/registry/garbage-collect... | Delete an alias from the registry. The blobs it points to won't be deleted. Use :meth:`del_blob` for that.
.. Note::
On private registry, garbage collection might need to be run manually; see:
https://docs.docker.com/registry/garbage-collection/
:param alias: Alias name.
... | https://github.com/davedoesdev/dxf/blob/63fad55e0f0086e5f6d3511670db1ef23b5298f6/dxf/__init__.py#L712-L729 |
davedoesdev/dxf | dxf/__init__.py | DXF.from_base | def from_base(cls, base, repo):
"""
Create a :class:`DXF` object which uses the same host, settings and
session as an existing :class:`DXFBase` object.
:param base: Existing :class:`DXFBase` object.
:type base: :class:`DXFBase`
:param repo: Name of the repository to acc... | python | def from_base(cls, base, repo):
"""
Create a :class:`DXF` object which uses the same host, settings and
session as an existing :class:`DXFBase` object.
:param base: Existing :class:`DXFBase` object.
:type base: :class:`DXFBase`
:param repo: Name of the repository to acc... | Create a :class:`DXF` object which uses the same host, settings and
session as an existing :class:`DXFBase` object.
:param base: Existing :class:`DXFBase` object.
:type base: :class:`DXFBase`
:param repo: Name of the repository to access on the registry. Typically this is of the form `... | https://github.com/davedoesdev/dxf/blob/63fad55e0f0086e5f6d3511670db1ef23b5298f6/dxf/__init__.py#L760-L779 |
shinichi-takii/ddlparse | ddlparse/ddlparse.py | DdlParseTableColumnBase.get_name | def get_name(self, name_case=DdlParseBase.NAME_CASE.original):
"""
Get Name converted case
:param name_case: name case type
* DdlParse.NAME_CASE.original : Return to no convert
* DdlParse.NAME_CASE.lower : Return to lower
* DdlParse.NAME_CASE.upper : Return t... | python | def get_name(self, name_case=DdlParseBase.NAME_CASE.original):
"""
Get Name converted case
:param name_case: name case type
* DdlParse.NAME_CASE.original : Return to no convert
* DdlParse.NAME_CASE.lower : Return to lower
* DdlParse.NAME_CASE.upper : Return t... | Get Name converted case
:param name_case: name case type
* DdlParse.NAME_CASE.original : Return to no convert
* DdlParse.NAME_CASE.lower : Return to lower
* DdlParse.NAME_CASE.upper : Return to upper
:return: name | https://github.com/shinichi-takii/ddlparse/blob/7328656ee807d14960999a98ace8cd76f0fe3ff8/ddlparse/ddlparse.py#L55-L71 |
shinichi-takii/ddlparse | ddlparse/ddlparse.py | DdlParseColumn.constraint | def constraint(self):
"""Constraint string"""
constraint_arr = []
if self._not_null:
constraint_arr.append("PRIMARY KEY" if self._pk else "NOT NULL")
if self._unique:
constraint_arr.append("UNIQUE")
return " ".join(constraint_arr) | python | def constraint(self):
"""Constraint string"""
constraint_arr = []
if self._not_null:
constraint_arr.append("PRIMARY KEY" if self._pk else "NOT NULL")
if self._unique:
constraint_arr.append("UNIQUE")
return " ".join(constraint_arr) | Constraint string | https://github.com/shinichi-takii/ddlparse/blob/7328656ee807d14960999a98ace8cd76f0fe3ff8/ddlparse/ddlparse.py#L125-L133 |
shinichi-takii/ddlparse | ddlparse/ddlparse.py | DdlParseColumn.bigquery_data_type | def bigquery_data_type(self):
"""Get BigQuery Legacy SQL data type"""
# BigQuery data type = {source_database: [data type, ...], ...}
BQ_DATA_TYPE_DIC = OrderedDict()
BQ_DATA_TYPE_DIC["STRING"] = {None: [re.compile(r"(CHAR|TEXT|CLOB|JSON|UUID)")]}
BQ_DATA_TYPE_DIC["INTEGER"] = {... | python | def bigquery_data_type(self):
"""Get BigQuery Legacy SQL data type"""
# BigQuery data type = {source_database: [data type, ...], ...}
BQ_DATA_TYPE_DIC = OrderedDict()
BQ_DATA_TYPE_DIC["STRING"] = {None: [re.compile(r"(CHAR|TEXT|CLOB|JSON|UUID)")]}
BQ_DATA_TYPE_DIC["INTEGER"] = {... | Get BigQuery Legacy SQL data type | https://github.com/shinichi-takii/ddlparse/blob/7328656ee807d14960999a98ace8cd76f0fe3ff8/ddlparse/ddlparse.py#L173-L216 |
shinichi-takii/ddlparse | ddlparse/ddlparse.py | DdlParseColumn.to_bigquery_field | def to_bigquery_field(self, name_case=DdlParseBase.NAME_CASE.original):
"""Generate BigQuery JSON field define"""
col_name = self.get_name(name_case)
mode = self.bigquery_mode
if self.array_dimensional <= 1:
# no or one dimensional array data type
type = self.bi... | python | def to_bigquery_field(self, name_case=DdlParseBase.NAME_CASE.original):
"""Generate BigQuery JSON field define"""
col_name = self.get_name(name_case)
mode = self.bigquery_mode
if self.array_dimensional <= 1:
# no or one dimensional array data type
type = self.bi... | Generate BigQuery JSON field define | https://github.com/shinichi-takii/ddlparse/blob/7328656ee807d14960999a98ace8cd76f0fe3ff8/ddlparse/ddlparse.py#L250-L284 |
shinichi-takii/ddlparse | ddlparse/ddlparse.py | DdlParseColumnDict.to_bigquery_fields | def to_bigquery_fields(self, name_case=DdlParseBase.NAME_CASE.original):
"""
Generate BigQuery JSON fields define
:param name_case: name case type
* DdlParse.NAME_CASE.original : Return to no convert
* DdlParse.NAME_CASE.lower : Return to lower
* DdlParse.NAM... | python | def to_bigquery_fields(self, name_case=DdlParseBase.NAME_CASE.original):
"""
Generate BigQuery JSON fields define
:param name_case: name case type
* DdlParse.NAME_CASE.original : Return to no convert
* DdlParse.NAME_CASE.lower : Return to lower
* DdlParse.NAM... | Generate BigQuery JSON fields define
:param name_case: name case type
* DdlParse.NAME_CASE.original : Return to no convert
* DdlParse.NAME_CASE.lower : Return to lower
* DdlParse.NAME_CASE.upper : Return to upper
:return: BigQuery JSON fields define | https://github.com/shinichi-takii/ddlparse/blob/7328656ee807d14960999a98ace8cd76f0fe3ff8/ddlparse/ddlparse.py#L314-L331 |
shinichi-takii/ddlparse | ddlparse/ddlparse.py | DdlParseTable.to_bigquery_fields | def to_bigquery_fields(self, name_case=DdlParseBase.NAME_CASE.original):
"""
Generate BigQuery JSON fields define
:param name_case: name case type
* DdlParse.NAME_CASE.original : Return to no convert
* DdlParse.NAME_CASE.lower : Return to lower
* DdlParse.NAM... | python | def to_bigquery_fields(self, name_case=DdlParseBase.NAME_CASE.original):
"""
Generate BigQuery JSON fields define
:param name_case: name case type
* DdlParse.NAME_CASE.original : Return to no convert
* DdlParse.NAME_CASE.lower : Return to lower
* DdlParse.NAM... | Generate BigQuery JSON fields define
:param name_case: name case type
* DdlParse.NAME_CASE.original : Return to no convert
* DdlParse.NAME_CASE.lower : Return to lower
* DdlParse.NAME_CASE.upper : Return to upper
:return: BigQuery JSON fields define | https://github.com/shinichi-takii/ddlparse/blob/7328656ee807d14960999a98ace8cd76f0fe3ff8/ddlparse/ddlparse.py#L379-L391 |
shinichi-takii/ddlparse | ddlparse/ddlparse.py | DdlParseTable.to_bigquery_ddl | def to_bigquery_ddl(self, name_case=DdlParseBase.NAME_CASE.original):
"""
Generate BigQuery CREATE TABLE statements
:param name_case: name case type
* DdlParse.NAME_CASE.original : Return to no convert
* DdlParse.NAME_CASE.lower : Return to lower
* DdlParse.N... | python | def to_bigquery_ddl(self, name_case=DdlParseBase.NAME_CASE.original):
"""
Generate BigQuery CREATE TABLE statements
:param name_case: name case type
* DdlParse.NAME_CASE.original : Return to no convert
* DdlParse.NAME_CASE.lower : Return to lower
* DdlParse.N... | Generate BigQuery CREATE TABLE statements
:param name_case: name case type
* DdlParse.NAME_CASE.original : Return to no convert
* DdlParse.NAME_CASE.lower : Return to lower
* DdlParse.NAME_CASE.upper : Return to upper
:return: BigQuery CREATE TABLE statements | https://github.com/shinichi-takii/ddlparse/blob/7328656ee807d14960999a98ace8cd76f0fe3ff8/ddlparse/ddlparse.py#L393-L450 |
shinichi-takii/ddlparse | ddlparse/ddlparse.py | DdlParse.parse | def parse(self, ddl=None, source_database=None):
"""
Parse DDL script.
:param ddl: DDL script
:return: DdlParseTable, Parsed table define info.
"""
if ddl is not None:
self._ddl = ddl
if source_database is not None:
self.source_database ... | python | def parse(self, ddl=None, source_database=None):
"""
Parse DDL script.
:param ddl: DDL script
:return: DdlParseTable, Parsed table define info.
"""
if ddl is not None:
self._ddl = ddl
if source_database is not None:
self.source_database ... | Parse DDL script.
:param ddl: DDL script
:return: DdlParseTable, Parsed table define info. | https://github.com/shinichi-takii/ddlparse/blob/7328656ee807d14960999a98ace8cd76f0fe3ff8/ddlparse/ddlparse.py#L540-L591 |
rhelmot/nclib | nclib/process.py | Process.launch | def launch(program, sock, stderr=True, cwd=None, env=None):
"""
A static method for launching a process that is connected to a given
socket. Same rules from the Process constructor apply.
"""
if stderr is True:
err = sock # redirect to socket
elif stderr is Fa... | python | def launch(program, sock, stderr=True, cwd=None, env=None):
"""
A static method for launching a process that is connected to a given
socket. Same rules from the Process constructor apply.
"""
if stderr is True:
err = sock # redirect to socket
elif stderr is Fa... | A static method for launching a process that is connected to a given
socket. Same rules from the Process constructor apply. | https://github.com/rhelmot/nclib/blob/6147779766557ee4fafcbae683bdd2f74157e825/nclib/process.py#L85-L104 |
rhelmot/nclib | nclib/server.py | UDPServer.respond | def respond(self, packet, peer, flags=0):
"""
Send a message back to a peer.
:param packet: The data to send
:param peer: The address to send to, as a tuple (host, port)
:param flags: Any sending flags you want to use for some reason
"""
self.so... | python | def respond(self, packet, peer, flags=0):
"""
Send a message back to a peer.
:param packet: The data to send
:param peer: The address to send to, as a tuple (host, port)
:param flags: Any sending flags you want to use for some reason
"""
self.so... | Send a message back to a peer.
:param packet: The data to send
:param peer: The address to send to, as a tuple (host, port)
:param flags: Any sending flags you want to use for some reason | https://github.com/rhelmot/nclib/blob/6147779766557ee4fafcbae683bdd2f74157e825/nclib/server.py#L75-L83 |
rhelmot/nclib | nclib/netcat.py | Netcat._parse_target | def _parse_target(target, listen, udp, ipv6):
"""
Takes the basic version of the user args and extract as much data as
possible from target. Returns a tuple that is its arguments but
sanitized.
"""
if isinstance(target, str):
if target.startswith('nc '):
... | python | def _parse_target(target, listen, udp, ipv6):
"""
Takes the basic version of the user args and extract as much data as
possible from target. Returns a tuple that is its arguments but
sanitized.
"""
if isinstance(target, str):
if target.startswith('nc '):
... | Takes the basic version of the user args and extract as much data as
possible from target. Returns a tuple that is its arguments but
sanitized. | https://github.com/rhelmot/nclib/blob/6147779766557ee4fafcbae683bdd2f74157e825/nclib/netcat.py#L232-L361 |
rhelmot/nclib | nclib/netcat.py | Netcat._connect | def _connect(self, target, listen, udp, ipv6, retry):
"""
Takes target/listen/udp/ipv6 and sets self.sock and self.peer
"""
ty = socket.SOCK_DGRAM if udp else socket.SOCK_STREAM
fam = socket.AF_INET6 if ipv6 else socket.AF_INET
self.sock = socket.socket(fam, ty)
i... | python | def _connect(self, target, listen, udp, ipv6, retry):
"""
Takes target/listen/udp/ipv6 and sets self.sock and self.peer
"""
ty = socket.SOCK_DGRAM if udp else socket.SOCK_STREAM
fam = socket.AF_INET6 if ipv6 else socket.AF_INET
self.sock = socket.socket(fam, ty)
i... | Takes target/listen/udp/ipv6 and sets self.sock and self.peer | https://github.com/rhelmot/nclib/blob/6147779766557ee4fafcbae683bdd2f74157e825/nclib/netcat.py#L363-L400 |
rhelmot/nclib | nclib/netcat.py | Netcat.close | def close(self):
"""
Close the socket.
"""
if self._sock_send is not None:
self._sock_send.close()
return self.sock.close() | python | def close(self):
"""
Close the socket.
"""
if self._sock_send is not None:
self._sock_send.close()
return self.sock.close() | Close the socket. | https://github.com/rhelmot/nclib/blob/6147779766557ee4fafcbae683bdd2f74157e825/nclib/netcat.py#L402-L408 |
rhelmot/nclib | nclib/netcat.py | Netcat.shutdown | def shutdown(self, how=socket.SHUT_RDWR):
"""
Send a shutdown signal for both reading and writing, or whatever
socket.SHUT_* constant you like.
Shutdown differs from closing in that it explicitly changes the state of
the socket resource to closed, whereas closing will only decre... | python | def shutdown(self, how=socket.SHUT_RDWR):
"""
Send a shutdown signal for both reading and writing, or whatever
socket.SHUT_* constant you like.
Shutdown differs from closing in that it explicitly changes the state of
the socket resource to closed, whereas closing will only decre... | Send a shutdown signal for both reading and writing, or whatever
socket.SHUT_* constant you like.
Shutdown differs from closing in that it explicitly changes the state of
the socket resource to closed, whereas closing will only decrement the
number of peers on this end of the socket, si... | https://github.com/rhelmot/nclib/blob/6147779766557ee4fafcbae683bdd2f74157e825/nclib/netcat.py#L424-L441 |
rhelmot/nclib | nclib/netcat.py | Netcat.shutdown_rd | def shutdown_rd(self):
"""
Send a shutdown signal for reading - you may no longer read from this
socket.
"""
if self._sock_send is not None:
self.sock.close()
else:
return self.shutdown(socket.SHUT_RD) | python | def shutdown_rd(self):
"""
Send a shutdown signal for reading - you may no longer read from this
socket.
"""
if self._sock_send is not None:
self.sock.close()
else:
return self.shutdown(socket.SHUT_RD) | Send a shutdown signal for reading - you may no longer read from this
socket. | https://github.com/rhelmot/nclib/blob/6147779766557ee4fafcbae683bdd2f74157e825/nclib/netcat.py#L443-L451 |
rhelmot/nclib | nclib/netcat.py | Netcat.shutdown_wr | def shutdown_wr(self):
"""
Send a shutdown signal for writing - you may no longer write to this
socket.
"""
if self._sock_send is not None:
self._sock_send.close()
else:
return self.shutdown(socket.SHUT_WR) | python | def shutdown_wr(self):
"""
Send a shutdown signal for writing - you may no longer write to this
socket.
"""
if self._sock_send is not None:
self._sock_send.close()
else:
return self.shutdown(socket.SHUT_WR) | Send a shutdown signal for writing - you may no longer write to this
socket. | https://github.com/rhelmot/nclib/blob/6147779766557ee4fafcbae683bdd2f74157e825/nclib/netcat.py#L453-L461 |
rhelmot/nclib | nclib/netcat.py | Netcat._recv_predicate | def _recv_predicate(self, predicate, timeout='default', raise_eof=True):
"""
Receive until predicate returns a positive integer.
The returned number is the size to return.
"""
if timeout == 'default':
timeout = self._timeout
self.timed_out = False
s... | python | def _recv_predicate(self, predicate, timeout='default', raise_eof=True):
"""
Receive until predicate returns a positive integer.
The returned number is the size to return.
"""
if timeout == 'default':
timeout = self._timeout
self.timed_out = False
s... | Receive until predicate returns a positive integer.
The returned number is the size to return. | https://github.com/rhelmot/nclib/blob/6147779766557ee4fafcbae683bdd2f74157e825/nclib/netcat.py#L569-L618 |
rhelmot/nclib | nclib/netcat.py | Netcat.recv | def recv(self, n=4096, timeout='default'):
"""
Receive at most n bytes (default 4096) from the socket
Aliases: read, get
"""
self._print_recv_header(
'======== Receiving {0}B{timeout_text} ========', timeout, n)
return self._recv_predicate(lambda s: min(n, ... | python | def recv(self, n=4096, timeout='default'):
"""
Receive at most n bytes (default 4096) from the socket
Aliases: read, get
"""
self._print_recv_header(
'======== Receiving {0}B{timeout_text} ========', timeout, n)
return self._recv_predicate(lambda s: min(n, ... | Receive at most n bytes (default 4096) from the socket
Aliases: read, get | https://github.com/rhelmot/nclib/blob/6147779766557ee4fafcbae683bdd2f74157e825/nclib/netcat.py#L640-L650 |
rhelmot/nclib | nclib/netcat.py | Netcat.recv_until | def recv_until(self, s, max_size=None, timeout='default'):
"""
Recieve data from the socket until the given substring is observed.
Data in the same datagram as the substring, following the substring,
will not be returned and will be cached for future receives.
Aliases: read_unti... | python | def recv_until(self, s, max_size=None, timeout='default'):
"""
Recieve data from the socket until the given substring is observed.
Data in the same datagram as the substring, following the substring,
will not be returned and will be cached for future receives.
Aliases: read_unti... | Recieve data from the socket until the given substring is observed.
Data in the same datagram as the substring, following the substring,
will not be returned and will be cached for future receives.
Aliases: read_until, readuntil, recvuntil | https://github.com/rhelmot/nclib/blob/6147779766557ee4fafcbae683bdd2f74157e825/nclib/netcat.py#L652-L672 |
rhelmot/nclib | nclib/netcat.py | Netcat.recv_all | def recv_all(self, timeout='default'):
"""
Return all data recieved until connection closes.
Aliases: read_all, readall, recvall
"""
self._print_recv_header('======== Receiving until close{timeout_text} ========', timeout)
return self._recv_predicate(lambda s: 0, timeo... | python | def recv_all(self, timeout='default'):
"""
Return all data recieved until connection closes.
Aliases: read_all, readall, recvall
"""
self._print_recv_header('======== Receiving until close{timeout_text} ========', timeout)
return self._recv_predicate(lambda s: 0, timeo... | Return all data recieved until connection closes.
Aliases: read_all, readall, recvall | https://github.com/rhelmot/nclib/blob/6147779766557ee4fafcbae683bdd2f74157e825/nclib/netcat.py#L674-L683 |
rhelmot/nclib | nclib/netcat.py | Netcat.recv_exactly | def recv_exactly(self, n, timeout='default'):
"""
Recieve exactly n bytes
Aliases: read_exactly, readexactly, recvexactly
"""
self._print_recv_header(
'======== Receiving until exactly {0}B{timeout_text} ========', timeout, n)
return self._recv_predicate(la... | python | def recv_exactly(self, n, timeout='default'):
"""
Recieve exactly n bytes
Aliases: read_exactly, readexactly, recvexactly
"""
self._print_recv_header(
'======== Receiving until exactly {0}B{timeout_text} ========', timeout, n)
return self._recv_predicate(la... | Recieve exactly n bytes
Aliases: read_exactly, readexactly, recvexactly | https://github.com/rhelmot/nclib/blob/6147779766557ee4fafcbae683bdd2f74157e825/nclib/netcat.py#L685-L695 |
rhelmot/nclib | nclib/netcat.py | Netcat.send | def send(self, s):
"""
Sends all the given data to the socket.
Aliases: write, put, sendall, send_all
"""
self._print_header('======== Sending ({0}) ========'.format(len(s)))
self._log_send(s)
out = len(s)
while s:
s = s[self._send(s):]
... | python | def send(self, s):
"""
Sends all the given data to the socket.
Aliases: write, put, sendall, send_all
"""
self._print_header('======== Sending ({0}) ========'.format(len(s)))
self._log_send(s)
out = len(s)
while s:
s = s[self._send(s):]
... | Sends all the given data to the socket.
Aliases: write, put, sendall, send_all | https://github.com/rhelmot/nclib/blob/6147779766557ee4fafcbae683bdd2f74157e825/nclib/netcat.py#L697-L710 |
rhelmot/nclib | nclib/netcat.py | Netcat.interact | def interact(self, insock=sys.stdin, outsock=sys.stdout):
"""
Connects the socket to the terminal for user interaction.
Alternate input and output files may be specified.
This method cannot be used with a timeout.
Aliases: interactive, interaction
"""
self._prin... | python | def interact(self, insock=sys.stdin, outsock=sys.stdout):
"""
Connects the socket to the terminal for user interaction.
Alternate input and output files may be specified.
This method cannot be used with a timeout.
Aliases: interactive, interaction
"""
self._prin... | Connects the socket to the terminal for user interaction.
Alternate input and output files may be specified.
This method cannot be used with a timeout.
Aliases: interactive, interaction | https://github.com/rhelmot/nclib/blob/6147779766557ee4fafcbae683bdd2f74157e825/nclib/netcat.py#L712-L758 |
rhelmot/nclib | nclib/netcat.py | Netcat.recv_line | def recv_line(self, max_size=None, timeout='default', ending=None):
"""
Recieve until the next newline , default "\\n". The newline string can
be changed by changing ``nc.LINE_ENDING``. The newline will be returned
as part of the string.
Aliases: recvline, readline, read_line, r... | python | def recv_line(self, max_size=None, timeout='default', ending=None):
"""
Recieve until the next newline , default "\\n". The newline string can
be changed by changing ``nc.LINE_ENDING``. The newline will be returned
as part of the string.
Aliases: recvline, readline, read_line, r... | Recieve until the next newline , default "\\n". The newline string can
be changed by changing ``nc.LINE_ENDING``. The newline will be returned
as part of the string.
Aliases: recvline, readline, read_line, readln, recvln | https://github.com/rhelmot/nclib/blob/6147779766557ee4fafcbae683bdd2f74157e825/nclib/netcat.py#L762-L772 |
rhelmot/nclib | nclib/netcat.py | Netcat.send_line | def send_line(self, line, ending=None):
"""
Write the string to the wire, followed by a newline. The newline string
can be changed by changing ``nc.LINE_ENDING``.
Aliases: sendline, writeline, write_line, writeln, sendln
"""
if ending is None:
ending = self.L... | python | def send_line(self, line, ending=None):
"""
Write the string to the wire, followed by a newline. The newline string
can be changed by changing ``nc.LINE_ENDING``.
Aliases: sendline, writeline, write_line, writeln, sendln
"""
if ending is None:
ending = self.L... | Write the string to the wire, followed by a newline. The newline string
can be changed by changing ``nc.LINE_ENDING``.
Aliases: sendline, writeline, write_line, writeln, sendln | https://github.com/rhelmot/nclib/blob/6147779766557ee4fafcbae683bdd2f74157e825/nclib/netcat.py#L774-L783 |
Alignak-monitoring/alignak | alignak/objects/resultmodulation.py | Resultmodulation.is_active | def is_active(self, timperiods):
"""
Know if this result modulation is active now
:return: True is we are in the period, otherwise False
:rtype: bool
"""
now = int(time.time())
timperiod = timperiods[self.modulation_period]
if not timperiod or timperiod.i... | python | def is_active(self, timperiods):
"""
Know if this result modulation is active now
:return: True is we are in the period, otherwise False
:rtype: bool
"""
now = int(time.time())
timperiod = timperiods[self.modulation_period]
if not timperiod or timperiod.i... | Know if this result modulation is active now
:return: True is we are in the period, otherwise False
:rtype: bool | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/resultmodulation.py#L93-L104 |
Alignak-monitoring/alignak | alignak/objects/resultmodulation.py | Resultmodulation.module_return | def module_return(self, return_code, timeperiods):
"""Module the exit code if necessary ::
* modulation_period is legit
* exit_code_modulation
* return_code in exit_codes_match
:param return_code: actual code returned by the check
:type return_code: int
:return:... | python | def module_return(self, return_code, timeperiods):
"""Module the exit code if necessary ::
* modulation_period is legit
* exit_code_modulation
* return_code in exit_codes_match
:param return_code: actual code returned by the check
:type return_code: int
:return:... | Module the exit code if necessary ::
* modulation_period is legit
* exit_code_modulation
* return_code in exit_codes_match
:param return_code: actual code returned by the check
:type return_code: int
:return: return_code modulated if necessary (exit_code_modulation)
... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/resultmodulation.py#L106-L126 |
Alignak-monitoring/alignak | alignak/http/scheduler_interface.py | SchedulerInterface.object | def object(self, o_type, o_name=None):
"""Get an object from the scheduler.
The result is a serialized object which is a Json structure containing:
- content: the serialized object content
- __sys_python_module__: the python class of the returned object
The Alignak unserialize ... | python | def object(self, o_type, o_name=None):
"""Get an object from the scheduler.
The result is a serialized object which is a Json structure containing:
- content: the serialized object content
- __sys_python_module__: the python class of the returned object
The Alignak unserialize ... | Get an object from the scheduler.
The result is a serialized object which is a Json structure containing:
- content: the serialized object content
- __sys_python_module__: the python class of the returned object
The Alignak unserialize function of the alignak.misc.serialization package... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/scheduler_interface.py#L48-L113 |
Alignak-monitoring/alignak | alignak/http/scheduler_interface.py | SchedulerInterface.dump | def dump(self, o_name=None, details=False, raw=False):
# pylint: disable=too-many-locals, too-many-branches
"""Dump an host (all hosts) from the scheduler.
This gets the main host information from the scheduler. If details is set, then some
more information are provided. This will not g... | python | def dump(self, o_name=None, details=False, raw=False):
# pylint: disable=too-many-locals, too-many-branches
"""Dump an host (all hosts) from the scheduler.
This gets the main host information from the scheduler. If details is set, then some
more information are provided. This will not g... | Dump an host (all hosts) from the scheduler.
This gets the main host information from the scheduler. If details is set, then some
more information are provided. This will not get all the host known attributes but only
a reduced set that will inform about the host and its services status
... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/scheduler_interface.py#L118-L325 |
Alignak-monitoring/alignak | alignak/http/scheduler_interface.py | SchedulerInterface.monitoring_problems | def monitoring_problems(self):
"""Get Alignak scheduler monitoring status
Returns an object with the scheduler livesynthesis
and the known problems
:return: scheduler live synthesis
:rtype: dict
"""
if self.app.type != 'scheduler':
return {'_status':... | python | def monitoring_problems(self):
"""Get Alignak scheduler monitoring status
Returns an object with the scheduler livesynthesis
and the known problems
:return: scheduler live synthesis
:rtype: dict
"""
if self.app.type != 'scheduler':
return {'_status':... | Get Alignak scheduler monitoring status
Returns an object with the scheduler livesynthesis
and the known problems
:return: scheduler live synthesis
:rtype: dict | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/scheduler_interface.py#L329-L344 |
Alignak-monitoring/alignak | alignak/http/scheduler_interface.py | SchedulerInterface._wait_new_conf | def _wait_new_conf(self):
"""Ask the scheduler to drop its configuration and wait for a new one.
This overrides the default method from GenericInterface
:return: None
"""
# Stop the scheduling loop
self.app.sched.stop_scheduling()
super(SchedulerInterface, self)... | python | def _wait_new_conf(self):
"""Ask the scheduler to drop its configuration and wait for a new one.
This overrides the default method from GenericInterface
:return: None
"""
# Stop the scheduling loop
self.app.sched.stop_scheduling()
super(SchedulerInterface, self)... | Ask the scheduler to drop its configuration and wait for a new one.
This overrides the default method from GenericInterface
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/scheduler_interface.py#L357-L366 |
Alignak-monitoring/alignak | alignak/http/scheduler_interface.py | SchedulerInterface._initial_broks | def _initial_broks(self, broker_name):
"""Get initial_broks from the scheduler
This is used by the brokers to prepare the initial status broks
This do not send broks, it only makes scheduler internal processing. Then the broker
must use the *_broks* API to get all the stuff
:p... | python | def _initial_broks(self, broker_name):
"""Get initial_broks from the scheduler
This is used by the brokers to prepare the initial status broks
This do not send broks, it only makes scheduler internal processing. Then the broker
must use the *_broks* API to get all the stuff
:p... | Get initial_broks from the scheduler
This is used by the brokers to prepare the initial status broks
This do not send broks, it only makes scheduler internal processing. Then the broker
must use the *_broks* API to get all the stuff
:param broker_name: broker name, used to filter brok... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/scheduler_interface.py#L370-L384 |
Alignak-monitoring/alignak | alignak/http/scheduler_interface.py | SchedulerInterface._broks | def _broks(self, broker_name):
"""Get the broks from a scheduler, used by brokers
This is used by the brokers to get the broks list of a scheduler
:param broker_name: broker name, used to filter broks
:type broker_name: str
:return: serialized brok list
:rtype: dict
... | python | def _broks(self, broker_name):
"""Get the broks from a scheduler, used by brokers
This is used by the brokers to get the broks list of a scheduler
:param broker_name: broker name, used to filter broks
:type broker_name: str
:return: serialized brok list
:rtype: dict
... | Get the broks from a scheduler, used by brokers
This is used by the brokers to get the broks list of a scheduler
:param broker_name: broker name, used to filter broks
:type broker_name: str
:return: serialized brok list
:rtype: dict | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/scheduler_interface.py#L388-L410 |
Alignak-monitoring/alignak | alignak/http/scheduler_interface.py | SchedulerInterface._checks | def _checks(self, do_checks=False, do_actions=False, poller_tags=None,
reactionner_tags=None, worker_name='none', module_types=None):
"""Get checks from scheduler, used by poller or reactionner when they are
in active mode (passive = False)
This function is not intended for exte... | python | def _checks(self, do_checks=False, do_actions=False, poller_tags=None,
reactionner_tags=None, worker_name='none', module_types=None):
"""Get checks from scheduler, used by poller or reactionner when they are
in active mode (passive = False)
This function is not intended for exte... | Get checks from scheduler, used by poller or reactionner when they are
in active mode (passive = False)
This function is not intended for external use. Let the poller and reactionner
manage all this stuff by themselves ;)
:param do_checks: used for poller to get checks
:type do... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/scheduler_interface.py#L414-L448 |
Alignak-monitoring/alignak | alignak/http/scheduler_interface.py | SchedulerInterface.put_results | def put_results(self):
"""Put results to scheduler, used by poller or reactionner when they are
in active mode (passive = False)
This function is not intended for external use. Let the poller and reactionner
manage all this stuff by themselves ;)
:param from: poller/reactionner... | python | def put_results(self):
"""Put results to scheduler, used by poller or reactionner when they are
in active mode (passive = False)
This function is not intended for external use. Let the poller and reactionner
manage all this stuff by themselves ;)
:param from: poller/reactionner... | Put results to scheduler, used by poller or reactionner when they are
in active mode (passive = False)
This function is not intended for external use. Let the poller and reactionner
manage all this stuff by themselves ;)
:param from: poller/reactionner identification
:type from... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/scheduler_interface.py#L453-L483 |
Alignak-monitoring/alignak | alignak/http/scheduler_interface.py | SchedulerInterface._run_external_commands | def _run_external_commands(self):
"""Post external_commands to scheduler (from arbiter)
Wrapper to to app.sched.run_external_commands method
:return: None
"""
commands = cherrypy.request.json
with self.app.lock:
self.app.sched.run_external_commands(commands['... | python | def _run_external_commands(self):
"""Post external_commands to scheduler (from arbiter)
Wrapper to to app.sched.run_external_commands method
:return: None
"""
commands = cherrypy.request.json
with self.app.lock:
self.app.sched.run_external_commands(commands['... | Post external_commands to scheduler (from arbiter)
Wrapper to to app.sched.run_external_commands method
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/scheduler_interface.py#L488-L496 |
Alignak-monitoring/alignak | alignak/http/scheduler_interface.py | SchedulerInterface._get_objects | def _get_objects(self, o_type):
"""Get an object list from the scheduler
Returns None if the required object type (`o_type`) is not known or an exception is raised.
Else returns the objects list
:param o_type: searched object type
:type o_type: str
:return: objects list... | python | def _get_objects(self, o_type):
"""Get an object list from the scheduler
Returns None if the required object type (`o_type`) is not known or an exception is raised.
Else returns the objects list
:param o_type: searched object type
:type o_type: str
:return: objects list... | Get an object list from the scheduler
Returns None if the required object type (`o_type`) is not known or an exception is raised.
Else returns the objects list
:param o_type: searched object type
:type o_type: str
:return: objects list
:rtype: alignak.objects.item.Items | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/scheduler_interface.py#L498-L518 |
Alignak-monitoring/alignak | alignak/http/scheduler_interface.py | SchedulerInterface._get_object | def _get_object(self, o_type, o_name=None):
"""Get an object from the scheduler
Returns None if the required object type (`o_type`) is not known.
Else returns the serialized object if found. The object is searched first with
o_name as its name and then with o_name as its uuid.
... | python | def _get_object(self, o_type, o_name=None):
"""Get an object from the scheduler
Returns None if the required object type (`o_type`) is not known.
Else returns the serialized object if found. The object is searched first with
o_name as its name and then with o_name as its uuid.
... | Get an object from the scheduler
Returns None if the required object type (`o_type`) is not known.
Else returns the serialized object if found. The object is searched first with
o_name as its name and then with o_name as its uuid.
:param o_type: searched object type
:type o_typ... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/scheduler_interface.py#L520-L547 |
Alignak-monitoring/alignak | alignak/objects/module.py | Module.is_a_module | def is_a_module(self, module_type):
"""
Is the module of the required type?
:param module_type: module type to check
:type: str
:return: True / False
"""
if hasattr(self, 'type'):
return module_type in self.type
return module_type in self.modu... | python | def is_a_module(self, module_type):
"""
Is the module of the required type?
:param module_type: module type to check
:type: str
:return: True / False
"""
if hasattr(self, 'type'):
return module_type in self.type
return module_type in self.modu... | Is the module of the required type?
:param module_type: module type to check
:type: str
:return: True / False | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/module.py#L198-L208 |
Alignak-monitoring/alignak | alignak/objects/module.py | Module.serialize | def serialize(self):
"""A module may have some properties that are not defined in the class properties list.
Serializing a module is the same as serializing an Item but we also also include all the
existing properties that are not defined in the properties or running_properties
class lis... | python | def serialize(self):
"""A module may have some properties that are not defined in the class properties list.
Serializing a module is the same as serializing an Item but we also also include all the
existing properties that are not defined in the properties or running_properties
class lis... | A module may have some properties that are not defined in the class properties list.
Serializing a module is the same as serializing an Item but we also also include all the
existing properties that are not defined in the properties or running_properties
class list.
We must also exclude... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/module.py#L210-L227 |
Alignak-monitoring/alignak | alignak/objects/module.py | Modules.linkify_s_by_plug | def linkify_s_by_plug(self):
"""Link a module to some other modules
:return: None
"""
for module in self:
new_modules = []
for related in getattr(module, 'modules', []):
related = related.strip()
if not related:
... | python | def linkify_s_by_plug(self):
"""Link a module to some other modules
:return: None
"""
for module in self:
new_modules = []
for related in getattr(module, 'modules', []):
related = related.strip()
if not related:
... | Link a module to some other modules
:return: None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/module.py#L245-L262 |
Alignak-monitoring/alignak | alignak/daterange.py | get_start_of_day | def get_start_of_day(year, month, day):
"""Get the timestamp associated to the first second of a specific day
:param year: date year
:type year: int
:param month: date month
:type month: int
:param day: date day
:type day: int
:return: timestamp
:rtype: int
"""
# DST is not ... | python | def get_start_of_day(year, month, day):
"""Get the timestamp associated to the first second of a specific day
:param year: date year
:type year: int
:param month: date month
:type month: int
:param day: date day
:type day: int
:return: timestamp
:rtype: int
"""
# DST is not ... | Get the timestamp associated to the first second of a specific day
:param year: date year
:type year: int
:param month: date month
:type month: int
:param day: date day
:type day: int
:return: timestamp
:rtype: int | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daterange.py#L63-L82 |
Alignak-monitoring/alignak | alignak/daterange.py | get_end_of_day | def get_end_of_day(year, month, day):
"""Get the timestamp associated to the last second of a specific day
:param year: date year
:type year: int
:param month: date month (int)
:type month: int
:param day: date day
:type day: int
:return: timestamp
:rtype: int
"""
# DST is n... | python | def get_end_of_day(year, month, day):
"""Get the timestamp associated to the last second of a specific day
:param year: date year
:type year: int
:param month: date month (int)
:type month: int
:param day: date day
:type day: int
:return: timestamp
:rtype: int
"""
# DST is n... | Get the timestamp associated to the last second of a specific day
:param year: date year
:type year: int
:param month: date month (int)
:type month: int
:param day: date day
:type day: int
:return: timestamp
:rtype: int | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daterange.py#L85-L99 |
Alignak-monitoring/alignak | alignak/daterange.py | get_sec_from_morning | def get_sec_from_morning(timestamp):
"""Get the number of seconds elapsed since the beginning of the
day deducted from the provided timestamp
:param timestamp: time to use for computation
:type timestamp: int
:return: timestamp
:rtype: int
"""
t_lt = time.localtime(timestamp)
return... | python | def get_sec_from_morning(timestamp):
"""Get the number of seconds elapsed since the beginning of the
day deducted from the provided timestamp
:param timestamp: time to use for computation
:type timestamp: int
:return: timestamp
:rtype: int
"""
t_lt = time.localtime(timestamp)
return... | Get the number of seconds elapsed since the beginning of the
day deducted from the provided timestamp
:param timestamp: time to use for computation
:type timestamp: int
:return: timestamp
:rtype: int | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daterange.py#L126-L136 |
Alignak-monitoring/alignak | alignak/daterange.py | find_day_by_weekday_offset | def find_day_by_weekday_offset(year, month, weekday, offset):
"""Get the day number based on a date and offset
:param year: date year
:type year: int
:param month: date month
:type month: int
:param weekday: date week day
:type weekday: int
:param offset: offset (-1 is last, 1 is first ... | python | def find_day_by_weekday_offset(year, month, weekday, offset):
"""Get the day number based on a date and offset
:param year: date year
:type year: int
:param month: date month
:type month: int
:param weekday: date week day
:type weekday: int
:param offset: offset (-1 is last, 1 is first ... | Get the day number based on a date and offset
:param year: date year
:type year: int
:param month: date month
:type month: int
:param weekday: date week day
:type weekday: int
:param offset: offset (-1 is last, 1 is first etc)
:type offset: int
:return: day number in the month
:... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daterange.py#L139-L175 |
Alignak-monitoring/alignak | alignak/daterange.py | find_day_by_offset | def find_day_by_offset(year, month, offset):
"""Get the month day based on date and offset
:param year: date year
:type year: int
:param month: date month
:type month: int
:param offset: offset in day to compute (usually negative)
:type offset: int
:return: day number in the month
:... | python | def find_day_by_offset(year, month, offset):
"""Get the month day based on date and offset
:param year: date year
:type year: int
:param month: date month
:type month: int
:param offset: offset in day to compute (usually negative)
:type offset: int
:return: day number in the month
:... | Get the month day based on date and offset
:param year: date year
:type year: int
:param month: date month
:type month: int
:param offset: offset in day to compute (usually negative)
:type offset: int
:return: day number in the month
:rtype: int
>>> find_day_by_offset(2015, 7, -1)
... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daterange.py#L178-L197 |
Alignak-monitoring/alignak | alignak/daterange.py | Timerange.serialize | def serialize(self):
"""This function serialize into a simple dict object.
It is used when transferring data to other daemons over the network (http)
Here we directly return all attributes
:return: json representation of a Timerange
:rtype: dict
"""
return {"hst... | python | def serialize(self):
"""This function serialize into a simple dict object.
It is used when transferring data to other daemons over the network (http)
Here we directly return all attributes
:return: json representation of a Timerange
:rtype: dict
"""
return {"hst... | This function serialize into a simple dict object.
It is used when transferring data to other daemons over the network (http)
Here we directly return all attributes
:return: json representation of a Timerange
:rtype: dict | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daterange.py#L233-L244 |
Alignak-monitoring/alignak | alignak/daterange.py | Timerange.get_first_sec_out_from_morning | def get_first_sec_out_from_morning(self):
"""Get the first second (from midnight) where we are out of the timerange
:return: seconds from midnight where timerange is not effective
:rtype: int
"""
# If start at 0:0, the min out is the end
if self.hstart == 0 and self.msta... | python | def get_first_sec_out_from_morning(self):
"""Get the first second (from midnight) where we are out of the timerange
:return: seconds from midnight where timerange is not effective
:rtype: int
"""
# If start at 0:0, the min out is the end
if self.hstart == 0 and self.msta... | Get the first second (from midnight) where we are out of the timerange
:return: seconds from midnight where timerange is not effective
:rtype: int | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daterange.py#L257-L266 |
Alignak-monitoring/alignak | alignak/daterange.py | Timerange.is_time_valid | def is_time_valid(self, timestamp):
"""Check if time is valid for this Timerange
If sec_from_morning is not provided, get the value.
:param timestamp: time to check
:type timestamp: int
:return: True if time is valid (in interval), False otherwise
:rtype: bool
"... | python | def is_time_valid(self, timestamp):
"""Check if time is valid for this Timerange
If sec_from_morning is not provided, get the value.
:param timestamp: time to check
:type timestamp: int
:return: True if time is valid (in interval), False otherwise
:rtype: bool
"... | Check if time is valid for this Timerange
If sec_from_morning is not provided, get the value.
:param timestamp: time to check
:type timestamp: int
:return: True if time is valid (in interval), False otherwise
:rtype: bool | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daterange.py#L268-L282 |
Alignak-monitoring/alignak | alignak/daterange.py | AbstractDaterange.is_time_valid | def is_time_valid(self, timestamp):
"""Check if time is valid for one of the timerange.
:param timestamp: time to check
:type timestamp: int
:return: True if one of the timerange is valid for t, False otherwise
:rtype: bool
"""
if self.is_time_day_valid(timestamp... | python | def is_time_valid(self, timestamp):
"""Check if time is valid for one of the timerange.
:param timestamp: time to check
:type timestamp: int
:return: True if one of the timerange is valid for t, False otherwise
:rtype: bool
"""
if self.is_time_day_valid(timestamp... | Check if time is valid for one of the timerange.
:param timestamp: time to check
:type timestamp: int
:return: True if one of the timerange is valid for t, False otherwise
:rtype: bool | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daterange.py#L379-L391 |
Alignak-monitoring/alignak | alignak/daterange.py | AbstractDaterange.get_min_sec_from_morning | def get_min_sec_from_morning(self):
"""Get the first second from midnight where a timerange is effective
:return: smallest amount of second from midnight of all timerange
:rtype: int
"""
mins = []
for timerange in self.timeranges:
mins.append(timerange.get_se... | python | def get_min_sec_from_morning(self):
"""Get the first second from midnight where a timerange is effective
:return: smallest amount of second from midnight of all timerange
:rtype: int
"""
mins = []
for timerange in self.timeranges:
mins.append(timerange.get_se... | Get the first second from midnight where a timerange is effective
:return: smallest amount of second from midnight of all timerange
:rtype: int | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daterange.py#L393-L402 |
Alignak-monitoring/alignak | alignak/daterange.py | AbstractDaterange.get_min_sec_out_from_morning | def get_min_sec_out_from_morning(self):
"""Get the first second (from midnight) where we are out of a timerange
:return: smallest seconds from midnight of all timerange where it is not effective
:rtype: int
"""
mins = []
for timerange in self.timeranges:
mins... | python | def get_min_sec_out_from_morning(self):
"""Get the first second (from midnight) where we are out of a timerange
:return: smallest seconds from midnight of all timerange where it is not effective
:rtype: int
"""
mins = []
for timerange in self.timeranges:
mins... | Get the first second (from midnight) where we are out of a timerange
:return: smallest seconds from midnight of all timerange where it is not effective
:rtype: int | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daterange.py#L404-L413 |
Alignak-monitoring/alignak | alignak/daterange.py | AbstractDaterange.get_min_from_t | def get_min_from_t(self, timestamp):
"""Get next time from t where a timerange is valid (withing range)
:param timestamp: base time to look for the next one
:return: time where a timerange is valid
:rtype: int
"""
if self.is_time_valid(timestamp):
return time... | python | def get_min_from_t(self, timestamp):
"""Get next time from t where a timerange is valid (withing range)
:param timestamp: base time to look for the next one
:return: time where a timerange is valid
:rtype: int
"""
if self.is_time_valid(timestamp):
return time... | Get next time from t where a timerange is valid (withing range)
:param timestamp: base time to look for the next one
:return: time where a timerange is valid
:rtype: int | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daterange.py#L415-L426 |
Alignak-monitoring/alignak | alignak/daterange.py | AbstractDaterange.is_time_day_valid | def is_time_day_valid(self, timestamp):
"""Check if it is within start time and end time of the DateRange
:param timestamp: time to check
:type timestamp: int
:return: True if t in range, False otherwise
:rtype: bool
"""
(start_time, end_time) = self.get_start_an... | python | def is_time_day_valid(self, timestamp):
"""Check if it is within start time and end time of the DateRange
:param timestamp: time to check
:type timestamp: int
:return: True if t in range, False otherwise
:rtype: bool
"""
(start_time, end_time) = self.get_start_an... | Check if it is within start time and end time of the DateRange
:param timestamp: time to check
:type timestamp: int
:return: True if t in range, False otherwise
:rtype: bool | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daterange.py#L428-L437 |
Alignak-monitoring/alignak | alignak/daterange.py | AbstractDaterange.get_next_future_timerange_valid | def get_next_future_timerange_valid(self, timestamp):
"""Get the next valid timerange (next timerange start in timeranges attribute)
:param timestamp: base time
:type timestamp: int
:return: next time when a timerange is valid
:rtype: None | int
"""
sec_from_morn... | python | def get_next_future_timerange_valid(self, timestamp):
"""Get the next valid timerange (next timerange start in timeranges attribute)
:param timestamp: base time
:type timestamp: int
:return: next time when a timerange is valid
:rtype: None | int
"""
sec_from_morn... | Get the next valid timerange (next timerange start in timeranges attribute)
:param timestamp: base time
:type timestamp: int
:return: next time when a timerange is valid
:rtype: None | int | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daterange.py#L449-L466 |
Alignak-monitoring/alignak | alignak/daterange.py | AbstractDaterange.get_next_future_timerange_invalid | def get_next_future_timerange_invalid(self, timestamp):
"""Get next invalid time for timeranges
:param timestamp: time to check
:type timestamp: int
:return: next time when a timerange is not valid
:rtype: None | int
"""
sec_from_morning = get_sec_from_morning(ti... | python | def get_next_future_timerange_invalid(self, timestamp):
"""Get next invalid time for timeranges
:param timestamp: time to check
:type timestamp: int
:return: next time when a timerange is not valid
:rtype: None | int
"""
sec_from_morning = get_sec_from_morning(ti... | Get next invalid time for timeranges
:param timestamp: time to check
:type timestamp: int
:return: next time when a timerange is not valid
:rtype: None | int | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daterange.py#L468-L488 |
Alignak-monitoring/alignak | alignak/daterange.py | AbstractDaterange.get_next_valid_day | def get_next_valid_day(self, timestamp):
"""Get next valid day for timerange
:param timestamp: time we compute from
:type timestamp: int
:return: timestamp of the next valid day (midnight) in LOCAL time.
:rtype: int | None
"""
if self.get_next_future_timerange_va... | python | def get_next_valid_day(self, timestamp):
"""Get next valid day for timerange
:param timestamp: time we compute from
:type timestamp: int
:return: timestamp of the next valid day (midnight) in LOCAL time.
:rtype: int | None
"""
if self.get_next_future_timerange_va... | Get next valid day for timerange
:param timestamp: time we compute from
:type timestamp: int
:return: timestamp of the next valid day (midnight) in LOCAL time.
:rtype: int | None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daterange.py#L490-L510 |
Alignak-monitoring/alignak | alignak/daterange.py | AbstractDaterange.get_next_valid_time_from_t | def get_next_valid_time_from_t(self, timestamp):
"""Get next valid time for time range
:param timestamp: time we compute from
:type timestamp: int
:return: timestamp of the next valid time (LOCAL TIME)
:rtype: int | None
"""
if self.is_time_valid(timestamp):
... | python | def get_next_valid_time_from_t(self, timestamp):
"""Get next valid time for time range
:param timestamp: time we compute from
:type timestamp: int
:return: timestamp of the next valid time (LOCAL TIME)
:rtype: int | None
"""
if self.is_time_valid(timestamp):
... | Get next valid time for time range
:param timestamp: time we compute from
:type timestamp: int
:return: timestamp of the next valid time (LOCAL TIME)
:rtype: int | None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daterange.py#L512-L548 |
Alignak-monitoring/alignak | alignak/daterange.py | AbstractDaterange.get_next_invalid_day | def get_next_invalid_day(self, timestamp):
# pylint: disable=no-else-return
"""Get next day where timerange is not active
:param timestamp: time we compute from
:type timestamp: int
:return: timestamp of the next invalid day (midnight) in LOCAL time.
:rtype: int | None
... | python | def get_next_invalid_day(self, timestamp):
# pylint: disable=no-else-return
"""Get next day where timerange is not active
:param timestamp: time we compute from
:type timestamp: int
:return: timestamp of the next invalid day (midnight) in LOCAL time.
:rtype: int | None
... | Get next day where timerange is not active
:param timestamp: time we compute from
:type timestamp: int
:return: timestamp of the next invalid day (midnight) in LOCAL time.
:rtype: int | None | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daterange.py#L550-L584 |
Alignak-monitoring/alignak | alignak/daterange.py | AbstractDaterange.get_next_invalid_time_from_t | def get_next_invalid_time_from_t(self, timestamp):
"""Get next invalid time for time range
:param timestamp: time we compute from
:type timestamp: int
:return: timestamp of the next invalid time (LOCAL TIME)
:rtype: int
"""
if not self.is_time_valid(timestamp):
... | python | def get_next_invalid_time_from_t(self, timestamp):
"""Get next invalid time for time range
:param timestamp: time we compute from
:type timestamp: int
:return: timestamp of the next invalid time (LOCAL TIME)
:rtype: int
"""
if not self.is_time_valid(timestamp):
... | Get next invalid time for time range
:param timestamp: time we compute from
:type timestamp: int
:return: timestamp of the next invalid time (LOCAL TIME)
:rtype: int | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daterange.py#L586-L632 |
Alignak-monitoring/alignak | alignak/daterange.py | Daterange.serialize | def serialize(self):
"""This function serialize into a simple dict object.
It is used when transferring data to other daemons over the network (http)
Here we directly return all attributes
:return: json representation of a Daterange
:rtype: dict
"""
return {'sye... | python | def serialize(self):
"""This function serialize into a simple dict object.
It is used when transferring data to other daemons over the network (http)
Here we directly return all attributes
:return: json representation of a Daterange
:rtype: dict
"""
return {'sye... | This function serialize into a simple dict object.
It is used when transferring data to other daemons over the network (http)
Here we directly return all attributes
:return: json representation of a Daterange
:rtype: dict | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daterange.py#L707-L721 |
Alignak-monitoring/alignak | alignak/daterange.py | CalendarDaterange.get_start_and_end_time | def get_start_and_end_time(self, ref=None):
"""Specific function to get start time and end time for CalendarDaterange
:param ref: time in seconds
:type ref: int
:return: tuple with start and end time
:rtype: tuple (int, int)
"""
return (get_start_of_day(self.syea... | python | def get_start_and_end_time(self, ref=None):
"""Specific function to get start time and end time for CalendarDaterange
:param ref: time in seconds
:type ref: int
:return: tuple with start and end time
:rtype: tuple (int, int)
"""
return (get_start_of_day(self.syea... | Specific function to get start time and end time for CalendarDaterange
:param ref: time in seconds
:type ref: int
:return: tuple with start and end time
:rtype: tuple (int, int) | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daterange.py#L728-L737 |
Alignak-monitoring/alignak | alignak/daterange.py | StandardDaterange.serialize | def serialize(self):
"""This function serialize into a simple dict object.
It is used when transferring data to other daemons over the network (http)
Here we directly return all attributes
:return: json representation of a Daterange
:rtype: dict
"""
return {'day... | python | def serialize(self):
"""This function serialize into a simple dict object.
It is used when transferring data to other daemons over the network (http)
Here we directly return all attributes
:return: json representation of a Daterange
:rtype: dict
"""
return {'day... | This function serialize into a simple dict object.
It is used when transferring data to other daemons over the network (http)
Here we directly return all attributes
:return: json representation of a Daterange
:rtype: dict | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daterange.py#L769-L779 |
Alignak-monitoring/alignak | alignak/daterange.py | StandardDaterange.is_correct | def is_correct(self):
"""Check if the Daterange is correct : weekdays are valid
:return: True if weekdays are valid, False otherwise
:rtype: bool
"""
valid = self.day in Daterange.weekdays
if not valid:
logger.error("Error: %s is not a valid day", self.day)
... | python | def is_correct(self):
"""Check if the Daterange is correct : weekdays are valid
:return: True if weekdays are valid, False otherwise
:rtype: bool
"""
valid = self.day in Daterange.weekdays
if not valid:
logger.error("Error: %s is not a valid day", self.day)
... | Check if the Daterange is correct : weekdays are valid
:return: True if weekdays are valid, False otherwise
:rtype: bool | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daterange.py#L781-L792 |
Alignak-monitoring/alignak | alignak/daterange.py | StandardDaterange.get_start_and_end_time | def get_start_and_end_time(self, ref=None):
"""Specific function to get start time and end time for StandardDaterange
:param ref: time in seconds
:type ref: int
:return: tuple with start and end time
:rtype: tuple (int, int)
"""
now = time.localtime(ref)
... | python | def get_start_and_end_time(self, ref=None):
"""Specific function to get start time and end time for StandardDaterange
:param ref: time in seconds
:type ref: int
:return: tuple with start and end time
:rtype: tuple (int, int)
"""
now = time.localtime(ref)
... | Specific function to get start time and end time for StandardDaterange
:param ref: time in seconds
:type ref: int
:return: tuple with start and end time
:rtype: tuple (int, int) | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daterange.py#L794-L812 |
Alignak-monitoring/alignak | alignak/daterange.py | MonthWeekDayDaterange.is_correct | def is_correct(self):
"""Check if the Daterange is correct : weekdays are valid
:return: True if weekdays are valid, False otherwise
:rtype: bool
"""
valid = True
valid &= self.swday in range(7)
if not valid:
logger.error("Error: %s is not a valid day... | python | def is_correct(self):
"""Check if the Daterange is correct : weekdays are valid
:return: True if weekdays are valid, False otherwise
:rtype: bool
"""
valid = True
valid &= self.swday in range(7)
if not valid:
logger.error("Error: %s is not a valid day... | Check if the Daterange is correct : weekdays are valid
:return: True if weekdays are valid, False otherwise
:rtype: bool | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daterange.py#L820-L835 |
Alignak-monitoring/alignak | alignak/daterange.py | MonthWeekDayDaterange.get_start_and_end_time | def get_start_and_end_time(self, ref=None):
"""Specific function to get start time and end time for MonthWeekDayDaterange
:param ref: time in seconds
:type ref: int | None
:return: tuple with start and end time
:rtype: tuple
"""
now = time.localtime(ref)
... | python | def get_start_and_end_time(self, ref=None):
"""Specific function to get start time and end time for MonthWeekDayDaterange
:param ref: time in seconds
:type ref: int | None
:return: tuple with start and end time
:rtype: tuple
"""
now = time.localtime(ref)
... | Specific function to get start time and end time for MonthWeekDayDaterange
:param ref: time in seconds
:type ref: int | None
:return: tuple with start and end time
:rtype: tuple | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daterange.py#L837-L878 |
Alignak-monitoring/alignak | alignak/daterange.py | MonthDateDaterange.get_start_and_end_time | def get_start_and_end_time(self, ref=None):
"""Specific function to get start time and end time for MonthDateDaterange
:param ref: time in seconds
:type ref: int
:return: tuple with start and end time
:rtype: tuple (int, int)
"""
now = time.localtime(ref)
... | python | def get_start_and_end_time(self, ref=None):
"""Specific function to get start time and end time for MonthDateDaterange
:param ref: time in seconds
:type ref: int
:return: tuple with start and end time
:rtype: tuple (int, int)
"""
now = time.localtime(ref)
... | Specific function to get start time and end time for MonthDateDaterange
:param ref: time in seconds
:type ref: int
:return: tuple with start and end time
:rtype: tuple (int, int) | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daterange.py#L885-L922 |
Alignak-monitoring/alignak | alignak/daterange.py | WeekDayDaterange.get_start_and_end_time | def get_start_and_end_time(self, ref=None):
"""Specific function to get start time and end time for WeekDayDaterange
:param ref: time in seconds
:type ref: int
:return: tuple with start and end time
:rtype: tuple (int, int)
"""
now = time.localtime(ref)
... | python | def get_start_and_end_time(self, ref=None):
"""Specific function to get start time and end time for WeekDayDaterange
:param ref: time in seconds
:type ref: int
:return: tuple with start and end time
:rtype: tuple (int, int)
"""
now = time.localtime(ref)
... | Specific function to get start time and end time for WeekDayDaterange
:param ref: time in seconds
:type ref: int
:return: tuple with start and end time
:rtype: tuple (int, int) | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daterange.py#L929-L986 |
Alignak-monitoring/alignak | alignak/daterange.py | MonthDayDaterange.get_start_and_end_time | def get_start_and_end_time(self, ref=None):
"""Specific function to get start time and end time for MonthDayDaterange
:param ref: time in seconds
:type ref: int
:return: tuple with start and end time
:rtype: tuple (int, int)
"""
now = time.localtime(ref)
... | python | def get_start_and_end_time(self, ref=None):
"""Specific function to get start time and end time for MonthDayDaterange
:param ref: time in seconds
:type ref: int
:return: tuple with start and end time
:rtype: tuple (int, int)
"""
now = time.localtime(ref)
... | Specific function to get start time and end time for MonthDayDaterange
:param ref: time in seconds
:type ref: int
:return: tuple with start and end time
:rtype: tuple (int, int) | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/daterange.py#L993-L1042 |
Alignak-monitoring/alignak | alignak/external_command.py | ExternalCommandManager.send_an_element | def send_an_element(self, element):
"""Send an element (Brok, Comment,...) to our daemon
Use the daemon `add` function if it exists, else raise an error log
:param element: elementto be sent
:type: alignak.Brok, or Comment, or Downtime, ...
:return:
"""
# Commen... | python | def send_an_element(self, element):
"""Send an element (Brok, Comment,...) to our daemon
Use the daemon `add` function if it exists, else raise an error log
:param element: elementto be sent
:type: alignak.Brok, or Comment, or Downtime, ...
:return:
"""
# Commen... | Send an element (Brok, Comment,...) to our daemon
Use the daemon `add` function if it exists, else raise an error log
:param element: elementto be sent
:type: alignak.Brok, or Comment, or Downtime, ...
:return: | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L541-L561 |
Alignak-monitoring/alignak | alignak/external_command.py | ExternalCommandManager.resolve_command | def resolve_command(self, excmd):
"""Parse command and dispatch it (to schedulers for example) if necessary
If the command is not global it will be executed.
:param excmd: external command to handle
:type excmd: alignak.external_command.ExternalCommand
:return: result of command... | python | def resolve_command(self, excmd):
"""Parse command and dispatch it (to schedulers for example) if necessary
If the command is not global it will be executed.
:param excmd: external command to handle
:type excmd: alignak.external_command.ExternalCommand
:return: result of command... | Parse command and dispatch it (to schedulers for example) if necessary
If the command is not global it will be executed.
:param excmd: external command to handle
:type excmd: alignak.external_command.ExternalCommand
:return: result of command parsing. None for an invalid command. | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L563-L617 |
Alignak-monitoring/alignak | alignak/external_command.py | ExternalCommandManager.search_host_and_dispatch | def search_host_and_dispatch(self, host_name, command, extcmd):
# pylint: disable=too-many-branches
"""Try to dispatch a command for a specific host (so specific scheduler)
because this command is related to a host (change notification interval for example)
:param host_name: host name t... | python | def search_host_and_dispatch(self, host_name, command, extcmd):
# pylint: disable=too-many-branches
"""Try to dispatch a command for a specific host (so specific scheduler)
because this command is related to a host (change notification interval for example)
:param host_name: host name t... | Try to dispatch a command for a specific host (so specific scheduler)
because this command is related to a host (change notification interval for example)
:param host_name: host name to search
:type host_name: str
:param command: command line
:type command: str
:param ex... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L619-L673 |
Alignak-monitoring/alignak | alignak/external_command.py | ExternalCommandManager.get_unknown_check_result_brok | def get_unknown_check_result_brok(cmd_line):
"""Create unknown check result brok and fill it with command data
:param cmd_line: command line to extract data
:type cmd_line: str
:return: unknown check result brok
:rtype: alignak.objects.brok.Brok
"""
match = re.ma... | python | def get_unknown_check_result_brok(cmd_line):
"""Create unknown check result brok and fill it with command data
:param cmd_line: command line to extract data
:type cmd_line: str
:return: unknown check result brok
:rtype: alignak.objects.brok.Brok
"""
match = re.ma... | Create unknown check result brok and fill it with command data
:param cmd_line: command line to extract data
:type cmd_line: str
:return: unknown check result brok
:rtype: alignak.objects.brok.Brok | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L676-L710 |
Alignak-monitoring/alignak | alignak/external_command.py | ExternalCommandManager.get_command_and_args | def get_command_and_args(self, command, extcmd=None):
# pylint: disable=too-many-return-statements, too-many-nested-blocks
# pylint: disable=too-many-locals,too-many-branches,too-many-statements
"""Parse command and get args
:param command: command line to parse
:type command: s... | python | def get_command_and_args(self, command, extcmd=None):
# pylint: disable=too-many-return-statements, too-many-nested-blocks
# pylint: disable=too-many-locals,too-many-branches,too-many-statements
"""Parse command and get args
:param command: command line to parse
:type command: s... | Parse command and get args
:param command: command line to parse
:type command: str
:param extcmd: external command object (used to dispatch)
:type extcmd: None | object
:return: Dict containing command and arg ::
{'global': False, 'c_name': c_name, 'args': args}
... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L712-L947 |
Alignak-monitoring/alignak | alignak/external_command.py | ExternalCommandManager.change_contact_host_notification_timeperiod | def change_contact_host_notification_timeperiod(self, contact, notification_timeperiod):
"""Change contact host notification timeperiod value
Format of the line that triggers function call::
CHANGE_CONTACT_HOST_NOTIFICATION_TIMEPERIOD;<contact_name>;<notification_timeperiod>
:param con... | python | def change_contact_host_notification_timeperiod(self, contact, notification_timeperiod):
"""Change contact host notification timeperiod value
Format of the line that triggers function call::
CHANGE_CONTACT_HOST_NOTIFICATION_TIMEPERIOD;<contact_name>;<notification_timeperiod>
:param con... | Change contact host notification timeperiod value
Format of the line that triggers function call::
CHANGE_CONTACT_HOST_NOTIFICATION_TIMEPERIOD;<contact_name>;<notification_timeperiod>
:param contact: contact to edit
:type contact: alignak.objects.contact.Contact
:param notifica... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L997-L1012 |
Alignak-monitoring/alignak | alignak/external_command.py | ExternalCommandManager.add_svc_comment | def add_svc_comment(self, service, author, comment):
"""Add a service comment
Format of the line that triggers function call::
ADD_SVC_COMMENT;<host_name>;<service_description>;<persistent:obsolete>;<author>;<comment>
:param service: service to add the comment
:type service: al... | python | def add_svc_comment(self, service, author, comment):
"""Add a service comment
Format of the line that triggers function call::
ADD_SVC_COMMENT;<host_name>;<service_description>;<persistent:obsolete>;<author>;<comment>
:param service: service to add the comment
:type service: al... | Add a service comment
Format of the line that triggers function call::
ADD_SVC_COMMENT;<host_name>;<service_description>;<persistent:obsolete>;<author>;<comment>
:param service: service to add the comment
:type service: alignak.objects.service.Service
:param author: author name... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L1014-L1048 |
Alignak-monitoring/alignak | alignak/external_command.py | ExternalCommandManager.add_host_comment | def add_host_comment(self, host, author, comment):
"""Add a host comment
Format of the line that triggers function call::
ADD_HOST_COMMENT;<host_name>;<persistent:obsolete>;<author>;<comment>
:param host: host to add the comment
:type host: alignak.objects.host.Host
:pa... | python | def add_host_comment(self, host, author, comment):
"""Add a host comment
Format of the line that triggers function call::
ADD_HOST_COMMENT;<host_name>;<persistent:obsolete>;<author>;<comment>
:param host: host to add the comment
:type host: alignak.objects.host.Host
:pa... | Add a host comment
Format of the line that triggers function call::
ADD_HOST_COMMENT;<host_name>;<persistent:obsolete>;<author>;<comment>
:param host: host to add the comment
:type host: alignak.objects.host.Host
:param author: author name
:type author: str
:par... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L1050-L1081 |
Alignak-monitoring/alignak | alignak/external_command.py | ExternalCommandManager.acknowledge_svc_problem | def acknowledge_svc_problem(self, service, sticky, notify, author, comment):
"""Acknowledge a service problem
Format of the line that triggers function call::
ACKNOWLEDGE_SVC_PROBLEM;<host_name>;<service_description>;<sticky>;<notify>;
<persistent:obsolete>;<author>;<comment>
:... | python | def acknowledge_svc_problem(self, service, sticky, notify, author, comment):
"""Acknowledge a service problem
Format of the line that triggers function call::
ACKNOWLEDGE_SVC_PROBLEM;<host_name>;<service_description>;<sticky>;<notify>;
<persistent:obsolete>;<author>;<comment>
:... | Acknowledge a service problem
Format of the line that triggers function call::
ACKNOWLEDGE_SVC_PROBLEM;<host_name>;<service_description>;<sticky>;<notify>;
<persistent:obsolete>;<author>;<comment>
:param service: service to acknowledge the problem
:type service: alignak.objects... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L1083-L1106 |
Alignak-monitoring/alignak | alignak/external_command.py | ExternalCommandManager.acknowledge_host_problem | def acknowledge_host_problem(self, host, sticky, notify, author, comment):
"""Acknowledge a host problem
Format of the line that triggers function call::
ACKNOWLEDGE_HOST_PROBLEM;<host_name>;<sticky>;<notify>;<persistent:obsolete>;<author>;
<comment>
:param host: host to acknow... | python | def acknowledge_host_problem(self, host, sticky, notify, author, comment):
"""Acknowledge a host problem
Format of the line that triggers function call::
ACKNOWLEDGE_HOST_PROBLEM;<host_name>;<sticky>;<notify>;<persistent:obsolete>;<author>;
<comment>
:param host: host to acknow... | Acknowledge a host problem
Format of the line that triggers function call::
ACKNOWLEDGE_HOST_PROBLEM;<host_name>;<sticky>;<notify>;<persistent:obsolete>;<author>;
<comment>
:param host: host to acknowledge the problem
:type host: alignak.objects.host.Host
:param sticky:... | https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/external_command.py#L1108-L1133 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.