Skip to content

Commit

Permalink
Merge pull request #17 from Jason-Zhang9309/dev
Browse files Browse the repository at this point in the history
add ces examples
  • Loading branch information
Jason-Zhang9309 authored Jan 23, 2025
2 parents de7b193 + b25133c commit a79055d
Show file tree
Hide file tree
Showing 9 changed files with 200 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ kind: Provider
metadata:
name: provider-huaweicloud
spec:
package: xpkg.upbound.io/hcs/provider-huaweicloud:v0.0.8
package: xpkg.upbound.io/hcs/provider-huaweicloud:v0.0.9
```
Define the provider version with `spec.package`.
Expand All @@ -22,7 +22,7 @@ Verify the configuration with `kubectl get providers`.
```shell
$ kubectl get providers
NAME INSTALLED HEALTHY PACKAGE AGE
provider-huaweicloud True True xpkg.upbound.io/hcs/provider-huaweicloud:v0.0.8 54s
provider-huaweicloud True True xpkg.upbound.io/hcs/provider-huaweicloud:v0.0.9 54s
```

View the Crossplane [Provider CRD definition](https://doc.crds.dev/github.com/huaweicloud/provider-huaweicloud) to view all available `Provider` options.
Expand Down
46 changes: 46 additions & 0 deletions examples/ces/alarmrule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
apiVersion: ces.huaweicloud.crossplane.io/v1alpha1
kind: Alarmrule
metadata:
annotations:
meta.upbound.io/example-id: ces/v1alpha1/alarmrule
labels:
testing.upbound.io/example-name: test
name: test
spec:
forProvider:
alarmActionEnabled: true
alarmActions:
- notificationList:
- the_topic_urn
type: notification
alarmEnabled: true
alarmName: rule-test
alarmType: MULTI_INSTANCE
condition:
- alarmLevel: 4
comparisonOperator: '>'
count: 1
filter: average
metricName: network_outgoing_bytes_rate_inband
period: 1200
suppressDuration: 300
unit: B/s
value: 6.5
- alarmLevel: 4
comparisonOperator: '>='
count: 1
filter: average
metricName: network_outgoing_bytes_rate_inband
period: 3600
suppressDuration: 300
unit: B/s
value: 20
metric:
- namespace: SYS.ECS
resources:
- dimensions:
- name: instance_id
value: the_instance_id_1
- dimensions:
- name: instance_id
value: the_instance_id_2
23 changes: 23 additions & 0 deletions examples/ces/alarmtemplate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: ces.huaweicloud.crossplane.io/v1alpha1
kind: AlarmTemplate
metadata:
annotations:
meta.upbound.io/example-id: ces/v1alpha1/alarmtemplate
labels:
testing.upbound.io/example-name: test
name: test
spec:
forProvider:
name: the_name
policies:
- alarmLevel: 2
comparisonOperator: '>='
count: 3
dimensionName: api_id
filter: average
metricName: req_count_2xx
namespace: SYS.APIG
period: 1
suppressDuration: 43200
unit: times/minute
value: "10"
12 changes: 12 additions & 0 deletions examples/ces/dashboard.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: ces.huaweicloud.crossplane.io/v1alpha1
kind: Dashboard
metadata:
annotations:
meta.upbound.io/example-id: ces/v1alpha1/dashboard
labels:
testing.upbound.io/example-name: test
name: test
spec:
forProvider:
name: the_name
rowWidgetNum: the_row_widget_num
29 changes: 29 additions & 0 deletions examples/ces/dashboardwidget.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: ces.huaweicloud.crossplane.io/v1alpha1
kind: DashboardWidget
metadata:
annotations:
meta.upbound.io/example-id: ces/v1alpha1/dashboardwidget
labels:
testing.upbound.io/example-name: test
name: test
spec:
forProvider:
dashboardIdSelector:
matchLabels:
testing.upbound.io/example-name: example
location:
- height: the_height
left: the_left
top: the_top
width: the_width
metricDisplayMode: single
metrics:
- dimensions:
- filterType: specific_instances
name: instance_id
values:
- the_instance_id
metricName: cpu_util
namespace: SYS.ECS
title: the_title
view: line
20 changes: 20 additions & 0 deletions examples/ces/eventreport.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: ces.huaweicloud.crossplane.io/v1alpha1
kind: EventReport
metadata:
annotations:
meta.upbound.io/example-id: ces/v1alpha1/eventreport
labels:
testing.upbound.io/example-name: test
name: test
spec:
forProvider:
detail:
- content: the_content
level: Major
resourceId: the_resource_id
resourceName: the_resource_name
state: normal
user: the_user
name: the_name
source: the_source
time: the_time
26 changes: 26 additions & 0 deletions examples/ces/oneclickalarm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: ces.huaweicloud.crossplane.io/v1alpha1
kind: OneClickAlarm
metadata:
annotations:
meta.upbound.io/example-id: ces/v1alpha1/oneclickalarm
labels:
testing.upbound.io/example-name: test
name: test
spec:
forProvider:
alarmNotifications:
- notificationList:
- the_notification_object
type: notification
dimensionNames:
- event: true
metric:
- bucket_name
notificationBeginTime: "00:00"
notificationEnabled: true
notificationEndTime: "23:59"
okNotifications:
- notificationList:
- the_notification_object
type: notification
oneClickAlarmId: OBSSystemOneClickAlarm
41 changes: 41 additions & 0 deletions examples/ces/resourcegroup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
apiVersion: ces.huaweicloud.crossplane.io/v1alpha1
kind: ResourceGroup
metadata:
annotations:
meta.upbound.io/example-id: ces/v1alpha1/resourcegroup
labels:
testing.upbound.io/example-name: test
name: test
spec:
forProvider:
name: test
resources:
- dimensions:
- name: instance_id
value: vm_1_id
namespace: SYS.ECS
- dimensions:
- name: disk_name
value: vm_1_id-sda
namespace: SYS.EVS

---

apiVersion: ecs.huaweicloud.crossplane.io/v1alpha1
kind: Instance
metadata:
annotations:
meta.upbound.io/example-id: ces/v1alpha1/resourcegroup
labels:
testing.upbound.io/example-name: vm_1
name: vm-1
spec:
forProvider:
availabilityZone: the_availability_zone
flavorId: the_flavor_id
imageId: the_image_id
name: ecs-test
network:
- uuid: the_subnet_id
securityGroupIds:
- the_security_group_id
2 changes: 1 addition & 1 deletion examples/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Provider
metadata:
name: provider-huaweicloud
spec:
package: xpkg.upbound.io/hcs/provider-huaweicloud:v0.0.8
package: xpkg.upbound.io/hcs/provider-huaweicloud:v0.0.9
controllerConfigRef:
name: debug-config

Expand Down

0 comments on commit a79055d

Please sign in to comment.