Skip to content

Latest commit

 

History

History
37 lines (30 loc) · 1.2 KB

delete_bucket_external_mirror.md

File metadata and controls

37 lines (30 loc) · 1.2 KB

DELETE Bucket External Mirror

Code Snippet

Initialize the Bucket service with accesskeyid and secretaccesskey

EnvContext env = new EnvContext(accessKey,accessSecret);
String zoneKey = "pek3a";
String bucketName = "testBucketName";
Bucket bucket = new Bucket(env, zoneKey, bucketName);

then you can DELETE Bucket External Mirror

    private void deleteBucketExternalMirror(Bucket bucket) {
        try {
            Bucket.DeleteBucketExternalMirrorOutput output = bucket.deleteExternalMirror();
            if (output.getStatueCode() == 204) {
                System.out.println("Delete bucket external mirror OK.");
            } else {
                // Failed
                System.out.println("Failed to delete bucket external mirror.");
                System.out.println("StatueCode = " + output.getStatueCode());
                System.out.println("Message = " + output.getMessage());
                System.out.println("RequestId = " + output.getRequestId());
                System.out.println("Code = " + output.getCode());
                System.out.println("Url = " + output.getUrl());
            }
        } catch (QSException e) {
            e.printStackTrace();
        }
    }