github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/core/v1/event.go (about) 1 // Code generated by pulumigen DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package v1 5 6 import ( 7 "context" 8 "reflect" 9 10 "errors" 11 metav1 "github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes/meta/v1" 12 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 13 ) 14 15 // Event is a report of an event somewhere in the cluster. Events have a limited retention time and triggers and messages may evolve with time. Event consumers should not rely on the timing of an event with a given Reason reflecting a consistent underlying trigger, or the continued existence of events with that Reason. Events should be treated as informative, best-effort, supplemental data. 16 type Event struct { 17 pulumi.CustomResourceState 18 19 // What action was taken/failed regarding to the Regarding object. 20 Action pulumi.StringPtrOutput `pulumi:"action"` 21 // APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources 22 ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"` 23 // The number of times this event has occurred. 24 Count pulumi.IntPtrOutput `pulumi:"count"` 25 // Time when this Event was first observed. 26 EventTime pulumi.StringPtrOutput `pulumi:"eventTime"` 27 // The time at which the event was first recorded. (Time of server receipt is in TypeMeta.) 28 FirstTimestamp pulumi.StringPtrOutput `pulumi:"firstTimestamp"` 29 // The object that this event is about. 30 InvolvedObject ObjectReferenceOutput `pulumi:"involvedObject"` 31 // Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 32 Kind pulumi.StringPtrOutput `pulumi:"kind"` 33 // The time at which the most recent occurrence of this event was recorded. 34 LastTimestamp pulumi.StringPtrOutput `pulumi:"lastTimestamp"` 35 // A human-readable description of the status of this operation. 36 Message pulumi.StringPtrOutput `pulumi:"message"` 37 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 38 Metadata metav1.ObjectMetaOutput `pulumi:"metadata"` 39 // This should be a short, machine understandable string that gives the reason for the transition into the object's current status. 40 Reason pulumi.StringPtrOutput `pulumi:"reason"` 41 // Optional secondary object for more complex actions. 42 Related ObjectReferencePtrOutput `pulumi:"related"` 43 // Name of the controller that emitted this Event, e.g. `kubernetes.io/kubelet`. 44 ReportingComponent pulumi.StringPtrOutput `pulumi:"reportingComponent"` 45 // ID of the controller instance, e.g. `kubelet-xyzf`. 46 ReportingInstance pulumi.StringPtrOutput `pulumi:"reportingInstance"` 47 // Data about the Event series this event represents or nil if it's a singleton Event. 48 Series EventSeriesPtrOutput `pulumi:"series"` 49 // The component reporting this event. Should be a short machine understandable string. 50 Source EventSourcePtrOutput `pulumi:"source"` 51 // Type of this event (Normal, Warning), new types could be added in the future 52 Type pulumi.StringPtrOutput `pulumi:"type"` 53 } 54 55 // NewEvent registers a new resource with the given unique name, arguments, and options. 56 func NewEvent(ctx *pulumi.Context, 57 name string, args *EventArgs, opts ...pulumi.ResourceOption) (*Event, error) { 58 if args == nil { 59 return nil, errors.New("missing one or more required arguments") 60 } 61 62 if args.InvolvedObject == nil { 63 return nil, errors.New("invalid value for required argument 'InvolvedObject'") 64 } 65 if args.Metadata == nil { 66 return nil, errors.New("invalid value for required argument 'Metadata'") 67 } 68 args.ApiVersion = pulumi.StringPtr("v1") 69 args.Kind = pulumi.StringPtr("Event") 70 aliases := pulumi.Aliases([]pulumi.Alias{ 71 { 72 Type: pulumi.String("kubernetes:events.k8s.io/v1:Event"), 73 }, 74 { 75 Type: pulumi.String("kubernetes:events.k8s.io/v1beta1:Event"), 76 }, 77 }) 78 opts = append(opts, aliases) 79 var resource Event 80 err := ctx.RegisterResource("kubernetes:core/v1:Event", name, args, &resource, opts...) 81 if err != nil { 82 return nil, err 83 } 84 return &resource, nil 85 } 86 87 // GetEvent gets an existing Event resource's state with the given name, ID, and optional 88 // state properties that are used to uniquely qualify the lookup (nil if not required). 89 func GetEvent(ctx *pulumi.Context, 90 name string, id pulumi.IDInput, state *EventState, opts ...pulumi.ResourceOption) (*Event, error) { 91 var resource Event 92 err := ctx.ReadResource("kubernetes:core/v1:Event", name, id, state, &resource, opts...) 93 if err != nil { 94 return nil, err 95 } 96 return &resource, nil 97 } 98 99 // Input properties used for looking up and filtering Event resources. 100 type eventState struct { 101 } 102 103 type EventState struct { 104 } 105 106 func (EventState) ElementType() reflect.Type { 107 return reflect.TypeOf((*eventState)(nil)).Elem() 108 } 109 110 type eventArgs struct { 111 // What action was taken/failed regarding to the Regarding object. 112 Action *string `pulumi:"action"` 113 // APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources 114 ApiVersion *string `pulumi:"apiVersion"` 115 // The number of times this event has occurred. 116 Count *int `pulumi:"count"` 117 // Time when this Event was first observed. 118 EventTime *string `pulumi:"eventTime"` 119 // The time at which the event was first recorded. (Time of server receipt is in TypeMeta.) 120 FirstTimestamp *string `pulumi:"firstTimestamp"` 121 // The object that this event is about. 122 InvolvedObject ObjectReference `pulumi:"involvedObject"` 123 // Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 124 Kind *string `pulumi:"kind"` 125 // The time at which the most recent occurrence of this event was recorded. 126 LastTimestamp *string `pulumi:"lastTimestamp"` 127 // A human-readable description of the status of this operation. 128 Message *string `pulumi:"message"` 129 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 130 Metadata metav1.ObjectMeta `pulumi:"metadata"` 131 // This should be a short, machine understandable string that gives the reason for the transition into the object's current status. 132 Reason *string `pulumi:"reason"` 133 // Optional secondary object for more complex actions. 134 Related *ObjectReference `pulumi:"related"` 135 // Name of the controller that emitted this Event, e.g. `kubernetes.io/kubelet`. 136 ReportingComponent *string `pulumi:"reportingComponent"` 137 // ID of the controller instance, e.g. `kubelet-xyzf`. 138 ReportingInstance *string `pulumi:"reportingInstance"` 139 // Data about the Event series this event represents or nil if it's a singleton Event. 140 Series *EventSeries `pulumi:"series"` 141 // The component reporting this event. Should be a short machine understandable string. 142 Source *EventSource `pulumi:"source"` 143 // Type of this event (Normal, Warning), new types could be added in the future 144 Type *string `pulumi:"type"` 145 } 146 147 // The set of arguments for constructing a Event resource. 148 type EventArgs struct { 149 // What action was taken/failed regarding to the Regarding object. 150 Action pulumi.StringPtrInput 151 // APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources 152 ApiVersion pulumi.StringPtrInput 153 // The number of times this event has occurred. 154 Count pulumi.IntPtrInput 155 // Time when this Event was first observed. 156 EventTime pulumi.StringPtrInput 157 // The time at which the event was first recorded. (Time of server receipt is in TypeMeta.) 158 FirstTimestamp pulumi.StringPtrInput 159 // The object that this event is about. 160 InvolvedObject ObjectReferenceInput 161 // Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 162 Kind pulumi.StringPtrInput 163 // The time at which the most recent occurrence of this event was recorded. 164 LastTimestamp pulumi.StringPtrInput 165 // A human-readable description of the status of this operation. 166 Message pulumi.StringPtrInput 167 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 168 Metadata metav1.ObjectMetaInput 169 // This should be a short, machine understandable string that gives the reason for the transition into the object's current status. 170 Reason pulumi.StringPtrInput 171 // Optional secondary object for more complex actions. 172 Related ObjectReferencePtrInput 173 // Name of the controller that emitted this Event, e.g. `kubernetes.io/kubelet`. 174 ReportingComponent pulumi.StringPtrInput 175 // ID of the controller instance, e.g. `kubelet-xyzf`. 176 ReportingInstance pulumi.StringPtrInput 177 // Data about the Event series this event represents or nil if it's a singleton Event. 178 Series EventSeriesPtrInput 179 // The component reporting this event. Should be a short machine understandable string. 180 Source EventSourcePtrInput 181 // Type of this event (Normal, Warning), new types could be added in the future 182 Type pulumi.StringPtrInput 183 } 184 185 func (EventArgs) ElementType() reflect.Type { 186 return reflect.TypeOf((*eventArgs)(nil)).Elem() 187 } 188 189 type EventInput interface { 190 pulumi.Input 191 192 ToEventOutput() EventOutput 193 ToEventOutputWithContext(ctx context.Context) EventOutput 194 } 195 196 func (*Event) ElementType() reflect.Type { 197 return reflect.TypeOf((**Event)(nil)).Elem() 198 } 199 200 func (i *Event) ToEventOutput() EventOutput { 201 return i.ToEventOutputWithContext(context.Background()) 202 } 203 204 func (i *Event) ToEventOutputWithContext(ctx context.Context) EventOutput { 205 return pulumi.ToOutputWithContext(ctx, i).(EventOutput) 206 } 207 208 // EventArrayInput is an input type that accepts EventArray and EventArrayOutput values. 209 // You can construct a concrete instance of `EventArrayInput` via: 210 // 211 // EventArray{ EventArgs{...} } 212 type EventArrayInput interface { 213 pulumi.Input 214 215 ToEventArrayOutput() EventArrayOutput 216 ToEventArrayOutputWithContext(context.Context) EventArrayOutput 217 } 218 219 type EventArray []EventInput 220 221 func (EventArray) ElementType() reflect.Type { 222 return reflect.TypeOf((*[]*Event)(nil)).Elem() 223 } 224 225 func (i EventArray) ToEventArrayOutput() EventArrayOutput { 226 return i.ToEventArrayOutputWithContext(context.Background()) 227 } 228 229 func (i EventArray) ToEventArrayOutputWithContext(ctx context.Context) EventArrayOutput { 230 return pulumi.ToOutputWithContext(ctx, i).(EventArrayOutput) 231 } 232 233 // EventMapInput is an input type that accepts EventMap and EventMapOutput values. 234 // You can construct a concrete instance of `EventMapInput` via: 235 // 236 // EventMap{ "key": EventArgs{...} } 237 type EventMapInput interface { 238 pulumi.Input 239 240 ToEventMapOutput() EventMapOutput 241 ToEventMapOutputWithContext(context.Context) EventMapOutput 242 } 243 244 type EventMap map[string]EventInput 245 246 func (EventMap) ElementType() reflect.Type { 247 return reflect.TypeOf((*map[string]*Event)(nil)).Elem() 248 } 249 250 func (i EventMap) ToEventMapOutput() EventMapOutput { 251 return i.ToEventMapOutputWithContext(context.Background()) 252 } 253 254 func (i EventMap) ToEventMapOutputWithContext(ctx context.Context) EventMapOutput { 255 return pulumi.ToOutputWithContext(ctx, i).(EventMapOutput) 256 } 257 258 type EventOutput struct{ *pulumi.OutputState } 259 260 func (EventOutput) ElementType() reflect.Type { 261 return reflect.TypeOf((**Event)(nil)).Elem() 262 } 263 264 func (o EventOutput) ToEventOutput() EventOutput { 265 return o 266 } 267 268 func (o EventOutput) ToEventOutputWithContext(ctx context.Context) EventOutput { 269 return o 270 } 271 272 // What action was taken/failed regarding to the Regarding object. 273 func (o EventOutput) Action() pulumi.StringPtrOutput { 274 return o.ApplyT(func(v *Event) pulumi.StringPtrOutput { return v.Action }).(pulumi.StringPtrOutput) 275 } 276 277 // APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources 278 func (o EventOutput) ApiVersion() pulumi.StringPtrOutput { 279 return o.ApplyT(func(v *Event) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput) 280 } 281 282 // The number of times this event has occurred. 283 func (o EventOutput) Count() pulumi.IntPtrOutput { 284 return o.ApplyT(func(v *Event) pulumi.IntPtrOutput { return v.Count }).(pulumi.IntPtrOutput) 285 } 286 287 // Time when this Event was first observed. 288 func (o EventOutput) EventTime() pulumi.StringPtrOutput { 289 return o.ApplyT(func(v *Event) pulumi.StringPtrOutput { return v.EventTime }).(pulumi.StringPtrOutput) 290 } 291 292 // The time at which the event was first recorded. (Time of server receipt is in TypeMeta.) 293 func (o EventOutput) FirstTimestamp() pulumi.StringPtrOutput { 294 return o.ApplyT(func(v *Event) pulumi.StringPtrOutput { return v.FirstTimestamp }).(pulumi.StringPtrOutput) 295 } 296 297 // The object that this event is about. 298 func (o EventOutput) InvolvedObject() ObjectReferenceOutput { 299 return o.ApplyT(func(v *Event) ObjectReferenceOutput { return v.InvolvedObject }).(ObjectReferenceOutput) 300 } 301 302 // Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 303 func (o EventOutput) Kind() pulumi.StringPtrOutput { 304 return o.ApplyT(func(v *Event) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput) 305 } 306 307 // The time at which the most recent occurrence of this event was recorded. 308 func (o EventOutput) LastTimestamp() pulumi.StringPtrOutput { 309 return o.ApplyT(func(v *Event) pulumi.StringPtrOutput { return v.LastTimestamp }).(pulumi.StringPtrOutput) 310 } 311 312 // A human-readable description of the status of this operation. 313 func (o EventOutput) Message() pulumi.StringPtrOutput { 314 return o.ApplyT(func(v *Event) pulumi.StringPtrOutput { return v.Message }).(pulumi.StringPtrOutput) 315 } 316 317 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 318 func (o EventOutput) Metadata() metav1.ObjectMetaOutput { 319 return o.ApplyT(func(v *Event) metav1.ObjectMetaOutput { return v.Metadata }).(metav1.ObjectMetaOutput) 320 } 321 322 // This should be a short, machine understandable string that gives the reason for the transition into the object's current status. 323 func (o EventOutput) Reason() pulumi.StringPtrOutput { 324 return o.ApplyT(func(v *Event) pulumi.StringPtrOutput { return v.Reason }).(pulumi.StringPtrOutput) 325 } 326 327 // Optional secondary object for more complex actions. 328 func (o EventOutput) Related() ObjectReferencePtrOutput { 329 return o.ApplyT(func(v *Event) ObjectReferencePtrOutput { return v.Related }).(ObjectReferencePtrOutput) 330 } 331 332 // Name of the controller that emitted this Event, e.g. `kubernetes.io/kubelet`. 333 func (o EventOutput) ReportingComponent() pulumi.StringPtrOutput { 334 return o.ApplyT(func(v *Event) pulumi.StringPtrOutput { return v.ReportingComponent }).(pulumi.StringPtrOutput) 335 } 336 337 // ID of the controller instance, e.g. `kubelet-xyzf`. 338 func (o EventOutput) ReportingInstance() pulumi.StringPtrOutput { 339 return o.ApplyT(func(v *Event) pulumi.StringPtrOutput { return v.ReportingInstance }).(pulumi.StringPtrOutput) 340 } 341 342 // Data about the Event series this event represents or nil if it's a singleton Event. 343 func (o EventOutput) Series() EventSeriesPtrOutput { 344 return o.ApplyT(func(v *Event) EventSeriesPtrOutput { return v.Series }).(EventSeriesPtrOutput) 345 } 346 347 // The component reporting this event. Should be a short machine understandable string. 348 func (o EventOutput) Source() EventSourcePtrOutput { 349 return o.ApplyT(func(v *Event) EventSourcePtrOutput { return v.Source }).(EventSourcePtrOutput) 350 } 351 352 // Type of this event (Normal, Warning), new types could be added in the future 353 func (o EventOutput) Type() pulumi.StringPtrOutput { 354 return o.ApplyT(func(v *Event) pulumi.StringPtrOutput { return v.Type }).(pulumi.StringPtrOutput) 355 } 356 357 type EventArrayOutput struct{ *pulumi.OutputState } 358 359 func (EventArrayOutput) ElementType() reflect.Type { 360 return reflect.TypeOf((*[]*Event)(nil)).Elem() 361 } 362 363 func (o EventArrayOutput) ToEventArrayOutput() EventArrayOutput { 364 return o 365 } 366 367 func (o EventArrayOutput) ToEventArrayOutputWithContext(ctx context.Context) EventArrayOutput { 368 return o 369 } 370 371 func (o EventArrayOutput) Index(i pulumi.IntInput) EventOutput { 372 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Event { 373 return vs[0].([]*Event)[vs[1].(int)] 374 }).(EventOutput) 375 } 376 377 type EventMapOutput struct{ *pulumi.OutputState } 378 379 func (EventMapOutput) ElementType() reflect.Type { 380 return reflect.TypeOf((*map[string]*Event)(nil)).Elem() 381 } 382 383 func (o EventMapOutput) ToEventMapOutput() EventMapOutput { 384 return o 385 } 386 387 func (o EventMapOutput) ToEventMapOutputWithContext(ctx context.Context) EventMapOutput { 388 return o 389 } 390 391 func (o EventMapOutput) MapIndex(k pulumi.StringInput) EventOutput { 392 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Event { 393 return vs[0].(map[string]*Event)[vs[1].(string)] 394 }).(EventOutput) 395 } 396 397 func init() { 398 pulumi.RegisterInputType(reflect.TypeOf((*EventInput)(nil)).Elem(), &Event{}) 399 pulumi.RegisterInputType(reflect.TypeOf((*EventArrayInput)(nil)).Elem(), EventArray{}) 400 pulumi.RegisterInputType(reflect.TypeOf((*EventMapInput)(nil)).Elem(), EventMap{}) 401 pulumi.RegisterOutputType(EventOutput{}) 402 pulumi.RegisterOutputType(EventArrayOutput{}) 403 pulumi.RegisterOutputType(EventMapOutput{}) 404 }