Example #1
0
def secret(uuid):
    conn = libvrt.wvmSecrets()
    try:
        conn.delete_secret(uuid)
    except libvirtError as err:
        error_msg(err)
    conn.close()
Example #2
0
def secret(uuid, secret: SecretValue):
    conn = libvrt.wvmSecrets()
    try:
        conn.set_secret_value(uuid, secret.value)
    except libvirtError as err:
        error_msg(err)

    conn.close()
    return secret
Example #3
0
def secrets(secret: SecretCreate):
    conn = libvrt.wvmSecrets()
    try:
        conn.create_secret(secret.ephemeral, secret.private,
                           secret.secret_type, secret.data)
    except libvirtError as err:
        error_msg(err)
    conn.close()
    return secret
Example #4
0
def secrets():
    secrets_list = []
    conn = libvrt.wvmSecrets()
    for uuid in conn.get_secrets():
        secret = conn.get_secret(uuid)
        secrets_list.append({
            'usage': secret.usageID(),
            'uuid': secret.UUIDString(),
            'usageType': secret.usageType(),
            'value': conn.get_secret_value(uuid)
        })
    conn.close()
    return {'secrets': secrets_list}
Example #5
0
def secret(uuid):
    conn = libvrt.wvmSecrets()
    try:
        secret = conn.get_secret(uuid)
    except libvirtError as err:
        error_msg(err)

    secret = {
        'usage': secret.usageID(),
        'uuid': secret.UUIDString(),
        'usageType': secret.usageType(),
        'value': conn.get_secret_value(uuid)
    }
    conn.close()
    return {'secret': secret}