smengcl commented on a change in pull request #3095:
URL: https://github.com/apache/ozone/pull/3095#discussion_r814076626



##########
File path: hadoop-hdds/docs/content/interface/Tenant.md
##########
@@ -0,0 +1,294 @@
+---
+title: "Multi-Tenant commands"
+weight: 1
+menu:
+   main:
+      parent: "Client Interfaces"
+summary: Ozone subcommands for tenant management
+---
+<!---
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You 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.
+-->
+
+For a higher level understanding of multi-tenancy architecture, see 
[Multi-Tenancy feature]({{< ref "feature/Multi-Tenancy.md" >}}).
+
+All Multi-Tenancy subcommands are located under CLI `ozone tenant`.
+
+The commands below assume a Kerberized Ozone cluster with Ranger install. 
Enabling HTTPS on S3 Gateway is optional but recommended.
+
+## Quick Start
+
+### Setup
+
+Follow the [Multi-Tenancy Setup]({{< ref "feature/Multi-Tenancy-Setup.md" >}}) 
guide if you haven't done so.
+
+If the OzoneManagers are running in HA, append `--om-service-id=` accordingly 
to the commands.
+
+### Create a tenant
+
+Create a new tenant in the current Ozone cluster.
+This operation requires Ozone cluster administrator privilege.
+
+Creating a tenant creates a volume of the exact same name. Volume name 
restrictions apply.
+
+```shell
+ozone tenant create <TENANT_NAME>
+```
+
+Example:
+
+```shell
+bash-4.2$ kinit -kt /etc/security/keytabs/om.keytab om/[email protected]
+bash-4.2$ ozone tenant create tenantone
+2022-02-16 00:00:00,000 [main] INFO rpc.RpcClient: Creating Tenant: 
'tenantone', with new volume: 'tenantone'
+Created tenant 'tenantone'.
+```
+
+
+### List tenants
+
+List all tenants in an Ozone cluster.
+
+```shell
+ozone tenant list
+```
+
+Example:
+
+```shell
+bash-4.2$ ozone tenant list
+tenantone
+```
+
+
+### Assign a user to a tenant
+
+The first user in a tenant must be assigned by an Ozone cluster administrator.
+
+By default when user `testuser` is assigned to tenant `tenantone`, the 
generated Access ID for the user in this tenant is `tenantone$testuser`.
+
+- Be sure to enclose the Access ID in single quotes in Bash when using it so 
it doesn't get auto-translated into environment variables.
+
+It is possible to assign a user to multiple tenants.
+
+```shell
+ozone tenant user assign <USER_NAME> --tenant=<TENANT_NAME>
+```
+
+Example:
+
+```shell
+bash-4.2$ ozone tenant user assign testuser --tenant=tenantone
+Assigned 'testuser' to 'tenantone' with accessId 'tenantone$testuser'.
+export AWS_ACCESS_KEY_ID='tenantone$testuser'
+export AWS_SECRET_ACCESS_KEY='<GENERATED_SECRET>'
+```
+
+
+### Assign a user as a tenant admin
+
+The first user in a tenant must be assigned by an Ozone cluster administrator.
+
+Both delegated and non-delegated tenant admin can assign and revoke 
**regular** tenant users.
+
+The only difference between delegated tenant admin and non-delegated tenant 
admin is that delegated tenant admin can assign and revoke tenant **admins** in 
the tenant,
+while non-delegated tenant admin can't.
+
+Unless specified, `ozone tenant assignadmin` assigns **delegated** tenant 
admins by default.

Review comment:
       Like this: `ozone tenant user assignadmin 'tenantone$testuser' 
--delegated=false --tenant=tenantone`
   
   Added to the doc.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to