Skip to content

Commit a305bed

Browse files
committed
Add zendhqctl tasks
1 parent e0b01f0 commit a305bed

40 files changed

+307
-0
lines changed

tasks/group_add.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"description": "Create a group",
3+
"input_method": "environment",
4+
"parameters": {
5+
"group": {
6+
"description": "Group to create",
7+
"type": "String[1]"
8+
},
9+
"comment": {
10+
"description": "Optional group comment",
11+
"type": "Optional[String[1]]"
12+
},
13+
"permission_mask": {
14+
"description": "Optional permission mask, such as 'r zray,mon,conf,ct,jq'",
15+
"type": "Optional[String[1]]"
16+
}
17+
}
18+
}

tasks/group_add.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
[[ -z "$PT_permission_mask" ]] && permissions='' || permissions="--permissions $PT_permission_mask"
4+
5+
/opt/zend/zendphp/bin/zendhqctl access group add $PT_group --comment "$PT_comment" $permissions

tasks/group_add_user.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"description": "Add one or more users to a group",
3+
"input_method": "environment",
4+
"parameters": {
5+
"group": {
6+
"description": "Group to add one or more users to",
7+
"type": "String[1]"
8+
},
9+
"user": {
10+
"description": "User(s) to add to the group",
11+
"type": "String[1]"
12+
}
13+
}
14+
}

tasks/group_add_user.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
/opt/zend/zendphp/bin/zendhqctl access group add-user $PT_group $PT_user

tasks/group_comment.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"description": "Set a comment for a given group",
3+
"input_method": "environment",
4+
"parameters": {
5+
"group": {
6+
"description": "Group to set comment for",
7+
"type": "String[1]"
8+
},
9+
"comment": {
10+
"description": "Comment for given group",
11+
"type": "Optional[String[1]]"
12+
}
13+
}
14+
}

tasks/group_comment.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
/opt/zend/zendphp/bin/zendhqctl access group comment $PT_group "$PT_comment"

tasks/group_disable.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"description": "Disable a given group",
3+
"input_method": "environment",
4+
"parameters": {
5+
"group": {
6+
"description": "Group to disable",
7+
"type": "String[1]"
8+
}
9+
}
10+
}

tasks/group_disable.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
/opt/zend/zendphp/bin/zendhqctl access group disable $PT_group

tasks/group_enable.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"description": "Enable a given group",
3+
"input_method": "environment",
4+
"parameters": {
5+
"group": {
6+
"description": "Group to enable",
7+
"type": "String[1]"
8+
}
9+
}
10+
}

tasks/group_enable.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
/opt/zend/zendphp/bin/zendhqctl access group enable $PT_group

tasks/group_list.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"description": "List the defined groups"
3+
}

tasks/group_list.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
/opt/zend/zendphp/bin/zendhqctl access group list

tasks/group_print.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"description": "List the permissions for a given group",
3+
"input_method": "environment",
4+
"parameters": {
5+
"group": {
6+
"description": "Group to list the permissions of",
7+
"type": "String[1]"
8+
}
9+
}
10+
}

tasks/group_print.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
/opt/zend/zendphp/bin/zendhqctl access group print $PT_group

tasks/group_remove.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"description": "Remove a given group",
3+
"input_method": "environment",
4+
"parameters": {
5+
"group": {
6+
"description": "Group to remove",
7+
"type": "String[1]"
8+
}
9+
}
10+
}

tasks/group_remove.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
/opt/zend/zendphp/bin/zendhqctl access group remove $PT_group

tasks/group_remove_user.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"description": "Remove one or more users from a group",
3+
"input_method": "environment",
4+
"parameters": {
5+
"group": {
6+
"description": "Group to remove one or more users from",
7+
"type": "String[1]"
8+
},
9+
"user": {
10+
"description": "User(s) to remove from the group",
11+
"type": "String[1]"
12+
}
13+
}
14+
}

tasks/group_remove_user.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
/opt/zend/zendphp/bin/zendhqctl access group remove-user $PT_group $PT_user

tasks/group_set_permissions.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"description": "Set the permissions for a given group",
3+
"input_method": "environment",
4+
"parameters": {
5+
"group": {
6+
"description": "Group to set the permissions of",
7+
"type": "String[1]"
8+
},
9+
"permission_mask": {
10+
"description": "Permission mask, such as '-wx zray,mon,conf,ct,jq'",
11+
"type": "String[1]"
12+
}
13+
}
14+
}

tasks/group_set_permissions.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
/opt/zend/zendphp/bin/zendhqctl access group set-permissions $PT_group $PT_permission_mask

