Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/stackit_beta_scf.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ stackit beta scf [flags]
* [stackit beta](./stackit_beta.md) - Contains beta STACKIT CLI commands
* [stackit beta scf organization](./stackit_beta_scf_organization.md) - Provides functionality for STACKIT Cloud Foundry organizations
* [stackit beta scf platform](./stackit_beta_scf_platform.md) - Provides functionality for STACKIT Cloud Foundry platforms
* [stackit beta scf space](./stackit_beta_scf_space.md) - Provides functionality for STACKIT Cloud Foundry spaces

39 changes: 39 additions & 0 deletions docs/stackit_beta_scf_space.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## stackit beta scf space

Provides functionality for STACKIT Cloud Foundry spaces

### Synopsis

Provides functionality for STACKIT Cloud Foundry spaces.

```
stackit beta scf space [flags]
```

### Options

```
-h, --help Help for "stackit beta scf space"
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, (one of: [json, pretty, none, yaml])
-p, --project-id string Project ID
--region string Target region for region-specific requests
--verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info")
```

### SEE ALSO

* [stackit beta scf](./stackit_beta_scf.md) - Provides functionality for STACKIT Cloud Foundry
* [stackit beta scf space create](./stackit_beta_scf_space_create.md) - Creates a STACKIT Cloud Foundry space
* [stackit beta scf space delete](./stackit_beta_scf_space_delete.md) - Deletes a STACKIT Cloud Foundry space
* [stackit beta scf space describe](./stackit_beta_scf_space_describe.md) - Shows details of a STACKIT Cloud Foundry space
* [stackit beta scf space list](./stackit_beta_scf_space_list.md) - Lists all STACKIT Cloud Foundry spaces of an organization
* [stackit beta scf space role](./stackit_beta_scf_space_role.md) - Manages roles of STACKIT Cloud Foundry spaces
* [stackit beta scf space update](./stackit_beta_scf_space_update.md) - Updates a STACKIT Cloud Foundry space

42 changes: 42 additions & 0 deletions docs/stackit_beta_scf_space_create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
## stackit beta scf space create

Creates a STACKIT Cloud Foundry space

### Synopsis

Creates a STACKIT Cloud Foundry space in an organization.

```
stackit beta scf space create [flags]
```

### Examples

```
Create a STACKIT Cloud Foundry space with name "my-space" in the organization with ID "xxx"
$ stackit beta scf space create --organization-id xxx --name my-space
```

### Options

```
-h, --help Help for "stackit beta scf space create"
--name string Name of the space
--organization-id string The UUID of the organization
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, (one of: [json, pretty, none, yaml])
-p, --project-id string Project ID
--region string Target region for region-specific requests
--verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info")
```

### SEE ALSO

* [stackit beta scf space](./stackit_beta_scf_space.md) - Provides functionality for STACKIT Cloud Foundry spaces

41 changes: 41 additions & 0 deletions docs/stackit_beta_scf_space_delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
## stackit beta scf space delete

Deletes a STACKIT Cloud Foundry space

### Synopsis

Deletes a STACKIT Cloud Foundry space.

```
stackit beta scf space delete SPACE_ID [flags]
```

### Examples

```
Delete the STACKIT Cloud Foundry space with ID "yyy" in the organization with ID "xxx"
$ stackit beta scf space delete yyy --organization-id xxx
```

### Options

```
-h, --help Help for "stackit beta scf space delete"
--organization-id string The UUID of the organization
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, (one of: [json, pretty, none, yaml])
-p, --project-id string Project ID
--region string Target region for region-specific requests
--verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info")
```

### SEE ALSO

* [stackit beta scf space](./stackit_beta_scf_space.md) - Provides functionality for STACKIT Cloud Foundry spaces

44 changes: 44 additions & 0 deletions docs/stackit_beta_scf_space_describe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
## stackit beta scf space describe

Shows details of a STACKIT Cloud Foundry space

### Synopsis

Shows details of a STACKIT Cloud Foundry space.

```
stackit beta scf space describe SPACE_ID [flags]
```

### Examples

```
Get details of the STACKIT Cloud Foundry space with ID "yyy" in the organization with ID "xxx"
$ stackit beta scf space describe yyy --organization-id xxx

Get details of the STACKIT Cloud Foundry space with ID "yyy" in the organization with ID "xxx" in JSON format
$ stackit beta scf space describe yyy --organization-id xxx --output-format json
```

### Options

```
-h, --help Help for "stackit beta scf space describe"
--organization-id string The UUID of the organization
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, (one of: [json, pretty, none, yaml])
-p, --project-id string Project ID
--region string Target region for region-specific requests
--verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info")
```

### SEE ALSO

* [stackit beta scf space](./stackit_beta_scf_space.md) - Provides functionality for STACKIT Cloud Foundry spaces

45 changes: 45 additions & 0 deletions docs/stackit_beta_scf_space_list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
## stackit beta scf space list

Lists all STACKIT Cloud Foundry spaces of an organization

### Synopsis

Lists all STACKIT Cloud Foundry spaces of an organization. The number of fetched spaces is limited to 5000.

```
stackit beta scf space list [flags]
```

### Examples

```
List all STACKIT Cloud Foundry spaces of the organization with ID "xxx"
$ stackit beta scf space list --organization-id xxx

List up to 10 STACKIT Cloud Foundry spaces of the organization with ID "xxx"
$ stackit beta scf space list --organization-id xxx --limit 10
```

### Options

```
-h, --help Help for "stackit beta scf space list"
--limit int Maximum number of entries to list
--organization-id string The UUID of the organization
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, (one of: [json, pretty, none, yaml])
-p, --project-id string Project ID
--region string Target region for region-specific requests
--verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info")
```

