forked from minio/minio-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add MinIO admin client functionality (minio#1221)
Co-authored-by: Minio Trusted <[email protected]>
- Loading branch information
1 parent
9d5b365
commit c21b24c
Showing
20 changed files
with
1,645 additions
and
336 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* MinIO Java SDK for Amazon S3 Compatible Cloud Storage, | ||
* (C) 2015-2021 MinIO, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.minio.admin; | ||
|
||
import io.minio.BaseArgs; | ||
import io.minio.ListBucketsArgs; | ||
|
||
public class AddPolicyArgs extends BaseArgs { | ||
|
||
protected String policyName; | ||
protected String policyString; | ||
|
||
public String policyName() { | ||
return policyName; | ||
} | ||
|
||
public String policyString() { | ||
return policyString; | ||
} | ||
|
||
public static AddPolicyArgs.Builder builder() { | ||
return new AddPolicyArgs.Builder(); | ||
} | ||
|
||
/** Argument builder of {@link ListBucketsArgs}. */ | ||
public static final class Builder extends BaseArgs.Builder<AddPolicyArgs.Builder, AddPolicyArgs> { | ||
@Override | ||
protected void validate(AddPolicyArgs args) {} | ||
|
||
public AddPolicyArgs.Builder policyName(String policyName) { | ||
this.operations.add(args -> args.policyName = policyName); | ||
return this; | ||
} | ||
|
||
public AddPolicyArgs.Builder policyString(String policyString) { | ||
this.operations.add(args -> args.policyString = policyString); | ||
return this; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* MinIO Java SDK for Amazon S3 Compatible Cloud Storage, | ||
* (C) 2015-2021 MinIO, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.minio.admin; | ||
|
||
import io.minio.BaseArgs; | ||
import io.minio.ListBucketsArgs; | ||
|
||
public class AddUserArgs extends BaseArgs { | ||
|
||
protected String accessKey; | ||
protected String secretKey; | ||
|
||
public String accessKey() { | ||
return accessKey; | ||
} | ||
|
||
public String secretKey() { | ||
return secretKey; | ||
} | ||
|
||
public static AddUserArgs.Builder builder() { | ||
return new AddUserArgs.Builder(); | ||
} | ||
|
||
/** Argument builder of {@link ListBucketsArgs}. */ | ||
public static final class Builder extends BaseArgs.Builder<AddUserArgs.Builder, AddUserArgs> { | ||
@Override | ||
protected void validate(AddUserArgs args) {} | ||
|
||
public AddUserArgs.Builder accessKey(String accessKey) { | ||
this.operations.add(args -> args.accessKey = accessKey); | ||
return this; | ||
} | ||
|
||
public AddUserArgs.Builder secretKey(String secretKey) { | ||
this.operations.add(args -> args.secretKey = secretKey); | ||
return this; | ||
} | ||
} | ||
|
||
public UserInfo toUserInfo() { | ||
UserInfo userInfo = new UserInfo(); | ||
userInfo.setSecretKey(secretKey()); | ||
userInfo.setStatus(UserInfo.STATUS_ENABLED); | ||
return userInfo; | ||
} | ||
} |
Oops, something went wrong.