tasks/user_add.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"description": "Create a user",
3+
"input_method": "environment",
4+
"parameters": {
5+
"user": {
6+
"description": "User to create",
7+
"type": "String[1]"
8+
},
9+
"password": {
10+
"description": "Password for user",
11+
"type": "Optional[String[1]]"
12+
},
13+
"group": {
14+
"description": "Optional group or comma-separated list of groups to add user to",
15+
"type": "Optional[String[1]]"
16+
},
17+
"comment": {
18+
"description": "Optional user comment",
19+
"type": "Optional[String[1]]"
20+
},
21+
"disable": {
22+
"description": "Optional disable user flag",
23+
"type": "Optional[String[1]]"
24+
}
25+
}
26+
}

tasks/user_add.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
[[ -z "$PT_group" ]] && group='' || group="--group $PT_group"
4+
[ "$PT_disable" = true ] && disable='--disable' || disable=''
5+
6+
/opt/zend/zendphp/bin/zendhqctl access user add $PT_user --comment "$PT_comment" --password $PT_password $group $disable

tasks/user_add_group.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"description": "Add a user to one or more groups",
3+
"input_method": "environment",
4+
"parameters": {
5+
"user": {
6+
"description": "User to add to group(s)",
7+
"type": "String[1]"
8+
},
9+
"group": {
10+
"description": "Group or comma-separated list of groups",
11+
"type": "String[1]"
12+
}
13+
}
14+
}

tasks/user_add_group.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
/opt/zend/zendphp/bin/zendhqctl access user add-group $PT_user $PT_group

tasks/user_comment.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"description": "Set a comment for a given user",
3+
"input_method": "environment",
4+
"parameters": {
5+
"user": {
6+
"description": "User to set comment for",
7+
"type": "String[1]"
8+
},
9+
"comment": {
10+
"description": "Comment for given user",
11+
"type": "Optional[String[1]]"
12+
}
13+
}
14+
}

tasks/user_comment.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
/opt/zend/zendphp/bin/zendhqctl access user comment $PT_user "$PT_comment"

tasks/user_disable.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"description": "Disable a given user",
3+
"input_method": "environment",
4+
"parameters": {
5+
"user": {
6+
"description": "User to disable",
7+
"type": "String[1]"
8+
}
9+
}
10+
}

tasks/user_disable.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
/opt/zend/zendphp/bin/zendhqctl access user disable $PT_user

tasks/user_enable.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"description": "Enable a given user",
3+
"input_method": "environment",
4+
"parameters": {
5+
"user": {
6+
"description": "User to enable",
7+
"type": "String[1]"
8+
}
9+
}
10+
}

tasks/user_enable.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
/opt/zend/zendphp/bin/zendhqctl access user enable $PT_user

tasks/user_list.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"description": "List the defined users"
3+
}

tasks/user_list.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
/opt/zend/zendphp/bin/zendhqctl access user list

tasks/user_password.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"description": "Change the password for a given user",
3+
"input_method": "environment",
4+
"parameters": {
5+
"user": {
6+
"description": "User to change password for",
7+
"type": "String[1]"
8+
},
9+
"password": {
10+
"description": "Password for given user",
11+
"type": "String[1]"
12+
}
13+
}
14+
}

tasks/user_password.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
/opt/zend/zendphp/bin/zendhqctl access user password $PT_user $PT_password

tasks/user_print.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"description": "List the permissions for a given user",
3+
"input_method": "environment",
4+
"parameters": {
5+
"user": {
6+
"description": "User to list the permissions of",
7+
"type": "String[1]"
8+
}
9+
}
10+
}

tasks/user_print.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
/opt/zend/zendphp/bin/zendhqctl access user print $PT_user

tasks/user_remove.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"description": "Remove a given user",
3+
"input_method": "environment",
4+
"parameters": {
5+
"user": {
6+
"description": "User to remove",
7+
"type": "String[1]"
8+
}
9+
}
10+
}

tasks/user_remove.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
/opt/zend/zendphp/bin/zendhqctl access user remove $PT_user

tasks/user_remove_group.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"description": "Remove a user from one or more groups",
3+
"input_method": "environment",
4+
"parameters": {
5+
"user": {
6+
"description": "User to remove from group(s)",
7+
"type": "String[1]"
8+
},
9+
"group": {
10+
"description": "Group or comma-separated list of groups",
11+
"type": "String[1]"
12+
}
13+
}
14+
}

tasks/user_remove_group.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
/opt/zend/zendphp/bin/zendhqctl access user remove-group $PT_user $PT_group

0 commit comments

Comments
 (0)