generated from pulumi/pulumi-tf-provider-boilerplate
/
getContainerRepository.go
128 lines (111 loc) · 4.49 KB
/
getContainerRepository.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package yandex
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Get information about a Yandex Container Repository. For more information, see
// [the official documentation](https://cloud.yandex.com/docs/container-registry/concepts/repository)
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-yandex/sdk/go/yandex"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err = yandex.LookupContainerRepository(ctx, &GetContainerRepositoryArgs{
// Name: pulumi.StringRef("some_repository_name"),
// }, nil)
// if err != nil {
// return err
// }
// _, err = yandex.LookupContainerRepository(ctx, &GetContainerRepositoryArgs{
// RepositoryId: pulumi.StringRef("some_repository_id"),
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func LookupContainerRepository(ctx *pulumi.Context, args *LookupContainerRepositoryArgs, opts ...pulumi.InvokeOption) (*LookupContainerRepositoryResult, error) {
opts = pkgInvokeDefaultOpts(opts)
var rv LookupContainerRepositoryResult
err := ctx.Invoke("yandex:index/getContainerRepository:getContainerRepository", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getContainerRepository.
type LookupContainerRepositoryArgs struct {
// Name of the repository. The name of the repository should start with id of a container registry and match the name of the images in the repository.
Name *string `pulumi:"name"`
// The ID of a specific repository.
RepositoryId *string `pulumi:"repositoryId"`
}
// A collection of values returned by getContainerRepository.
type LookupContainerRepositoryResult struct {
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
Name string `pulumi:"name"`
RepositoryId string `pulumi:"repositoryId"`
}
func LookupContainerRepositoryOutput(ctx *pulumi.Context, args LookupContainerRepositoryOutputArgs, opts ...pulumi.InvokeOption) LookupContainerRepositoryResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupContainerRepositoryResult, error) {
args := v.(LookupContainerRepositoryArgs)
r, err := LookupContainerRepository(ctx, &args, opts...)
var s LookupContainerRepositoryResult
if r != nil {
s = *r
}
return s, err
}).(LookupContainerRepositoryResultOutput)
}
// A collection of arguments for invoking getContainerRepository.
type LookupContainerRepositoryOutputArgs struct {
// Name of the repository. The name of the repository should start with id of a container registry and match the name of the images in the repository.
Name pulumi.StringPtrInput `pulumi:"name"`
// The ID of a specific repository.
RepositoryId pulumi.StringPtrInput `pulumi:"repositoryId"`
}
func (LookupContainerRepositoryOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupContainerRepositoryArgs)(nil)).Elem()
}
// A collection of values returned by getContainerRepository.
type LookupContainerRepositoryResultOutput struct{ *pulumi.OutputState }
func (LookupContainerRepositoryResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupContainerRepositoryResult)(nil)).Elem()
}
func (o LookupContainerRepositoryResultOutput) ToLookupContainerRepositoryResultOutput() LookupContainerRepositoryResultOutput {
return o
}
func (o LookupContainerRepositoryResultOutput) ToLookupContainerRepositoryResultOutputWithContext(ctx context.Context) LookupContainerRepositoryResultOutput {
return o
}
// The provider-assigned unique ID for this managed resource.
func (o LookupContainerRepositoryResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupContainerRepositoryResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o LookupContainerRepositoryResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupContainerRepositoryResult) string { return v.Name }).(pulumi.StringOutput)
}
func (o LookupContainerRepositoryResultOutput) RepositoryId() pulumi.StringOutput {
return o.ApplyT(func(v LookupContainerRepositoryResult) string { return v.RepositoryId }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupContainerRepositoryResultOutput{})
}