コード例 #1
0
ファイル: service.py プロジェクト: yiluzhu/lemur
def get(aid):
    """
    Retrieves an api key by its ID.
    :param aid: The access key id to get.
    :return:
    """
    return database.get(ApiKey, aid)
コード例 #2
0
ファイル: service.py プロジェクト: Netflix/lemur
def get(policy_id):
    """
    Retrieves policy by its ID.
    :param policy_id:
    :return:
    """
    return database.get(RotationPolicy, policy_id)
コード例 #3
0
def get(policy_id):
    """
    Retrieves policy by its ID.
    :param policy_id:
    :return:
    """
    return database.get(RotationPolicy, policy_id)
コード例 #4
0
def update(endpoint_id, **kwargs):
    endpoint = database.get(Endpoint, endpoint_id)

    endpoint.policy = kwargs['policy']
    endpoint.certificate = kwargs['certificate']
    database.update(endpoint)
    return endpoint
コード例 #5
0
def update(endpoint_id, **kwargs):
    endpoint = database.get(Endpoint, endpoint_id)

    endpoint.policy = kwargs["policy"]
    endpoint.certificate = kwargs["certificate"]
    endpoint.source = kwargs["source"]
    endpoint.certificate_path = kwargs.get("certificate_path")
    endpoint.registry_type = kwargs.get("registry_type")
    existing_alias = {}
    for e in endpoint.aliases:
        existing_alias[e.alias] = e
    endpoint.aliases = []
    if "aliases" in kwargs:
        for name in kwargs["aliases"]:
            if name in existing_alias:
                endpoint.aliases.append(existing_alias[name])
            else:
                endpoint.aliases.append(EndpointDnsAlias(alias=name))
    endpoint.last_updated = arrow.utcnow()
    metrics.send(
        "endpoint_updated", "counter", 1,
        metric_tags={"source": endpoint.source.label, "type": endpoint.type}
    )
    database.update(endpoint)
    return endpoint
コード例 #6
0
ファイル: service.py プロジェクト: harmw/lemur
def get_by_name(role_name):
    """
    Retrieve a role by its name

    :param role_name:
    :return:
    """
    return database.get(Role, role_name, field='name')
コード例 #7
0
def get_by_label(label):
    """
    Retrieves a notification by its label

    :param label:
    :return:
    """
    return database.get(Notification, label, field='label')
コード例 #8
0
ファイル: service.py プロジェクト: harmw/lemur
def get(user_id):
    """
    Retrieve a user from the database

    :param user_id:
    :return:
    """
    return database.get(User, user_id)
コード例 #9
0
ファイル: service.py プロジェクト: harmw/lemur
def get_by_email(email):
    """
    Retrieve a user from the database by their email address

    :param email:
    :return:
    """
    return database.get(User, email, field='email')
コード例 #10
0
ファイル: service.py プロジェクト: harmw/lemur
def get_by_username(username):
    """
    Retrieve a user from the database by their username

    :param username:
    :return:
    """
    return database.get(User, username, field='username')
コード例 #11
0
ファイル: service.py プロジェクト: harmw/lemur
def get(role_id):
    """
    Retrieve a role by ID

    :param role_id:
    :return:
    """
    return database.get(Role, role_id)
コード例 #12
0
ファイル: service.py プロジェクト: bossadvisors/lemur
def get_by_label(label):
    """
    Retrieves a notification by it's label

    :param label:
    :return:
    """
    return database.get(Notification, label, field='label')
コード例 #13
0
def get(role_id):
    """
    Retrieve a role by ID

    :param role_id:
    :return:
    """
    return database.get(Role, role_id)
コード例 #14
0
def get(domain_id):
    """
    Fetches one domain

    :param domain_id:
    :return:
    """
    return database.get(Domain, domain_id)
コード例 #15
0
def get(authority_id):
    """
    Retrieves an authority given it's ID

    :param authority_id:
    :return:
    """
    return database.get(Authority, authority_id)
コード例 #16
0
def get(user_id):
    """
    Retrieve a user from the database

    :param user_id:
    :return:
    """
    return database.get(User, user_id)
コード例 #17
0
def get_by_name(authority_name):
    """
    Retrieves an authority given it's name.

    :param authority_name:
    :return:
    """
    return database.get(Authority, authority_name, field='name')
コード例 #18
0
def get_by_username(username):
    """
    Retrieve a user from the database by their username

    :param username:
    :return:
    """
    return database.get(User, username, field="username")
コード例 #19
0
def get_by_email(email):
    """
    Retrieve a user from the database by their email address

    :param email:
    :return:
    """
    return database.get(User, email, field="email")
コード例 #20
0
ファイル: service.py プロジェクト: harmw/lemur
def get(domain_id):
    """
    Fetches one domain

    :param domain_id:
    :return:
    """
    return database.get(Domain, domain_id)
