1. Packages
  2. MSSQL
  3. API Docs
  4. getServerRoles
Microsoft SQL Server v0.1.0 published on Tuesday, Oct 8, 2024 by pulumiverse

mssql.getServerRoles

Explore with Pulumi AI

mssql logo
Microsoft SQL Server v0.1.0 published on Tuesday, Oct 8, 2024 by pulumiverse

    Obtains information about all roles defined in the server.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as mssql from "@pulumi/mssql";
    
    const all = mssql.getServerRoles({});
    export const roles = all.then(all => all.roles);
    
    import pulumi
    import pulumi_mssql as mssql
    
    all = mssql.get_server_roles()
    pulumi.export("roles", all.roles)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-mssql/sdk/go/mssql"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		all, err := mssql.GetServerRoles(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("roles", all.Roles)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Mssql = Pulumi.Mssql;
    
    return await Deployment.RunAsync(() => 
    {
        var all = Mssql.GetServerRoles.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["roles"] = all.Apply(getServerRolesResult => getServerRolesResult.Roles),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.mssql.MssqlFunctions;
    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 all = MssqlFunctions.getServerRoles();
    
            ctx.export("roles", all.applyValue(getServerRolesResult -> getServerRolesResult.roles()));
        }
    }
    
    variables:
      all:
        fn::invoke:
          Function: mssql:getServerRoles
          Arguments: {}
    outputs:
      roles: ${all.roles}
    

    Using getServerRoles

    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 getServerRoles(opts?: InvokeOptions): Promise<GetServerRolesResult>
    function getServerRolesOutput(opts?: InvokeOptions): Output<GetServerRolesResult>
    def get_server_roles(opts: Optional[InvokeOptions] = None) -> GetServerRolesResult
    def get_server_roles_output(opts: Optional[InvokeOptions] = None) -> Output[GetServerRolesResult]
    func GetServerRoles(ctx *Context, opts ...InvokeOption) (*GetServerRolesResult, error)
    func GetServerRolesOutput(ctx *Context, opts ...InvokeOption) GetServerRolesResultOutput

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

    public static class GetServerRoles 
    {
        public static Task<GetServerRolesResult> InvokeAsync(InvokeOptions? opts = null)
        public static Output<GetServerRolesResult> Invoke(InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetServerRolesResult> getServerRoles(InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: mssql:index/getServerRoles:getServerRoles
      arguments:
        # arguments dictionary

    getServerRoles Result

    The following output properties are available:

    Id string
    Roles List<Pulumiverse.Mssql.Outputs.GetServerRolesRole>
    Set of all roles found in the server
    Id string
    Roles []GetServerRolesRole
    Set of all roles found in the server
    id String
    roles List<GetServerRolesRole>
    Set of all roles found in the server
    id string
    roles GetServerRolesRole[]
    Set of all roles found in the server
    id str
    roles Sequence[GetServerRolesRole]
    Set of all roles found in the server
    id String
    roles List<Property Map>
    Set of all roles found in the server

    Supporting Types

    GetServerRolesRole

    Id string
    Role principal ID.
    Name string
    Role name. Must follow Regular Identifiers rules and cannot be longer than 128 chars.
    OwnerId string
    ID of another server role or login owning this role. Can be retrieved using mssql.ServerRole or mssql.SqlLogin.
    Id string
    Role principal ID.
    Name string
    Role name. Must follow Regular Identifiers rules and cannot be longer than 128 chars.
    OwnerId string
    ID of another server role or login owning this role. Can be retrieved using mssql.ServerRole or mssql.SqlLogin.
    id String
    Role principal ID.
    name String
    Role name. Must follow Regular Identifiers rules and cannot be longer than 128 chars.
    ownerId String
    ID of another server role or login owning this role. Can be retrieved using mssql.ServerRole or mssql.SqlLogin.
    id string
    Role principal ID.
    name string
    Role name. Must follow Regular Identifiers rules and cannot be longer than 128 chars.
    ownerId string
    ID of another server role or login owning this role. Can be retrieved using mssql.ServerRole or mssql.SqlLogin.
    id str
    Role principal ID.
    name str
    Role name. Must follow Regular Identifiers rules and cannot be longer than 128 chars.
    owner_id str
    ID of another server role or login owning this role. Can be retrieved using mssql.ServerRole or mssql.SqlLogin.
    id String
    Role principal ID.
    name String
    Role name. Must follow Regular Identifiers rules and cannot be longer than 128 chars.
    ownerId String
    ID of another server role or login owning this role. Can be retrieved using mssql.ServerRole or mssql.SqlLogin.

    Package Details

    Repository
    mssql pulumiverse/pulumi-mssql
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the mssql Terraform Provider.
    mssql logo
    Microsoft SQL Server v0.1.0 published on Tuesday, Oct 8, 2024 by pulumiverse