diff --git a/api/spec/json/applications.json b/api/spec/json/applications.json index 614121858..c60792e6a 100644 --- a/api/spec/json/applications.json +++ b/api/spec/json/applications.json @@ -88,6 +88,16 @@ "name": "hasVersions", "type": "boolean", "description": "When set to true, the returned result contains applications with an applicationVersions field that is not empty. When set to false, the result will contain applications with an empty applicationVersions field." + }, + { + "name": "availability", + "type": "string", + "description": "Application access level for other tenants.", + "validationSet": [ + "SHARED", + "PRIVATE", + "MARKET" + ] } ] }, diff --git a/api/spec/yaml/applications.yaml b/api/spec/yaml/applications.yaml index 32b4fba01..ac2e3a05d 100644 --- a/api/spec/yaml/applications.yaml +++ b/api/spec/yaml/applications.yaml @@ -69,6 +69,14 @@ commands: type: boolean description: When set to true, the returned result contains applications with an applicationVersions field that is not empty. When set to false, the result will contain applications with an empty applicationVersions field. + - name: availability + type: string + description: Application access level for other tenants. + validationSet: + - SHARED + - PRIVATE + - MARKET + - name: newApplication description: Create application descriptionLong: Create a new application using explicit settings diff --git a/pkg/cmd/applications/list/list.auto.go b/pkg/cmd/applications/list/list.auto.go index 77a531ca5..a9faadb0d 100644 --- a/pkg/cmd/applications/list/list.auto.go +++ b/pkg/cmd/applications/list/list.auto.go @@ -60,6 +60,7 @@ Check if a user has access to the cockpit application cmd.Flags().StringSlice("user", []string{""}, "The ID of a user that has access to the applications.") cmd.Flags().String("tenant", "", "The ID of a tenant that either owns the application or is subscribed to the applications.") cmd.Flags().Bool("hasVersions", false, "When set to true, the returned result contains applications with an applicationVersions field that is not empty. When set to false, the result will contain applications with an empty applicationVersions field.") + cmd.Flags().String("availability", "", "Application access level for other tenants.") completion.WithOptions( cmd, @@ -70,6 +71,7 @@ Check if a user has access to the cockpit application completion.WithTenantID("subscriber", func() (*c8y.Client, error) { return ccmd.factory.Client() }), completion.WithUser("user", func() (*c8y.Client, error) { return ccmd.factory.Client() }), completion.WithTenantID("tenant", func() (*c8y.Client, error) { return ccmd.factory.Client() }), + completion.WithValidateSet("availability", "SHARED", "PRIVATE", "MARKET"), ) flags.WithOptions( @@ -127,6 +129,7 @@ func (n *ListCmd) RunE(cmd *cobra.Command, args []string) error { c8yfetcher.WithUserByNameFirstMatch(n.factory, args, "user", "user"), flags.WithStringValue("tenant", "tenant"), flags.WithBoolValue("hasVersions", "hasVersions", ""), + flags.WithStringValue("availability", "availability"), ) if err != nil { return cmderrors.NewUserError(err) diff --git a/tools/PSc8y/Public/Get-ApplicationCollection.ps1 b/tools/PSc8y/Public/Get-ApplicationCollection.ps1 index 34edd41dd..dad2df7bd 100644 --- a/tools/PSc8y/Public/Get-ApplicationCollection.ps1 +++ b/tools/PSc8y/Public/Get-ApplicationCollection.ps1 @@ -62,7 +62,13 @@ Get applications # When set to true, the returned result contains applications with an applicationVersions field that is not empty. When set to false, the result will contain applications with an empty applicationVersions field. [Parameter()] [switch] - $HasVersions + $HasVersions, + + # Application access level for other tenants. + [Parameter()] + [ValidateSet('SHARED','PRIVATE','MARKET')] + [string] + $Availability ) DynamicParam { Get-ClientCommonParameters -Type "Get", "Collection"