1. Packages
  2. Spectrocloud Provider
  3. API Docs
  4. getPermission
spectrocloud 0.23.5 published on Sunday, Apr 20, 2025 by spectrocloud

spectrocloud.getPermission

Explore with Pulumi AI

spectrocloud 0.23.5 published on Sunday, Apr 20, 2025 by spectrocloud

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as spectrocloud from "@pulumi/spectrocloud";

const example = spectrocloud.getPermission({
    name: "App Deployment",
    scope: "project",
});
export const permissionDetails = example;
export const permissionId = example.then(example => example.id);
export const permissionList = example.then(example => example.permissions);
Copy
import pulumi
import pulumi_spectrocloud as spectrocloud

example = spectrocloud.get_permission(name="App Deployment",
    scope="project")
pulumi.export("permissionDetails", example)
pulumi.export("permissionId", example.id)
pulumi.export("permissionList", example.permissions)
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/spectrocloud/spectrocloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := spectrocloud.GetPermission(ctx, &spectrocloud.GetPermissionArgs{
			Name:  "App Deployment",
			Scope: pulumi.StringRef("project"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("permissionDetails", example)
		ctx.Export("permissionId", example.Id)
		ctx.Export("permissionList", example.Permissions)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Spectrocloud = Pulumi.Spectrocloud;

return await Deployment.RunAsync(() => 
{
    var example = Spectrocloud.GetPermission.Invoke(new()
    {
        Name = "App Deployment",
        Scope = "project",
    });

    return new Dictionary<string, object?>
    {
        ["permissionDetails"] = example,
        ["permissionId"] = example.Apply(getPermissionResult => getPermissionResult.Id),
        ["permissionList"] = example.Apply(getPermissionResult => getPermissionResult.Permissions),
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.spectrocloud.SpectrocloudFunctions;
import com.pulumi.spectrocloud.inputs.GetPermissionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var example = SpectrocloudFunctions.getPermission(GetPermissionArgs.builder()
            .name("App Deployment")
            .scope("project")
            .build());

        ctx.export("permissionDetails", example.applyValue(getPermissionResult -> getPermissionResult));
        ctx.export("permissionId", example.applyValue(getPermissionResult -> getPermissionResult.id()));
        ctx.export("permissionList", example.applyValue(getPermissionResult -> getPermissionResult.permissions()));
    }
}
Copy
variables:
  example:
    fn::invoke:
      function: spectrocloud:getPermission
      arguments:
        name: App Deployment
        scope: project
outputs:
  # Output the retrieved permission details
  permissionDetails: ${example}
  # Individual outputs for better clarity (optional)
  permissionId: ${example.id}
  permissionList: ${example.permissions}
Copy

Using getPermission

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getPermission(args: GetPermissionArgs, opts?: InvokeOptions): Promise<GetPermissionResult>
function getPermissionOutput(args: GetPermissionOutputArgs, opts?: InvokeOptions): Output<GetPermissionResult>
Copy
def get_permission(name: Optional[str] = None,
                   scope: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetPermissionResult
def get_permission_output(name: Optional[pulumi.Input[str]] = None,
                   scope: Optional[pulumi.Input[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetPermissionResult]
Copy
func GetPermission(ctx *Context, args *GetPermissionArgs, opts ...InvokeOption) (*GetPermissionResult, error)
func GetPermissionOutput(ctx *Context, args *GetPermissionOutputArgs, opts ...InvokeOption) GetPermissionResultOutput
Copy

> Note: This function is named GetPermission in the Go SDK.

public static class GetPermission 
{
    public static Task<GetPermissionResult> InvokeAsync(GetPermissionArgs args, InvokeOptions? opts = null)
    public static Output<GetPermissionResult> Invoke(GetPermissionInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetPermissionResult> getPermission(GetPermissionArgs args, InvokeOptions options)
public static Output<GetPermissionResult> getPermission(GetPermissionArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: spectrocloud:index/getPermission:getPermission
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name This property is required. string
Name of the permissions. eg: App Deployment.
Scope string
Permission scope. Allowed permission levels are project or tenant or resource . Defaults to project.
Name This property is required. string
Name of the permissions. eg: App Deployment.
Scope string
Permission scope. Allowed permission levels are project or tenant or resource . Defaults to project.
name This property is required. String
Name of the permissions. eg: App Deployment.
scope String
Permission scope. Allowed permission levels are project or tenant or resource . Defaults to project.
name This property is required. string
Name of the permissions. eg: App Deployment.
scope string
Permission scope. Allowed permission levels are project or tenant or resource . Defaults to project.
name This property is required. str
Name of the permissions. eg: App Deployment.
scope str
Permission scope. Allowed permission levels are project or tenant or resource . Defaults to project.
name This property is required. String
Name of the permissions. eg: App Deployment.
scope String
Permission scope. Allowed permission levels are project or tenant or resource . Defaults to project.

getPermission Result

The following output properties are available:

Id string
The ID of this resource.
Name string
Name of the permissions. eg: App Deployment.
Permissions List<string>
List of permissions associated with the permission name.
Scope string
Permission scope. Allowed permission levels are project or tenant or resource . Defaults to project.
Id string
The ID of this resource.
Name string
Name of the permissions. eg: App Deployment.
Permissions []string
List of permissions associated with the permission name.
Scope string
Permission scope. Allowed permission levels are project or tenant or resource . Defaults to project.
id String
The ID of this resource.
name String
Name of the permissions. eg: App Deployment.
permissions List<String>
List of permissions associated with the permission name.
scope String
Permission scope. Allowed permission levels are project or tenant or resource . Defaults to project.
id string
The ID of this resource.
name string
Name of the permissions. eg: App Deployment.
permissions string[]
List of permissions associated with the permission name.
scope string
Permission scope. Allowed permission levels are project or tenant or resource . Defaults to project.
id str
The ID of this resource.
name str
Name of the permissions. eg: App Deployment.
permissions Sequence[str]
List of permissions associated with the permission name.
scope str
Permission scope. Allowed permission levels are project or tenant or resource . Defaults to project.
id String
The ID of this resource.
name String
Name of the permissions. eg: App Deployment.
permissions List<String>
List of permissions associated with the permission name.
scope String
Permission scope. Allowed permission levels are project or tenant or resource . Defaults to project.

Package Details

Repository
spectrocloud spectrocloud/terraform-provider-spectrocloud
License
Notes
This Pulumi package is based on the spectrocloud Terraform Provider.
spectrocloud 0.23.5 published on Sunday, Apr 20, 2025 by spectrocloud