def apply_device_labels(device_id: ResourceID) -> APICall:
    """Removes all existing labels from the device and
    applies the device labels (see About Device Labels) specified
    by id. Returns a reduced version of device object
    containing an array of the applied labels."""
    url_path = f"/devices/{device_id}/labels"
    return APICall(url_path)
def get_active_alerts(
    start_time: str,
    end_time: str,
    filter_by: str,
    filter_val: str,
    show_mitigations: int,
    show_alarms: int,
    show_matches: int,
    learning_mode: int,
) -> APICall:
    """ Returns active alerts (alarms)."""
    return APICall(
        f"/alerts-active/alarms?startTime={start_time}&endTime={end_time}&filterBy={filter_by}&"
        f"filterVal={filter_val}&showMitigations={show_mitigations}&showAlarms={show_alarms}&"
        f"showMatches={show_matches}&learningMode={learning_mode}")
Esempio n. 3
0
def delete_tag(tag_id: ResourceID) -> APICall:
    """Deletes a tag."""
    url_path = f"/tag/{tag_id}"
    return APICall(url_path)
Esempio n. 4
0
def create_tag() -> APICall:
    """Creates and returns a tag object containing information about an individual tag"""
    return APICall("/tag")
Esempio n. 5
0
def get_sites() -> APICall:
    """Returns an array of sites objects that each contain information about an individual site."""
    return APICall("/sites")
Esempio n. 6
0
def update_site(site_id: ResourceID) -> APICall:
    """Updates and returns a site object containing information about an individual site"""
    url_path = f"/site/{site_id}"
    return APICall(url_path)
def get_tenants() -> APICall:
    """Returns an array of tenants, each of which contains
    information about an individual tenant."""
    return APICall("/mykentik/tenants")
def create_tenant_user(tenant_id: ResourceID) -> APICall:
    """Creates and returns a tenant user object containing
    information about an individual tenant user"""
    url_path = f"/mykentik/tenant/{tenant_id}/user"
    return APICall(url_path)
Esempio n. 9
0
def get_batch_operation_status(batch_operation_guid: str) -> APICall:
    """Returns batch API call which provides status of batch operation specified by its guid"""
    url_path = f"/batch/{batch_operation_guid}/status"
    return APICall(url_path)
Esempio n. 10
0
def populators_batch_operation(dimension_name: str) -> APICall:
    """Returns batch API call to custom dimensions populators endpoint"""
    url_path = f"/batch/customdimensions/{dimension_name}/populators"
    return APICall(url_path)
Esempio n. 11
0
def get_device_labels() -> APICall:
    """Returns an array of device_labels objects
    that each contain information about an individual device_label."""
    return APICall("/deviceLabels")
Esempio n. 12
0
def delete_device_label(device_label_id: ResourceID) -> APICall:
    """Deletes a device_label."""
    url_path = f"/deviceLabels/{device_label_id}"
    return APICall(url_path)
Esempio n. 13
0
def update_device_label(device_label_id: ResourceID) -> APICall:
    """Updates and returns a device_label object
    containing information about an individual device_label"""
    url_path = f"/deviceLabels/{device_label_id}"
    return APICall(url_path)
Esempio n. 14
0
def create_device_label() -> APICall:
    """Creates and returns a device_label object
    containing information about an individual device_label"""
    return APICall("/deviceLabels")
Esempio n. 15
0
def create_manual_mitigation() -> APICall:
    """Creates a manual mitigation. A mitigation started manually will not clear on its own.
    It must be stopped manually from the active alerts page."""
    return APICall("/alerts/manual-mitigate")
def delete_populator(custom_dimension_id: ResourceID,
                     populator_id: ResourceID) -> APICall:
    """Deletes a populator"""
    url_path = f"/customdimension/{custom_dimension_id}/populator/{populator_id}"
    return APICall(url_path)
def get_tenant_info(tenant_id: ResourceID) -> APICall:
    """Returns a tenant object containing information about an individual tenant"""
    url_path = f"/mykentik/tenant/{tenant_id}"
    return APICall(url_path)
Esempio n. 18
0
def flow_tags_batch_operation() -> APICall:
    """Returns batch API call to tags endpoint"""
    return APICall("/batch/tags")
def delete_tenant_user(tenant_id: ResourceID, user_id: ResourceID) -> APICall:
    """Deletes a tenant user from the system"""
    url_path = f"/mykentik/tenant/{tenant_id}/user/{user_id}"
    return APICall(url_path)
def create_custom_dimension() -> APICall:
    """Creates and returns a custom dimension object
    containing information about an individual custom dimension"""
    return APICall("/customdimension")
Esempio n. 21
0
def create_site() -> APICall:
    """Creates and returns a site object containing information about an individual site"""
    return APICall("/site")
def update_custom_dimension(custom_dimension_id: ResourceID) -> APICall:
    """Updates and returns a custom dimension object
    containing information about an individual custom dimension"""
    url_path = f"/customdimension/{custom_dimension_id}"
    return APICall(url_path)
Esempio n. 23
0
def delete_site(site_id: ResourceID) -> APICall:
    """Deletes a site."""
    url_path = f"/site/{site_id}"
    return APICall(url_path)
def delete_custom_dimension(custom_dimension_id: ResourceID) -> APICall:
    """Deletes a custom dimension."""
    url_path = f"/customdimension/{custom_dimension_id}"
    return APICall(url_path)
Esempio n. 25
0
def get_tag_info(tag_id: ResourceID) -> APICall:
    """Returns a tag object containing information about an individual tag"""
    url_path = f"/tag/{tag_id}"
    return APICall(url_path)
def create_populator(custom_dimension_id: ResourceID) -> APICall:
    """Creates and returns a populator object containing
    information about an individual populator"""
    return APICall(f"/customdimension/{custom_dimension_id}/populator")
Esempio n. 27
0
def update_tag(tag_id: ResourceID) -> APICall:
    """Updates and returns a tag object containing information about an individual tag"""
    url_path = f"/tag/{tag_id}"
    return APICall(url_path)
def update_populator(custom_dimension_id: ResourceID,
                     populator_id: ResourceID) -> APICall:
    """Updates and returns a populator object containing
    information about an individual populator"""
    url_path = f"/customdimension/{custom_dimension_id}/populator/{populator_id}"
    return APICall(url_path)
Esempio n. 29
0
def get_tags() -> APICall:
    """Returns an array of tags objects that each contain information about an individual tag."""
    return APICall("/tags")
def get_custom_dimensions() -> APICall:
    """Returns an array of custom dimensions objects
    that each contain information about an individual custom dimension."""
    return APICall("/customdimensions")