### SEE ALSO

* [stackit beta scf space](./stackit_beta_scf_space.md) - Provides functionality for STACKIT Cloud Foundry spaces

34 changes: 34 additions & 0 deletions docs/stackit_beta_scf_space_role.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## stackit beta scf space role

Manages roles of STACKIT Cloud Foundry spaces

### Synopsis

Manages roles of STACKIT Cloud Foundry spaces.

```
stackit beta scf space role [flags]
```

### Options

```
-h, --help Help for "stackit beta scf space role"
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, (one of: [json, pretty, none, yaml])
-p, --project-id string Project ID
--region string Target region for region-specific requests
--verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info")
```

### SEE ALSO

* [stackit beta scf space](./stackit_beta_scf_space.md) - Provides functionality for STACKIT Cloud Foundry spaces
* [stackit beta scf space role set](./stackit_beta_scf_space_role_set.md) - Assigns a role to a user of a STACKIT Cloud Foundry space

47 changes: 47 additions & 0 deletions docs/stackit_beta_scf_space_role_set.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
## stackit beta scf space role set

Assigns a role to a user of a STACKIT Cloud Foundry space

### Synopsis

Assigns a role to a user of a STACKIT Cloud Foundry space. The user is identified either by its GUID or by its username.

```
stackit beta scf space role set SPACE_ID [flags]
```

### Examples

```
Assign the role "space_developer" to the user with GUID "zzz" in the STACKIT Cloud Foundry space with ID "yyy" of the organization with ID "xxx"
$ stackit beta scf space role set yyy --organization-id xxx --role space_developer --user-guid zzz

Assign the role "space_auditor" to the user with username "jane.doe" in the STACKIT Cloud Foundry space with ID "yyy" of the organization with ID "xxx"
$ stackit beta scf space role set yyy --organization-id xxx --role space_auditor --user-name jane.doe
```

### Options

```
-h, --help Help for "stackit beta scf space role set"
--organization-id string The UUID of the organization
--role string The role to assign to the user (one of: [space_auditor, space_developer, space_manager, space_supporter])
--user-guid string The GUID of the user to assign the role to
--user-name string The username of the user to assign the role to
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, (one of: [json, pretty, none, yaml])
-p, --project-id string Project ID
--region string Target region for region-specific requests
--verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info")
```

### SEE ALSO

* [stackit beta scf space role](./stackit_beta_scf_space_role.md) - Manages roles of STACKIT Cloud Foundry spaces

42 changes: 42 additions & 0 deletions docs/stackit_beta_scf_space_update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
## stackit beta scf space update

Updates a STACKIT Cloud Foundry space

### Synopsis

Updates a STACKIT Cloud Foundry space.

```
stackit beta scf space update SPACE_ID [flags]
```

### Examples

```
Rename the STACKIT Cloud Foundry space with ID "yyy" in the organization with ID "xxx"
$ stackit beta scf space update yyy --organization-id xxx --name new-name
```

### Options

```
-h, --help Help for "stackit beta scf space update"
--name string New name of the space
--organization-id string The UUID of the organization
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, (one of: [json, pretty, none, yaml])
-p, --project-id string Project ID
--region string Target region for region-specific requests
--verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info")
```

### SEE ALSO

* [stackit beta scf space](./stackit_beta_scf_space.md) - Provides functionality for STACKIT Cloud Foundry spaces

13 changes: 3 additions & 10 deletions internal/cmd/beta/scf/organization/role/set/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/stackitcloud/stackit-cli/internal/pkg/globalflags"
"github.com/stackitcloud/stackit-cli/internal/pkg/print"
"github.com/stackitcloud/stackit-cli/internal/pkg/services/scf/client"
scfUtils "github.com/stackitcloud/stackit-cli/internal/pkg/services/scf/utils"
"github.com/stackitcloud/stackit-cli/internal/pkg/types"
"github.com/stackitcloud/stackit-cli/internal/pkg/utils"
)
Expand Down Expand Up @@ -66,7 +67,7 @@ func NewCmd(p *types.CmdParams) *cobra.Command {
return err
}

prompt := fmt.Sprintf("Are you sure you want to assign role %q to user %q in STACKIT Cloud Foundry organization %q?", model.Role, userLabel(model), model.OrganizationId)
prompt := fmt.Sprintf("Are you sure you want to assign role %q to user %q in STACKIT Cloud Foundry organization %q?", model.Role, scfUtils.UserLabel(model.UserGuid, model.UserName), model.OrganizationId)
err = p.Printer.PromptForConfirmation(prompt)
if err != nil {
return err
Expand Down Expand Up @@ -130,15 +131,7 @@ func buildRequest(ctx context.Context, model *inputModel, apiClient scf.DefaultA

func outputResult(p *print.Printer, model *inputModel, resp *scf.OrgRoleResponse) error {
return p.OutputResult(model.OutputFormat, resp, func() error {
p.Outputf("Assigned role %q to user %q in STACKIT Cloud Foundry organization %s\n", model.Role, userLabel(model), model.OrganizationId)
p.Outputf("Assigned role %q to user %q in STACKIT Cloud Foundry organization %s\n", model.Role, scfUtils.UserLabel(model.UserGuid, model.UserName), model.OrganizationId)
return nil
})
}

// userLabel returns the user identifier given on the command line, either the GUID or the username
func userLabel(model *inputModel) string {
if model.UserGuid != nil {
return *model.UserGuid
}
return utils.PtrString(model.UserName)
}
Loading
Loading