#Private-CLI mapping for "vserver services name-service getxxbyyy getgrbyname" command

1 messages · Page 1 of 1 (latest)

earnest solstice
#

While provisioning a volume via CLI, it accepts unix-group name but in volume create REST API endpoint, unix-group ID is accepted. Due to this, we need a way to retrieve group-id of the given unix group name. For this, "vserver services name-service getxxbyyy getgrbyname" command can be leveraged.

I am trying to convert this command to equivalent private-cli endpoint and below is the API endpoint that i have tested.

GET https://CLUSTER/api/private/cli/vserver/services/name-service/getxxbyyy/getgrbyname?node=NODE-NAME&vserver=VSERVER-NAME&groupname=GRP-NAME&privilege_level=diagnostic

This API endpoint throws below error

{
"error": {
"message": "invalid operation",
"code": "3"
}
}

Can someone help get the right private-cli endpoint for me?

Thanks in advance

idle charm
earnest solstice
#

@idle charm : thank you🙏 , above command has worked. For private-cli, for some command GET operation is allowed and for some POST operation. Is there a way to determine what is the right METHOD and payload to use?

tawny moat
#

According to the documentation GET maps to the "show" command in CLI, POST to "create" and PATCH to "modify". I agree it is not well documented how the special advanced/diag commands are handled.