scaleway_async.cockpit.v1 package
Submodules
scaleway_async.cockpit.v1.api module
- class scaleway_async.cockpit.v1.api.CockpitV1GlobalAPI(client: Client, *, bypass_validation: bool = False)
Bases:
API
The Cockpit Global API allows you to manage your Cockpit’s Grafana and plans.
- async create_grafana_user(*, login: str, project_id: Optional[str] = None, role: Optional[GrafanaUserRole] = 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:
GrafanaUser
Usage:
result = await api.create_grafana_user( login="example", )
- async delete_grafana_user(*, project_id: Optional[str] = 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 = await api.delete_grafana_user( grafana_user_id=1, )
- async get_current_plan(*, project_id: Optional[str] = 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 = await api.get_current_plan()
- async get_grafana(*, project_id: Optional[str] = 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:
Grafana
Usage:
result = await api.get_grafana()
- async get_grafana_product_dashboard(*, project_id: Optional[str] = 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:
GrafanaProductDashboard
Usage:
result = await api.get_grafana_product_dashboard( dashboard_name="example", )
- async list_grafana_product_dashboards(*, project_id: Optional[str] = None, page: Optional[int] = None, page_size: Optional[int] = None, tags: Optional[List[str]] = 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:
ListGrafanaProductDashboardsResponse
Usage:
result = await api.list_grafana_product_dashboards()
- async list_grafana_product_dashboards_all(*, project_id: Optional[str] = None, page: Optional[int] = None, page_size: Optional[int] = None, tags: Optional[List[str]] = 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 = await api.list_grafana_product_dashboards_all()
- async list_grafana_users(*, page: Optional[int] = None, page_size: Optional[int] = None, order_by: Optional[ListGrafanaUsersRequestOrderBy] = None, project_id: Optional[str] = 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:
ListGrafanaUsersResponse
Usage:
result = await api.list_grafana_users()
- async list_grafana_users_all(*, page: Optional[int] = None, page_size: Optional[int] = None, order_by: Optional[ListGrafanaUsersRequestOrderBy] = None, project_id: Optional[str] = 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 = await api.list_grafana_users_all()
- async list_plans(*, page: Optional[int] = None, page_size: Optional[int] = None, order_by: Optional[ListPlansRequestOrderBy] = 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 = await api.list_plans()
- async list_plans_all(*, page: Optional[int] = None, page_size: Optional[int] = None, order_by: Optional[ListPlansRequestOrderBy] = 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 = await api.list_plans_all()
- async reset_grafana_user_password(*, project_id: Optional[str] = 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:
GrafanaUser
Usage:
result = await api.reset_grafana_user_password( grafana_user_id=1, )
- async select_plan(*, project_id: Optional[str] = None, plan_name: Optional[PlanName] = 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 = await api.select_plan()
- async sync_grafana_data_sources(*, project_id: Optional[str] = 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 = await api.sync_grafana_data_sources()
- class scaleway_async.cockpit.v1.api.CockpitV1RegionalAPI(client: Client, *, bypass_validation: bool = False)
Bases:
API
The Cockpit Regional API allows you to create data sources and 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.
- async create_contact_point(*, region: Optional[str] = None, project_id: Optional[str] = None, email: Optional[ContactPointEmail] = None, send_resolved_notifications: Optional[bool] = 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:
ContactPoint
Usage:
result = await api.create_contact_point()
- async create_data_source(*, name: str, region: Optional[str] = None, project_id: Optional[str] = None, type_: Optional[DataSourceType] = None, retention_days: Optional[int] = None) DataSource
Create a data source. You must specify the data source type upon creation. Available data source types include:
metrics
logs
traces
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 30 days for metrics, 7 days for logs and traces. :return:
DataSource
Usage:
result = await api.create_data_source( name="example", )
- async create_token(*, name: str, region: Optional[str] = None, project_id: Optional[str] = None, token_scopes: Optional[List[TokenScope]] = 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:
Token
Usage:
result = await api.create_token( name="example", )
- async delete_contact_point(*, region: Optional[str] = None, project_id: Optional[str] = None, email: Optional[ContactPointEmail] = 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 = await api.delete_contact_point()
- async delete_data_source(*, data_source_id: str, region: Optional[str] = None) None
Delete a data source. Delete a given data source, specified by the data source ID. Note that deleting a data source is irreversible, and cannot be undone. :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 = await api.delete_data_source( data_source_id="example", )
- async delete_token(*, token_id: str, region: Optional[str] = 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 = await api.delete_token( token_id="example", )
- async disable_alert_manager(*, region: Optional[str] = None, project_id: Optional[str] = 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:
AlertManager
Usage:
result = await api.disable_alert_manager()
- async disable_managed_alerts(*, region: Optional[str] = None, project_id: Optional[str] = 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:
AlertManager
Usage:
result = await api.disable_managed_alerts()
- async enable_alert_manager(*, region: Optional[str] = None, project_id: Optional[str] = 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:
AlertManager
Usage:
result = await api.enable_alert_manager()
- async enable_managed_alerts(*, region: Optional[str] = None, project_id: Optional[str] = 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:
AlertManager
Usage:
result = await api.enable_managed_alerts()
- async get_alert_manager(*, region: Optional[str] = None, project_id: Optional[str] = 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:
AlertManager
Usage:
result = await api.get_alert_manager()
- async get_config(*, region: Optional[str] = None) GetConfigResponse
Get the Cockpit configuration. :param region: Region to target. If none is passed will use default region from the config. :return:
GetConfigResponse
Usage:
result = await api.get_config()
- async get_data_source(*, data_source_id: str, region: Optional[str] = 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:
DataSource
Usage:
result = await api.get_data_source( data_source_id="example", )
- async get_token(*, token_id: str, region: Optional[str] = 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:
Token
Usage:
result = await api.get_token( token_id="example", )
- async get_usage_overview(*, region: Optional[str] = None, project_id: Optional[str] = None, interval: Optional[str] = None) UsageOverview
Get data source usage overview. Retrieve the data source usage overview per type for the specified Project. :param region: Region to target. If none is passed will use default region from the config. :param project_id: :param interval: :return:
UsageOverview
Usage:
result = await api.get_usage_overview()
- async list_alerts(*, region: Optional[str] = None, project_id: Optional[str] = None, is_enabled: Optional[bool] = None, is_preconfigured: Optional[bool] = None, state: Optional[AlertState] = None) ListAlertsResponse
List alerts. List preconfigured and/or custom alerts for the specified Project. :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 is_enabled: True returns only enabled alerts. False returns only disabled alerts. 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 disabled, enabled, pending and firing. If omitted, no filtering is applied on alert states. Other filters may still apply. :return:
ListAlertsResponse
Usage:
result = await api.list_alerts()
- async list_contact_points(*, region: Optional[str] = None, page: Optional[int] = None, page_size: Optional[int] = None, project_id: Optional[str] = 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:
ListContactPointsResponse
Usage:
result = await api.list_contact_points()
- async list_contact_points_all(*, region: Optional[str] = None, page: Optional[int] = None, page_size: Optional[int] = None, project_id: Optional[str] = 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 = await api.list_contact_points_all()
- async list_data_sources(*, region: Optional[str] = None, page: Optional[int] = None, page_size: Optional[int] = None, order_by: Optional[ListDataSourcesRequestOrderBy] = None, project_id: Optional[str] = None, origin: Optional[DataSourceOrigin] = None, types: Optional[List[DataSourceType]] = 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. You can list data sources by Project, type and origin. :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. :param types: Types to filter for, only data sources with matching types will be returned. :return:
ListDataSourcesResponse
Usage:
result = await api.list_data_sources()
- async list_data_sources_all(*, region: Optional[str] = None, page: Optional[int] = None, page_size: Optional[int] = None, order_by: Optional[ListDataSourcesRequestOrderBy] = None, project_id: Optional[str] = None, origin: Optional[DataSourceOrigin] = None, types: Optional[List[DataSourceType]] = 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. You can list data sources by Project, type and origin. :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. :param types: Types to filter for, only data sources with matching types will be returned. :return:
List[DataSource]
Usage:
result = await api.list_data_sources_all()
- async list_tokens(*, region: Optional[str] = None, page: Optional[int] = None, page_size: Optional[int] = None, order_by: Optional[ListTokensRequestOrderBy] = None, project_id: Optional[str] = None, token_scopes: Optional[List[TokenScope]] = 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:
ListTokensResponse
Usage:
result = await api.list_tokens()
- async list_tokens_all(*, region: Optional[str] = None, page: Optional[int] = None, page_size: Optional[int] = None, order_by: Optional[ListTokensRequestOrderBy] = None, project_id: Optional[str] = None, token_scopes: Optional[List[TokenScope]] = 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 = await api.list_tokens_all()
- async trigger_test_alert(*, region: Optional[str] = None, project_id: Optional[str] = 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 = await api.trigger_test_alert()
- async update_contact_point(*, region: Optional[str] = None, project_id: Optional[str] = None, email: Optional[ContactPointEmail] = None, send_resolved_notifications: Optional[bool] = 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:
ContactPoint
Usage:
result = await api.update_contact_point()
- async update_data_source(*, data_source_id: str, region: Optional[str] = None, name: Optional[str] = None, retention_days: Optional[int] = None) DataSource
Update a data source. Update a given data source name, specified by the data source ID. :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: BETA - Duration for which the data will be retained in the data source. :return:
DataSource
Usage:
result = await api.update_data_source( data_source_id="example", )
scaleway_async.cockpit.v1.marshalling module
- scaleway_async.cockpit.v1.marshalling.marshal_ContactPointEmail(request: ContactPointEmail, defaults: ProfileDefaults) Dict[str, Any]
- scaleway_async.cockpit.v1.marshalling.marshal_GlobalApiCreateGrafanaUserRequest(request: GlobalApiCreateGrafanaUserRequest, defaults: ProfileDefaults) Dict[str, Any]
- scaleway_async.cockpit.v1.marshalling.marshal_GlobalApiResetGrafanaUserPasswordRequest(request: GlobalApiResetGrafanaUserPasswordRequest, defaults: ProfileDefaults) Dict[str, Any]
- scaleway_async.cockpit.v1.marshalling.marshal_GlobalApiSelectPlanRequest(request: GlobalApiSelectPlanRequest, defaults: ProfileDefaults) Dict[str, Any]
- scaleway_async.cockpit.v1.marshalling.marshal_GlobalApiSyncGrafanaDataSourcesRequest(request: GlobalApiSyncGrafanaDataSourcesRequest, defaults: ProfileDefaults) Dict[str, Any]
- scaleway_async.cockpit.v1.marshalling.marshal_RegionalApiCreateContactPointRequest(request: RegionalApiCreateContactPointRequest, defaults: ProfileDefaults) Dict[str, Any]
- scaleway_async.cockpit.v1.marshalling.marshal_RegionalApiCreateDataSourceRequest(request: RegionalApiCreateDataSourceRequest, defaults: ProfileDefaults) Dict[str, Any]
- scaleway_async.cockpit.v1.marshalling.marshal_RegionalApiCreateTokenRequest(request: RegionalApiCreateTokenRequest, defaults: ProfileDefaults) Dict[str, Any]
- scaleway_async.cockpit.v1.marshalling.marshal_RegionalApiDeleteContactPointRequest(request: RegionalApiDeleteContactPointRequest, defaults: ProfileDefaults) Dict[str, Any]
- scaleway_async.cockpit.v1.marshalling.marshal_RegionalApiDisableAlertManagerRequest(request: RegionalApiDisableAlertManagerRequest, defaults: ProfileDefaults) Dict[str, Any]
- scaleway_async.cockpit.v1.marshalling.marshal_RegionalApiDisableManagedAlertsRequest(request: RegionalApiDisableManagedAlertsRequest, defaults: ProfileDefaults) Dict[str, Any]
- scaleway_async.cockpit.v1.marshalling.marshal_RegionalApiEnableAlertManagerRequest(request: RegionalApiEnableAlertManagerRequest, defaults: ProfileDefaults) Dict[str, Any]
- scaleway_async.cockpit.v1.marshalling.marshal_RegionalApiEnableManagedAlertsRequest(request: RegionalApiEnableManagedAlertsRequest, defaults: ProfileDefaults) Dict[str, Any]
- scaleway_async.cockpit.v1.marshalling.marshal_RegionalApiTriggerTestAlertRequest(request: RegionalApiTriggerTestAlertRequest, defaults: ProfileDefaults) Dict[str, Any]
- scaleway_async.cockpit.v1.marshalling.marshal_RegionalApiUpdateContactPointRequest(request: RegionalApiUpdateContactPointRequest, defaults: ProfileDefaults) Dict[str, Any]
- scaleway_async.cockpit.v1.marshalling.marshal_RegionalApiUpdateDataSourceRequest(request: RegionalApiUpdateDataSourceRequest, defaults: ProfileDefaults) Dict[str, Any]
- scaleway_async.cockpit.v1.marshalling.unmarshal_AlertManager(data: Any) AlertManager
- scaleway_async.cockpit.v1.marshalling.unmarshal_ContactPoint(data: Any) ContactPoint
- scaleway_async.cockpit.v1.marshalling.unmarshal_ContactPointEmail(data: Any) ContactPointEmail
- scaleway_async.cockpit.v1.marshalling.unmarshal_DataSource(data: Any) DataSource
- scaleway_async.cockpit.v1.marshalling.unmarshal_GetConfigResponse(data: Any) GetConfigResponse
- scaleway_async.cockpit.v1.marshalling.unmarshal_GetConfigResponseRetention(data: Any) GetConfigResponseRetention
- scaleway_async.cockpit.v1.marshalling.unmarshal_GrafanaProductDashboard(data: Any) GrafanaProductDashboard
- scaleway_async.cockpit.v1.marshalling.unmarshal_GrafanaUser(data: Any) GrafanaUser
- scaleway_async.cockpit.v1.marshalling.unmarshal_ListAlertsResponse(data: Any) ListAlertsResponse
- scaleway_async.cockpit.v1.marshalling.unmarshal_ListContactPointsResponse(data: Any) ListContactPointsResponse
- scaleway_async.cockpit.v1.marshalling.unmarshal_ListDataSourcesResponse(data: Any) ListDataSourcesResponse
- scaleway_async.cockpit.v1.marshalling.unmarshal_ListGrafanaProductDashboardsResponse(data: Any) ListGrafanaProductDashboardsResponse
- scaleway_async.cockpit.v1.marshalling.unmarshal_ListGrafanaUsersResponse(data: Any) ListGrafanaUsersResponse
- scaleway_async.cockpit.v1.marshalling.unmarshal_ListPlansResponse(data: Any) ListPlansResponse
- scaleway_async.cockpit.v1.marshalling.unmarshal_ListTokensResponse(data: Any) ListTokensResponse
- scaleway_async.cockpit.v1.marshalling.unmarshal_UsageOverview(data: Any) UsageOverview
scaleway_async.cockpit.v1.types module
- class scaleway_async.cockpit.v1.types.Alert(region: 'ScwRegion', preconfigured: 'bool', name: 'str', rule: 'str', duration: 'str', enabled: 'bool', annotations: 'Dict[str, str]', state: 'Optional[AlertState]')
Bases:
object
- annotations: Dict[str, str]
- duration: str
- enabled: bool
- name: str
- preconfigured: bool
- region: str
Region to target. If none is passed will use default region from the config.
- rule: str
- state: Optional[AlertState]
- class scaleway_async.cockpit.v1.types.AlertManager(alert_manager_enabled: bool, managed_alerts_enabled: bool, region: str, alert_manager_url: Optional[str])
Bases:
object
Alert manager information.
- alert_manager_enabled: bool
The Alert manager is enabled.
- alert_manager_url: Optional[str]
Alert manager URL.
- managed_alerts_enabled: bool
Managed alerts are enabled.
- region: str
Regions where the Alert manager is enabled.
- class scaleway_async.cockpit.v1.types.AlertState(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- FIRING = 'firing'
- INACTIVE = 'inactive'
- PENDING = 'pending'
- UNKNOWN_STATE = 'unknown_state'
- class scaleway_async.cockpit.v1.types.ContactPoint(region: str, send_resolved_notifications: bool, email: Optional[ContactPointEmail])
Bases:
object
Contact point.
- email: Optional[ContactPointEmail]
- region: str
Region.
- send_resolved_notifications: bool
Send an email notification when an alert is marked as resolved.
- class scaleway_async.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: Optional[datetime], updated_at: Optional[datetime])
Bases:
object
Data source.
- created_at: Optional[datetime]
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
BETA - 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: Optional[datetime]
Date the data source was last updated.
- url: str
Data source URL.
- class scaleway_async.cockpit.v1.types.DataSourceOrigin(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- CUSTOM = 'custom'
- EXTERNAL = 'external'
- SCALEWAY = 'scaleway'
- UNKNOWN_ORIGIN = 'unknown_origin'
- class scaleway_async.cockpit.v1.types.DataSourceType(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- LOGS = 'logs'
- METRICS = 'metrics'
- TRACES = 'traces'
- UNKNOWN_TYPE = 'unknown_type'
- class scaleway_async.cockpit.v1.types.GetConfigResponse(custom_metrics_retention: Optional[GetConfigResponseRetention], custom_logs_retention: Optional[GetConfigResponseRetention], custom_traces_retention: Optional[GetConfigResponseRetention], product_metrics_retention: Optional[GetConfigResponseRetention], product_logs_retention: Optional[GetConfigResponseRetention])
Bases:
object
Cockpit configuration.
- custom_logs_retention: Optional[GetConfigResponseRetention]
Custom logs retention configuration.
- custom_metrics_retention: Optional[GetConfigResponseRetention]
Custom metrics retention configuration.
- custom_traces_retention: Optional[GetConfigResponseRetention]
Custom traces retention configuration.
- product_logs_retention: Optional[GetConfigResponseRetention]
Scaleway logs retention configuration.
- product_metrics_retention: Optional[GetConfigResponseRetention]
Scaleway metrics retention configuration.
- class scaleway_async.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_async.cockpit.v1.types.GlobalApiCreateGrafanaUserRequest(login: str, project_id: Optional[str], role: Optional[GrafanaUserRole])
Bases:
object
Create a Grafana user.
- login: str
Username of the Grafana user. Note that the admin username is not available for creation.
- project_id: Optional[str]
ID of the Project in which to create the Grafana user.
- role: Optional[GrafanaUserRole]
Role assigned to the Grafana user.
- class scaleway_async.cockpit.v1.types.GlobalApiDeleteGrafanaUserRequest(project_id: Optional[str], grafana_user_id: int)
Bases:
object
Delete a Grafana user.
- grafana_user_id: int
ID of the Grafana user.
- project_id: Optional[str]
ID of the Project to target.
- class scaleway_async.cockpit.v1.types.GlobalApiGetCurrentPlanRequest(project_id: Optional[str])
Bases:
object
Retrieve a pricing plan for the given Project.
- project_id: Optional[str]
ID of the Project.
- class scaleway_async.cockpit.v1.types.GlobalApiGetGrafanaProductDashboardRequest(project_id: Optional[str], dashboard_name: str)
Bases:
object
Retrieve a specific dashboard.
- dashboard_name: str
Name of the dashboard.
- project_id: Optional[str]
ID of the Project the dashboard belongs to.
- class scaleway_async.cockpit.v1.types.GlobalApiGetGrafanaRequest(project_id: Optional[str])
Bases:
object
Request a Grafana.
- project_id: Optional[str]
ID of the Project.
- class scaleway_async.cockpit.v1.types.GlobalApiListGrafanaProductDashboardsRequest(project_id: Optional[str], page: Optional[int], page_size: Optional[int], tags: Optional[List[str]])
Bases:
object
Retrieve a list of available product dashboards.
- page: Optional[int]
Page number.
- page_size: Optional[int]
Page size.
- project_id: Optional[str]
ID of the Project to target.
- tags: Optional[List[str]]
Tags to filter for.
- class scaleway_async.cockpit.v1.types.GlobalApiListGrafanaUsersRequest(page: Optional[int], page_size: Optional[int], order_by: Optional[ListGrafanaUsersRequestOrderBy], project_id: Optional[str])
Bases:
object
List all Grafana users.
- order_by: Optional[ListGrafanaUsersRequestOrderBy]
Order of the Grafana users.
- page: Optional[int]
Page number.
- page_size: Optional[int]
Page size.
- project_id: Optional[str]
ID of the Project to target.
- class scaleway_async.cockpit.v1.types.GlobalApiListPlansRequest(page: Optional[int], page_size: Optional[int], order_by: Optional[ListPlansRequestOrderBy])
Bases:
object
Retrieve a list of available pricing plans.
- order_by: Optional[ListPlansRequestOrderBy]
- page: Optional[int]
Page number.
- page_size: Optional[int]
Page size.
- class scaleway_async.cockpit.v1.types.GlobalApiResetGrafanaUserPasswordRequest(project_id: Optional[str], grafana_user_id: int)
Bases:
object
Reset a Grafana user’s password.
- grafana_user_id: int
ID of the Grafana user.
- project_id: Optional[str]
ID of the Project to target.
- class scaleway_async.cockpit.v1.types.GlobalApiSelectPlanRequest(project_id: Optional[str], plan_name: Optional[PlanName])
Bases:
object
Select a specific pricing plan.
- project_id: Optional[str]
ID of the Project.
- class scaleway_async.cockpit.v1.types.GlobalApiSyncGrafanaDataSourcesRequest(project_id: Optional[str])
Bases:
object
Trigger the synchronization of all data sources created in the relevant regions.
- project_id: Optional[str]
ID of the Project to target.
- class scaleway_async.cockpit.v1.types.Grafana(grafana_url: str)
Bases:
object
Grafana user.
- grafana_url: str
URL to access your Cockpit’s Grafana.
- class scaleway_async.cockpit.v1.types.GrafanaProductDashboard(name: str, title: str, url: str, tags: List[str], variables: List[str])
Bases:
object
Grafana 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_async.cockpit.v1.types.GrafanaUser(id: int, login: str, role: GrafanaUserRole, password: Optional[str])
Bases:
object
Grafana user.
- id: int
ID of the Grafana user.
- login: str
Username of the Grafana user.
- password: Optional[str]
Grafana user’s password.
- role: GrafanaUserRole
Role assigned to the Grafana user.
- class scaleway_async.cockpit.v1.types.GrafanaUserRole(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- EDITOR = 'editor'
- UNKNOWN_ROLE = 'unknown_role'
- VIEWER = 'viewer'
- class scaleway_async.cockpit.v1.types.ListAlertsResponse(total_count: int, alerts: List[Alert])
Bases:
object
Retrieve a list of alerts matching the request.
- total_count: int
Total count of alerts matching the request.
- class scaleway_async.cockpit.v1.types.ListContactPointsResponse(total_count: int, contact_points: List[ContactPoint], has_additional_receivers: bool, has_additional_contact_points: bool)
Bases:
object
Response 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_async.cockpit.v1.types.ListDataSourcesRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- 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_async.cockpit.v1.types.ListDataSourcesResponse(total_count: int, data_sources: List[DataSource])
Bases:
object
Response 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_async.cockpit.v1.types.ListGrafanaProductDashboardsResponse(total_count: int, dashboards: List[GrafanaProductDashboard])
Bases:
object
Output returned when listing dashboards.
- dashboards: List[GrafanaProductDashboard]
Grafana dashboards information.
- total_count: int
Total count of Grafana dashboards.
- class scaleway_async.cockpit.v1.types.ListGrafanaUsersRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- LOGIN_ASC = 'login_asc'
- LOGIN_DESC = 'login_desc'
- class scaleway_async.cockpit.v1.types.ListGrafanaUsersResponse(total_count: int, grafana_users: List[GrafanaUser])
Bases:
object
Ouptut returned when listing Grafana users.
- grafana_users: List[GrafanaUser]
Grafana users information.
- total_count: int
Total count of Grafana users.
- class scaleway_async.cockpit.v1.types.ListPlansRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- NAME_ASC = 'name_asc'
- NAME_DESC = 'name_desc'
- class scaleway_async.cockpit.v1.types.ListPlansResponse(total_count: int, plans: List[Plan])
Bases:
object
Output returned when listing pricing plans.
- total_count: int
Total count of available pricing plans.
- class scaleway_async.cockpit.v1.types.ListTokensRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- CREATED_AT_ASC = 'created_at_asc'
- CREATED_AT_DESC = 'created_at_desc'
- NAME_ASC = 'name_asc'
- NAME_DESC = 'name_desc'
- class scaleway_async.cockpit.v1.types.ListTokensResponse(total_count: int, tokens: List[Token])
Bases:
object
Response returned when listing tokens.
- total_count: int
Total count of tokens matching the request.
- class scaleway_async.cockpit.v1.types.Plan(name: PlanName, sample_ingestion_price: int, logs_ingestion_price: int, traces_ingestion_price: int, monthly_price: int, retention_metrics_interval: Optional[str], retention_logs_interval: Optional[str], retention_traces_interval: Optional[str])
Bases:
object
Type 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: Optional[str]
Interval of time during which Scaleway’s Cockpit keeps your logs.
- retention_metrics_interval: Optional[str]
Interval of time during which Scaleway’s Cockpit keeps your metrics.
- retention_traces_interval: Optional[str]
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_async.cockpit.v1.types.PlanName(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- CUSTOM = 'custom'
- FREE = 'free'
- PREMIUM = 'premium'
- UNKNOWN_NAME = 'unknown_name'
- class scaleway_async.cockpit.v1.types.RegionalApiCreateContactPointRequest(region: Optional[str], project_id: Optional[str], send_resolved_notifications: Optional[bool], email: Optional[ContactPointEmail])
Bases:
object
Create a contact point.
- email: Optional[ContactPointEmail]
- project_id: Optional[str]
ID of the Project to create the contact point in.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- send_resolved_notifications: Optional[bool]
Send an email notification when an alert is marked as resolved.
- class scaleway_async.cockpit.v1.types.RegionalApiCreateDataSourceRequest(name: str, region: Optional[str], project_id: Optional[str], type_: Optional[DataSourceType], retention_days: Optional[int])
Bases:
object
Create a data source.
- name: str
Data source name.
- project_id: Optional[str]
ID of the Project the data source belongs to.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- retention_days: Optional[int]
Default values are 30 days for metrics, 7 days for logs and traces.
- type_: Optional[DataSourceType]
Data source type.
- class scaleway_async.cockpit.v1.types.RegionalApiCreateTokenRequest(name: str, region: Optional[str], project_id: Optional[str], token_scopes: Optional[List[TokenScope]])
Bases:
object
Create a token.
- name: str
Name of the token.
- project_id: Optional[str]
ID of the Project the token belongs to.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- token_scopes: Optional[List[TokenScope]]
Token permission scopes.
- class scaleway_async.cockpit.v1.types.RegionalApiDeleteContactPointRequest(region: Optional[str], project_id: Optional[str], email: Optional[ContactPointEmail])
Bases:
object
Delete a contact point.
- email: Optional[ContactPointEmail]
- project_id: Optional[str]
ID of the Project containing the contact point to delete.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- class scaleway_async.cockpit.v1.types.RegionalApiDeleteDataSourceRequest(data_source_id: str, region: Optional[str])
Bases:
object
Delete a data source.
- data_source_id: str
ID of the data source to delete.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- class scaleway_async.cockpit.v1.types.RegionalApiDeleteTokenRequest(token_id: str, region: Optional[str])
Bases:
object
Delete a token.
- region: Optional[str]
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_async.cockpit.v1.types.RegionalApiDisableAlertManagerRequest(region: Optional[str], project_id: Optional[str])
Bases:
object
Disable the Alert manager.
- project_id: Optional[str]
ID of the Project to disable the Alert manager in.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- class scaleway_async.cockpit.v1.types.RegionalApiDisableManagedAlertsRequest(region: Optional[str], project_id: Optional[str])
Bases:
object
Disable the sending of managed alerts.
- project_id: Optional[str]
ID of the Project.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- class scaleway_async.cockpit.v1.types.RegionalApiEnableAlertManagerRequest(region: Optional[str], project_id: Optional[str])
Bases:
object
Enable the Alert manager.
- project_id: Optional[str]
ID of the Project to enable the Alert manager in.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- class scaleway_async.cockpit.v1.types.RegionalApiEnableManagedAlertsRequest(region: Optional[str], project_id: Optional[str])
Bases:
object
Enable the sending of managed alerts.
- project_id: Optional[str]
ID of the Project.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- class scaleway_async.cockpit.v1.types.RegionalApiGetAlertManagerRequest(region: Optional[str], project_id: Optional[str])
Bases:
object
Get the Alert manager.
- project_id: Optional[str]
Project ID of the requested Alert manager.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- class scaleway_async.cockpit.v1.types.RegionalApiGetConfigRequest(region: Optional[str])
Bases:
object
Get Cockpit configuration.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- class scaleway_async.cockpit.v1.types.RegionalApiGetDataSourceRequest(data_source_id: str, region: Optional[str])
Bases:
object
Retrieve a data source.
- data_source_id: str
ID of the relevant data source.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- class scaleway_async.cockpit.v1.types.RegionalApiGetTokenRequest(token_id: str, region: Optional[str])
Bases:
object
Get a token.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- token_id: str
Token ID.
- class scaleway_async.cockpit.v1.types.RegionalApiGetUsageOverviewRequest(region: 'Optional[ScwRegion]', project_id: 'Optional[str]', interval: 'Optional[str]')
Bases:
object
- interval: Optional[str]
- project_id: Optional[str]
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- class scaleway_async.cockpit.v1.types.RegionalApiListAlertsRequest(region: Optional[str], project_id: Optional[str], is_enabled: Optional[bool], is_preconfigured: Optional[bool], state: Optional[AlertState])
Bases:
object
Retrieve a list of alerts.
- is_enabled: Optional[bool]
True returns only enabled alerts. False returns only disabled alerts. If omitted, no alert filtering is applied. Other filters may still apply.
- is_preconfigured: Optional[bool]
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: Optional[str]
Project ID to filter for, only alerts from this Project will be returned.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- state: Optional[AlertState]
Valid values to filter on are disabled, enabled, pending and firing. If omitted, no filtering is applied on alert states. Other filters may still apply.
- class scaleway_async.cockpit.v1.types.RegionalApiListContactPointsRequest(region: Optional[str], page: Optional[int], page_size: Optional[int], project_id: Optional[str])
Bases:
object
List contact points.
- page: Optional[int]
Page number to return, from the paginated results.
- page_size: Optional[int]
Total count of contact points to return per page.
- project_id: Optional[str]
ID of the Project containing the contact points to list.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- class scaleway_async.cockpit.v1.types.RegionalApiListDataSourcesRequest(region: Optional[str], page: Optional[int], page_size: Optional[int], order_by: Optional[ListDataSourcesRequestOrderBy], project_id: Optional[str], origin: Optional[DataSourceOrigin], types: Optional[List[DataSourceType]])
Bases:
object
List data sources.
- order_by: Optional[ListDataSourcesRequestOrderBy]
Sort order for data sources in the response.
- origin: Optional[DataSourceOrigin]
Origin to filter for, only data sources with matching origin will be returned.
- page: Optional[int]
Page number to return, from the paginated results.
- page_size: Optional[int]
Number of data sources to return per page.
- project_id: Optional[str]
Project ID to filter for, only data sources from this Project will be returned.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- types: Optional[List[DataSourceType]]
Types to filter for, only data sources with matching types will be returned.
- class scaleway_async.cockpit.v1.types.RegionalApiListTokensRequest(region: Optional[str], page: Optional[int], page_size: Optional[int], order_by: Optional[ListTokensRequestOrderBy], project_id: Optional[str], token_scopes: Optional[List[TokenScope]])
Bases:
object
List tokens.
- order_by: Optional[ListTokensRequestOrderBy]
Order in which to return results.
- page: Optional[int]
Page number to return, from the paginated results.
- page_size: Optional[int]
Number of tokens to return per page.
- project_id: Optional[str]
ID of the Project the tokens belong to.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- token_scopes: Optional[List[TokenScope]]
Token scopes to filter for.
- class scaleway_async.cockpit.v1.types.RegionalApiTriggerTestAlertRequest(region: Optional[str], project_id: Optional[str])
Bases:
object
Request to trigger a test alert.
- project_id: Optional[str]
ID of the Project.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- class scaleway_async.cockpit.v1.types.RegionalApiUpdateContactPointRequest(region: Optional[str], project_id: Optional[str], send_resolved_notifications: Optional[bool], email: Optional[ContactPointEmail])
Bases:
object
Update a contact point.
- email: Optional[ContactPointEmail]
- project_id: Optional[str]
ID of the Project containing the contact point to update.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- send_resolved_notifications: Optional[bool]
Enable or disable notifications when alert is resolved.
- class scaleway_async.cockpit.v1.types.RegionalApiUpdateDataSourceRequest(data_source_id: str, region: Optional[str], name: Optional[str], retention_days: Optional[int])
Bases:
object
Update a data source name.
- data_source_id: str
ID of the data source to update.
- name: Optional[str]
Updated name of the data source.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- retention_days: Optional[int]
BETA - Duration for which the data will be retained in the data source.
- class scaleway_async.cockpit.v1.types.Token(id: str, project_id: str, name: str, scopes: List[TokenScope], region: str, created_at: Optional[datetime], updated_at: Optional[datetime], secret_key: Optional[str])
Bases:
object
Token.
- created_at: Optional[datetime]
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: Optional[str]
Token secret key.
- updated_at: Optional[datetime]
Token last modification date.
- class scaleway_async.cockpit.v1.types.TokenScope(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- 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_async.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: Optional[str], interval: Optional[str])
Bases:
object
Data source usage.
- data_source_id: Optional[str]
ID of the data source.
- data_source_origin: DataSourceOrigin
Origin of the data source.
- data_source_type: DataSourceType
Type of the data source.
- interval: Optional[str]
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_async.cockpit.v1.types.UsageOverview(scaleway_metrics_usage: 'Optional[Usage]', scaleway_logs_usage: 'Optional[Usage]', external_metrics_usage: 'Optional[Usage]', external_logs_usage: 'Optional[Usage]', external_traces_usage: 'Optional[Usage]')
Bases:
object
Module contents
- class scaleway_async.cockpit.v1.Alert(region: 'ScwRegion', preconfigured: 'bool', name: 'str', rule: 'str', duration: 'str', enabled: 'bool', annotations: 'Dict[str, str]', state: 'Optional[AlertState]')
Bases:
object
- annotations: Dict[str, str]
- duration: str
- enabled: bool
- name: str
- preconfigured: bool
- region: str
Region to target. If none is passed will use default region from the config.
- rule: str
- state: Optional[AlertState]
- class scaleway_async.cockpit.v1.AlertManager(alert_manager_enabled: bool, managed_alerts_enabled: bool, region: str, alert_manager_url: Optional[str])
Bases:
object
Alert manager information.
- alert_manager_enabled: bool
The Alert manager is enabled.
- alert_manager_url: Optional[str]
Alert manager URL.
- managed_alerts_enabled: bool
Managed alerts are enabled.
- region: str
Regions where the Alert manager is enabled.
- class scaleway_async.cockpit.v1.AlertState(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- FIRING = 'firing'
- INACTIVE = 'inactive'
- PENDING = 'pending'
- UNKNOWN_STATE = 'unknown_state'
- class scaleway_async.cockpit.v1.CockpitV1GlobalAPI(client: Client, *, bypass_validation: bool = False)
Bases:
API
The Cockpit Global API allows you to manage your Cockpit’s Grafana and plans.
- async create_grafana_user(*, login: str, project_id: Optional[str] = None, role: Optional[GrafanaUserRole] = 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:
GrafanaUser
Usage:
result = await api.create_grafana_user( login="example", )
- async delete_grafana_user(*, project_id: Optional[str] = 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 = await api.delete_grafana_user( grafana_user_id=1, )
- async get_current_plan(*, project_id: Optional[str] = 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 = await api.get_current_plan()
- async get_grafana(*, project_id: Optional[str] = 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:
Grafana
Usage:
result = await api.get_grafana()
- async get_grafana_product_dashboard(*, project_id: Optional[str] = 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:
GrafanaProductDashboard
Usage:
result = await api.get_grafana_product_dashboard( dashboard_name="example", )
- async list_grafana_product_dashboards(*, project_id: Optional[str] = None, page: Optional[int] = None, page_size: Optional[int] = None, tags: Optional[List[str]] = 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:
ListGrafanaProductDashboardsResponse
Usage:
result = await api.list_grafana_product_dashboards()
- async list_grafana_product_dashboards_all(*, project_id: Optional[str] = None, page: Optional[int] = None, page_size: Optional[int] = None, tags: Optional[List[str]] = 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 = await api.list_grafana_product_dashboards_all()
- async list_grafana_users(*, page: Optional[int] = None, page_size: Optional[int] = None, order_by: Optional[ListGrafanaUsersRequestOrderBy] = None, project_id: Optional[str] = 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:
ListGrafanaUsersResponse
Usage:
result = await api.list_grafana_users()
- async list_grafana_users_all(*, page: Optional[int] = None, page_size: Optional[int] = None, order_by: Optional[ListGrafanaUsersRequestOrderBy] = None, project_id: Optional[str] = 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 = await api.list_grafana_users_all()
- async list_plans(*, page: Optional[int] = None, page_size: Optional[int] = None, order_by: Optional[ListPlansRequestOrderBy] = 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 = await api.list_plans()
- async list_plans_all(*, page: Optional[int] = None, page_size: Optional[int] = None, order_by: Optional[ListPlansRequestOrderBy] = 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 = await api.list_plans_all()
- async reset_grafana_user_password(*, project_id: Optional[str] = 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:
GrafanaUser
Usage:
result = await api.reset_grafana_user_password( grafana_user_id=1, )
- async select_plan(*, project_id: Optional[str] = None, plan_name: Optional[PlanName] = 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 = await api.select_plan()
- async sync_grafana_data_sources(*, project_id: Optional[str] = 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 = await api.sync_grafana_data_sources()
- class scaleway_async.cockpit.v1.CockpitV1RegionalAPI(client: Client, *, bypass_validation: bool = False)
Bases:
API
The Cockpit Regional API allows you to create data sources and 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.
- async create_contact_point(*, region: Optional[str] = None, project_id: Optional[str] = None, email: Optional[ContactPointEmail] = None, send_resolved_notifications: Optional[bool] = 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:
ContactPoint
Usage:
result = await api.create_contact_point()
- async create_data_source(*, name: str, region: Optional[str] = None, project_id: Optional[str] = None, type_: Optional[DataSourceType] = None, retention_days: Optional[int] = None) DataSource
Create a data source. You must specify the data source type upon creation. Available data source types include:
metrics
logs
traces
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 30 days for metrics, 7 days for logs and traces. :return:
DataSource
Usage:
result = await api.create_data_source( name="example", )
- async create_token(*, name: str, region: Optional[str] = None, project_id: Optional[str] = None, token_scopes: Optional[List[TokenScope]] = 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:
Token
Usage:
result = await api.create_token( name="example", )
- async delete_contact_point(*, region: Optional[str] = None, project_id: Optional[str] = None, email: Optional[ContactPointEmail] = 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 = await api.delete_contact_point()
- async delete_data_source(*, data_source_id: str, region: Optional[str] = None) None
Delete a data source. Delete a given data source, specified by the data source ID. Note that deleting a data source is irreversible, and cannot be undone. :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 = await api.delete_data_source( data_source_id="example", )
- async delete_token(*, token_id: str, region: Optional[str] = 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 = await api.delete_token( token_id="example", )
- async disable_alert_manager(*, region: Optional[str] = None, project_id: Optional[str] = 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:
AlertManager
Usage:
result = await api.disable_alert_manager()
- async disable_managed_alerts(*, region: Optional[str] = None, project_id: Optional[str] = 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:
AlertManager
Usage:
result = await api.disable_managed_alerts()
- async enable_alert_manager(*, region: Optional[str] = None, project_id: Optional[str] = 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:
AlertManager
Usage:
result = await api.enable_alert_manager()
- async enable_managed_alerts(*, region: Optional[str] = None, project_id: Optional[str] = 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:
AlertManager
Usage:
result = await api.enable_managed_alerts()
- async get_alert_manager(*, region: Optional[str] = None, project_id: Optional[str] = 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:
AlertManager
Usage:
result = await api.get_alert_manager()
- async get_config(*, region: Optional[str] = None) GetConfigResponse
Get the Cockpit configuration. :param region: Region to target. If none is passed will use default region from the config. :return:
GetConfigResponse
Usage:
result = await api.get_config()
- async get_data_source(*, data_source_id: str, region: Optional[str] = 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:
DataSource
Usage:
result = await api.get_data_source( data_source_id="example", )
- async get_token(*, token_id: str, region: Optional[str] = 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:
Token
Usage:
result = await api.get_token( token_id="example", )
- async get_usage_overview(*, region: Optional[str] = None, project_id: Optional[str] = None, interval: Optional[str] = None) UsageOverview
Get data source usage overview. Retrieve the data source usage overview per type for the specified Project. :param region: Region to target. If none is passed will use default region from the config. :param project_id: :param interval: :return:
UsageOverview
Usage:
result = await api.get_usage_overview()
- async list_alerts(*, region: Optional[str] = None, project_id: Optional[str] = None, is_enabled: Optional[bool] = None, is_preconfigured: Optional[bool] = None, state: Optional[AlertState] = None) ListAlertsResponse
List alerts. List preconfigured and/or custom alerts for the specified Project. :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 is_enabled: True returns only enabled alerts. False returns only disabled alerts. 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 disabled, enabled, pending and firing. If omitted, no filtering is applied on alert states. Other filters may still apply. :return:
ListAlertsResponse
Usage:
result = await api.list_alerts()
- async list_contact_points(*, region: Optional[str] = None, page: Optional[int] = None, page_size: Optional[int] = None, project_id: Optional[str] = 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:
ListContactPointsResponse
Usage:
result = await api.list_contact_points()
- async list_contact_points_all(*, region: Optional[str] = None, page: Optional[int] = None, page_size: Optional[int] = None, project_id: Optional[str] = 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 = await api.list_contact_points_all()
- async list_data_sources(*, region: Optional[str] = None, page: Optional[int] = None, page_size: Optional[int] = None, order_by: Optional[ListDataSourcesRequestOrderBy] = None, project_id: Optional[str] = None, origin: Optional[DataSourceOrigin] = None, types: Optional[List[DataSourceType]] = 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. You can list data sources by Project, type and origin. :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. :param types: Types to filter for, only data sources with matching types will be returned. :return:
ListDataSourcesResponse
Usage:
result = await api.list_data_sources()
- async list_data_sources_all(*, region: Optional[str] = None, page: Optional[int] = None, page_size: Optional[int] = None, order_by: Optional[ListDataSourcesRequestOrderBy] = None, project_id: Optional[str] = None, origin: Optional[DataSourceOrigin] = None, types: Optional[List[DataSourceType]] = 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. You can list data sources by Project, type and origin. :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. :param types: Types to filter for, only data sources with matching types will be returned. :return:
List[DataSource]
Usage:
result = await api.list_data_sources_all()
- async list_tokens(*, region: Optional[str] = None, page: Optional[int] = None, page_size: Optional[int] = None, order_by: Optional[ListTokensRequestOrderBy] = None, project_id: Optional[str] = None, token_scopes: Optional[List[TokenScope]] = 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:
ListTokensResponse
Usage:
result = await api.list_tokens()
- async list_tokens_all(*, region: Optional[str] = None, page: Optional[int] = None, page_size: Optional[int] = None, order_by: Optional[ListTokensRequestOrderBy] = None, project_id: Optional[str] = None, token_scopes: Optional[List[TokenScope]] = 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 = await api.list_tokens_all()
- async trigger_test_alert(*, region: Optional[str] = None, project_id: Optional[str] = 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 = await api.trigger_test_alert()
- async update_contact_point(*, region: Optional[str] = None, project_id: Optional[str] = None, email: Optional[ContactPointEmail] = None, send_resolved_notifications: Optional[bool] = 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:
ContactPoint
Usage:
result = await api.update_contact_point()
- async update_data_source(*, data_source_id: str, region: Optional[str] = None, name: Optional[str] = None, retention_days: Optional[int] = None) DataSource
Update a data source. Update a given data source name, specified by the data source ID. :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: BETA - Duration for which the data will be retained in the data source. :return:
DataSource
Usage:
result = await api.update_data_source( data_source_id="example", )
- class scaleway_async.cockpit.v1.ContactPoint(region: str, send_resolved_notifications: bool, email: Optional[ContactPointEmail])
Bases:
object
Contact point.
- email: Optional[ContactPointEmail]
- region: str
Region.
- send_resolved_notifications: bool
Send an email notification when an alert is marked as resolved.
- class scaleway_async.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: Optional[datetime], updated_at: Optional[datetime])
Bases:
object
Data source.
- created_at: Optional[datetime]
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
BETA - 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: Optional[datetime]
Date the data source was last updated.
- url: str
Data source URL.
- class scaleway_async.cockpit.v1.DataSourceOrigin(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- CUSTOM = 'custom'
- EXTERNAL = 'external'
- SCALEWAY = 'scaleway'
- UNKNOWN_ORIGIN = 'unknown_origin'
- class scaleway_async.cockpit.v1.DataSourceType(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- LOGS = 'logs'
- METRICS = 'metrics'
- TRACES = 'traces'
- UNKNOWN_TYPE = 'unknown_type'
- class scaleway_async.cockpit.v1.GetConfigResponse(custom_metrics_retention: Optional[GetConfigResponseRetention], custom_logs_retention: Optional[GetConfigResponseRetention], custom_traces_retention: Optional[GetConfigResponseRetention], product_metrics_retention: Optional[GetConfigResponseRetention], product_logs_retention: Optional[GetConfigResponseRetention])
Bases:
object
Cockpit configuration.
- custom_logs_retention: Optional[GetConfigResponseRetention]
Custom logs retention configuration.
- custom_metrics_retention: Optional[GetConfigResponseRetention]
Custom metrics retention configuration.
- custom_traces_retention: Optional[GetConfigResponseRetention]
Custom traces retention configuration.
- product_logs_retention: Optional[GetConfigResponseRetention]
Scaleway logs retention configuration.
- product_metrics_retention: Optional[GetConfigResponseRetention]
Scaleway metrics retention configuration.
- class scaleway_async.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_async.cockpit.v1.GlobalApiCreateGrafanaUserRequest(login: str, project_id: Optional[str], role: Optional[GrafanaUserRole])
Bases:
object
Create a Grafana user.
- login: str
Username of the Grafana user. Note that the admin username is not available for creation.
- project_id: Optional[str]
ID of the Project in which to create the Grafana user.
- role: Optional[GrafanaUserRole]
Role assigned to the Grafana user.
- class scaleway_async.cockpit.v1.GlobalApiDeleteGrafanaUserRequest(project_id: Optional[str], grafana_user_id: int)
Bases:
object
Delete a Grafana user.
- grafana_user_id: int
ID of the Grafana user.
- project_id: Optional[str]
ID of the Project to target.
- class scaleway_async.cockpit.v1.GlobalApiGetCurrentPlanRequest(project_id: Optional[str])
Bases:
object
Retrieve a pricing plan for the given Project.
- project_id: Optional[str]
ID of the Project.
- class scaleway_async.cockpit.v1.GlobalApiGetGrafanaProductDashboardRequest(project_id: Optional[str], dashboard_name: str)
Bases:
object
Retrieve a specific dashboard.
- dashboard_name: str
Name of the dashboard.
- project_id: Optional[str]
ID of the Project the dashboard belongs to.
- class scaleway_async.cockpit.v1.GlobalApiGetGrafanaRequest(project_id: Optional[str])
Bases:
object
Request a Grafana.
- project_id: Optional[str]
ID of the Project.
- class scaleway_async.cockpit.v1.GlobalApiListGrafanaProductDashboardsRequest(project_id: Optional[str], page: Optional[int], page_size: Optional[int], tags: Optional[List[str]])
Bases:
object
Retrieve a list of available product dashboards.
- page: Optional[int]
Page number.
- page_size: Optional[int]
Page size.
- project_id: Optional[str]
ID of the Project to target.
- tags: Optional[List[str]]
Tags to filter for.
- class scaleway_async.cockpit.v1.GlobalApiListGrafanaUsersRequest(page: Optional[int], page_size: Optional[int], order_by: Optional[ListGrafanaUsersRequestOrderBy], project_id: Optional[str])
Bases:
object
List all Grafana users.
- order_by: Optional[ListGrafanaUsersRequestOrderBy]
Order of the Grafana users.
- page: Optional[int]
Page number.
- page_size: Optional[int]
Page size.
- project_id: Optional[str]
ID of the Project to target.
- class scaleway_async.cockpit.v1.GlobalApiListPlansRequest(page: Optional[int], page_size: Optional[int], order_by: Optional[ListPlansRequestOrderBy])
Bases:
object
Retrieve a list of available pricing plans.
- order_by: Optional[ListPlansRequestOrderBy]
- page: Optional[int]
Page number.
- page_size: Optional[int]
Page size.
- class scaleway_async.cockpit.v1.GlobalApiResetGrafanaUserPasswordRequest(project_id: Optional[str], grafana_user_id: int)
Bases:
object
Reset a Grafana user’s password.
- grafana_user_id: int
ID of the Grafana user.
- project_id: Optional[str]
ID of the Project to target.
- class scaleway_async.cockpit.v1.GlobalApiSelectPlanRequest(project_id: Optional[str], plan_name: Optional[PlanName])
Bases:
object
Select a specific pricing plan.
- project_id: Optional[str]
ID of the Project.
- class scaleway_async.cockpit.v1.GlobalApiSyncGrafanaDataSourcesRequest(project_id: Optional[str])
Bases:
object
Trigger the synchronization of all data sources created in the relevant regions.
- project_id: Optional[str]
ID of the Project to target.
- class scaleway_async.cockpit.v1.Grafana(grafana_url: str)
Bases:
object
Grafana user.
- grafana_url: str
URL to access your Cockpit’s Grafana.
- class scaleway_async.cockpit.v1.GrafanaProductDashboard(name: str, title: str, url: str, tags: List[str], variables: List[str])
Bases:
object
Grafana 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_async.cockpit.v1.GrafanaUser(id: int, login: str, role: GrafanaUserRole, password: Optional[str])
Bases:
object
Grafana user.
- id: int
ID of the Grafana user.
- login: str
Username of the Grafana user.
- password: Optional[str]
Grafana user’s password.
- role: GrafanaUserRole
Role assigned to the Grafana user.
- class scaleway_async.cockpit.v1.GrafanaUserRole(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- EDITOR = 'editor'
- UNKNOWN_ROLE = 'unknown_role'
- VIEWER = 'viewer'
- class scaleway_async.cockpit.v1.ListAlertsResponse(total_count: int, alerts: List[Alert])
Bases:
object
Retrieve a list of alerts matching the request.
- total_count: int
Total count of alerts matching the request.
- class scaleway_async.cockpit.v1.ListContactPointsResponse(total_count: int, contact_points: List[ContactPoint], has_additional_receivers: bool, has_additional_contact_points: bool)
Bases:
object
Response 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_async.cockpit.v1.ListDataSourcesRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- 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_async.cockpit.v1.ListDataSourcesResponse(total_count: int, data_sources: List[DataSource])
Bases:
object
Response 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_async.cockpit.v1.ListGrafanaProductDashboardsResponse(total_count: int, dashboards: List[GrafanaProductDashboard])
Bases:
object
Output returned when listing dashboards.
- dashboards: List[GrafanaProductDashboard]
Grafana dashboards information.
- total_count: int
Total count of Grafana dashboards.
- class scaleway_async.cockpit.v1.ListGrafanaUsersRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- LOGIN_ASC = 'login_asc'
- LOGIN_DESC = 'login_desc'
- class scaleway_async.cockpit.v1.ListGrafanaUsersResponse(total_count: int, grafana_users: List[GrafanaUser])
Bases:
object
Ouptut returned when listing Grafana users.
- grafana_users: List[GrafanaUser]
Grafana users information.
- total_count: int
Total count of Grafana users.
- class scaleway_async.cockpit.v1.ListPlansRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- NAME_ASC = 'name_asc'
- NAME_DESC = 'name_desc'
- class scaleway_async.cockpit.v1.ListPlansResponse(total_count: int, plans: List[Plan])
Bases:
object
Output returned when listing pricing plans.
- total_count: int
Total count of available pricing plans.
- class scaleway_async.cockpit.v1.ListTokensRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- CREATED_AT_ASC = 'created_at_asc'
- CREATED_AT_DESC = 'created_at_desc'
- NAME_ASC = 'name_asc'
- NAME_DESC = 'name_desc'
- class scaleway_async.cockpit.v1.ListTokensResponse(total_count: int, tokens: List[Token])
Bases:
object
Response returned when listing tokens.
- total_count: int
Total count of tokens matching the request.
- class scaleway_async.cockpit.v1.Plan(name: PlanName, sample_ingestion_price: int, logs_ingestion_price: int, traces_ingestion_price: int, monthly_price: int, retention_metrics_interval: Optional[str], retention_logs_interval: Optional[str], retention_traces_interval: Optional[str])
Bases:
object
Type 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: Optional[str]
Interval of time during which Scaleway’s Cockpit keeps your logs.
- retention_metrics_interval: Optional[str]
Interval of time during which Scaleway’s Cockpit keeps your metrics.
- retention_traces_interval: Optional[str]
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_async.cockpit.v1.PlanName(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- CUSTOM = 'custom'
- FREE = 'free'
- PREMIUM = 'premium'
- UNKNOWN_NAME = 'unknown_name'
- class scaleway_async.cockpit.v1.RegionalApiCreateContactPointRequest(region: Optional[str], project_id: Optional[str], send_resolved_notifications: Optional[bool], email: Optional[ContactPointEmail])
Bases:
object
Create a contact point.
- email: Optional[ContactPointEmail]
- project_id: Optional[str]
ID of the Project to create the contact point in.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- send_resolved_notifications: Optional[bool]
Send an email notification when an alert is marked as resolved.
- class scaleway_async.cockpit.v1.RegionalApiCreateDataSourceRequest(name: str, region: Optional[str], project_id: Optional[str], type_: Optional[DataSourceType], retention_days: Optional[int])
Bases:
object
Create a data source.
- name: str
Data source name.
- project_id: Optional[str]
ID of the Project the data source belongs to.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- retention_days: Optional[int]
Default values are 30 days for metrics, 7 days for logs and traces.
- type_: Optional[DataSourceType]
Data source type.
- class scaleway_async.cockpit.v1.RegionalApiCreateTokenRequest(name: str, region: Optional[str], project_id: Optional[str], token_scopes: Optional[List[TokenScope]])
Bases:
object
Create a token.
- name: str
Name of the token.
- project_id: Optional[str]
ID of the Project the token belongs to.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- token_scopes: Optional[List[TokenScope]]
Token permission scopes.
- class scaleway_async.cockpit.v1.RegionalApiDeleteContactPointRequest(region: Optional[str], project_id: Optional[str], email: Optional[ContactPointEmail])
Bases:
object
Delete a contact point.
- email: Optional[ContactPointEmail]
- project_id: Optional[str]
ID of the Project containing the contact point to delete.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- class scaleway_async.cockpit.v1.RegionalApiDeleteDataSourceRequest(data_source_id: str, region: Optional[str])
Bases:
object
Delete a data source.
- data_source_id: str
ID of the data source to delete.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- class scaleway_async.cockpit.v1.RegionalApiDeleteTokenRequest(token_id: str, region: Optional[str])
Bases:
object
Delete a token.
- region: Optional[str]
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_async.cockpit.v1.RegionalApiDisableAlertManagerRequest(region: Optional[str], project_id: Optional[str])
Bases:
object
Disable the Alert manager.
- project_id: Optional[str]
ID of the Project to disable the Alert manager in.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- class scaleway_async.cockpit.v1.RegionalApiDisableManagedAlertsRequest(region: Optional[str], project_id: Optional[str])
Bases:
object
Disable the sending of managed alerts.
- project_id: Optional[str]
ID of the Project.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- class scaleway_async.cockpit.v1.RegionalApiEnableAlertManagerRequest(region: Optional[str], project_id: Optional[str])
Bases:
object
Enable the Alert manager.
- project_id: Optional[str]
ID of the Project to enable the Alert manager in.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- class scaleway_async.cockpit.v1.RegionalApiEnableManagedAlertsRequest(region: Optional[str], project_id: Optional[str])
Bases:
object
Enable the sending of managed alerts.
- project_id: Optional[str]
ID of the Project.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- class scaleway_async.cockpit.v1.RegionalApiGetAlertManagerRequest(region: Optional[str], project_id: Optional[str])
Bases:
object
Get the Alert manager.
- project_id: Optional[str]
Project ID of the requested Alert manager.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- class scaleway_async.cockpit.v1.RegionalApiGetConfigRequest(region: Optional[str])
Bases:
object
Get Cockpit configuration.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- class scaleway_async.cockpit.v1.RegionalApiGetDataSourceRequest(data_source_id: str, region: Optional[str])
Bases:
object
Retrieve a data source.
- data_source_id: str
ID of the relevant data source.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- class scaleway_async.cockpit.v1.RegionalApiGetTokenRequest(token_id: str, region: Optional[str])
Bases:
object
Get a token.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- token_id: str
Token ID.
- class scaleway_async.cockpit.v1.RegionalApiGetUsageOverviewRequest(region: 'Optional[ScwRegion]', project_id: 'Optional[str]', interval: 'Optional[str]')
Bases:
object
- interval: Optional[str]
- project_id: Optional[str]
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- class scaleway_async.cockpit.v1.RegionalApiListAlertsRequest(region: Optional[str], project_id: Optional[str], is_enabled: Optional[bool], is_preconfigured: Optional[bool], state: Optional[AlertState])
Bases:
object
Retrieve a list of alerts.
- is_enabled: Optional[bool]
True returns only enabled alerts. False returns only disabled alerts. If omitted, no alert filtering is applied. Other filters may still apply.
- is_preconfigured: Optional[bool]
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: Optional[str]
Project ID to filter for, only alerts from this Project will be returned.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- state: Optional[AlertState]
Valid values to filter on are disabled, enabled, pending and firing. If omitted, no filtering is applied on alert states. Other filters may still apply.
- class scaleway_async.cockpit.v1.RegionalApiListContactPointsRequest(region: Optional[str], page: Optional[int], page_size: Optional[int], project_id: Optional[str])
Bases:
object
List contact points.
- page: Optional[int]
Page number to return, from the paginated results.
- page_size: Optional[int]
Total count of contact points to return per page.
- project_id: Optional[str]
ID of the Project containing the contact points to list.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- class scaleway_async.cockpit.v1.RegionalApiListDataSourcesRequest(region: Optional[str], page: Optional[int], page_size: Optional[int], order_by: Optional[ListDataSourcesRequestOrderBy], project_id: Optional[str], origin: Optional[DataSourceOrigin], types: Optional[List[DataSourceType]])
Bases:
object
List data sources.
- order_by: Optional[ListDataSourcesRequestOrderBy]
Sort order for data sources in the response.
- origin: Optional[DataSourceOrigin]
Origin to filter for, only data sources with matching origin will be returned.
- page: Optional[int]
Page number to return, from the paginated results.
- page_size: Optional[int]
Number of data sources to return per page.
- project_id: Optional[str]
Project ID to filter for, only data sources from this Project will be returned.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- types: Optional[List[DataSourceType]]
Types to filter for, only data sources with matching types will be returned.
- class scaleway_async.cockpit.v1.RegionalApiListTokensRequest(region: Optional[str], page: Optional[int], page_size: Optional[int], order_by: Optional[ListTokensRequestOrderBy], project_id: Optional[str], token_scopes: Optional[List[TokenScope]])
Bases:
object
List tokens.
- order_by: Optional[ListTokensRequestOrderBy]
Order in which to return results.
- page: Optional[int]
Page number to return, from the paginated results.
- page_size: Optional[int]
Number of tokens to return per page.
- project_id: Optional[str]
ID of the Project the tokens belong to.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- token_scopes: Optional[List[TokenScope]]
Token scopes to filter for.
- class scaleway_async.cockpit.v1.RegionalApiTriggerTestAlertRequest(region: Optional[str], project_id: Optional[str])
Bases:
object
Request to trigger a test alert.
- project_id: Optional[str]
ID of the Project.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- class scaleway_async.cockpit.v1.RegionalApiUpdateContactPointRequest(region: Optional[str], project_id: Optional[str], send_resolved_notifications: Optional[bool], email: Optional[ContactPointEmail])
Bases:
object
Update a contact point.
- email: Optional[ContactPointEmail]
- project_id: Optional[str]
ID of the Project containing the contact point to update.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- send_resolved_notifications: Optional[bool]
Enable or disable notifications when alert is resolved.
- class scaleway_async.cockpit.v1.RegionalApiUpdateDataSourceRequest(data_source_id: str, region: Optional[str], name: Optional[str], retention_days: Optional[int])
Bases:
object
Update a data source name.
- data_source_id: str
ID of the data source to update.
- name: Optional[str]
Updated name of the data source.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- retention_days: Optional[int]
BETA - Duration for which the data will be retained in the data source.
- class scaleway_async.cockpit.v1.Token(id: str, project_id: str, name: str, scopes: List[TokenScope], region: str, created_at: Optional[datetime], updated_at: Optional[datetime], secret_key: Optional[str])
Bases:
object
Token.
- created_at: Optional[datetime]
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: Optional[str]
Token secret key.
- updated_at: Optional[datetime]
Token last modification date.
- class scaleway_async.cockpit.v1.TokenScope(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- 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_async.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: Optional[str], interval: Optional[str])
Bases:
object
Data source usage.
- data_source_id: Optional[str]
ID of the data source.
- data_source_origin: DataSourceOrigin
Origin of the data source.
- data_source_type: DataSourceType
Type of the data source.
- interval: Optional[str]
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_async.cockpit.v1.UsageOverview(scaleway_metrics_usage: 'Optional[Usage]', scaleway_logs_usage: 'Optional[Usage]', external_metrics_usage: 'Optional[Usage]', external_logs_usage: 'Optional[Usage]', external_traces_usage: 'Optional[Usage]')
Bases:
object