Stopping a Visualization Job¶
Sample Code¶
In ModelArts notebook, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
Method 1: Stop a visualization job based on the specified visualization_id.
from modelarts.session import Session from modelarts.estimator import VisualizationJob session = Session() job = VisualizationJob(modelarts_session=session, visualization_id='8992') status = job.stop_visualization_job()
Method 2: Stop the visualization job created in Creating a Visualization Job.
status = job_visualization_instance.stop_visualization_job()
Method 3: Stop the visualization job object returned in Querying the List of Visualization Job Objects.
status = job_visualization_instance_list[0].stop_visualization_job()
Parameter Description¶
Parameter | Mandatory | Type | Description |
---|---|---|---|
modelarts_session | Yes | Object | Session object. For details about the initialization method, see Session Authentication. |
visualization_id | Yes | String | ID of a visualization job |
Parameter | Type | Description |
---|---|---|
error_code | String | Error code when the API fails to be called. For details, see Error Codes in ModelArts API Reference. This parameter is not included when the API call succeeds. |
error_msg | String | Error message when the API call fails. This parameter is not included when the API call succeeds. |
is_success | Boolean | Whether the API call succeeds |