Skip to main content
Security groups act as virtual firewalls, controlling inbound and outbound traffic for compute instances. Aliases: securitygroups, sg

Subcommands

  • list — List security groups
  • get — Get security group details
  • create — Create a new security group
  • update — Update an existing security group
  • delete — Delete a security group

list

List security groups, optionally filtered by organization, project, network, or region.
nscale securitygroups list [flags]

Flags

FlagDescription
--org stringOrganization ID
--project stringProject ID
--network stringNetwork ID
--region stringRegion ID
--jsonOutput in JSON format

Example

nscale securitygroups list --org <org-id> --region <region-id>

get

Get details for a specific security group in JSON format.
nscale securitygroups get --id <sg-id> --org <org-id>

Flags

FlagDescription
--id stringSecurity group ID
--org stringOrganization ID

create

Create a new security group. Accepts input from a JSON file or stdin.
nscale securitygroups create [flags]

Flags

FlagDescription
--org stringOrganization ID
-f, --file stringPath to a JSON file
--stdinRead JSON from standard input
--dry-runPreview the request payload without persisting
-y, --yesAutomatically confirm creation

Examples

nscale securitygroups create --file securitygroup.json
nscale securitygroups create --stdin < securitygroup.json
cat securitygroup.json | nscale securitygroups create --stdin

update

Update an existing security group.
nscale securitygroups update --id <sg-id> [flags]

Flags

FlagDescription
--id stringSecurity group ID
--org stringOrganization ID
-f, --file stringPath to a JSON file
--stdinRead JSON from standard input
--dry-runPreview the request payload without persisting
-y, --yesAutomatically confirm update

Examples

nscale securitygroups update --id <sg-id> --file securitygroup.json
nscale securitygroups update --id <sg-id> --stdin < securitygroup.json

delete

Delete an existing security group.
nscale securitygroups delete --id <sg-id> --org <org-id> [flags]

Flags

FlagDescription
--id stringSecurity group ID
--org stringOrganization ID
--dry-runPreview the request payload without persisting
-y, --yesAutomatically confirm deletion