github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/events/v1beta1/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 v1beta1 5 6 import ( 7 "context" 8 "reflect" 9 10 "errors" 11 corev1 "github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes/core/v1" 12 metav1 "github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes/meta/v1" 13 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 14 ) 15 16 // Event is a report of an event somewhere in the cluster. It generally denotes some state change in the system. 17 type Event struct { 18 pulumi.CustomResourceState 19 20 // What action was taken/failed regarding to the regarding object. 21 Action pulumi.StringPtrOutput `pulumi:"action"` 22 // 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 23 ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"` 24 // Deprecated field assuring backward compatibility with core.v1 Event type 25 DeprecatedCount pulumi.IntPtrOutput `pulumi:"deprecatedCount"` 26 // Deprecated field assuring backward compatibility with core.v1 Event type 27 DeprecatedFirstTimestamp pulumi.StringPtrOutput `pulumi:"deprecatedFirstTimestamp"` 28 // Deprecated field assuring backward compatibility with core.v1 Event type 29 DeprecatedLastTimestamp pulumi.StringPtrOutput `pulumi:"deprecatedLastTimestamp"` 30 // Deprecated field assuring backward compatibility with core.v1 Event type 31 DeprecatedSource corev1.EventSourcePtrOutput `pulumi:"deprecatedSource"` 32 // Required. Time when this Event was first observed. 33 EventTime pulumi.StringOutput `pulumi:"eventTime"` 34 // 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 35 Kind pulumi.StringPtrOutput `pulumi:"kind"` 36 Metadata metav1.ObjectMetaPtrOutput `pulumi:"metadata"` 37 // Optional. A human-readable description of the status of this operation. Maximal length of the note is 1kB, but libraries should be prepared to handle values up to 64kB. 38 Note pulumi.StringPtrOutput `pulumi:"note"` 39 // Why the action was taken. 40 Reason pulumi.StringPtrOutput `pulumi:"reason"` 41 // The object this Event is about. In most cases it's an Object reporting controller implements. E.g. ReplicaSetController implements ReplicaSets and this event is emitted because it acts on some changes in a ReplicaSet object. 42 Regarding corev1.ObjectReferencePtrOutput `pulumi:"regarding"` 43 // Optional secondary object for more complex actions. E.g. when regarding object triggers a creation or deletion of related object. 44 Related corev1.ObjectReferencePtrOutput `pulumi:"related"` 45 // Name of the controller that emitted this Event, e.g. `kubernetes.io/kubelet`. 46 ReportingController pulumi.StringPtrOutput `pulumi:"reportingController"` 47 // ID of the controller instance, e.g. `kubelet-xyzf`. 48 ReportingInstance pulumi.StringPtrOutput `pulumi:"reportingInstance"` 49 // Data about the Event series this event represents or nil if it's a singleton Event. 50 Series EventSeriesPtrOutput `pulumi:"series"` 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.EventTime == nil { 63 return nil, errors.New("invalid value for required argument 'EventTime'") 64 } 65 args.ApiVersion = pulumi.StringPtr("events.k8s.io/v1beta1") 66 args.Kind = pulumi.StringPtr("Event") 67 aliases := pulumi.Aliases([]pulumi.Alias{ 68 { 69 Type: pulumi.String("kubernetes:core/v1:Event"), 70 }, 71 { 72 Type: pulumi.String("kubernetes:events.k8s.io/v1:Event"), 73 }, 74 }) 75 opts = append(opts, aliases) 76 var resource Event 77 err := ctx.RegisterResource("kubernetes:events.k8s.io/v1beta1:Event", name, args, &resource, opts...) 78 if err != nil { 79 return nil, err 80 } 81 return &resource, nil 82 } 83 84 // GetEvent gets an existing Event resource's state with the given name, ID, and optional 85 // state properties that are used to uniquely qualify the lookup (nil if not required). 86 func GetEvent(ctx *pulumi.Context, 87 name string, id pulumi.IDInput, state *EventState, opts ...pulumi.ResourceOption) (*Event, error) { 88 var resource Event 89 err := ctx.ReadResource("kubernetes:events.k8s.io/v1beta1:Event", name, id, state, &resource, opts...) 90 if err != nil { 91 return nil, err 92 } 93 return &resource, nil 94 } 95 96 // Input properties used for looking up and filtering Event resources. 97 type eventState struct { 98 } 99 100 type EventState struct { 101 } 102 103 func (EventState) ElementType() reflect.Type { 104 return reflect.TypeOf((*eventState)(nil)).Elem() 105 } 106 107 type eventArgs struct { 108 // What action was taken/failed regarding to the regarding object. 109 Action *string `pulumi:"action"` 110 // 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 111 ApiVersion *string `pulumi:"apiVersion"` 112 // Deprecated field assuring backward compatibility with core.v1 Event type 113 DeprecatedCount *int `pulumi:"deprecatedCount"` 114 // Deprecated field assuring backward compatibility with core.v1 Event type 115 DeprecatedFirstTimestamp *string `pulumi:"deprecatedFirstTimestamp"` 116 // Deprecated field assuring backward compatibility with core.v1 Event type 117 DeprecatedLastTimestamp *string `pulumi:"deprecatedLastTimestamp"` 118 // Deprecated field assuring backward compatibility with core.v1 Event type 119 DeprecatedSource *corev1.EventSource `pulumi:"deprecatedSource"` 120 // Required. Time when this Event was first observed. 121 EventTime string `pulumi:"eventTime"` 122 // 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 123 Kind *string `pulumi:"kind"` 124 Metadata *metav1.ObjectMeta `pulumi:"metadata"` 125 // Optional. A human-readable description of the status of this operation. Maximal length of the note is 1kB, but libraries should be prepared to handle values up to 64kB. 126 Note *string `pulumi:"note"` 127 // Why the action was taken. 128 Reason *string `pulumi:"reason"` 129 // The object this Event is about. In most cases it's an Object reporting controller implements. E.g. ReplicaSetController implements ReplicaSets and this event is emitted because it acts on some changes in a ReplicaSet object. 130 Regarding *corev1.ObjectReference `pulumi:"regarding"` 131 // Optional secondary object for more complex actions. E.g. when regarding object triggers a creation or deletion of related object. 132 Related *corev1.ObjectReference `pulumi:"related"` 133 // Name of the controller that emitted this Event, e.g. `kubernetes.io/kubelet`. 134 ReportingController *string `pulumi:"reportingController"` 135 // ID of the controller instance, e.g. `kubelet-xyzf`. 136 ReportingInstance *string `pulumi:"reportingInstance"` 137 // Data about the Event series this event represents or nil if it's a singleton Event. 138 Series *EventSeries `pulumi:"series"` 139 // Type of this event (Normal, Warning), new types could be added in the future. 140 Type *string `pulumi:"type"` 141 } 142 143 // The set of arguments for constructing a Event resource. 144 type EventArgs struct { 145 // What action was taken/failed regarding to the regarding object. 146 Action pulumi.StringPtrInput 147 // 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 148 ApiVersion pulumi.StringPtrInput 149 // Deprecated field assuring backward compatibility with core.v1 Event type 150 DeprecatedCount pulumi.IntPtrInput 151 // Deprecated field assuring backward compatibility with core.v1 Event type 152 DeprecatedFirstTimestamp pulumi.StringPtrInput 153 // Deprecated field assuring backward compatibility with core.v1 Event type 154 DeprecatedLastTimestamp pulumi.StringPtrInput 155 // Deprecated field assuring backward compatibility with core.v1 Event type 156 DeprecatedSource corev1.EventSourcePtrInput 157 // Required. Time when this Event was first observed. 158 EventTime pulumi.StringInput 159 // 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 160 Kind pulumi.StringPtrInput 161 Metadata metav1.ObjectMetaPtrInput 162 // Optional. A human-readable description of the status of this operation. Maximal length of the note is 1kB, but libraries should be prepared to handle values up to 64kB. 163 Note pulumi.StringPtrInput 164 // Why the action was taken. 165 Reason pulumi.StringPtrInput 166 // The object this Event is about. In most cases it's an Object reporting controller implements. E.g. ReplicaSetController implements ReplicaSets and this event is emitted because it acts on some changes in a ReplicaSet object. 167 Regarding corev1.ObjectReferencePtrInput 168 // Optional secondary object for more complex actions. E.g. when regarding object triggers a creation or deletion of related object. 169 Related corev1.ObjectReferencePtrInput 170 // Name of the controller that emitted this Event, e.g. `kubernetes.io/kubelet`. 171 ReportingController pulumi.StringPtrInput 172 // ID of the controller instance, e.g. `kubelet-xyzf`. 173 ReportingInstance pulumi.StringPtrInput 174 // Data about the Event series this event represents or nil if it's a singleton Event. 175 Series EventSeriesPtrInput 176 // Type of this event (Normal, Warning), new types could be added in the future. 177 Type pulumi.StringPtrInput 178 } 179 180 func (EventArgs) ElementType() reflect.Type { 181 return reflect.TypeOf((*eventArgs)(nil)).Elem() 182 } 183 184 type EventInput interface { 185 pulumi.Input 186 187 ToEventOutput() EventOutput 188 ToEventOutputWithContext(ctx context.Context) EventOutput 189 } 190 191 func (*Event) ElementType() reflect.Type { 192 return reflect.TypeOf((**Event)(nil)).Elem() 193 } 194 195 func (i *Event) ToEventOutput() EventOutput { 196 return i.ToEventOutputWithContext(context.Background()) 197 } 198 199 func (i *Event) ToEventOutputWithContext(ctx context.Context) EventOutput { 200 return pulumi.ToOutputWithContext(ctx, i).(EventOutput) 201 } 202 203 // EventArrayInput is an input type that accepts EventArray and EventArrayOutput values. 204 // You can construct a concrete instance of `EventArrayInput` via: 205 // 206 // EventArray{ EventArgs{...} } 207 type EventArrayInput interface { 208 pulumi.Input 209 210 ToEventArrayOutput() EventArrayOutput 211 ToEventArrayOutputWithContext(context.Context) EventArrayOutput 212 } 213 214 type EventArray []EventInput 215 216 func (EventArray) ElementType() reflect.Type { 217 return reflect.TypeOf((*[]*Event)(nil)).Elem() 218 } 219 220 func (i EventArray) ToEventArrayOutput() EventArrayOutput { 221 return i.ToEventArrayOutputWithContext(context.Background()) 222 } 223 224 func (i EventArray) ToEventArrayOutputWithContext(ctx context.Context) EventArrayOutput { 225 return pulumi.ToOutputWithContext(ctx, i).(EventArrayOutput) 226 } 227 228 // EventMapInput is an input type that accepts EventMap and EventMapOutput values. 229 // You can construct a concrete instance of `EventMapInput` via: 230 // 231 // EventMap{ "key": EventArgs{...} } 232 type EventMapInput interface { 233 pulumi.Input 234 235 ToEventMapOutput() EventMapOutput 236 ToEventMapOutputWithContext(context.Context) EventMapOutput 237 } 238 239 type EventMap map[string]EventInput 240 241 func (EventMap) ElementType() reflect.Type { 242 return reflect.TypeOf((*map[string]*Event)(nil)).Elem() 243 } 244 245 func (i EventMap) ToEventMapOutput() EventMapOutput { 246 return i.ToEventMapOutputWithContext(context.Background()) 247 } 248 249 func (i EventMap) ToEventMapOutputWithContext(ctx context.Context) EventMapOutput { 250 return pulumi.ToOutputWithContext(ctx, i).(EventMapOutput) 251 } 252 253 type EventOutput struct{ *pulumi.OutputState } 254 255 func (EventOutput) ElementType() reflect.Type { 256 return reflect.TypeOf((**Event)(nil)).Elem() 257 } 258 259 func (o EventOutput) ToEventOutput() EventOutput { 260 return o 261 } 262 263 func (o EventOutput) ToEventOutputWithContext(ctx context.Context) EventOutput { 264 return o 265 } 266 267 // What action was taken/failed regarding to the regarding object. 268 func (o EventOutput) Action() pulumi.StringPtrOutput { 269 return o.ApplyT(func(v *Event) pulumi.StringPtrOutput { return v.Action }).(pulumi.StringPtrOutput) 270 } 271 272 // 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 273 func (o EventOutput) ApiVersion() pulumi.StringPtrOutput { 274 return o.ApplyT(func(v *Event) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput) 275 } 276 277 // Deprecated field assuring backward compatibility with core.v1 Event type 278 func (o EventOutput) DeprecatedCount() pulumi.IntPtrOutput { 279 return o.ApplyT(func(v *Event) pulumi.IntPtrOutput { return v.DeprecatedCount }).(pulumi.IntPtrOutput) 280 } 281 282 // Deprecated field assuring backward compatibility with core.v1 Event type 283 func (o EventOutput) DeprecatedFirstTimestamp() pulumi.StringPtrOutput { 284 return o.ApplyT(func(v *Event) pulumi.StringPtrOutput { return v.DeprecatedFirstTimestamp }).(pulumi.StringPtrOutput) 285 } 286 287 // Deprecated field assuring backward compatibility with core.v1 Event type 288 func (o EventOutput) DeprecatedLastTimestamp() pulumi.StringPtrOutput { 289 return o.ApplyT(func(v *Event) pulumi.StringPtrOutput { return v.DeprecatedLastTimestamp }).(pulumi.StringPtrOutput) 290 } 291 292 // Deprecated field assuring backward compatibility with core.v1 Event type 293 func (o EventOutput) DeprecatedSource() corev1.EventSourcePtrOutput { 294 return o.ApplyT(func(v *Event) corev1.EventSourcePtrOutput { return v.DeprecatedSource }).(corev1.EventSourcePtrOutput) 295 } 296 297 // Required. Time when this Event was first observed. 298 func (o EventOutput) EventTime() pulumi.StringOutput { 299 return o.ApplyT(func(v *Event) pulumi.StringOutput { return v.EventTime }).(pulumi.StringOutput) 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 func (o EventOutput) Metadata() metav1.ObjectMetaPtrOutput { 308 return o.ApplyT(func(v *Event) metav1.ObjectMetaPtrOutput { return v.Metadata }).(metav1.ObjectMetaPtrOutput) 309 } 310 311 // Optional. A human-readable description of the status of this operation. Maximal length of the note is 1kB, but libraries should be prepared to handle values up to 64kB. 312 func (o EventOutput) Note() pulumi.StringPtrOutput { 313 return o.ApplyT(func(v *Event) pulumi.StringPtrOutput { return v.Note }).(pulumi.StringPtrOutput) 314 } 315 316 // Why the action was taken. 317 func (o EventOutput) Reason() pulumi.StringPtrOutput { 318 return o.ApplyT(func(v *Event) pulumi.StringPtrOutput { return v.Reason }).(pulumi.StringPtrOutput) 319 } 320 321 // The object this Event is about. In most cases it's an Object reporting controller implements. E.g. ReplicaSetController implements ReplicaSets and this event is emitted because it acts on some changes in a ReplicaSet object. 322 func (o EventOutput) Regarding() corev1.ObjectReferencePtrOutput { 323 return o.ApplyT(func(v *Event) corev1.ObjectReferencePtrOutput { return v.Regarding }).(corev1.ObjectReferencePtrOutput) 324 } 325 326 // Optional secondary object for more complex actions. E.g. when regarding object triggers a creation or deletion of related object. 327 func (o EventOutput) Related() corev1.ObjectReferencePtrOutput { 328 return o.ApplyT(func(v *Event) corev1.ObjectReferencePtrOutput { return v.Related }).(corev1.ObjectReferencePtrOutput) 329 } 330 331 // Name of the controller that emitted this Event, e.g. `kubernetes.io/kubelet`. 332 func (o EventOutput) ReportingController() pulumi.StringPtrOutput { 333 return o.ApplyT(func(v *Event) pulumi.StringPtrOutput { return v.ReportingController }).(pulumi.StringPtrOutput) 334 } 335 336 // ID of the controller instance, e.g. `kubelet-xyzf`. 337 func (o EventOutput) ReportingInstance() pulumi.StringPtrOutput { 338 return o.ApplyT(func(v *Event) pulumi.StringPtrOutput { return v.ReportingInstance }).(pulumi.StringPtrOutput) 339 } 340 341 // Data about the Event series this event represents or nil if it's a singleton Event. 342 func (o EventOutput) Series() EventSeriesPtrOutput { 343 return o.ApplyT(func(v *Event) EventSeriesPtrOutput { return v.Series }).(EventSeriesPtrOutput) 344 } 345 346 // Type of this event (Normal, Warning), new types could be added in the future. 347 func (o EventOutput) Type() pulumi.StringPtrOutput { 348 return o.ApplyT(func(v *Event) pulumi.StringPtrOutput { return v.Type }).(pulumi.StringPtrOutput) 349 } 350 351 type EventArrayOutput struct{ *pulumi.OutputState } 352 353 func (EventArrayOutput) ElementType() reflect.Type { 354 return reflect.TypeOf((*[]*Event)(nil)).Elem() 355 } 356 357 func (o EventArrayOutput) ToEventArrayOutput() EventArrayOutput { 358 return o 359 } 360 361 func (o EventArrayOutput) ToEventArrayOutputWithContext(ctx context.Context) EventArrayOutput { 362 return o 363 } 364 365 func (o EventArrayOutput) Index(i pulumi.IntInput) EventOutput { 366 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Event { 367 return vs[0].([]*Event)[vs[1].(int)] 368 }).(EventOutput) 369 } 370 371 type EventMapOutput struct{ *pulumi.OutputState } 372 373 func (EventMapOutput) ElementType() reflect.Type { 374 return reflect.TypeOf((*map[string]*Event)(nil)).Elem() 375 } 376 377 func (o EventMapOutput) ToEventMapOutput() EventMapOutput { 378 return o 379 } 380 381 func (o EventMapOutput) ToEventMapOutputWithContext(ctx context.Context) EventMapOutput { 382 return o 383 } 384 385 func (o EventMapOutput) MapIndex(k pulumi.StringInput) EventOutput { 386 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Event { 387 return vs[0].(map[string]*Event)[vs[1].(string)] 388 }).(EventOutput) 389 } 390 391 func init() { 392 pulumi.RegisterInputType(reflect.TypeOf((*EventInput)(nil)).Elem(), &Event{}) 393 pulumi.RegisterInputType(reflect.TypeOf((*EventArrayInput)(nil)).Elem(), EventArray{}) 394 pulumi.RegisterInputType(reflect.TypeOf((*EventMapInput)(nil)).Elem(), EventMap{}) 395 pulumi.RegisterOutputType(EventOutput{}) 396 pulumi.RegisterOutputType(EventArrayOutput{}) 397 pulumi.RegisterOutputType(EventMapOutput{}) 398 }