-
Notifications
You must be signed in to change notification settings - Fork 8
/
getAuthScope.go
84 lines (79 loc) · 2.71 KB
/
getAuthScope.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package identity
import (
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Use this data source to get authentication information about the current
// auth scope in use. This can be used as self-discovery or introspection of
// the username or project name currently in use.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-openstack/sdk/v2/go/openstack/identity"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := identity.GetAuthScope(ctx, &identity.GetAuthScopeArgs{
// Name: "my_scope",
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
func GetAuthScope(ctx *pulumi.Context, args *GetAuthScopeArgs, opts ...pulumi.InvokeOption) (*GetAuthScopeResult, error) {
var rv GetAuthScopeResult
err := ctx.Invoke("openstack:identity/getAuthScope:getAuthScope", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getAuthScope.
type GetAuthScopeArgs struct {
// The name of the scope. This is an arbitrary name which is
// only used as a unique identifier so an actual token isn't used as the ID.
Name string `pulumi:"name"`
// The region in which to obtain the V3 Identity client.
// A Identity client is needed to retrieve tokens IDs. If omitted, the
// `region` argument of the provider is used.
Region *string `pulumi:"region"`
}
// A collection of values returned by getAuthScope.
type GetAuthScopeResult struct {
// The domain ID of the scope.
DomainId string `pulumi:"domainId"`
// The domain name of the scope.
DomainName string `pulumi:"domainName"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
Name string `pulumi:"name"`
// The domain ID of the project.
ProjectDomainId string `pulumi:"projectDomainId"`
// The domain name of the project.
ProjectDomainName string `pulumi:"projectDomainName"`
// The project ID of the scope.
ProjectId string `pulumi:"projectId"`
// The project name of the scope.
ProjectName string `pulumi:"projectName"`
Region string `pulumi:"region"`
// A list of roles in the current scope. See reference below.
Roles []GetAuthScopeRole `pulumi:"roles"`
// The domain ID of the user.
UserDomainId string `pulumi:"userDomainId"`
// The domain name of the user.
UserDomainName string `pulumi:"userDomainName"`
// The user ID the of the scope.
UserId string `pulumi:"userId"`
// The username of the scope.
UserName string `pulumi:"userName"`
}