コード例 #21
0
def get_by_name(role_name):
    """
    Retrieve a role by its name

    :param role_name:
    :return:
    """
    return database.get(Role, role_name, field="name")
コード例 #22
0
ファイル: service.py プロジェクト: Netflix/lemur
def get(endpoint_id):
    """
    Retrieves an endpoint given it's ID

    :param endpoint_id:
    :return:
    """
    return database.get(Endpoint, endpoint_id)
コード例 #23
0
ファイル: service.py プロジェクト: bossadvisors/lemur
def get(cert_id):
    """
    Retrieves certificate by it's ID.

    :param cert_id:
    :return:
    """
    return database.get(Certificate, cert_id)
コード例 #24
0
ファイル: service.py プロジェクト: intgr/lemur
def get_by_label(label):
    """
    Retrieves a destination by its label

    :param label:
    :return:
    """
    return database.get(Destination, label, field='label')
コード例 #25
0
ファイル: service.py プロジェクト: bossadvisors/lemur
def get_by_name(name):
    """
    Retrieves certificate by it's Name.

    :param name:
    :return:
    """
    return database.get(Certificate, name, field='name')
コード例 #26
0
ファイル: service.py プロジェクト: jramosf/lemur
def get_by_label(label):
    """
    Retrieves a destination by its label

    :param label:
    :return:
    """
    return database.get(Destination, label, field='label')
コード例 #27
0
ファイル: service.py プロジェクト: Netflix/lemur
def get_by_dnsname(dnsname):
    """
    Retrieves an endpoint given it's name.

    :param dnsname:
    :return:
    """
    return database.get(Endpoint, dnsname, field='dnsname')
コード例 #28
0
ファイル: service.py プロジェクト: EADPCloudSeattle/lemur
def get_by_name(authority_name):
    """
    Retrieves an authority given it's name.

    :param authority_name:
    :return:
    """
    return database.get(Authority, authority_name, field='name')
コード例 #29
0
ファイル: service.py プロジェクト: Netflix/lemur
def get_or_create_policy(**kwargs):
    policy = database.get(Policy, kwargs['name'], field='name')

    if not policy:
        policy = Policy(**kwargs)
        database.create(policy)

    return policy
コード例 #30
0
ファイル: service.py プロジェクト: EADPCloudSeattle/lemur
def get(authority_id):
    """
    Retrieves an authority given it's ID

    :param authority_id:
    :return:
    """
    return database.get(Authority, authority_id)
コード例 #31
0
ファイル: service.py プロジェクト: terinjokes/lemur
def get_by_name(name):
    """
    Retrieves certificate by it's Name.

    :param name:
    :return:
    """
    return database.get(Certificate, name, field='name')
コード例 #32
0
ファイル: service.py プロジェクト: EADPCloudSeattle/lemur
def get_by_label(label):
    """
    Retrieves a source by it's label

    :param label:
    :return:
    """
    return database.get(Source, label, field='label')
コード例 #33
0
ファイル: service.py プロジェクト: terinjokes/lemur
def get(cert_id):
    """
    Retrieves certificate by it's ID.

    :param cert_id:
    :return:
    """
    return database.get(Certificate, cert_id)
コード例 #34
0
def get_by_dnsname(dnsname):
    """
    Retrieves an endpoint given it's name.

    :param dnsname:
    :return:
    """
    return database.get(Endpoint, dnsname, field='dnsname')
コード例 #35
0
def get_or_create_cipher(**kwargs):
    cipher = database.get(Cipher, kwargs['name'], field='name')

    if not cipher:
        cipher = Cipher(**kwargs)
        database.create(cipher)

    return cipher
コード例 #36
0
def get(endpoint_id):
    """
    Retrieves an endpoint given it's ID

    :param endpoint_id:
    :return:
    """
    return database.get(Endpoint, endpoint_id)
コード例 #37
0
def get_or_create_policy(**kwargs):
    policy = database.get(Policy, kwargs['name'], field='name')

    if not policy:
        policy = Policy(**kwargs)
        database.create(policy)

    return policy
コード例 #38
0
def get_by_label(label):
    """
    Retrieves a source by it's label

    :param label:
    :return:
    """
    return database.get(Source, label, field='label')
コード例 #39
0
ファイル: service.py プロジェクト: Netflix/lemur
def get_or_create_cipher(**kwargs):
    cipher = database.get(Cipher, kwargs['name'], field='name')

    if not cipher:
        cipher = Cipher(**kwargs)
        database.create(cipher)

    return cipher
コード例 #40
0
ファイル: service.py プロジェクト: thousandeyes/lemur
def get_by_name(name):
    """
    Retrieves an endpoint given it's name.

    :param name:
    :return:
    """
    return database.get(Endpoint, name, field="name")
