metalcloud-cli role create
Create a new role with specified permissions
Synopsis
Section titled “Synopsis”Create a new role with specified permissions in the MetalCloud platform.
This command creates a new role based on configuration provided through a JSON file or piped input. The role configuration must include a label and permissions list. Description is optional but recommended for clarity.
Required configuration fields: label Human-readable name for the role permissions Array of permission strings
Optional configuration fields: description Detailed description of the role’s purpose
Flags: —config-source string Required. Source of the role configuration. Can be ‘pipe’ for stdin input or path to a JSON file.
Configuration format (JSON): { “label”: “Custom Admin Role”, “description”: “Administrative role with full system access”, “permissions”: [“roles:read”, “roles:write”, “users:read”, “users:write”] }
Examples:
Create role from JSON file
Section titled “Create role from JSON file”metalcloud-cli role create —config-source role-config.json
Create role using piped JSON
Section titled “Create role using piped JSON”echo ’{“label”: “Editor”, “permissions”: [“content:read”, “content:write”]}’ | metalcloud-cli role create —config-source pipe
Create role with multiple permissions from file
Section titled “Create role with multiple permissions from file”metalcloud-cli role new —config-source /path/to/role.json
metalcloud-cli role create [flags]Options
Section titled “Options” --config-source string Source of the role configuration. Can be 'pipe' or path to a JSON file. -h, --help help for createOptions inherited from parent commands
Section titled “Options inherited from parent commands” -k, --api_key string MetalCloud API key -c, --config string Config file path -d, --debug Set to enable debug logging -e, --endpoint string MetalCloud API endpoint -f, --format string Output format. Supported values are 'text','csv','md','json','yaml'. (default "text") -i, --insecure_skip_verify Set to allow insecure transport -l, --log_file string Log file path -v, --verbosity string Log level verbosity (default "INFO")SEE ALSO
Section titled “SEE ALSO”- metalcloud-cli role - Manage user roles and permissions