scaleway.cockpit.v1 package
Submodules
scaleway.cockpit.v1.api module
- class scaleway.cockpit.v1.api.CockpitV1GlobalAPI(client: Client, *, bypass_validation: bool = False)
Bases:
APIThe Cockpit Global API allows you to manage your Cockpit’s Grafana.
- create_grafana_user(*, login: str, project_id: str | None = None, role: GrafanaUserRole | None = None) GrafanaUser
Create a Grafana user. Create a Grafana user to connect to your Cockpit’s Grafana. Upon creation, your user password displays only once, so make sure that you save it. Each Grafana user is associated with a role: viewer or editor. A viewer can only view dashboards, whereas an editor can create and edit dashboards. Note that the admin username is not available for creation. :param login: Username of the Grafana user. Note that the admin username is not available for creation. :param project_id: ID of the Project in which to create the Grafana user. :param role: Role assigned to the Grafana user. :return:
GrafanaUserUsage:
result = api.create_grafana_user( login="example", )
- delete_grafana_user(*, project_id: str | None = None, grafana_user_id: int) None
Delete a Grafana user. Delete a Grafana user from your Cockpit’s Grafana, specified by the ID of the Project the Cockpit belongs to, and the ID of the Grafana user. :param project_id: ID of the Project to target. :param grafana_user_id: ID of the Grafana user.
Usage:
result = api.delete_grafana_user( grafana_user_id=1, )
- get_current_plan(*, project_id: str | None = None) Plan
Get current plan. Retrieve a pricing plan for the given Project, specified by the ID of the Project. Deprecated: retention is now managed at the data source level. :param project_id: ID of the Project. :return:
Plan:deprecatedUsage:
result = api.get_current_plan()
- get_grafana(*, project_id: str | None = None) Grafana
Get your Cockpit’s Grafana. Retrieve information on your Cockpit’s Grafana, specified by the ID of the Project the Cockpit belongs to. The output returned displays the URL to access your Cockpit’s Grafana. :param project_id: ID of the Project. :return:
GrafanaUsage:
result = api.get_grafana()
- get_grafana_product_dashboard(*, project_id: str | None = None, dashboard_name: str) GrafanaProductDashboard
Get Scaleway resource dashboard. Retrieve information about the dashboard of a Scaleway resource in Grafana, specified by the ID of the Project the Cockpit belongs to, and the name of the dashboard. :param project_id: ID of the Project the dashboard belongs to. :param dashboard_name: Name of the dashboard. :return:
GrafanaProductDashboardUsage:
result = api.get_grafana_product_dashboard( dashboard_name="example", )
- list_grafana_product_dashboards(*, project_id: str | None = None, page: int | None = None, page_size: int | None = None, tags: List[str] | None = None) ListGrafanaProductDashboardsResponse
List Scaleway resources dashboards. Retrieve a list of available dashboards in Grafana, for all Scaleway resources which are integrated with Cockpit. :param project_id: ID of the Project to target. :param page: Page number. :param page_size: Page size. :param tags: Tags to filter for. :return:
ListGrafanaProductDashboardsResponseUsage:
result = api.list_grafana_product_dashboards()
- list_grafana_product_dashboards_all(*, project_id: str | None = None, page: int | None = None, page_size: int | None = None, tags: List[str] | None = None) List[GrafanaProductDashboard]
List Scaleway resources dashboards. Retrieve a list of available dashboards in Grafana, for all Scaleway resources which are integrated with Cockpit. :param project_id: ID of the Project to target. :param page: Page number. :param page_size: Page size. :param tags: Tags to filter for. :return:
List[GrafanaProductDashboard]Usage:
result = api.list_grafana_product_dashboards_all()
- list_grafana_users(*, page: int | None = None, page_size: int | None = None, order_by: ListGrafanaUsersRequestOrderBy | None = None, project_id: str | None = None) ListGrafanaUsersResponse
List Grafana users. List all Grafana users created in your Cockpit’s Grafana. By default, the Grafana users returned in the list are ordered in ascending order. :param page: Page number. :param page_size: Page size. :param order_by: Order of the Grafana users. :param project_id: ID of the Project to target. :return:
ListGrafanaUsersResponseUsage:
result = api.list_grafana_users()
- list_grafana_users_all(*, page: int | None = None, page_size: int | None = None, order_by: ListGrafanaUsersRequestOrderBy | None = None, project_id: str | None = None) List[GrafanaUser]
List Grafana users. List all Grafana users created in your Cockpit’s Grafana. By default, the Grafana users returned in the list are ordered in ascending order. :param page: Page number. :param page_size: Page size. :param order_by: Order of the Grafana users. :param project_id: ID of the Project to target. :return:
List[GrafanaUser]Usage:
result = api.list_grafana_users_all()
- list_plans(*, page: int | None = None, page_size: int | None = None, order_by: ListPlansRequestOrderBy | None = None) ListPlansResponse
List plan types. Retrieve a list of available pricing plan types. Deprecated: retention is now managed at the data source level. :param page: Page number. :param page_size: Page size. :param order_by: :return:
ListPlansResponse:deprecatedUsage:
result = api.list_plans()
- list_plans_all(*, page: int | None = None, page_size: int | None = None, order_by: ListPlansRequestOrderBy | None = None) List[Plan]
List plan types. Retrieve a list of available pricing plan types. Deprecated: retention is now managed at the data source level. :param page: Page number. :param page_size: Page size. :param order_by: :return:
List[Plan]:deprecatedUsage:
result = api.list_plans_all()
- reset_grafana_user_password(*, project_id: str | None = None, grafana_user_id: int) GrafanaUser
Reset a Grafana user password. Reset the password of a Grafana user, specified by the ID of the Project the Cockpit belongs to, and the ID of the Grafana user. A new password regenerates and only displays once. Make sure that you save it. :param project_id: ID of the Project to target. :param grafana_user_id: ID of the Grafana user. :return:
GrafanaUserUsage:
result = api.reset_grafana_user_password( grafana_user_id=1, )
- select_plan(*, project_id: str | None = None, plan_name: PlanName | None = None) Plan
Apply a pricing plan. Apply a pricing plan on a given Project. You must specify the ID of the pricing plan type. Note that you will be billed for the plan you apply. Deprecated: retention is now managed at the data source level. :param project_id: ID of the Project. :param plan_name: Name of the pricing plan. :return:
Plan:deprecatedUsage:
result = api.select_plan()
- sync_grafana_data_sources(*, project_id: str | None = None) None
Synchronize Grafana data sources. Trigger the synchronization of all your data sources and the alert manager in the relevant regions. The alert manager will only be synchronized if you have enabled it. :param project_id: ID of the Project to target.
Usage:
result = api.sync_grafana_data_sources()
- class scaleway.cockpit.v1.api.CockpitV1RegionalAPI(client: Client, *, bypass_validation: bool = False)
Bases:
APIThe Cockpit API allows you to create data sources and Cockpit tokens to store and query data types such as metrics, logs, and traces. You can also push your data into Cockpit, and send alerts to your contact points when your resources may require your attention, using the regional Alert manager.
- create_contact_point(*, region: str | None = None, project_id: str | None = None, email: ContactPointEmail | None = None, send_resolved_notifications: bool | None = None) ContactPoint
Create a contact point. Contact points are email addresses associated with the default receiver, that the Alert manager sends alerts to. The source of the alerts are data sources within the same Project and region as the Alert manager. If you need to receive alerts for other receivers, you can create additional contact points and receivers in Grafana. Make sure that you select the Scaleway Alert manager. :param region: Region to target. If none is passed will use default region from the config. :param project_id: ID of the Project to create the contact point in. :param email: Email address of the contact point to create. One-Of (‘configuration’): at most one of ‘email’ could be set. :param send_resolved_notifications: Send an email notification when an alert is marked as resolved. :return:
ContactPointUsage:
result = api.create_contact_point()
- create_data_source(*, name: str, region: str | None = None, project_id: str | None = None, type_: DataSourceType | None = None, retention_days: int | None = None) DataSource
Create a data source. You must specify the data source name and type (metrics, logs, traces) upon creation. The name of the data source will then be used as reference to name the associated Grafana data source. :param name: Data source name. :param region: Region to target. If none is passed will use default region from the config. :param project_id: ID of the Project the data source belongs to. :param type_: Data source type. :param retention_days: Default values are 31 days for metrics, 7 days for logs and traces. :return:
DataSourceUsage:
result = api.create_data_source( name="example", )
- create_token(*, name: str, region: str | None = None, project_id: str | None = None, token_scopes: List[TokenScope] | None = None) Token
Create a token. Give your token the relevant scopes to ensure it has the right permissions to interact with your data sources and the Alert manager. Make sure that you create your token in the same regions as the data sources you want to use it for. Upon creation, your token’s secret key display only once. Make sure that you save it. :param name: Name of the token. :param region: Region to target. If none is passed will use default region from the config. :param project_id: ID of the Project the token belongs to. :param token_scopes: Token permission scopes. :return:
TokenUsage:
result = api.create_token( name="example", )
- delete_contact_point(*, region: str | None = None, project_id: str | None = None, email: ContactPointEmail | None = None) None
Delete a contact point. Delete a contact point associated with the default receiver. :param region: Region to target. If none is passed will use default region from the config. :param project_id: ID of the Project containing the contact point to delete. :param email: Email address of the contact point to delete. One-Of (‘configuration’): at most one of ‘email’ could be set.
Usage:
result = api.delete_contact_point()
- delete_data_source(*, data_source_id: str, region: str | None = None) None
Delete a data source. Delete a given data source. Note that this action will permanently delete this data source and any data associated with it. :param data_source_id: ID of the data source to delete. :param region: Region to target. If none is passed will use default region from the config.
Usage:
result = api.delete_data_source( data_source_id="example", )
- delete_token(*, token_id: str, region: str | None = None) None
Delete a token. Delete a given token, specified by the token ID. Deleting a token is irreversible and cannot be undone. :param token_id: ID of the token to delete. :param region: Region to target. If none is passed will use default region from the config.
Usage:
result = api.delete_token( token_id="example", )
- disable_alert_manager(*, region: str | None = None, project_id: str | None = None) AlertManager
Disable the Alert manager. Disabling the Alert manager deletes the contact points you have created and disables managed alerts in the specified Project and region. :param region: Region to target. If none is passed will use default region from the config. :param project_id: ID of the Project to disable the Alert manager in. :return:
AlertManagerUsage:
result = api.disable_alert_manager()
- disable_alert_rules(*, region: str | None = None, project_id: str | None = None, rule_ids: List[str] | None = None) DisableAlertRulesResponse
Disable preconfigured alert rules. Disable alert rules from the list of available preconfigured rules. :param region: Region to target. If none is passed will use default region from the config. :param project_id: ID of the Project. :param rule_ids: List of IDs of the rules to enable. If empty, disables all preconfigured rules. :return:
DisableAlertRulesResponseUsage:
result = api.disable_alert_rules()
- disable_managed_alerts(*, region: str | None = None, project_id: str | None = None) AlertManager
Disable managed alerts. Disable the sending of managed alerts for the specified Project. :param region: Region to target. If none is passed will use default region from the config. :param project_id: ID of the Project. :return:
AlertManagerUsage:
result = api.disable_managed_alerts()
- enable_alert_manager(*, region: str | None = None, project_id: str | None = None) AlertManager
Enable the Alert manager. Enabling the Alert manager allows you to enable managed alerts and create contact points in the specified Project and region, to be notified when your Scaleway resources may require your attention. :param region: Region to target. If none is passed will use default region from the config. :param project_id: ID of the Project to enable the Alert manager in. :return:
AlertManagerUsage:
result = api.enable_alert_manager()
- enable_alert_rules(*, region: str | None = None, project_id: str | None = None, rule_ids: List[str] | None = None) EnableAlertRulesResponse
Enable preconfigured alert rules. Enable alert rules from the list of available preconfigured rules. :param region: Region to target. If none is passed will use default region from the config. :param project_id: ID of the Project. :param rule_ids: List of IDs of the rules to enable. If empty, enables all preconfigured rules. :return:
EnableAlertRulesResponseUsage:
result = api.enable_alert_rules()
- enable_managed_alerts(*, region: str | None = None, project_id: str | None = None) AlertManager
Enable managed alerts. Enable the sending of managed alerts for the specified Project. Managed alerts are predefined alerts that apply to Scaleway recources integrated with Cockpit by default. :param region: Region to target. If none is passed will use default region from the config. :param project_id: ID of the Project. :return:
AlertManagerUsage:
result = api.enable_managed_alerts()
- get_alert_manager(*, region: str | None = None, project_id: str | None = None) AlertManager
Get the Alert manager. Retrieve information about the Alert manager which is unique per Project and region. By default the Alert manager is disabled. The output returned displays a URL to access the Alert manager, and whether the Alert manager and managed alerts are enabled. :param region: Region to target. If none is passed will use default region from the config. :param project_id: Project ID of the requested Alert manager. :return:
AlertManagerUsage:
result = api.get_alert_manager()
- get_config(*, region: str | None = None) GetConfigResponse
Get the Cockpit configuration. :param region: Region to target. If none is passed will use default region from the config. :return:
GetConfigResponseUsage:
result = api.get_config()
- get_data_source(*, data_source_id: str, region: str | None = None) DataSource
Get a data source. Retrieve information about a given data source, specified by the data source ID. The data source’s information such as its name, type, URL, origin, and retention period, is returned. :param data_source_id: ID of the relevant data source. :param region: Region to target. If none is passed will use default region from the config. :return:
DataSourceUsage:
result = api.get_data_source( data_source_id="example", )
- get_rules_count(*, region: str | None = None, project_id: str | None = None) GetRulesCountResponse
Get a detailed count of enabled rules in the specified Project. Includes preconfigured and custom alerting and recording rules. :param region: Region to target. If none is passed will use default region from the config. :param project_id: ID of the Project to retrieve the rule count for. :return:
GetRulesCountResponseUsage:
result = api.get_rules_count()
- get_token(*, token_id: str, region: str | None = None) Token
Get a token. Retrieve information about a given token, specified by the token ID. The token’s information such as its scopes, is returned. :param token_id: Token ID. :param region: Region to target. If none is passed will use default region from the config. :return:
TokenUsage:
result = api.get_token( token_id="example", )
- get_usage_overview(*, region: str | None = None, project_id: str | None = None, interval: str | None = None) UsageOverview
Get data source usage overview. Retrieve the volume of data ingested for each of your data sources in the specified project and region. :param region: Region to target. If none is passed will use default region from the config. :param project_id: :param interval: :return:
UsageOverviewUsage:
result = api.get_usage_overview()
- list_alerts(*, region: str | None = None, project_id: str | None = None, rule_status: AlertStatus | None = None, is_preconfigured: bool | None = None, state: AlertState | None = None, data_source_id: str | None = None) ListAlertsResponse
List alerts. List preconfigured and/or custom alerts for the specified Project and data source. :param region: Region to target. If none is passed will use default region from the config. :param project_id: Project ID to filter for, only alerts from this Project will be returned. :param rule_status: Returns only alerts with the given activation status. If omitted, no alert filtering is applied. Other filters may still apply. :param is_preconfigured: True returns only preconfigured alerts. False returns only custom alerts. If omitted, no filtering is applied on alert types. Other filters may still apply. :param state: Valid values to filter on are inactive, pending and firing. If omitted, no filtering is applied on alert states. Other filters may still apply. :param data_source_id: If omitted, only alerts from the default Scaleway metrics data source will be listed. :return:
ListAlertsResponseUsage:
result = api.list_alerts()
- list_contact_points(*, region: str | None = None, page: int | None = None, page_size: int | None = None, project_id: str | None = None) ListContactPointsResponse
List contact points. Retrieve a list of contact points for the specified Project. The response lists all contact points and receivers created in Grafana or via the API. :param region: Region to target. If none is passed will use default region from the config. :param page: Page number to return, from the paginated results. :param page_size: Total count of contact points to return per page. :param project_id: ID of the Project containing the contact points to list. :return:
ListContactPointsResponseUsage:
result = api.list_contact_points()
- list_contact_points_all(*, region: str | None = None, page: int | None = None, page_size: int | None = None, project_id: str | None = None) List[ContactPoint]
List contact points. Retrieve a list of contact points for the specified Project. The response lists all contact points and receivers created in Grafana or via the API. :param region: Region to target. If none is passed will use default region from the config. :param page: Page number to return, from the paginated results. :param page_size: Total count of contact points to return per page. :param project_id: ID of the Project containing the contact points to list. :return:
List[ContactPoint]Usage:
result = api.list_contact_points_all()
- list_data_sources(*, region: str | None = None, page: int | None = None, page_size: int | None = None, order_by: ListDataSourcesRequestOrderBy | None = None, project_id: str | None = None, origin: DataSourceOrigin | None = None, types: List[DataSourceType] | None = None) ListDataSourcesResponse
List data sources. Retrieve the list of data sources available in the specified region. By default, the data sources returned in the list are ordered by creation date, in ascending order. :param region: Region to target. If none is passed will use default region from the config. :param page: Page number to return, from the paginated results. :param page_size: Number of data sources to return per page. :param order_by: Sort order for data sources in the response. :param project_id: Project ID to filter for, only data sources from this Project will be returned. :param origin: Origin to filter for, only data sources with matching origin will be returned. If omitted, all types will be returned. :param types: Types to filter for (metrics, logs, traces), only data sources with matching types will be returned. If omitted, all types will be returned. :return:
ListDataSourcesResponseUsage:
result = api.list_data_sources()
- list_data_sources_all(*, region: str | None = None, page: int | None = None, page_size: int | None = None, order_by: ListDataSourcesRequestOrderBy | None = None, project_id: str | None = None, origin: DataSourceOrigin | None = None, types: List[DataSourceType] | None = None) List[DataSource]
List data sources. Retrieve the list of data sources available in the specified region. By default, the data sources returned in the list are ordered by creation date, in ascending order. :param region: Region to target. If none is passed will use default region from the config. :param page: Page number to return, from the paginated results. :param page_size: Number of data sources to return per page. :param order_by: Sort order for data sources in the response. :param project_id: Project ID to filter for, only data sources from this Project will be returned. :param origin: Origin to filter for, only data sources with matching origin will be returned. If omitted, all types will be returned. :param types: Types to filter for (metrics, logs, traces), only data sources with matching types will be returned. If omitted, all types will be returned. :return:
List[DataSource]Usage:
result = api.list_data_sources_all()
- list_tokens(*, region: str | None = None, page: int | None = None, page_size: int | None = None, order_by: ListTokensRequestOrderBy | None = None, project_id: str | None = None, token_scopes: List[TokenScope] | None = None) ListTokensResponse
List tokens. Retrieve a list of all tokens in the specified region. By default, tokens returned in the list are ordered by creation date, in ascending order. You can filter tokens by Project ID and token scopes. :param region: Region to target. If none is passed will use default region from the config. :param page: Page number to return, from the paginated results. :param page_size: Number of tokens to return per page. :param order_by: Order in which to return results. :param project_id: ID of the Project the tokens belong to. :param token_scopes: Token scopes to filter for. :return:
ListTokensResponseUsage:
result = api.list_tokens()
- list_tokens_all(*, region: str | None = None, page: int | None = None, page_size: int | None = None, order_by: ListTokensRequestOrderBy | None = None, project_id: str | None = None, token_scopes: List[TokenScope] | None = None) List[Token]
List tokens. Retrieve a list of all tokens in the specified region. By default, tokens returned in the list are ordered by creation date, in ascending order. You can filter tokens by Project ID and token scopes. :param region: Region to target. If none is passed will use default region from the config. :param page: Page number to return, from the paginated results. :param page_size: Number of tokens to return per page. :param order_by: Order in which to return results. :param project_id: ID of the Project the tokens belong to. :param token_scopes: Token scopes to filter for. :return:
List[Token]Usage:
result = api.list_tokens_all()
- trigger_test_alert(*, region: str | None = None, project_id: str | None = None) None
Trigger a test alert. Send a test alert to the Alert manager to make sure your contact points get notified. :param region: Region to target. If none is passed will use default region from the config. :param project_id: ID of the Project.
Usage:
result = api.trigger_test_alert()
- update_contact_point(*, region: str | None = None, project_id: str | None = None, email: ContactPointEmail | None = None, send_resolved_notifications: bool | None = None) ContactPoint
- Parameters:
region – Region to target. If none is passed will use default region from the config.
project_id – ID of the Project containing the contact point to update.
email – Email address of the contact point to update.
One-Of (‘configuration’): at most one of ‘email’ could be set. :param send_resolved_notifications: Enable or disable notifications when alert is resolved. :return:
ContactPointUsage:
result = api.update_contact_point()
- update_data_source(*, data_source_id: str, region: str | None = None, name: str | None = None, retention_days: int | None = None) DataSource
Update a data source. Update a given data source attributes (name and/or retention_days). :param data_source_id: ID of the data source to update. :param region: Region to target. If none is passed will use default region from the config. :param name: Updated name of the data source. :param retention_days: Duration for which the data will be retained in the data source. :return:
DataSourceUsage:
result = api.update_data_source( data_source_id="example", )
scaleway.cockpit.v1.marshalling module
- scaleway.cockpit.v1.marshalling.marshal_ContactPointEmail(request: ContactPointEmail, defaults: ProfileDefaults) Dict[str, Any]
- scaleway.cockpit.v1.marshalling.marshal_GlobalApiCreateGrafanaUserRequest(request: GlobalApiCreateGrafanaUserRequest, defaults: ProfileDefaults) Dict[str, Any]
- scaleway.cockpit.v1.marshalling.marshal_GlobalApiResetGrafanaUserPasswordRequest(request: GlobalApiResetGrafanaUserPasswordRequest, defaults: ProfileDefaults) Dict[str, Any]
- scaleway.cockpit.v1.marshalling.marshal_GlobalApiSelectPlanRequest(request: GlobalApiSelectPlanRequest, defaults: ProfileDefaults) Dict[str, Any]
- scaleway.cockpit.v1.marshalling.marshal_GlobalApiSyncGrafanaDataSourcesRequest(request: GlobalApiSyncGrafanaDataSourcesRequest, defaults: ProfileDefaults) Dict[str, Any]
- scaleway.cockpit.v1.marshalling.marshal_RegionalApiCreateContactPointRequest(request: RegionalApiCreateContactPointRequest, defaults: ProfileDefaults) Dict[str, Any]
- scaleway.cockpit.v1.marshalling.marshal_RegionalApiCreateDataSourceRequest(request: RegionalApiCreateDataSourceRequest, defaults: ProfileDefaults) Dict[str, Any]
- scaleway.cockpit.v1.marshalling.marshal_RegionalApiCreateTokenRequest(request: RegionalApiCreateTokenRequest, defaults: ProfileDefaults) Dict[str, Any]
- scaleway.cockpit.v1.marshalling.marshal_RegionalApiDeleteContactPointRequest(request: RegionalApiDeleteContactPointRequest, defaults: ProfileDefaults) Dict[str, Any]
- scaleway.cockpit.v1.marshalling.marshal_RegionalApiDisableAlertManagerRequest(request: RegionalApiDisableAlertManagerRequest, defaults: ProfileDefaults) Dict[str, Any]
- scaleway.cockpit.v1.marshalling.marshal_RegionalApiDisableAlertRulesRequest(request: RegionalApiDisableAlertRulesRequest, defaults: ProfileDefaults) Dict[str, Any]
- scaleway.cockpit.v1.marshalling.marshal_RegionalApiDisableManagedAlertsRequest(request: RegionalApiDisableManagedAlertsRequest, defaults: ProfileDefaults) Dict[str, Any]
- scaleway.cockpit.v1.marshalling.marshal_RegionalApiEnableAlertManagerRequest(request: RegionalApiEnableAlertManagerRequest, defaults: ProfileDefaults) Dict[str, Any]
- scaleway.cockpit.v1.marshalling.marshal_RegionalApiEnableAlertRulesRequest(request: RegionalApiEnableAlertRulesRequest, defaults: ProfileDefaults) Dict[str, Any]
- scaleway.cockpit.v1.marshalling.marshal_RegionalApiEnableManagedAlertsRequest(request: RegionalApiEnableManagedAlertsRequest, defaults: ProfileDefaults) Dict[str, Any]
- scaleway.cockpit.v1.marshalling.marshal_RegionalApiTriggerTestAlertRequest(request: RegionalApiTriggerTestAlertRequest, defaults: ProfileDefaults) Dict[str, Any]
- scaleway.cockpit.v1.marshalling.marshal_RegionalApiUpdateContactPointRequest(request: RegionalApiUpdateContactPointRequest, defaults: ProfileDefaults) Dict[str, Any]
- scaleway.cockpit.v1.marshalling.marshal_RegionalApiUpdateDataSourceRequest(request: RegionalApiUpdateDataSourceRequest, defaults: ProfileDefaults) Dict[str, Any]
- scaleway.cockpit.v1.marshalling.unmarshal_AlertManager(data: Any) AlertManager
- scaleway.cockpit.v1.marshalling.unmarshal_ContactPoint(data: Any) ContactPoint
- scaleway.cockpit.v1.marshalling.unmarshal_ContactPointEmail(data: Any) ContactPointEmail
- scaleway.cockpit.v1.marshalling.unmarshal_DataSource(data: Any) DataSource
- scaleway.cockpit.v1.marshalling.unmarshal_DisableAlertRulesResponse(data: Any) DisableAlertRulesResponse
- scaleway.cockpit.v1.marshalling.unmarshal_EnableAlertRulesResponse(data: Any) EnableAlertRulesResponse
- scaleway.cockpit.v1.marshalling.unmarshal_GetConfigResponse(data: Any) GetConfigResponse
- scaleway.cockpit.v1.marshalling.unmarshal_GetConfigResponseRetention(data: Any) GetConfigResponseRetention
- scaleway.cockpit.v1.marshalling.unmarshal_GetRulesCountResponse(data: Any) GetRulesCountResponse
- scaleway.cockpit.v1.marshalling.unmarshal_GrafanaProductDashboard(data: Any) GrafanaProductDashboard
- scaleway.cockpit.v1.marshalling.unmarshal_GrafanaUser(data: Any) GrafanaUser
- scaleway.cockpit.v1.marshalling.unmarshal_ListAlertsResponse(data: Any) ListAlertsResponse
- scaleway.cockpit.v1.marshalling.unmarshal_ListContactPointsResponse(data: Any) ListContactPointsResponse
- scaleway.cockpit.v1.marshalling.unmarshal_ListDataSourcesResponse(data: Any) ListDataSourcesResponse
- scaleway.cockpit.v1.marshalling.unmarshal_ListGrafanaProductDashboardsResponse(data: Any) ListGrafanaProductDashboardsResponse
- scaleway.cockpit.v1.marshalling.unmarshal_ListGrafanaUsersResponse(data: Any) ListGrafanaUsersResponse
- scaleway.cockpit.v1.marshalling.unmarshal_ListPlansResponse(data: Any) ListPlansResponse
- scaleway.cockpit.v1.marshalling.unmarshal_ListTokensResponse(data: Any) ListTokensResponse
- scaleway.cockpit.v1.marshalling.unmarshal_PreconfiguredAlertData(data: Any) PreconfiguredAlertData
- scaleway.cockpit.v1.marshalling.unmarshal_RulesCount(data: Any) RulesCount
- scaleway.cockpit.v1.marshalling.unmarshal_UsageOverview(data: Any) UsageOverview
scaleway.cockpit.v1.types module
- class scaleway.cockpit.v1.types.Alert(region: str, preconfigured: bool, name: str, rule: str, duration: str, rule_status: AlertStatus, annotations: Dict[str, str], data_source_id: str, state: AlertState | None = AlertState.UNKNOWN_STATE, preconfigured_data: PreconfiguredAlertData | None = None)
Bases:
objectStructure representing an alert.
- annotations: Dict[str, str]
Annotations for the alert, used to provide additional information about the alert.
- data_source_id: str
ID of the data source containing the alert rule.
- duration: str
Duration for which the alert must be active before firing. The format of this duration follows the prometheus duration format.
- name: str
Name of the alert.
- preconfigured: bool
Indicates if the alert is preconfigured or custom.
- preconfigured_data: PreconfiguredAlertData | None = None
Contains additional data for preconfigured alerts, such as the rule ID, display name, and description. Only present if the alert is preconfigured.
- region: str
The region in which the alert is defined.
- rule: str
Rule defining the alert condition.
- rule_status: AlertStatus
Indicates if the alert is enabled, enabling, disabled or disabling. Preconfigured alerts can have any of these values, whereas custom alerts can only have the status “enabled”.
- state: AlertState | None = 'unknown_state'
Current state of the alert. Possible states are inactive, pending, and firing.
- class scaleway.cockpit.v1.types.AlertManager(alert_manager_enabled: bool, managed_alerts_enabled: bool, region: str, alert_manager_url: str | None = None)
Bases:
objectAlert manager information.
- alert_manager_enabled: bool
The Alert manager is enabled.
- alert_manager_url: str | None = None
Alert manager URL.
- managed_alerts_enabled: bool
Managed alerts are enabled.
- region: str
Regions where the Alert manager is enabled.
- class scaleway.cockpit.v1.types.AlertState(value: str, names: Any | None = None, *args: Any, **kwargs: Any)
Bases:
str,Enum- FIRING = 'firing'
- INACTIVE = 'inactive'
- PENDING = 'pending'
- UNKNOWN_STATE = 'unknown_state'
- class scaleway.cockpit.v1.types.AlertStatus(value: str, names: Any | None = None, *args: Any, **kwargs: Any)
Bases:
str,Enum- DISABLED = 'disabled'
- DISABLING = 'disabling'
- ENABLED = 'enabled'
- ENABLING = 'enabling'
- UNKNOWN_STATUS = 'unknown_status'
- class scaleway.cockpit.v1.types.ContactPoint(region: str, send_resolved_notifications: bool, email: ContactPointEmail | None = None)
Bases:
objectContact point.
- email: ContactPointEmail | None = None
- region: str
Region.
- send_resolved_notifications: bool
Send an email notification when an alert is marked as resolved.
- class scaleway.cockpit.v1.types.DataSource(id: str, project_id: str, name: str, url: str, type_: DataSourceType, origin: DataSourceOrigin, synchronized_with_grafana: bool, retention_days: int, region: str, created_at: datetime | None = None, updated_at: datetime | None = None)
Bases:
objectData source.
- created_at: datetime | None = None
Date the data source was created.
- id: str
ID of the data source.
- name: str
Data source name.
- origin: DataSourceOrigin
Data source origin.
- project_id: str
ID of the Project the data source belongs to.
- region: str
Region of the data source.
- retention_days: int
Duration for which the data will be retained in the data source.
- synchronized_with_grafana: bool
Indicates whether the data source is synchronized with Grafana.
- type_: DataSourceType
Data source type.
- updated_at: datetime | None = None
Date the data source was last updated.
- url: str
Data source URL.
- class scaleway.cockpit.v1.types.DataSourceOrigin(value: str, names: Any | None = None, *args: Any, **kwargs: Any)
Bases:
str,Enum- CUSTOM = 'custom'
- EXTERNAL = 'external'
- SCALEWAY = 'scaleway'
- UNKNOWN_ORIGIN = 'unknown_origin'
- class scaleway.cockpit.v1.types.DataSourceType(value: str, names: Any | None = None, *args: Any, **kwargs: Any)
Bases:
str,Enum- LOGS = 'logs'
- METRICS = 'metrics'
- TRACES = 'traces'
- UNKNOWN_TYPE = 'unknown_type'
- class scaleway.cockpit.v1.types.DisableAlertRulesResponse(disabled_rule_ids: List[str])
Bases:
objectOutput returned when alert rules are disabled.
- disabled_rule_ids: List[str]
Only newly disabled rules are listed. Rules that were already disabled are not returned in the output.
- class scaleway.cockpit.v1.types.EnableAlertRulesResponse(enabled_rule_ids: List[str])
Bases:
objectOutput returned when alert rules are enabled.
- enabled_rule_ids: List[str]
Only newly enabled rules are listed. Rules that were already enabled are not returned in the output.
- class scaleway.cockpit.v1.types.GetConfigResponse(custom_metrics_retention: GetConfigResponseRetention | None = None, custom_logs_retention: GetConfigResponseRetention | None = None, custom_traces_retention: GetConfigResponseRetention | None = None, product_metrics_retention: GetConfigResponseRetention | None = None, product_logs_retention: GetConfigResponseRetention | None = None)
Bases:
objectCockpit configuration.
- custom_logs_retention: GetConfigResponseRetention | None = None
Custom logs retention configuration.
- custom_metrics_retention: GetConfigResponseRetention | None = None
Custom metrics retention configuration.
- custom_traces_retention: GetConfigResponseRetention | None = None
Custom traces retention configuration.
- product_logs_retention: GetConfigResponseRetention | None = None
Scaleway logs retention configuration.
- product_metrics_retention: GetConfigResponseRetention | None = None
Scaleway metrics retention configuration.
- class scaleway.cockpit.v1.types.GetConfigResponseRetention(min_days: 'int', max_days: 'int', default_days: 'int')
Bases:
object- default_days: int
- max_days: int
- min_days: int
- class scaleway.cockpit.v1.types.GetRulesCountResponse(rules_count_by_datasource: 'List[RulesCount]', preconfigured_rules_count: 'int', custom_rules_count: 'int')
Bases:
object- custom_rules_count: int
Total count of custom rules.
- preconfigured_rules_count: int
Total count of preconfigured rules.
- rules_count_by_datasource: List[RulesCount]
Total count of rules grouped by data source.
- class scaleway.cockpit.v1.types.GlobalApiCreateGrafanaUserRequest(login: str, project_id: str | None = None, role: GrafanaUserRole | None = GrafanaUserRole.UNKNOWN_ROLE)
Bases:
objectCreate a Grafana user.
- login: str
Username of the Grafana user. Note that the admin username is not available for creation.
- project_id: str | None = None
ID of the Project in which to create the Grafana user.
- role: GrafanaUserRole | None = 'unknown_role'
Role assigned to the Grafana user.
- class scaleway.cockpit.v1.types.GlobalApiDeleteGrafanaUserRequest(grafana_user_id: int, project_id: str | None = None)
Bases:
objectDelete a Grafana user.
- grafana_user_id: int
ID of the Grafana user.
- project_id: str | None = None
ID of the Project to target.
- class scaleway.cockpit.v1.types.GlobalApiGetCurrentPlanRequest(project_id: str | None = None)
Bases:
objectRetrieve a pricing plan for the given Project.
- project_id: str | None = None
ID of the Project.
- class scaleway.cockpit.v1.types.GlobalApiGetGrafanaProductDashboardRequest(dashboard_name: str, project_id: str | None = None)
Bases:
objectRetrieve a specific dashboard.
- dashboard_name: str
Name of the dashboard.
- project_id: str | None = None
ID of the Project the dashboard belongs to.
- class scaleway.cockpit.v1.types.GlobalApiGetGrafanaRequest(project_id: str | None = None)
Bases:
objectRequest a Grafana.
- project_id: str | None = None
ID of the Project.
- class scaleway.cockpit.v1.types.GlobalApiListGrafanaProductDashboardsRequest(project_id: str | None = None, page: int | None = 0, page_size: int | None = 0, tags: ~typing.List[str] | None = <factory>)
Bases:
objectRetrieve a list of available product dashboards.
- page: int | None = 0
Page number.
- page_size: int | None = 0
Page size.
- project_id: str | None = None
ID of the Project to target.
- tags: List[str] | None
Tags to filter for.
- class scaleway.cockpit.v1.types.GlobalApiListGrafanaUsersRequest(page: int | None = 0, page_size: int | None = 0, order_by: ListGrafanaUsersRequestOrderBy | None = ListGrafanaUsersRequestOrderBy.LOGIN_ASC, project_id: str | None = None)
Bases:
objectList all Grafana users.
- order_by: ListGrafanaUsersRequestOrderBy | None = 'login_asc'
Order of the Grafana users.
- page: int | None = 0
Page number.
- page_size: int | None = 0
Page size.
- project_id: str | None = None
ID of the Project to target.
- class scaleway.cockpit.v1.types.GlobalApiListPlansRequest(page: int | None = 0, page_size: int | None = 0, order_by: ListPlansRequestOrderBy | None = ListPlansRequestOrderBy.NAME_ASC)
Bases:
objectRetrieve a list of available pricing plans.
- order_by: ListPlansRequestOrderBy | None = 'name_asc'
- page: int | None = 0
Page number.
- page_size: int | None = 0
Page size.
- class scaleway.cockpit.v1.types.GlobalApiResetGrafanaUserPasswordRequest(grafana_user_id: int, project_id: str | None = None)
Bases:
objectReset a Grafana user’s password.
- grafana_user_id: int
ID of the Grafana user.
- project_id: str | None = None
ID of the Project to target.
- class scaleway.cockpit.v1.types.GlobalApiSelectPlanRequest(project_id: str | None = None, plan_name: PlanName | None = PlanName.UNKNOWN_NAME)
Bases:
objectSelect a specific pricing plan.
- project_id: str | None = None
ID of the Project.
- class scaleway.cockpit.v1.types.GlobalApiSyncGrafanaDataSourcesRequest(project_id: str | None = None)
Bases:
objectTrigger the synchronization of all data sources created in the relevant regions.
- project_id: str | None = None
ID of the Project to target.
- class scaleway.cockpit.v1.types.Grafana(grafana_url: str)
Bases:
objectGrafana user.
- grafana_url: str
URL to access your Cockpit’s Grafana.
- class scaleway.cockpit.v1.types.GrafanaProductDashboard(name: str, title: str, url: str, tags: List[str], variables: List[str])
Bases:
objectGrafana dashboard.
- name: str
Dashboard name.
- tags: List[str]
Dashboard tags.
- title: str
Dashboard title.
- url: str
Dashboard URL.
- variables: List[str]
Dashboard variables.
- class scaleway.cockpit.v1.types.GrafanaUser(id: int, login: str, role: GrafanaUserRole, password: str | None = None)
Bases:
objectGrafana user.
- id: int
ID of the Grafana user.
- login: str
Username of the Grafana user.
- password: str | None = None
Grafana user’s password.
- role: GrafanaUserRole
Role assigned to the Grafana user.
- class scaleway.cockpit.v1.types.GrafanaUserRole(value: str, names: Any | None = None, *args: Any, **kwargs: Any)
Bases:
str,Enum- EDITOR = 'editor'
- UNKNOWN_ROLE = 'unknown_role'
- VIEWER = 'viewer'
- class scaleway.cockpit.v1.types.ListAlertsResponse(total_count: int, alerts: List[Alert])
Bases:
objectRetrieve a list of alerts matching the request.
- total_count: int
Total count of alerts matching the request.
- class scaleway.cockpit.v1.types.ListContactPointsResponse(total_count: int, contact_points: List[ContactPoint], has_additional_receivers: bool, has_additional_contact_points: bool)
Bases:
objectResponse returned when listing contact points.
- contact_points: List[ContactPoint]
List of contact points associated with the default receiver.
- has_additional_contact_points: bool
Indicates whether there are unmanaged contact points on the default receiver.
- has_additional_receivers: bool
Indicates whether the Alert manager has other receivers than the default one.
- total_count: int
Total count of contact points associated with the default receiver.
- class scaleway.cockpit.v1.types.ListDataSourcesRequestOrderBy(value: str, names: Any | None = None, *args: Any, **kwargs: Any)
Bases:
str,Enum- CREATED_AT_ASC = 'created_at_asc'
- CREATED_AT_DESC = 'created_at_desc'
- NAME_ASC = 'name_asc'
- NAME_DESC = 'name_desc'
- TYPE_ASC = 'type_asc'
- TYPE_DESC = 'type_desc'
- class scaleway.cockpit.v1.types.ListDataSourcesResponse(total_count: int, data_sources: List[DataSource])
Bases:
objectResponse returned when listing data sources.
- data_sources: List[DataSource]
Data sources matching the request within the pagination.
- total_count: int
Total count of data sources matching the request.
- class scaleway.cockpit.v1.types.ListGrafanaProductDashboardsResponse(total_count: int, dashboards: List[GrafanaProductDashboard])
Bases:
objectOutput returned when listing dashboards.
- dashboards: List[GrafanaProductDashboard]
Grafana dashboards information.
- total_count: int
Total count of Grafana dashboards.
- class scaleway.cockpit.v1.types.ListGrafanaUsersRequestOrderBy(value: str, names: Any | None = None, *args: Any, **kwargs: Any)
Bases:
str,Enum- LOGIN_ASC = 'login_asc'
- LOGIN_DESC = 'login_desc'
- class scaleway.cockpit.v1.types.ListGrafanaUsersResponse(total_count: int, grafana_users: List[GrafanaUser])
Bases:
objectOuptut returned when listing Grafana users.
- grafana_users: List[GrafanaUser]
Grafana users information.
- total_count: int
Total count of Grafana users.
- class scaleway.cockpit.v1.types.ListPlansRequestOrderBy(value: str, names: Any | None = None, *args: Any, **kwargs: Any)
Bases:
str,Enum- NAME_ASC = 'name_asc'
- NAME_DESC = 'name_desc'
- class scaleway.cockpit.v1.types.ListPlansResponse(total_count: int, plans: List[Plan])
Bases:
objectOutput returned when listing pricing plans.
- total_count: int
Total count of available pricing plans.
- class scaleway.cockpit.v1.types.ListTokensRequestOrderBy(value: str, names: Any | None = None, *args: Any, **kwargs: Any)
Bases:
str,Enum- CREATED_AT_ASC = 'created_at_asc'
- CREATED_AT_DESC = 'created_at_desc'
- NAME_ASC = 'name_asc'
- NAME_DESC = 'name_desc'
- class scaleway.cockpit.v1.types.ListTokensResponse(total_count: int, tokens: List[Token])
Bases:
objectResponse returned when listing tokens.
- total_count: int
Total count of tokens matching the request.
- class scaleway.cockpit.v1.types.Plan(name: PlanName, sample_ingestion_price: int, logs_ingestion_price: int, traces_ingestion_price: int, monthly_price: int, retention_metrics_interval: str | None = None, retention_logs_interval: str | None = None, retention_traces_interval: str | None = None)
Bases:
objectType of pricing plan.
- logs_ingestion_price: int
Ingestion price in cents for 1 GB of logs.
- monthly_price: int
Retention price in euros per month.
- retention_logs_interval: str | None = None
Interval of time during which Scaleway’s Cockpit keeps your logs.
- retention_metrics_interval: str | None = None
Interval of time during which Scaleway’s Cockpit keeps your metrics.
- retention_traces_interval: str | None = None
Interval of time during which Scaleway’s Cockpit keeps your traces.
- sample_ingestion_price: int
Ingestion price in cents for 1 million samples.
- traces_ingestion_price: int
Ingestion price in cents for 1 GB of traces.
- class scaleway.cockpit.v1.types.PlanName(value: str, names: Any | None = None, *args: Any, **kwargs: Any)
Bases:
str,Enum- CUSTOM = 'custom'
- FREE = 'free'
- PREMIUM = 'premium'
- UNKNOWN_NAME = 'unknown_name'
- class scaleway.cockpit.v1.types.PreconfiguredAlertData(preconfigured_rule_id: str, display_name: str, display_description: str, product_name: str, product_family: str)
Bases:
objectStructure for additional data relative to preconfigured alerts.
- display_description: str
Human readable description of the alert.
- display_name: str
Human readable name of the alert.
- preconfigured_rule_id: str
ID of the preconfigured rule if the alert is preconfigured.
- product_family: str
Family of the product associated with the alert.
- product_name: str
Product associated with the alert.
- class scaleway.cockpit.v1.types.RegionalApiCreateContactPointRequest(region: str | None = None, project_id: str | None = None, send_resolved_notifications: bool | None = False, email: ContactPointEmail | None = None)
Bases:
objectCreate a contact point.
- email: ContactPointEmail | None = None
- project_id: str | None = None
ID of the Project to create the contact point in.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- send_resolved_notifications: bool | None = False
Send an email notification when an alert is marked as resolved.
- class scaleway.cockpit.v1.types.RegionalApiCreateDataSourceRequest(name: str, region: str | None = None, project_id: str | None = None, type_: DataSourceType | None = DataSourceType.UNKNOWN_TYPE, retention_days: int | None = 0)
Bases:
objectCreate a data source.
- name: str
Data source name.
- project_id: str | None = None
ID of the Project the data source belongs to.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- retention_days: int | None = 0
Default values are 31 days for metrics, 7 days for logs and traces.
- type_: DataSourceType | None = 'unknown_type'
Data source type.
- class scaleway.cockpit.v1.types.RegionalApiCreateTokenRequest(name: str, region: str | None = None, project_id: str | None = None, token_scopes: ~typing.List[~scaleway.cockpit.v1.types.TokenScope] | None = <factory>)
Bases:
objectCreate a token.
- name: str
Name of the token.
- project_id: str | None = None
ID of the Project the token belongs to.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- token_scopes: List[TokenScope] | None
Token permission scopes.
- class scaleway.cockpit.v1.types.RegionalApiDeleteContactPointRequest(region: str | None = None, project_id: str | None = None, email: ContactPointEmail | None = None)
Bases:
objectDelete a contact point.
- email: ContactPointEmail | None = None
- project_id: str | None = None
ID of the Project containing the contact point to delete.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- class scaleway.cockpit.v1.types.RegionalApiDeleteDataSourceRequest(data_source_id: str, region: str | None = None)
Bases:
objectDelete a data source.
- data_source_id: str
ID of the data source to delete.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- class scaleway.cockpit.v1.types.RegionalApiDeleteTokenRequest(token_id: str, region: str | None = None)
Bases:
objectDelete a token.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- token_id: str
ID of the token to delete.
- class scaleway.cockpit.v1.types.RegionalApiDisableAlertManagerRequest(region: str | None = None, project_id: str | None = None)
Bases:
objectDisable the Alert manager.
- project_id: str | None = None
ID of the Project to disable the Alert manager in.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- class scaleway.cockpit.v1.types.RegionalApiDisableAlertRulesRequest(region: 'Optional[ScwRegion]' = None, project_id: 'Optional[str]' = None, rule_ids: 'Optional[List[str]]' = <factory>)
Bases:
object- project_id: str | None = None
ID of the Project.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- rule_ids: List[str] | None
List of IDs of the rules to enable. If empty, disables all preconfigured rules.
- class scaleway.cockpit.v1.types.RegionalApiDisableManagedAlertsRequest(region: str | None = None, project_id: str | None = None)
Bases:
objectDisable the sending of managed alerts.
- project_id: str | None = None
ID of the Project.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- class scaleway.cockpit.v1.types.RegionalApiEnableAlertManagerRequest(region: str | None = None, project_id: str | None = None)
Bases:
objectEnable the Alert manager.
- project_id: str | None = None
ID of the Project to enable the Alert manager in.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- class scaleway.cockpit.v1.types.RegionalApiEnableAlertRulesRequest(region: 'Optional[ScwRegion]' = None, project_id: 'Optional[str]' = None, rule_ids: 'Optional[List[str]]' = <factory>)
Bases:
object- project_id: str | None = None
ID of the Project.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- rule_ids: List[str] | None
List of IDs of the rules to enable. If empty, enables all preconfigured rules.
- class scaleway.cockpit.v1.types.RegionalApiEnableManagedAlertsRequest(region: str | None = None, project_id: str | None = None)
Bases:
objectEnable the sending of managed alerts.
- project_id: str | None = None
ID of the Project.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- class scaleway.cockpit.v1.types.RegionalApiGetAlertManagerRequest(region: str | None = None, project_id: str | None = None)
Bases:
objectGet the Alert manager.
- project_id: str | None = None
Project ID of the requested Alert manager.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- class scaleway.cockpit.v1.types.RegionalApiGetConfigRequest(region: str | None = None)
Bases:
objectGet Cockpit configuration.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- class scaleway.cockpit.v1.types.RegionalApiGetDataSourceRequest(data_source_id: str, region: str | None = None)
Bases:
objectRetrieve a data source.
- data_source_id: str
ID of the relevant data source.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- class scaleway.cockpit.v1.types.RegionalApiGetRulesCountRequest(region: 'Optional[ScwRegion]' = None, project_id: 'Optional[str]' = None)
Bases:
object- project_id: str | None = None
ID of the Project to retrieve the rule count for.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- class scaleway.cockpit.v1.types.RegionalApiGetTokenRequest(token_id: str, region: str | None = None)
Bases:
objectGet a token.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- token_id: str
Token ID.
- class scaleway.cockpit.v1.types.RegionalApiGetUsageOverviewRequest(region: 'Optional[ScwRegion]' = None, project_id: 'Optional[str]' = None, interval: 'Optional[str]' = None)
Bases:
object- interval: str | None = None
- project_id: str | None = None
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- class scaleway.cockpit.v1.types.RegionalApiListAlertsRequest(region: str | None = None, project_id: str | None = None, rule_status: AlertStatus | None = AlertStatus.UNKNOWN_STATUS, is_preconfigured: bool | None = False, state: AlertState | None = AlertState.UNKNOWN_STATE, data_source_id: str | None = None)
Bases:
objectRetrieve a list of alerts.
- data_source_id: str | None = None
If omitted, only alerts from the default Scaleway metrics data source will be listed.
- is_preconfigured: bool | None = False
True returns only preconfigured alerts. False returns only custom alerts. If omitted, no filtering is applied on alert types. Other filters may still apply.
- project_id: str | None = None
Project ID to filter for, only alerts from this Project will be returned.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- rule_status: AlertStatus | None = 'unknown_status'
Returns only alerts with the given activation status. If omitted, no alert filtering is applied. Other filters may still apply.
- state: AlertState | None = 'unknown_state'
Valid values to filter on are inactive, pending and firing. If omitted, no filtering is applied on alert states. Other filters may still apply.
- class scaleway.cockpit.v1.types.RegionalApiListContactPointsRequest(region: str | None = None, page: int | None = 0, page_size: int | None = 0, project_id: str | None = None)
Bases:
objectList contact points.
- page: int | None = 0
Page number to return, from the paginated results.
- page_size: int | None = 0
Total count of contact points to return per page.
- project_id: str | None = None
ID of the Project containing the contact points to list.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- class scaleway.cockpit.v1.types.RegionalApiListDataSourcesRequest(region: str | None = None, page: int | None = 0, page_size: int | None = 0, order_by: ~scaleway.cockpit.v1.types.ListDataSourcesRequestOrderBy | None = ListDataSourcesRequestOrderBy.CREATED_AT_ASC, project_id: str | None = None, origin: ~scaleway.cockpit.v1.types.DataSourceOrigin | None = DataSourceOrigin.UNKNOWN_ORIGIN, types: ~typing.List[~scaleway.cockpit.v1.types.DataSourceType] | None = <factory>)
Bases:
objectList data sources.
- order_by: ListDataSourcesRequestOrderBy | None = 'created_at_asc'
Sort order for data sources in the response.
- origin: DataSourceOrigin | None = 'unknown_origin'
Origin to filter for, only data sources with matching origin will be returned. If omitted, all types will be returned.
- page: int | None = 0
Page number to return, from the paginated results.
- page_size: int | None = 0
Number of data sources to return per page.
- project_id: str | None = None
Project ID to filter for, only data sources from this Project will be returned.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- types: List[DataSourceType] | None
Types to filter for (metrics, logs, traces), only data sources with matching types will be returned. If omitted, all types will be returned.
- class scaleway.cockpit.v1.types.RegionalApiListTokensRequest(region: str | None = None, page: int | None = 0, page_size: int | None = 0, order_by: ~scaleway.cockpit.v1.types.ListTokensRequestOrderBy | None = ListTokensRequestOrderBy.CREATED_AT_ASC, project_id: str | None = None, token_scopes: ~typing.List[~scaleway.cockpit.v1.types.TokenScope] | None = <factory>)
Bases:
objectList tokens.
- order_by: ListTokensRequestOrderBy | None = 'created_at_asc'
Order in which to return results.
- page: int | None = 0
Page number to return, from the paginated results.
- page_size: int | None = 0
Number of tokens to return per page.
- project_id: str | None = None
ID of the Project the tokens belong to.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- token_scopes: List[TokenScope] | None
Token scopes to filter for.
- class scaleway.cockpit.v1.types.RegionalApiTriggerTestAlertRequest(region: str | None = None, project_id: str | None = None)
Bases:
objectRequest to trigger a test alert.
- project_id: str | None = None
ID of the Project.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- class scaleway.cockpit.v1.types.RegionalApiUpdateContactPointRequest(region: str | None = None, project_id: str | None = None, send_resolved_notifications: bool | None = False, email: ContactPointEmail | None = None)
Bases:
objectUpdate a contact point.
- email: ContactPointEmail | None = None
- project_id: str | None = None
ID of the Project containing the contact point to update.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- send_resolved_notifications: bool | None = False
Enable or disable notifications when alert is resolved.
- class scaleway.cockpit.v1.types.RegionalApiUpdateDataSourceRequest(data_source_id: str, region: str | None = None, name: str | None = None, retention_days: int | None = 0)
Bases:
objectUpdate a data source name.
- data_source_id: str
ID of the data source to update.
- name: str | None = None
Updated name of the data source.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- retention_days: int | None = 0
Duration for which the data will be retained in the data source.
- class scaleway.cockpit.v1.types.RulesCount(data_source_id: 'str', data_source_name: 'str', rules_count: 'int')
Bases:
object- data_source_id: str
ID of the data source.
- data_source_name: str
Name of the data source.
- rules_count: int
Total count of rules associated with this data source.
- class scaleway.cockpit.v1.types.Token(id: str, project_id: str, name: str, scopes: List[TokenScope], region: str, created_at: datetime | None = None, updated_at: datetime | None = None, secret_key: str | None = None)
Bases:
objectToken.
- created_at: datetime | None = None
Token creation date.
- id: str
ID of the token.
- name: str
Name of the token.
- project_id: str
ID of the Project the token belongs to.
- region: str
Regions where the token is located.
- scopes: List[TokenScope]
Token permission scopes.
- secret_key: str | None = None
Token secret key.
- updated_at: datetime | None = None
Token last modification date.
- class scaleway.cockpit.v1.types.TokenScope(value: str, names: Any | None = None, *args: Any, **kwargs: Any)
Bases:
str,Enum- FULL_ACCESS_ALERT_MANAGER = 'full_access_alert_manager'
- FULL_ACCESS_LOGS_RULES = 'full_access_logs_rules'
- FULL_ACCESS_METRICS_RULES = 'full_access_metrics_rules'
- READ_ONLY_LOGS = 'read_only_logs'
- READ_ONLY_METRICS = 'read_only_metrics'
- READ_ONLY_TRACES = 'read_only_traces'
- UNKNOWN_SCOPE = 'unknown_scope'
- WRITE_ONLY_LOGS = 'write_only_logs'
- WRITE_ONLY_METRICS = 'write_only_metrics'
- WRITE_ONLY_TRACES = 'write_only_traces'
- class scaleway.cockpit.v1.types.Usage(project_id: str, data_source_origin: DataSourceOrigin, data_source_type: DataSourceType, unit: UsageUnit, quantity_over_interval: int, region: str, data_source_id: str | None = None, interval: str | None = None)
Bases:
objectData source usage.
- data_source_id: str | None = None
ID of the data source.
- data_source_origin: DataSourceOrigin
Origin of the data source.
- data_source_type: DataSourceType
Type of the data source.
- interval: str | None = None
Interval for the data source usage.
- project_id: str
ID of the Project the data source belongs to.
- quantity_over_interval: int
Data source usage for the given interval.
- region: str
Region of the data source usage.
- class scaleway.cockpit.v1.types.UsageOverview(scaleway_metrics_usage: 'Optional[Usage]' = None, scaleway_logs_usage: 'Optional[Usage]' = None, external_metrics_usage: 'Optional[Usage]' = None, external_logs_usage: 'Optional[Usage]' = None, external_traces_usage: 'Optional[Usage]' = None)
Bases:
object
Module contents
- class scaleway.cockpit.v1.Alert(region: str, preconfigured: bool, name: str, rule: str, duration: str, rule_status: AlertStatus, annotations: Dict[str, str], data_source_id: str, state: AlertState | None = AlertState.UNKNOWN_STATE, preconfigured_data: PreconfiguredAlertData | None = None)
Bases:
objectStructure representing an alert.
- annotations: Dict[str, str]
Annotations for the alert, used to provide additional information about the alert.
- data_source_id: str
ID of the data source containing the alert rule.
- duration: str
Duration for which the alert must be active before firing. The format of this duration follows the prometheus duration format.
- name: str
Name of the alert.
- preconfigured: bool
Indicates if the alert is preconfigured or custom.
- preconfigured_data: PreconfiguredAlertData | None = None
Contains additional data for preconfigured alerts, such as the rule ID, display name, and description. Only present if the alert is preconfigured.
- region: str
The region in which the alert is defined.
- rule: str
Rule defining the alert condition.
- rule_status: AlertStatus
Indicates if the alert is enabled, enabling, disabled or disabling. Preconfigured alerts can have any of these values, whereas custom alerts can only have the status “enabled”.
- state: AlertState | None = 'unknown_state'
Current state of the alert. Possible states are inactive, pending, and firing.
- class scaleway.cockpit.v1.AlertManager(alert_manager_enabled: bool, managed_alerts_enabled: bool, region: str, alert_manager_url: str | None = None)
Bases:
objectAlert manager information.
- alert_manager_enabled: bool
The Alert manager is enabled.
- alert_manager_url: str | None = None
Alert manager URL.
- managed_alerts_enabled: bool
Managed alerts are enabled.
- region: str
Regions where the Alert manager is enabled.
- class scaleway.cockpit.v1.AlertState(value: str, names: Any | None = None, *args: Any, **kwargs: Any)
Bases:
str,Enum- FIRING = 'firing'
- INACTIVE = 'inactive'
- PENDING = 'pending'
- UNKNOWN_STATE = 'unknown_state'
- class scaleway.cockpit.v1.AlertStatus(value: str, names: Any | None = None, *args: Any, **kwargs: Any)
Bases:
str,Enum- DISABLED = 'disabled'
- DISABLING = 'disabling'
- ENABLED = 'enabled'
- ENABLING = 'enabling'
- UNKNOWN_STATUS = 'unknown_status'
- class scaleway.cockpit.v1.CockpitV1GlobalAPI(client: Client, *, bypass_validation: bool = False)
Bases:
APIThe Cockpit Global API allows you to manage your Cockpit’s Grafana.
- create_grafana_user(*, login: str, project_id: str | None = None, role: GrafanaUserRole | None = None) GrafanaUser
Create a Grafana user. Create a Grafana user to connect to your Cockpit’s Grafana. Upon creation, your user password displays only once, so make sure that you save it. Each Grafana user is associated with a role: viewer or editor. A viewer can only view dashboards, whereas an editor can create and edit dashboards. Note that the admin username is not available for creation. :param login: Username of the Grafana user. Note that the admin username is not available for creation. :param project_id: ID of the Project in which to create the Grafana user. :param role: Role assigned to the Grafana user. :return:
GrafanaUserUsage:
result = api.create_grafana_user( login="example", )
- delete_grafana_user(*, project_id: str | None = None, grafana_user_id: int) None
Delete a Grafana user. Delete a Grafana user from your Cockpit’s Grafana, specified by the ID of the Project the Cockpit belongs to, and the ID of the Grafana user. :param project_id: ID of the Project to target. :param grafana_user_id: ID of the Grafana user.
Usage:
result = api.delete_grafana_user( grafana_user_id=1, )
- get_current_plan(*, project_id: str | None = None) Plan
Get current plan. Retrieve a pricing plan for the given Project, specified by the ID of the Project. Deprecated: retention is now managed at the data source level. :param project_id: ID of the Project. :return:
Plan:deprecatedUsage:
result = api.get_current_plan()
- get_grafana(*, project_id: str | None = None) Grafana
Get your Cockpit’s Grafana. Retrieve information on your Cockpit’s Grafana, specified by the ID of the Project the Cockpit belongs to. The output returned displays the URL to access your Cockpit’s Grafana. :param project_id: ID of the Project. :return:
GrafanaUsage:
result = api.get_grafana()
- get_grafana_product_dashboard(*, project_id: str | None = None, dashboard_name: str) GrafanaProductDashboard
Get Scaleway resource dashboard. Retrieve information about the dashboard of a Scaleway resource in Grafana, specified by the ID of the Project the Cockpit belongs to, and the name of the dashboard. :param project_id: ID of the Project the dashboard belongs to. :param dashboard_name: Name of the dashboard. :return:
GrafanaProductDashboardUsage:
result = api.get_grafana_product_dashboard( dashboard_name="example", )
- list_grafana_product_dashboards(*, project_id: str | None = None, page: int | None = None, page_size: int | None = None, tags: List[str] | None = None) ListGrafanaProductDashboardsResponse
List Scaleway resources dashboards. Retrieve a list of available dashboards in Grafana, for all Scaleway resources which are integrated with Cockpit. :param project_id: ID of the Project to target. :param page: Page number. :param page_size: Page size. :param tags: Tags to filter for. :return:
ListGrafanaProductDashboardsResponseUsage:
result = api.list_grafana_product_dashboards()
- list_grafana_product_dashboards_all(*, project_id: str | None = None, page: int | None = None, page_size: int | None = None, tags: List[str] | None = None) List[GrafanaProductDashboard]
List Scaleway resources dashboards. Retrieve a list of available dashboards in Grafana, for all Scaleway resources which are integrated with Cockpit. :param project_id: ID of the Project to target. :param page: Page number. :param page_size: Page size. :param tags: Tags to filter for. :return:
List[GrafanaProductDashboard]Usage:
result = api.list_grafana_product_dashboards_all()
- list_grafana_users(*, page: int | None = None, page_size: int | None = None, order_by: ListGrafanaUsersRequestOrderBy | None = None, project_id: str | None = None) ListGrafanaUsersResponse
List Grafana users. List all Grafana users created in your Cockpit’s Grafana. By default, the Grafana users returned in the list are ordered in ascending order. :param page: Page number. :param page_size: Page size. :param order_by: Order of the Grafana users. :param project_id: ID of the Project to target. :return:
ListGrafanaUsersResponseUsage:
result = api.list_grafana_users()
- list_grafana_users_all(*, page: int | None = None, page_size: int | None = None, order_by: ListGrafanaUsersRequestOrderBy | None = None, project_id: str | None = None) List[GrafanaUser]
List Grafana users. List all Grafana users created in your Cockpit’s Grafana. By default, the Grafana users returned in the list are ordered in ascending order. :param page: Page number. :param page_size: Page size. :param order_by: Order of the Grafana users. :param project_id: ID of the Project to target. :return:
List[GrafanaUser]Usage:
result = api.list_grafana_users_all()
- list_plans(*, page: int | None = None, page_size: int | None = None, order_by: ListPlansRequestOrderBy | None = None) ListPlansResponse
List plan types. Retrieve a list of available pricing plan types. Deprecated: retention is now managed at the data source level. :param page: Page number. :param page_size: Page size. :param order_by: :return:
ListPlansResponse:deprecatedUsage:
result = api.list_plans()
- list_plans_all(*, page: int | None = None, page_size: int | None = None, order_by: ListPlansRequestOrderBy | None = None) List[Plan]
List plan types. Retrieve a list of available pricing plan types. Deprecated: retention is now managed at the data source level. :param page: Page number. :param page_size: Page size. :param order_by: :return:
List[Plan]:deprecatedUsage:
result = api.list_plans_all()
- reset_grafana_user_password(*, project_id: str | None = None, grafana_user_id: int) GrafanaUser
Reset a Grafana user password. Reset the password of a Grafana user, specified by the ID of the Project the Cockpit belongs to, and the ID of the Grafana user. A new password regenerates and only displays once. Make sure that you save it. :param project_id: ID of the Project to target. :param grafana_user_id: ID of the Grafana user. :return:
GrafanaUserUsage:
result = api.reset_grafana_user_password( grafana_user_id=1, )
- select_plan(*, project_id: str | None = None, plan_name: PlanName | None = None) Plan
Apply a pricing plan. Apply a pricing plan on a given Project. You must specify the ID of the pricing plan type. Note that you will be billed for the plan you apply. Deprecated: retention is now managed at the data source level. :param project_id: ID of the Project. :param plan_name: Name of the pricing plan. :return:
Plan:deprecatedUsage:
result = api.select_plan()
- sync_grafana_data_sources(*, project_id: str | None = None) None
Synchronize Grafana data sources. Trigger the synchronization of all your data sources and the alert manager in the relevant regions. The alert manager will only be synchronized if you have enabled it. :param project_id: ID of the Project to target.
Usage:
result = api.sync_grafana_data_sources()
- class scaleway.cockpit.v1.CockpitV1RegionalAPI(client: Client, *, bypass_validation: bool = False)
Bases:
APIThe Cockpit API allows you to create data sources and Cockpit tokens to store and query data types such as metrics, logs, and traces. You can also push your data into Cockpit, and send alerts to your contact points when your resources may require your attention, using the regional Alert manager.
- create_contact_point(*, region: str | None = None, project_id: str | None = None, email: ContactPointEmail | None = None, send_resolved_notifications: bool | None = None) ContactPoint
Create a contact point. Contact points are email addresses associated with the default receiver, that the Alert manager sends alerts to. The source of the alerts are data sources within the same Project and region as the Alert manager. If you need to receive alerts for other receivers, you can create additional contact points and receivers in Grafana. Make sure that you select the Scaleway Alert manager. :param region: Region to target. If none is passed will use default region from the config. :param project_id: ID of the Project to create the contact point in. :param email: Email address of the contact point to create. One-Of (‘configuration’): at most one of ‘email’ could be set. :param send_resolved_notifications: Send an email notification when an alert is marked as resolved. :return:
ContactPointUsage:
result = api.create_contact_point()
- create_data_source(*, name: str, region: str | None = None, project_id: str | None = None, type_: DataSourceType | None = None, retention_days: int | None = None) DataSource
Create a data source. You must specify the data source name and type (metrics, logs, traces) upon creation. The name of the data source will then be used as reference to name the associated Grafana data source. :param name: Data source name. :param region: Region to target. If none is passed will use default region from the config. :param project_id: ID of the Project the data source belongs to. :param type_: Data source type. :param retention_days: Default values are 31 days for metrics, 7 days for logs and traces. :return:
DataSourceUsage:
result = api.create_data_source( name="example", )
- create_token(*, name: str, region: str | None = None, project_id: str | None = None, token_scopes: List[TokenScope] | None = None) Token
Create a token. Give your token the relevant scopes to ensure it has the right permissions to interact with your data sources and the Alert manager. Make sure that you create your token in the same regions as the data sources you want to use it for. Upon creation, your token’s secret key display only once. Make sure that you save it. :param name: Name of the token. :param region: Region to target. If none is passed will use default region from the config. :param project_id: ID of the Project the token belongs to. :param token_scopes: Token permission scopes. :return:
TokenUsage:
result = api.create_token( name="example", )
- delete_contact_point(*, region: str | None = None, project_id: str | None = None, email: ContactPointEmail | None = None) None
Delete a contact point. Delete a contact point associated with the default receiver. :param region: Region to target. If none is passed will use default region from the config. :param project_id: ID of the Project containing the contact point to delete. :param email: Email address of the contact point to delete. One-Of (‘configuration’): at most one of ‘email’ could be set.
Usage:
result = api.delete_contact_point()
- delete_data_source(*, data_source_id: str, region: str | None = None) None
Delete a data source. Delete a given data source. Note that this action will permanently delete this data source and any data associated with it. :param data_source_id: ID of the data source to delete. :param region: Region to target. If none is passed will use default region from the config.
Usage:
result = api.delete_data_source( data_source_id="example", )
- delete_token(*, token_id: str, region: str | None = None) None
Delete a token. Delete a given token, specified by the token ID. Deleting a token is irreversible and cannot be undone. :param token_id: ID of the token to delete. :param region: Region to target. If none is passed will use default region from the config.
Usage:
result = api.delete_token( token_id="example", )
- disable_alert_manager(*, region: str | None = None, project_id: str | None = None) AlertManager
Disable the Alert manager. Disabling the Alert manager deletes the contact points you have created and disables managed alerts in the specified Project and region. :param region: Region to target. If none is passed will use default region from the config. :param project_id: ID of the Project to disable the Alert manager in. :return:
AlertManagerUsage:
result = api.disable_alert_manager()
- disable_alert_rules(*, region: str | None = None, project_id: str | None = None, rule_ids: List[str] | None = None) DisableAlertRulesResponse
Disable preconfigured alert rules. Disable alert rules from the list of available preconfigured rules. :param region: Region to target. If none is passed will use default region from the config. :param project_id: ID of the Project. :param rule_ids: List of IDs of the rules to enable. If empty, disables all preconfigured rules. :return:
DisableAlertRulesResponseUsage:
result = api.disable_alert_rules()
- disable_managed_alerts(*, region: str | None = None, project_id: str | None = None) AlertManager
Disable managed alerts. Disable the sending of managed alerts for the specified Project. :param region: Region to target. If none is passed will use default region from the config. :param project_id: ID of the Project. :return:
AlertManagerUsage:
result = api.disable_managed_alerts()
- enable_alert_manager(*, region: str | None = None, project_id: str | None = None) AlertManager
Enable the Alert manager. Enabling the Alert manager allows you to enable managed alerts and create contact points in the specified Project and region, to be notified when your Scaleway resources may require your attention. :param region: Region to target. If none is passed will use default region from the config. :param project_id: ID of the Project to enable the Alert manager in. :return:
AlertManagerUsage:
result = api.enable_alert_manager()
- enable_alert_rules(*, region: str | None = None, project_id: str | None = None, rule_ids: List[str] | None = None) EnableAlertRulesResponse
Enable preconfigured alert rules. Enable alert rules from the list of available preconfigured rules. :param region: Region to target. If none is passed will use default region from the config. :param project_id: ID of the Project. :param rule_ids: List of IDs of the rules to enable. If empty, enables all preconfigured rules. :return:
EnableAlertRulesResponseUsage:
result = api.enable_alert_rules()
- enable_managed_alerts(*, region: str | None = None, project_id: str | None = None) AlertManager
Enable managed alerts. Enable the sending of managed alerts for the specified Project. Managed alerts are predefined alerts that apply to Scaleway recources integrated with Cockpit by default. :param region: Region to target. If none is passed will use default region from the config. :param project_id: ID of the Project. :return:
AlertManagerUsage:
result = api.enable_managed_alerts()
- get_alert_manager(*, region: str | None = None, project_id: str | None = None) AlertManager
Get the Alert manager. Retrieve information about the Alert manager which is unique per Project and region. By default the Alert manager is disabled. The output returned displays a URL to access the Alert manager, and whether the Alert manager and managed alerts are enabled. :param region: Region to target. If none is passed will use default region from the config. :param project_id: Project ID of the requested Alert manager. :return:
AlertManagerUsage:
result = api.get_alert_manager()
- get_config(*, region: str | None = None) GetConfigResponse
Get the Cockpit configuration. :param region: Region to target. If none is passed will use default region from the config. :return:
GetConfigResponseUsage:
result = api.get_config()
- get_data_source(*, data_source_id: str, region: str | None = None) DataSource
Get a data source. Retrieve information about a given data source, specified by the data source ID. The data source’s information such as its name, type, URL, origin, and retention period, is returned. :param data_source_id: ID of the relevant data source. :param region: Region to target. If none is passed will use default region from the config. :return:
DataSourceUsage:
result = api.get_data_source( data_source_id="example", )
- get_rules_count(*, region: str | None = None, project_id: str | None = None) GetRulesCountResponse
Get a detailed count of enabled rules in the specified Project. Includes preconfigured and custom alerting and recording rules. :param region: Region to target. If none is passed will use default region from the config. :param project_id: ID of the Project to retrieve the rule count for. :return:
GetRulesCountResponseUsage:
result = api.get_rules_count()
- get_token(*, token_id: str, region: str | None = None) Token
Get a token. Retrieve information about a given token, specified by the token ID. The token’s information such as its scopes, is returned. :param token_id: Token ID. :param region: Region to target. If none is passed will use default region from the config. :return:
TokenUsage:
result = api.get_token( token_id="example", )
- get_usage_overview(*, region: str | None = None, project_id: str | None = None, interval: str | None = None) UsageOverview
Get data source usage overview. Retrieve the volume of data ingested for each of your data sources in the specified project and region. :param region: Region to target. If none is passed will use default region from the config. :param project_id: :param interval: :return:
UsageOverviewUsage:
result = api.get_usage_overview()
- list_alerts(*, region: str | None = None, project_id: str | None = None, rule_status: AlertStatus | None = None, is_preconfigured: bool | None = None, state: AlertState | None = None, data_source_id: str | None = None) ListAlertsResponse
List alerts. List preconfigured and/or custom alerts for the specified Project and data source. :param region: Region to target. If none is passed will use default region from the config. :param project_id: Project ID to filter for, only alerts from this Project will be returned. :param rule_status: Returns only alerts with the given activation status. If omitted, no alert filtering is applied. Other filters may still apply. :param is_preconfigured: True returns only preconfigured alerts. False returns only custom alerts. If omitted, no filtering is applied on alert types. Other filters may still apply. :param state: Valid values to filter on are inactive, pending and firing. If omitted, no filtering is applied on alert states. Other filters may still apply. :param data_source_id: If omitted, only alerts from the default Scaleway metrics data source will be listed. :return:
ListAlertsResponseUsage:
result = api.list_alerts()
- list_contact_points(*, region: str | None = None, page: int | None = None, page_size: int | None = None, project_id: str | None = None) ListContactPointsResponse
List contact points. Retrieve a list of contact points for the specified Project. The response lists all contact points and receivers created in Grafana or via the API. :param region: Region to target. If none is passed will use default region from the config. :param page: Page number to return, from the paginated results. :param page_size: Total count of contact points to return per page. :param project_id: ID of the Project containing the contact points to list. :return:
ListContactPointsResponseUsage:
result = api.list_contact_points()
- list_contact_points_all(*, region: str | None = None, page: int | None = None, page_size: int | None = None, project_id: str | None = None) List[ContactPoint]
List contact points. Retrieve a list of contact points for the specified Project. The response lists all contact points and receivers created in Grafana or via the API. :param region: Region to target. If none is passed will use default region from the config. :param page: Page number to return, from the paginated results. :param page_size: Total count of contact points to return per page. :param project_id: ID of the Project containing the contact points to list. :return:
List[ContactPoint]Usage:
result = api.list_contact_points_all()
- list_data_sources(*, region: str | None = None, page: int | None = None, page_size: int | None = None, order_by: ListDataSourcesRequestOrderBy | None = None, project_id: str | None = None, origin: DataSourceOrigin | None = None, types: List[DataSourceType] | None = None) ListDataSourcesResponse
List data sources. Retrieve the list of data sources available in the specified region. By default, the data sources returned in the list are ordered by creation date, in ascending order. :param region: Region to target. If none is passed will use default region from the config. :param page: Page number to return, from the paginated results. :param page_size: Number of data sources to return per page. :param order_by: Sort order for data sources in the response. :param project_id: Project ID to filter for, only data sources from this Project will be returned. :param origin: Origin to filter for, only data sources with matching origin will be returned. If omitted, all types will be returned. :param types: Types to filter for (metrics, logs, traces), only data sources with matching types will be returned. If omitted, all types will be returned. :return:
ListDataSourcesResponseUsage:
result = api.list_data_sources()
- list_data_sources_all(*, region: str | None = None, page: int | None = None, page_size: int | None = None, order_by: ListDataSourcesRequestOrderBy | None = None, project_id: str | None = None, origin: DataSourceOrigin | None = None, types: List[DataSourceType] | None = None) List[DataSource]
List data sources. Retrieve the list of data sources available in the specified region. By default, the data sources returned in the list are ordered by creation date, in ascending order. :param region: Region to target. If none is passed will use default region from the config. :param page: Page number to return, from the paginated results. :param page_size: Number of data sources to return per page. :param order_by: Sort order for data sources in the response. :param project_id: Project ID to filter for, only data sources from this Project will be returned. :param origin: Origin to filter for, only data sources with matching origin will be returned. If omitted, all types will be returned. :param types: Types to filter for (metrics, logs, traces), only data sources with matching types will be returned. If omitted, all types will be returned. :return:
List[DataSource]Usage:
result = api.list_data_sources_all()
- list_tokens(*, region: str | None = None, page: int | None = None, page_size: int | None = None, order_by: ListTokensRequestOrderBy | None = None, project_id: str | None = None, token_scopes: List[TokenScope] | None = None) ListTokensResponse
List tokens. Retrieve a list of all tokens in the specified region. By default, tokens returned in the list are ordered by creation date, in ascending order. You can filter tokens by Project ID and token scopes. :param region: Region to target. If none is passed will use default region from the config. :param page: Page number to return, from the paginated results. :param page_size: Number of tokens to return per page. :param order_by: Order in which to return results. :param project_id: ID of the Project the tokens belong to. :param token_scopes: Token scopes to filter for. :return:
ListTokensResponseUsage:
result = api.list_tokens()
- list_tokens_all(*, region: str | None = None, page: int | None = None, page_size: int | None = None, order_by: ListTokensRequestOrderBy | None = None, project_id: str | None = None, token_scopes: List[TokenScope] | None = None) List[Token]
List tokens. Retrieve a list of all tokens in the specified region. By default, tokens returned in the list are ordered by creation date, in ascending order. You can filter tokens by Project ID and token scopes. :param region: Region to target. If none is passed will use default region from the config. :param page: Page number to return, from the paginated results. :param page_size: Number of tokens to return per page. :param order_by: Order in which to return results. :param project_id: ID of the Project the tokens belong to. :param token_scopes: Token scopes to filter for. :return:
List[Token]Usage:
result = api.list_tokens_all()
- trigger_test_alert(*, region: str | None = None, project_id: str | None = None) None
Trigger a test alert. Send a test alert to the Alert manager to make sure your contact points get notified. :param region: Region to target. If none is passed will use default region from the config. :param project_id: ID of the Project.
Usage:
result = api.trigger_test_alert()
- update_contact_point(*, region: str | None = None, project_id: str | None = None, email: ContactPointEmail | None = None, send_resolved_notifications: bool | None = None) ContactPoint
- Parameters:
region – Region to target. If none is passed will use default region from the config.
project_id – ID of the Project containing the contact point to update.
email – Email address of the contact point to update.
One-Of (‘configuration’): at most one of ‘email’ could be set. :param send_resolved_notifications: Enable or disable notifications when alert is resolved. :return:
ContactPointUsage:
result = api.update_contact_point()
- update_data_source(*, data_source_id: str, region: str | None = None, name: str | None = None, retention_days: int | None = None) DataSource
Update a data source. Update a given data source attributes (name and/or retention_days). :param data_source_id: ID of the data source to update. :param region: Region to target. If none is passed will use default region from the config. :param name: Updated name of the data source. :param retention_days: Duration for which the data will be retained in the data source. :return:
DataSourceUsage:
result = api.update_data_source( data_source_id="example", )
- class scaleway.cockpit.v1.ContactPoint(region: str, send_resolved_notifications: bool, email: ContactPointEmail | None = None)
Bases:
objectContact point.
- email: ContactPointEmail | None = None
- region: str
Region.
- send_resolved_notifications: bool
Send an email notification when an alert is marked as resolved.
- class scaleway.cockpit.v1.DataSource(id: str, project_id: str, name: str, url: str, type_: DataSourceType, origin: DataSourceOrigin, synchronized_with_grafana: bool, retention_days: int, region: str, created_at: datetime | None = None, updated_at: datetime | None = None)
Bases:
objectData source.
- created_at: datetime | None = None
Date the data source was created.
- id: str
ID of the data source.
- name: str
Data source name.
- origin: DataSourceOrigin
Data source origin.
- project_id: str
ID of the Project the data source belongs to.
- region: str
Region of the data source.
- retention_days: int
Duration for which the data will be retained in the data source.
- synchronized_with_grafana: bool
Indicates whether the data source is synchronized with Grafana.
- type_: DataSourceType
Data source type.
- updated_at: datetime | None = None
Date the data source was last updated.
- url: str
Data source URL.
- class scaleway.cockpit.v1.DataSourceOrigin(value: str, names: Any | None = None, *args: Any, **kwargs: Any)
Bases:
str,Enum- CUSTOM = 'custom'
- EXTERNAL = 'external'
- SCALEWAY = 'scaleway'
- UNKNOWN_ORIGIN = 'unknown_origin'
- class scaleway.cockpit.v1.DataSourceType(value: str, names: Any | None = None, *args: Any, **kwargs: Any)
Bases:
str,Enum- LOGS = 'logs'
- METRICS = 'metrics'
- TRACES = 'traces'
- UNKNOWN_TYPE = 'unknown_type'
- class scaleway.cockpit.v1.DisableAlertRulesResponse(disabled_rule_ids: List[str])
Bases:
objectOutput returned when alert rules are disabled.
- disabled_rule_ids: List[str]
Only newly disabled rules are listed. Rules that were already disabled are not returned in the output.
- class scaleway.cockpit.v1.EnableAlertRulesResponse(enabled_rule_ids: List[str])
Bases:
objectOutput returned when alert rules are enabled.
- enabled_rule_ids: List[str]
Only newly enabled rules are listed. Rules that were already enabled are not returned in the output.
- class scaleway.cockpit.v1.GetConfigResponse(custom_metrics_retention: GetConfigResponseRetention | None = None, custom_logs_retention: GetConfigResponseRetention | None = None, custom_traces_retention: GetConfigResponseRetention | None = None, product_metrics_retention: GetConfigResponseRetention | None = None, product_logs_retention: GetConfigResponseRetention | None = None)
Bases:
objectCockpit configuration.
- custom_logs_retention: GetConfigResponseRetention | None = None
Custom logs retention configuration.
- custom_metrics_retention: GetConfigResponseRetention | None = None
Custom metrics retention configuration.
- custom_traces_retention: GetConfigResponseRetention | None = None
Custom traces retention configuration.
- product_logs_retention: GetConfigResponseRetention | None = None
Scaleway logs retention configuration.
- product_metrics_retention: GetConfigResponseRetention | None = None
Scaleway metrics retention configuration.
- class scaleway.cockpit.v1.GetConfigResponseRetention(min_days: 'int', max_days: 'int', default_days: 'int')
Bases:
object- default_days: int
- max_days: int
- min_days: int
- class scaleway.cockpit.v1.GetRulesCountResponse(rules_count_by_datasource: 'List[RulesCount]', preconfigured_rules_count: 'int', custom_rules_count: 'int')
Bases:
object- custom_rules_count: int
Total count of custom rules.
- preconfigured_rules_count: int
Total count of preconfigured rules.
- rules_count_by_datasource: List[RulesCount]
Total count of rules grouped by data source.
- class scaleway.cockpit.v1.GlobalApiCreateGrafanaUserRequest(login: str, project_id: str | None = None, role: GrafanaUserRole | None = GrafanaUserRole.UNKNOWN_ROLE)
Bases:
objectCreate a Grafana user.
- login: str
Username of the Grafana user. Note that the admin username is not available for creation.
- project_id: str | None = None
ID of the Project in which to create the Grafana user.
- role: GrafanaUserRole | None = 'unknown_role'
Role assigned to the Grafana user.
- class scaleway.cockpit.v1.GlobalApiDeleteGrafanaUserRequest(grafana_user_id: int, project_id: str | None = None)
Bases:
objectDelete a Grafana user.
- grafana_user_id: int
ID of the Grafana user.
- project_id: str | None = None
ID of the Project to target.
- class scaleway.cockpit.v1.GlobalApiGetCurrentPlanRequest(project_id: str | None = None)
Bases:
objectRetrieve a pricing plan for the given Project.
- project_id: str | None = None
ID of the Project.
- class scaleway.cockpit.v1.GlobalApiGetGrafanaProductDashboardRequest(dashboard_name: str, project_id: str | None = None)
Bases:
objectRetrieve a specific dashboard.
- dashboard_name: str
Name of the dashboard.
- project_id: str | None = None
ID of the Project the dashboard belongs to.
- class scaleway.cockpit.v1.GlobalApiGetGrafanaRequest(project_id: str | None = None)
Bases:
objectRequest a Grafana.
- project_id: str | None = None
ID of the Project.
- class scaleway.cockpit.v1.GlobalApiListGrafanaProductDashboardsRequest(project_id: str | None = None, page: int | None = 0, page_size: int | None = 0, tags: ~typing.List[str] | None = <factory>)
Bases:
objectRetrieve a list of available product dashboards.
- page: int | None = 0
Page number.
- page_size: int | None = 0
Page size.
- project_id: str | None = None
ID of the Project to target.
- tags: List[str] | None
Tags to filter for.
- class scaleway.cockpit.v1.GlobalApiListGrafanaUsersRequest(page: int | None = 0, page_size: int | None = 0, order_by: ListGrafanaUsersRequestOrderBy | None = ListGrafanaUsersRequestOrderBy.LOGIN_ASC, project_id: str | None = None)
Bases:
objectList all Grafana users.
- order_by: ListGrafanaUsersRequestOrderBy | None = 'login_asc'
Order of the Grafana users.
- page: int | None = 0
Page number.
- page_size: int | None = 0
Page size.
- project_id: str | None = None
ID of the Project to target.
- class scaleway.cockpit.v1.GlobalApiListPlansRequest(page: int | None = 0, page_size: int | None = 0, order_by: ListPlansRequestOrderBy | None = ListPlansRequestOrderBy.NAME_ASC)
Bases:
objectRetrieve a list of available pricing plans.
- order_by: ListPlansRequestOrderBy | None = 'name_asc'
- page: int | None = 0
Page number.
- page_size: int | None = 0
Page size.
- class scaleway.cockpit.v1.GlobalApiResetGrafanaUserPasswordRequest(grafana_user_id: int, project_id: str | None = None)
Bases:
objectReset a Grafana user’s password.
- grafana_user_id: int
ID of the Grafana user.
- project_id: str | None = None
ID of the Project to target.
- class scaleway.cockpit.v1.GlobalApiSelectPlanRequest(project_id: str | None = None, plan_name: PlanName | None = PlanName.UNKNOWN_NAME)
Bases:
objectSelect a specific pricing plan.
- project_id: str | None = None
ID of the Project.
- class scaleway.cockpit.v1.GlobalApiSyncGrafanaDataSourcesRequest(project_id: str | None = None)
Bases:
objectTrigger the synchronization of all data sources created in the relevant regions.
- project_id: str | None = None
ID of the Project to target.
- class scaleway.cockpit.v1.Grafana(grafana_url: str)
Bases:
objectGrafana user.
- grafana_url: str
URL to access your Cockpit’s Grafana.
- class scaleway.cockpit.v1.GrafanaProductDashboard(name: str, title: str, url: str, tags: List[str], variables: List[str])
Bases:
objectGrafana dashboard.
- name: str
Dashboard name.
- tags: List[str]
Dashboard tags.
- title: str
Dashboard title.
- url: str
Dashboard URL.
- variables: List[str]
Dashboard variables.
- class scaleway.cockpit.v1.GrafanaUser(id: int, login: str, role: GrafanaUserRole, password: str | None = None)
Bases:
objectGrafana user.
- id: int
ID of the Grafana user.
- login: str
Username of the Grafana user.
- password: str | None = None
Grafana user’s password.
- role: GrafanaUserRole
Role assigned to the Grafana user.
- class scaleway.cockpit.v1.GrafanaUserRole(value: str, names: Any | None = None, *args: Any, **kwargs: Any)
Bases:
str,Enum- EDITOR = 'editor'
- UNKNOWN_ROLE = 'unknown_role'
- VIEWER = 'viewer'
- class scaleway.cockpit.v1.ListAlertsResponse(total_count: int, alerts: List[Alert])
Bases:
objectRetrieve a list of alerts matching the request.
- total_count: int
Total count of alerts matching the request.
- class scaleway.cockpit.v1.ListContactPointsResponse(total_count: int, contact_points: List[ContactPoint], has_additional_receivers: bool, has_additional_contact_points: bool)
Bases:
objectResponse returned when listing contact points.
- contact_points: List[ContactPoint]
List of contact points associated with the default receiver.
- has_additional_contact_points: bool
Indicates whether there are unmanaged contact points on the default receiver.
- has_additional_receivers: bool
Indicates whether the Alert manager has other receivers than the default one.
- total_count: int
Total count of contact points associated with the default receiver.
- class scaleway.cockpit.v1.ListDataSourcesRequestOrderBy(value: str, names: Any | None = None, *args: Any, **kwargs: Any)
Bases:
str,Enum- CREATED_AT_ASC = 'created_at_asc'
- CREATED_AT_DESC = 'created_at_desc'
- NAME_ASC = 'name_asc'
- NAME_DESC = 'name_desc'
- TYPE_ASC = 'type_asc'
- TYPE_DESC = 'type_desc'
- class scaleway.cockpit.v1.ListDataSourcesResponse(total_count: int, data_sources: List[DataSource])
Bases:
objectResponse returned when listing data sources.
- data_sources: List[DataSource]
Data sources matching the request within the pagination.
- total_count: int
Total count of data sources matching the request.
- class scaleway.cockpit.v1.ListGrafanaProductDashboardsResponse(total_count: int, dashboards: List[GrafanaProductDashboard])
Bases:
objectOutput returned when listing dashboards.
- dashboards: List[GrafanaProductDashboard]
Grafana dashboards information.
- total_count: int
Total count of Grafana dashboards.
- class scaleway.cockpit.v1.ListGrafanaUsersRequestOrderBy(value: str, names: Any | None = None, *args: Any, **kwargs: Any)
Bases:
str,Enum- LOGIN_ASC = 'login_asc'
- LOGIN_DESC = 'login_desc'
- class scaleway.cockpit.v1.ListGrafanaUsersResponse(total_count: int, grafana_users: List[GrafanaUser])
Bases:
objectOuptut returned when listing Grafana users.
- grafana_users: List[GrafanaUser]
Grafana users information.
- total_count: int
Total count of Grafana users.
- class scaleway.cockpit.v1.ListPlansRequestOrderBy(value: str, names: Any | None = None, *args: Any, **kwargs: Any)
Bases:
str,Enum- NAME_ASC = 'name_asc'
- NAME_DESC = 'name_desc'
- class scaleway.cockpit.v1.ListPlansResponse(total_count: int, plans: List[Plan])
Bases:
objectOutput returned when listing pricing plans.
- total_count: int
Total count of available pricing plans.
- class scaleway.cockpit.v1.ListTokensRequestOrderBy(value: str, names: Any | None = None, *args: Any, **kwargs: Any)
Bases:
str,Enum- CREATED_AT_ASC = 'created_at_asc'
- CREATED_AT_DESC = 'created_at_desc'
- NAME_ASC = 'name_asc'
- NAME_DESC = 'name_desc'
- class scaleway.cockpit.v1.ListTokensResponse(total_count: int, tokens: List[Token])
Bases:
objectResponse returned when listing tokens.
- total_count: int
Total count of tokens matching the request.
- class scaleway.cockpit.v1.Plan(name: PlanName, sample_ingestion_price: int, logs_ingestion_price: int, traces_ingestion_price: int, monthly_price: int, retention_metrics_interval: str | None = None, retention_logs_interval: str | None = None, retention_traces_interval: str | None = None)
Bases:
objectType of pricing plan.
- logs_ingestion_price: int
Ingestion price in cents for 1 GB of logs.
- monthly_price: int
Retention price in euros per month.
- retention_logs_interval: str | None = None
Interval of time during which Scaleway’s Cockpit keeps your logs.
- retention_metrics_interval: str | None = None
Interval of time during which Scaleway’s Cockpit keeps your metrics.
- retention_traces_interval: str | None = None
Interval of time during which Scaleway’s Cockpit keeps your traces.
- sample_ingestion_price: int
Ingestion price in cents for 1 million samples.
- traces_ingestion_price: int
Ingestion price in cents for 1 GB of traces.
- class scaleway.cockpit.v1.PlanName(value: str, names: Any | None = None, *args: Any, **kwargs: Any)
Bases:
str,Enum- CUSTOM = 'custom'
- FREE = 'free'
- PREMIUM = 'premium'
- UNKNOWN_NAME = 'unknown_name'
- class scaleway.cockpit.v1.PreconfiguredAlertData(preconfigured_rule_id: str, display_name: str, display_description: str, product_name: str, product_family: str)
Bases:
objectStructure for additional data relative to preconfigured alerts.
- display_description: str
Human readable description of the alert.
- display_name: str
Human readable name of the alert.
- preconfigured_rule_id: str
ID of the preconfigured rule if the alert is preconfigured.
- product_family: str
Family of the product associated with the alert.
- product_name: str
Product associated with the alert.
- class scaleway.cockpit.v1.RegionalApiCreateContactPointRequest(region: str | None = None, project_id: str | None = None, send_resolved_notifications: bool | None = False, email: ContactPointEmail | None = None)
Bases:
objectCreate a contact point.
- email: ContactPointEmail | None = None
- project_id: str | None = None
ID of the Project to create the contact point in.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- send_resolved_notifications: bool | None = False
Send an email notification when an alert is marked as resolved.
- class scaleway.cockpit.v1.RegionalApiCreateDataSourceRequest(name: str, region: str | None = None, project_id: str | None = None, type_: DataSourceType | None = DataSourceType.UNKNOWN_TYPE, retention_days: int | None = 0)
Bases:
objectCreate a data source.
- name: str
Data source name.
- project_id: str | None = None
ID of the Project the data source belongs to.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- retention_days: int | None = 0
Default values are 31 days for metrics, 7 days for logs and traces.
- type_: DataSourceType | None = 'unknown_type'
Data source type.
- class scaleway.cockpit.v1.RegionalApiCreateTokenRequest(name: str, region: str | None = None, project_id: str | None = None, token_scopes: ~typing.List[~scaleway.cockpit.v1.types.TokenScope] | None = <factory>)
Bases:
objectCreate a token.
- name: str
Name of the token.
- project_id: str | None = None
ID of the Project the token belongs to.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- token_scopes: List[TokenScope] | None
Token permission scopes.
- class scaleway.cockpit.v1.RegionalApiDeleteContactPointRequest(region: str | None = None, project_id: str | None = None, email: ContactPointEmail | None = None)
Bases:
objectDelete a contact point.
- email: ContactPointEmail | None = None
- project_id: str | None = None
ID of the Project containing the contact point to delete.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- class scaleway.cockpit.v1.RegionalApiDeleteDataSourceRequest(data_source_id: str, region: str | None = None)
Bases:
objectDelete a data source.
- data_source_id: str
ID of the data source to delete.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- class scaleway.cockpit.v1.RegionalApiDeleteTokenRequest(token_id: str, region: str | None = None)
Bases:
objectDelete a token.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- token_id: str
ID of the token to delete.
- class scaleway.cockpit.v1.RegionalApiDisableAlertManagerRequest(region: str | None = None, project_id: str | None = None)
Bases:
objectDisable the Alert manager.
- project_id: str | None = None
ID of the Project to disable the Alert manager in.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- class scaleway.cockpit.v1.RegionalApiDisableAlertRulesRequest(region: 'Optional[ScwRegion]' = None, project_id: 'Optional[str]' = None, rule_ids: 'Optional[List[str]]' = <factory>)
Bases:
object- project_id: str | None = None
ID of the Project.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- rule_ids: List[str] | None
List of IDs of the rules to enable. If empty, disables all preconfigured rules.
- class scaleway.cockpit.v1.RegionalApiDisableManagedAlertsRequest(region: str | None = None, project_id: str | None = None)
Bases:
objectDisable the sending of managed alerts.
- project_id: str | None = None
ID of the Project.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- class scaleway.cockpit.v1.RegionalApiEnableAlertManagerRequest(region: str | None = None, project_id: str | None = None)
Bases:
objectEnable the Alert manager.
- project_id: str | None = None
ID of the Project to enable the Alert manager in.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- class scaleway.cockpit.v1.RegionalApiEnableAlertRulesRequest(region: 'Optional[ScwRegion]' = None, project_id: 'Optional[str]' = None, rule_ids: 'Optional[List[str]]' = <factory>)
Bases:
object- project_id: str | None = None
ID of the Project.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- rule_ids: List[str] | None
List of IDs of the rules to enable. If empty, enables all preconfigured rules.
- class scaleway.cockpit.v1.RegionalApiEnableManagedAlertsRequest(region: str | None = None, project_id: str | None = None)
Bases:
objectEnable the sending of managed alerts.
- project_id: str | None = None
ID of the Project.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- class scaleway.cockpit.v1.RegionalApiGetAlertManagerRequest(region: str | None = None, project_id: str | None = None)
Bases:
objectGet the Alert manager.
- project_id: str | None = None
Project ID of the requested Alert manager.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- class scaleway.cockpit.v1.RegionalApiGetConfigRequest(region: str | None = None)
Bases:
objectGet Cockpit configuration.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- class scaleway.cockpit.v1.RegionalApiGetDataSourceRequest(data_source_id: str, region: str | None = None)
Bases:
objectRetrieve a data source.
- data_source_id: str
ID of the relevant data source.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- class scaleway.cockpit.v1.RegionalApiGetRulesCountRequest(region: 'Optional[ScwRegion]' = None, project_id: 'Optional[str]' = None)
Bases:
object- project_id: str | None = None
ID of the Project to retrieve the rule count for.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- class scaleway.cockpit.v1.RegionalApiGetTokenRequest(token_id: str, region: str | None = None)
Bases:
objectGet a token.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- token_id: str
Token ID.
- class scaleway.cockpit.v1.RegionalApiGetUsageOverviewRequest(region: 'Optional[ScwRegion]' = None, project_id: 'Optional[str]' = None, interval: 'Optional[str]' = None)
Bases:
object- interval: str | None = None
- project_id: str | None = None
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- class scaleway.cockpit.v1.RegionalApiListAlertsRequest(region: str | None = None, project_id: str | None = None, rule_status: AlertStatus | None = AlertStatus.UNKNOWN_STATUS, is_preconfigured: bool | None = False, state: AlertState | None = AlertState.UNKNOWN_STATE, data_source_id: str | None = None)
Bases:
objectRetrieve a list of alerts.
- data_source_id: str | None = None
If omitted, only alerts from the default Scaleway metrics data source will be listed.
- is_preconfigured: bool | None = False
True returns only preconfigured alerts. False returns only custom alerts. If omitted, no filtering is applied on alert types. Other filters may still apply.
- project_id: str | None = None
Project ID to filter for, only alerts from this Project will be returned.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- rule_status: AlertStatus | None = 'unknown_status'
Returns only alerts with the given activation status. If omitted, no alert filtering is applied. Other filters may still apply.
- state: AlertState | None = 'unknown_state'
Valid values to filter on are inactive, pending and firing. If omitted, no filtering is applied on alert states. Other filters may still apply.
- class scaleway.cockpit.v1.RegionalApiListContactPointsRequest(region: str | None = None, page: int | None = 0, page_size: int | None = 0, project_id: str | None = None)
Bases:
objectList contact points.
- page: int | None = 0
Page number to return, from the paginated results.
- page_size: int | None = 0
Total count of contact points to return per page.
- project_id: str | None = None
ID of the Project containing the contact points to list.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- class scaleway.cockpit.v1.RegionalApiListDataSourcesRequest(region: str | None = None, page: int | None = 0, page_size: int | None = 0, order_by: ~scaleway.cockpit.v1.types.ListDataSourcesRequestOrderBy | None = ListDataSourcesRequestOrderBy.CREATED_AT_ASC, project_id: str | None = None, origin: ~scaleway.cockpit.v1.types.DataSourceOrigin | None = DataSourceOrigin.UNKNOWN_ORIGIN, types: ~typing.List[~scaleway.cockpit.v1.types.DataSourceType] | None = <factory>)
Bases:
objectList data sources.
- order_by: ListDataSourcesRequestOrderBy | None = 'created_at_asc'
Sort order for data sources in the response.
- origin: DataSourceOrigin | None = 'unknown_origin'
Origin to filter for, only data sources with matching origin will be returned. If omitted, all types will be returned.
- page: int | None = 0
Page number to return, from the paginated results.
- page_size: int | None = 0
Number of data sources to return per page.
- project_id: str | None = None
Project ID to filter for, only data sources from this Project will be returned.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- types: List[DataSourceType] | None
Types to filter for (metrics, logs, traces), only data sources with matching types will be returned. If omitted, all types will be returned.
- class scaleway.cockpit.v1.RegionalApiListTokensRequest(region: str | None = None, page: int | None = 0, page_size: int | None = 0, order_by: ~scaleway.cockpit.v1.types.ListTokensRequestOrderBy | None = ListTokensRequestOrderBy.CREATED_AT_ASC, project_id: str | None = None, token_scopes: ~typing.List[~scaleway.cockpit.v1.types.TokenScope] | None = <factory>)
Bases:
objectList tokens.
- order_by: ListTokensRequestOrderBy | None = 'created_at_asc'
Order in which to return results.
- page: int | None = 0
Page number to return, from the paginated results.
- page_size: int | None = 0
Number of tokens to return per page.
- project_id: str | None = None
ID of the Project the tokens belong to.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- token_scopes: List[TokenScope] | None
Token scopes to filter for.
- class scaleway.cockpit.v1.RegionalApiTriggerTestAlertRequest(region: str | None = None, project_id: str | None = None)
Bases:
objectRequest to trigger a test alert.
- project_id: str | None = None
ID of the Project.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- class scaleway.cockpit.v1.RegionalApiUpdateContactPointRequest(region: str | None = None, project_id: str | None = None, send_resolved_notifications: bool | None = False, email: ContactPointEmail | None = None)
Bases:
objectUpdate a contact point.
- email: ContactPointEmail | None = None
- project_id: str | None = None
ID of the Project containing the contact point to update.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- send_resolved_notifications: bool | None = False
Enable or disable notifications when alert is resolved.
- class scaleway.cockpit.v1.RegionalApiUpdateDataSourceRequest(data_source_id: str, region: str | None = None, name: str | None = None, retention_days: int | None = 0)
Bases:
objectUpdate a data source name.
- data_source_id: str
ID of the data source to update.
- name: str | None = None
Updated name of the data source.
- region: str | None = None
Region to target. If none is passed will use default region from the config.
- retention_days: int | None = 0
Duration for which the data will be retained in the data source.
- class scaleway.cockpit.v1.RulesCount(data_source_id: 'str', data_source_name: 'str', rules_count: 'int')
Bases:
object- data_source_id: str
ID of the data source.
- data_source_name: str
Name of the data source.
- rules_count: int
Total count of rules associated with this data source.
- class scaleway.cockpit.v1.Token(id: str, project_id: str, name: str, scopes: List[TokenScope], region: str, created_at: datetime | None = None, updated_at: datetime | None = None, secret_key: str | None = None)
Bases:
objectToken.
- created_at: datetime | None = None
Token creation date.
- id: str
ID of the token.
- name: str
Name of the token.
- project_id: str
ID of the Project the token belongs to.
- region: str
Regions where the token is located.
- scopes: List[TokenScope]
Token permission scopes.
- secret_key: str | None = None
Token secret key.
- updated_at: datetime | None = None
Token last modification date.
- class scaleway.cockpit.v1.TokenScope(value: str, names: Any | None = None, *args: Any, **kwargs: Any)
Bases:
str,Enum- FULL_ACCESS_ALERT_MANAGER = 'full_access_alert_manager'
- FULL_ACCESS_LOGS_RULES = 'full_access_logs_rules'
- FULL_ACCESS_METRICS_RULES = 'full_access_metrics_rules'
- READ_ONLY_LOGS = 'read_only_logs'
- READ_ONLY_METRICS = 'read_only_metrics'
- READ_ONLY_TRACES = 'read_only_traces'
- UNKNOWN_SCOPE = 'unknown_scope'
- WRITE_ONLY_LOGS = 'write_only_logs'
- WRITE_ONLY_METRICS = 'write_only_metrics'
- WRITE_ONLY_TRACES = 'write_only_traces'
- class scaleway.cockpit.v1.Usage(project_id: str, data_source_origin: DataSourceOrigin, data_source_type: DataSourceType, unit: UsageUnit, quantity_over_interval: int, region: str, data_source_id: str | None = None, interval: str | None = None)
Bases:
objectData source usage.
- data_source_id: str | None = None
ID of the data source.
- data_source_origin: DataSourceOrigin
Origin of the data source.
- data_source_type: DataSourceType
Type of the data source.
- interval: str | None = None
Interval for the data source usage.
- project_id: str
ID of the Project the data source belongs to.
- quantity_over_interval: int
Data source usage for the given interval.
- region: str
Region of the data source usage.
- class scaleway.cockpit.v1.UsageOverview(scaleway_metrics_usage: 'Optional[Usage]' = None, scaleway_logs_usage: 'Optional[Usage]' = None, external_metrics_usage: 'Optional[Usage]' = None, external_logs_usage: 'Optional[Usage]' = None, external_traces_usage: 'Optional[Usage]' = None)
Bases:
object