DeleteOSSIngestion

Updated at:

Delete an Object Storage Service (OSS) data import job from a Simple Log Service project.

Prerequisites

Make sure that you have:

Verify your environment

Verify your Python and pip versions:

python -V
pip3 -V

Install the SDK

pip install alibabacloud_sls20201230

Verify the installation:

pip show alibabacloud_sls20201230

Method signature

def delete_ossingestion(
        self,
        project: str,
        oss_ingestion_name: str,
) -> sls_20201230_models.DeleteOSSIngestionResponse:

Request parameters

Parameter Type Required Description Example
project String Yes The name of the project. ali-test-project
oss_ingestion_name String Yes The name of the OSS data import job. ingest-oss-123456

Response

On success, the method returns a DeleteOSSIngestionResponse object.

Sample code

import os

from alibabacloud_sls20201230.client import Client as Sls20201230Client
from alibabacloud_tea_openapi import models as open_api_models
from alibabacloud_sls20201230 import models as sls_20201230_models
from alibabacloud_tea_util.client import Client as UtilClient


def main():
    config = open_api_models.Config(
        # Required. Make sure that the ALIBABA_CLOUD_ACCESS_KEY_ID environment variable is configured.
        access_key_id=os.environ['ALIBABA_CLOUD_ACCESS_KEY_ID'],
        # Required. Make sure that the ALIBABA_CLOUD_ACCESS_KEY_SECRET environment variable is configured.
        access_key_secret=os.environ['ALIBABA_CLOUD_ACCESS_KEY_SECRET']
    )
    # The Simple Log Service endpoint.
    config.endpoint = "cn-hangzhou.log.aliyuncs.com"
    project_name = "ali-test-project"
    oss_ingestion_name = "ingest-oss-123456"
    client = Sls20201230Client(config)
    try:
        response = client.delete_ossingestion(project_name, oss_ingestion_name)
        print(response)
    except Exception as error:
        print(error.message)
        print(error.data.get("Recommend"))
        UtilClient.assert_as_string(error.message)


if __name__ == '__main__':
    main()