コード例 #41
0
def get(source_id):
    """
    Retrieves an source by it's lemur assigned ID.

    :param source_id: Lemur assigned ID
    :rtype : Source
    :return:
    """
    return database.get(Source, source_id)
コード例 #42
0
ファイル: service.py プロジェクト: EADPCloudSeattle/lemur
def get(source_id):
    """
    Retrieves an source by it's lemur assigned ID.

    :param source_id: Lemur assigned ID
    :rtype : Source
    :return:
    """
    return database.get(Source, source_id)
コード例 #43
0
ファイル: service.py プロジェクト: bossadvisors/lemur
def get(notification_id):
    """
    Retrieves an notification by it's lemur assigned ID.

    :param notification_id: Lemur assigned ID
    :rtype : Notification
    :return:
    """
    return database.get(Notification, notification_id)
コード例 #44
0
ファイル: service.py プロジェクト: jramosf/lemur
def get(destination_id):
    """
    Retrieves an destination by its lemur assigned ID.

    :param destination_id: Lemur assigned ID
    :rtype : Destination
    :return:
    """
    return database.get(Destination, destination_id)
コード例 #45
0
ファイル: service.py プロジェクト: intgr/lemur
def get(destination_id):
    """
    Retrieves an destination by its lemur assigned ID.

    :param destination_id: Lemur assigned ID
    :rtype : Destination
    :return:
    """
    return database.get(Destination, destination_id)
コード例 #46
0
def update(endpoint_id, **kwargs):
    endpoint = database.get(Endpoint, endpoint_id)

    endpoint.policy = kwargs['policy']
    endpoint.certificate = kwargs['certificate']
    endpoint.source = kwargs['source']
    metrics.send('endpoint_added', 'counter', 1)
    database.update(endpoint)
    return endpoint
コード例 #47
0
def get(notification_id):
    """
    Retrieves an notification by its lemur assigned ID.

    :param notification_id: Lemur assigned ID
    :rtype : Notification
    :return:
    """
    return database.get(Notification, notification_id)
コード例 #48
0
ファイル: service.py プロジェクト: teamlakana/lemur
def update(endpoint_id, **kwargs):
    endpoint = database.get(Endpoint, endpoint_id)

    endpoint.policy = kwargs['policy']
    endpoint.certificate = kwargs['certificate']
    endpoint.source = kwargs['source']
    endpoint.last_updated = arrow.utcnow()
    metrics.send('endpoint_updated', 'counter', 1, metric_tags={'source': endpoint.source.label})
    database.update(endpoint)
    return endpoint
コード例 #49
0
ファイル: service.py プロジェクト: Netflix/lemur
def update(endpoint_id, **kwargs):
    endpoint = database.get(Endpoint, endpoint_id)

    endpoint.policy = kwargs['policy']
    endpoint.certificate = kwargs['certificate']
    endpoint.source = kwargs['source']
    endpoint.last_updated = arrow.utcnow()
    metrics.send('endpoint_updated', 'counter', 1, metric_tags={'source': endpoint.source.label})
    database.update(endpoint)
    return endpoint
コード例 #50
0
ファイル: service.py プロジェクト: thousandeyes/lemur
def update(endpoint_id, **kwargs):
    endpoint = database.get(Endpoint, endpoint_id)

    endpoint.policy = kwargs["policy"]
    endpoint.certificate = kwargs["certificate"]
    endpoint.source = kwargs["source"]
    endpoint.last_updated = arrow.utcnow()
    metrics.send("endpoint_updated",
                 "counter",
                 1,
                 metric_tags={"source": endpoint.source.label})
    database.update(endpoint)
    return endpoint
コード例 #51
0
ファイル: service.py プロジェクト: Netflix/lemur
def get(authorization_id):
    """
    Retrieve dns authorization by ID
    """
    return database.get(Authorization, authorization_id)
コード例 #52
0
ファイル: service.py プロジェクト: Netflix/lemur
def get_by_name(pending_cert_name):
    """
    Retrieve pending certificate by name
    """
    return database.get(PendingCertificate, pending_cert_name, field='name')
コード例 #53
0
ファイル: service.py プロジェクト: Netflix/lemur
def get(pending_cert_id):
    """
    Retrieve pending certificate by ID
    """
    return database.get(PendingCertificate, pending_cert_id)
コード例 #54
0
def get(pending_cert_id):
    """
    Retrieve pending certificate by ID
    """
    return database.get(PendingCertificate, pending_cert_id)
コード例 #55
0
def get_by_name(pending_cert_name):
    """
    Retrieve pending certificate by name
    """
    return database.get(PendingCertificate, pending_cert_name, field="name")