Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix slo.Target nil dereference #546

Merged
merged 3 commits into from
Sep 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 28 additions & 27 deletions plugins/slo/pkg/apis/slo/slo.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 24 additions & 30 deletions plugins/slo/pkg/apis/slo/slo.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions plugins/slo/pkg/apis/slo/slo.proto
Original file line number Diff line number Diff line change
Expand Up @@ -50,32 +50,37 @@ service SLO {
rpc ListMetrics(ListMetricsRequest) returns (MetricGroupList) {
option (google.api.http) = {
post: "/metrics"
body: "*"
};
}

// Returns the list of services discovered by the Service Discovery backend
rpc ListServices(ListServicesRequest) returns (ServiceList) {
option (google.api.http) = {
post: "/services"
body: "*"
};
}

rpc ListEvents(ListEventsRequest) returns (EventList) {
option (google.api.http) = {
post: "/events"

};
}

// Returns a status enum badge for a given SLO
rpc Status(core.Reference) returns (SLOStatus) {
option (google.api.http) = {
post: "/slos/{id}/status"

};
}

rpc Preview(CreateSLORequest) returns (SLOPreviewResponse) {
option (google.api.http) = {
post : "/slos/preview"
body: "*"
};
}
}
Expand Down
130 changes: 49 additions & 81 deletions plugins/slo/pkg/apis/slo/slo.swagger.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{
"swagger": "2.0",
"info": {
"title": "Opni SLO API",
"version": "1.0"
"title": "Opni Alerting API",
"version": "1.0",
"license": {
"name": "Apache 2.0",
"url": "https://github.com/rancher/opni/blob/main/LICENSE"
}
},
"tags": [
{
Expand Down Expand Up @@ -84,22 +88,12 @@
},
"parameters": [
{
"name": "datasource",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "clusterId",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "serviceId",
"in": "query",
"required": false,
"type": "string"
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/sloListMetricsRequest"
}
}
],
"tags": [
Expand Down Expand Up @@ -127,16 +121,12 @@
},
"parameters": [
{
"name": "datasource",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "clusterId",
"in": "query",
"required": false,
"type": "string"
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/sloListServicesRequest"
}
}
],
"tags": [
Expand Down Expand Up @@ -215,59 +205,12 @@
},
"parameters": [
{
"name": "slo.name",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "slo.datasource",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "slo.clusterId",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "slo.serviceId",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "slo.goodMetricName",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "slo.totalMetricName",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "slo.sloPeriod",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "slo.budgetingInterval",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "slo.target.value",
"in": "query",
"required": false,
"type": "number",
"format": "double"
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/sloCreateSLORequest"
}
}
],
"tags": [
Expand Down Expand Up @@ -585,6 +528,31 @@
}
}
},
"sloListMetricsRequest": {
"type": "object",
"properties": {
"datasource": {
"type": "string"
},
"clusterId": {
"type": "string"
},
"serviceId": {
"type": "string"
}
}
},
"sloListServicesRequest": {
"type": "object",
"properties": {
"datasource": {
"type": "string"
},
"clusterId": {
"type": "string"
}
}
},
"sloMetric": {
"type": "object",
"properties": {
Expand Down
Loading