diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index bf2effce632..82c52f0447d 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -10354,6 +10354,16 @@ components: type: string status: $ref: '#/components/schemas/NotebookStatus' + template_variables: + description: List of template variables for this notebook. + example: + - available_values: [] + default: '*' + name: host + prefix: host + items: + $ref: '#/components/schemas/NotebookTemplateVariable' + type: array time: $ref: '#/components/schemas/NotebookGlobalTime' required: @@ -10657,6 +10667,39 @@ components: type: string x-enum-varnames: - PUBLISHED + NotebookTemplateVariable: + description: Template variable for a notebook. + properties: + available_values: + description: The list of values that the template variable drop-down is + limited to. + example: + - my-host + - host1 + - host2 + items: + description: Template variable value. + type: string + nullable: true + type: array + default: + description: The default value for the template variable. + example: '*' + nullable: true + type: string + name: + description: The name of the variable. + example: host + type: string + prefix: + description: The tag prefix associated with the variable. Only tags with + this prefix appear in the variable drop-down. + example: host + nullable: true + type: string + required: + - name + type: object NotebookTimeseriesCellAttributes: description: The attributes of a notebook `timeseries` cell. properties: @@ -10760,6 +10803,16 @@ components: type: string status: $ref: '#/components/schemas/NotebookStatus' + template_variables: + description: List of template variables for this notebook. + example: + - available_values: [] + default: '*' + name: host + prefix: host + items: + $ref: '#/components/schemas/NotebookTemplateVariable' + type: array time: $ref: '#/components/schemas/NotebookGlobalTime' required: @@ -10836,6 +10889,16 @@ components: type: string status: $ref: '#/components/schemas/NotebookStatus' + template_variables: + description: List of template variables for this notebook. + example: + - available_values: [] + default: '*' + name: host + prefix: host + items: + $ref: '#/components/schemas/NotebookTemplateVariable' + type: array time: $ref: '#/components/schemas/NotebookGlobalTime' required: diff --git a/src/main/java/com/datadog/api/client/v1/model/NotebookCreateDataAttributes.java b/src/main/java/com/datadog/api/client/v1/model/NotebookCreateDataAttributes.java index bb6142e3295..dd54e9db20c 100644 --- a/src/main/java/com/datadog/api/client/v1/model/NotebookCreateDataAttributes.java +++ b/src/main/java/com/datadog/api/client/v1/model/NotebookCreateDataAttributes.java @@ -25,6 +25,7 @@ NotebookCreateDataAttributes.JSON_PROPERTY_METADATA, NotebookCreateDataAttributes.JSON_PROPERTY_NAME, NotebookCreateDataAttributes.JSON_PROPERTY_STATUS, + NotebookCreateDataAttributes.JSON_PROPERTY_TEMPLATE_VARIABLES, NotebookCreateDataAttributes.JSON_PROPERTY_TIME }) @jakarta.annotation.Generated( @@ -43,6 +44,9 @@ public class NotebookCreateDataAttributes { public static final String JSON_PROPERTY_STATUS = "status"; private NotebookStatus status = NotebookStatus.PUBLISHED; + public static final String JSON_PROPERTY_TEMPLATE_VARIABLES = "template_variables"; + private List templateVariables = null; + public static final String JSON_PROPERTY_TIME = "time"; private NotebookGlobalTime time; @@ -156,6 +160,41 @@ public void setStatus(NotebookStatus status) { this.status = status; } + public NotebookCreateDataAttributes templateVariables( + List templateVariables) { + this.templateVariables = templateVariables; + for (NotebookTemplateVariable item : templateVariables) { + this.unparsed |= item.unparsed; + } + return this; + } + + public NotebookCreateDataAttributes addTemplateVariablesItem( + NotebookTemplateVariable templateVariablesItem) { + if (this.templateVariables == null) { + this.templateVariables = new ArrayList<>(); + } + this.templateVariables.add(templateVariablesItem); + this.unparsed |= templateVariablesItem.unparsed; + return this; + } + + /** + * List of template variables for this notebook. + * + * @return templateVariables + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEMPLATE_VARIABLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTemplateVariables() { + return templateVariables; + } + + public void setTemplateVariables(List templateVariables) { + this.templateVariables = templateVariables; + } + public NotebookCreateDataAttributes time(NotebookGlobalTime time) { this.time = time; this.unparsed |= time.unparsed; @@ -237,6 +276,7 @@ public boolean equals(Object o) { && Objects.equals(this.metadata, notebookCreateDataAttributes.metadata) && Objects.equals(this.name, notebookCreateDataAttributes.name) && Objects.equals(this.status, notebookCreateDataAttributes.status) + && Objects.equals(this.templateVariables, notebookCreateDataAttributes.templateVariables) && Objects.equals(this.time, notebookCreateDataAttributes.time) && Objects.equals( this.additionalProperties, notebookCreateDataAttributes.additionalProperties); @@ -244,7 +284,8 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(cells, metadata, name, status, time, additionalProperties); + return Objects.hash( + cells, metadata, name, status, templateVariables, time, additionalProperties); } @Override @@ -255,6 +296,7 @@ public String toString() { sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" templateVariables: ").append(toIndentedString(templateVariables)).append("\n"); sb.append(" time: ").append(toIndentedString(time)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v1/model/NotebookTemplateVariable.java b/src/main/java/com/datadog/api/client/v1/model/NotebookTemplateVariable.java new file mode 100644 index 00000000000..7605aa238ba --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/NotebookTemplateVariable.java @@ -0,0 +1,272 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v1.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Template variable for a notebook. */ +@JsonPropertyOrder({ + NotebookTemplateVariable.JSON_PROPERTY_AVAILABLE_VALUES, + NotebookTemplateVariable.JSON_PROPERTY_DEFAULT, + NotebookTemplateVariable.JSON_PROPERTY_NAME, + NotebookTemplateVariable.JSON_PROPERTY_PREFIX +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class NotebookTemplateVariable { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AVAILABLE_VALUES = "available_values"; + private JsonNullable> availableValues = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_DEFAULT = "default"; + private JsonNullable _default = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_PREFIX = "prefix"; + private JsonNullable prefix = JsonNullable.undefined(); + + public NotebookTemplateVariable() {} + + @JsonCreator + public NotebookTemplateVariable( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.name = name; + } + + public NotebookTemplateVariable availableValues(List availableValues) { + this.availableValues = JsonNullable.>of(availableValues); + return this; + } + + public NotebookTemplateVariable addAvailableValuesItem(String availableValuesItem) { + if (this.availableValues == null || !this.availableValues.isPresent()) { + this.availableValues = JsonNullable.>of(new ArrayList<>()); + } + try { + this.availableValues.get().add(availableValuesItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * The list of values that the template variable drop-down is limited to. + * + * @return availableValues + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getAvailableValues() { + return availableValues.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_AVAILABLE_VALUES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getAvailableValues_JsonNullable() { + return availableValues; + } + + @JsonProperty(JSON_PROPERTY_AVAILABLE_VALUES) + public void setAvailableValues_JsonNullable(JsonNullable> availableValues) { + this.availableValues = availableValues; + } + + public void setAvailableValues(List availableValues) { + this.availableValues = JsonNullable.>of(availableValues); + } + + public NotebookTemplateVariable _default(String _default) { + this._default = JsonNullable.of(_default); + return this; + } + + /** + * The default value for the template variable. + * + * @return _default + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getDefault() { + return _default.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_DEFAULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getDefault_JsonNullable() { + return _default; + } + + @JsonProperty(JSON_PROPERTY_DEFAULT) + public void setDefault_JsonNullable(JsonNullable _default) { + this._default = _default; + } + + public void setDefault(String _default) { + this._default = JsonNullable.of(_default); + } + + public NotebookTemplateVariable name(String name) { + this.name = name; + return this; + } + + /** + * The name of the variable. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public NotebookTemplateVariable prefix(String prefix) { + this.prefix = JsonNullable.of(prefix); + return this; + } + + /** + * The tag prefix associated with the variable. Only tags with this prefix appear in the variable + * drop-down. + * + * @return prefix + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getPrefix() { + return prefix.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_PREFIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getPrefix_JsonNullable() { + return prefix; + } + + @JsonProperty(JSON_PROPERTY_PREFIX) + public void setPrefix_JsonNullable(JsonNullable prefix) { + this.prefix = prefix; + } + + public void setPrefix(String prefix) { + this.prefix = JsonNullable.of(prefix); + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return NotebookTemplateVariable + */ + @JsonAnySetter + public NotebookTemplateVariable putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this NotebookTemplateVariable object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotebookTemplateVariable notebookTemplateVariable = (NotebookTemplateVariable) o; + return Objects.equals(this.availableValues, notebookTemplateVariable.availableValues) + && Objects.equals(this._default, notebookTemplateVariable._default) + && Objects.equals(this.name, notebookTemplateVariable.name) + && Objects.equals(this.prefix, notebookTemplateVariable.prefix) + && Objects.equals(this.additionalProperties, notebookTemplateVariable.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(availableValues, _default, name, prefix, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NotebookTemplateVariable {\n"); + sb.append(" availableValues: ").append(toIndentedString(availableValues)).append("\n"); + sb.append(" _default: ").append(toIndentedString(_default)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/NotebookUpdateDataAttributes.java b/src/main/java/com/datadog/api/client/v1/model/NotebookUpdateDataAttributes.java index ccb327a5700..138e44ffcf3 100644 --- a/src/main/java/com/datadog/api/client/v1/model/NotebookUpdateDataAttributes.java +++ b/src/main/java/com/datadog/api/client/v1/model/NotebookUpdateDataAttributes.java @@ -25,6 +25,7 @@ NotebookUpdateDataAttributes.JSON_PROPERTY_METADATA, NotebookUpdateDataAttributes.JSON_PROPERTY_NAME, NotebookUpdateDataAttributes.JSON_PROPERTY_STATUS, + NotebookUpdateDataAttributes.JSON_PROPERTY_TEMPLATE_VARIABLES, NotebookUpdateDataAttributes.JSON_PROPERTY_TIME }) @jakarta.annotation.Generated( @@ -43,6 +44,9 @@ public class NotebookUpdateDataAttributes { public static final String JSON_PROPERTY_STATUS = "status"; private NotebookStatus status = NotebookStatus.PUBLISHED; + public static final String JSON_PROPERTY_TEMPLATE_VARIABLES = "template_variables"; + private List templateVariables = null; + public static final String JSON_PROPERTY_TIME = "time"; private NotebookGlobalTime time; @@ -155,6 +159,41 @@ public void setStatus(NotebookStatus status) { this.status = status; } + public NotebookUpdateDataAttributes templateVariables( + List templateVariables) { + this.templateVariables = templateVariables; + for (NotebookTemplateVariable item : templateVariables) { + this.unparsed |= item.unparsed; + } + return this; + } + + public NotebookUpdateDataAttributes addTemplateVariablesItem( + NotebookTemplateVariable templateVariablesItem) { + if (this.templateVariables == null) { + this.templateVariables = new ArrayList<>(); + } + this.templateVariables.add(templateVariablesItem); + this.unparsed |= templateVariablesItem.unparsed; + return this; + } + + /** + * List of template variables for this notebook. + * + * @return templateVariables + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEMPLATE_VARIABLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTemplateVariables() { + return templateVariables; + } + + public void setTemplateVariables(List templateVariables) { + this.templateVariables = templateVariables; + } + public NotebookUpdateDataAttributes time(NotebookGlobalTime time) { this.time = time; this.unparsed |= time.unparsed; @@ -236,6 +275,7 @@ public boolean equals(Object o) { && Objects.equals(this.metadata, notebookUpdateDataAttributes.metadata) && Objects.equals(this.name, notebookUpdateDataAttributes.name) && Objects.equals(this.status, notebookUpdateDataAttributes.status) + && Objects.equals(this.templateVariables, notebookUpdateDataAttributes.templateVariables) && Objects.equals(this.time, notebookUpdateDataAttributes.time) && Objects.equals( this.additionalProperties, notebookUpdateDataAttributes.additionalProperties); @@ -243,7 +283,8 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(cells, metadata, name, status, time, additionalProperties); + return Objects.hash( + cells, metadata, name, status, templateVariables, time, additionalProperties); } @Override @@ -254,6 +295,7 @@ public String toString() { sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" templateVariables: ").append(toIndentedString(templateVariables)).append("\n"); sb.append(" time: ").append(toIndentedString(time)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v1/model/NotebooksResponseDataAttributes.java b/src/main/java/com/datadog/api/client/v1/model/NotebooksResponseDataAttributes.java index 0a1dfc622ff..f76ca27eecb 100644 --- a/src/main/java/com/datadog/api/client/v1/model/NotebooksResponseDataAttributes.java +++ b/src/main/java/com/datadog/api/client/v1/model/NotebooksResponseDataAttributes.java @@ -29,6 +29,7 @@ NotebooksResponseDataAttributes.JSON_PROPERTY_MODIFIED, NotebooksResponseDataAttributes.JSON_PROPERTY_NAME, NotebooksResponseDataAttributes.JSON_PROPERTY_STATUS, + NotebooksResponseDataAttributes.JSON_PROPERTY_TEMPLATE_VARIABLES, NotebooksResponseDataAttributes.JSON_PROPERTY_TIME }) @jakarta.annotation.Generated( @@ -56,6 +57,9 @@ public class NotebooksResponseDataAttributes { public static final String JSON_PROPERTY_STATUS = "status"; private NotebookStatus status = NotebookStatus.PUBLISHED; + public static final String JSON_PROPERTY_TEMPLATE_VARIABLES = "template_variables"; + private List templateVariables = null; + public static final String JSON_PROPERTY_TIME = "time"; private NotebookGlobalTime time; @@ -213,6 +217,41 @@ public void setStatus(NotebookStatus status) { this.status = status; } + public NotebooksResponseDataAttributes templateVariables( + List templateVariables) { + this.templateVariables = templateVariables; + for (NotebookTemplateVariable item : templateVariables) { + this.unparsed |= item.unparsed; + } + return this; + } + + public NotebooksResponseDataAttributes addTemplateVariablesItem( + NotebookTemplateVariable templateVariablesItem) { + if (this.templateVariables == null) { + this.templateVariables = new ArrayList<>(); + } + this.templateVariables.add(templateVariablesItem); + this.unparsed |= templateVariablesItem.unparsed; + return this; + } + + /** + * List of template variables for this notebook. + * + * @return templateVariables + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEMPLATE_VARIABLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTemplateVariables() { + return templateVariables; + } + + public void setTemplateVariables(List templateVariables) { + this.templateVariables = templateVariables; + } + public NotebooksResponseDataAttributes time(NotebookGlobalTime time) { this.time = time; this.unparsed |= time.unparsed; @@ -299,6 +338,7 @@ public boolean equals(Object o) { && Objects.equals(this.modified, notebooksResponseDataAttributes.modified) && Objects.equals(this.name, notebooksResponseDataAttributes.name) && Objects.equals(this.status, notebooksResponseDataAttributes.status) + && Objects.equals(this.templateVariables, notebooksResponseDataAttributes.templateVariables) && Objects.equals(this.time, notebooksResponseDataAttributes.time) && Objects.equals( this.additionalProperties, notebooksResponseDataAttributes.additionalProperties); @@ -307,7 +347,16 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - author, cells, created, metadata, modified, name, status, time, additionalProperties); + author, + cells, + created, + metadata, + modified, + name, + status, + templateVariables, + time, + additionalProperties); } @Override @@ -321,6 +370,7 @@ public String toString() { sb.append(" modified: ").append(toIndentedString(modified)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" templateVariables: ").append(toIndentedString(templateVariables)).append("\n"); sb.append(" time: ").append(toIndentedString(time)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/test/resources/com/datadog/api/client/v1/api/notebooks.feature b/src/test/resources/com/datadog/api/client/v1/api/notebooks.feature index 3ff8343c9b1..6c361af0d67 100644 --- a/src/test/resources/com/datadog/api/client/v1/api/notebooks.feature +++ b/src/test/resources/com/datadog/api/client/v1/api/notebooks.feature @@ -13,7 +13,7 @@ Feature: Notebooks @generated @skip @team:DataDog/notebooks Scenario: Create a notebook returns "Bad Request" response Given new "CreateNotebook" request - And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"text": "## Some test markdown\n\n```\nvar x, y;\nx = 5;\ny = 6;\n```", "type": "markdown"}}, "type": "notebook_cells"}, {"attributes": {"definition": {"requests": [{"display_type": "line", "q": "avg:system.load.1{*}", "style": {"line_type": "solid", "line_width": "normal", "palette": "dog_classic"}}], "show_legend": true, "type": "timeseries", "yaxis": {"scale": "linear"}}, "graph_size": "m", "split_by": {"keys": [], "tags": []}, "time": null}, "type": "notebook_cells"}], "metadata": {"is_template": false, "take_snapshots": false, "type": "investigation"}, "name": "Example Notebook", "status": "published", "time": {"live_span": "1h"}}, "type": "notebooks"}} + And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"text": "## Some test markdown\n\n```\nvar x, y;\nx = 5;\ny = 6;\n```", "type": "markdown"}}, "type": "notebook_cells"}, {"attributes": {"definition": {"requests": [{"display_type": "line", "q": "avg:system.load.1{*}", "style": {"line_type": "solid", "line_width": "normal", "palette": "dog_classic"}}], "show_legend": true, "type": "timeseries", "yaxis": {"scale": "linear"}}, "graph_size": "m", "split_by": {"keys": [], "tags": []}, "time": null}, "type": "notebook_cells"}], "metadata": {"is_template": false, "take_snapshots": false, "type": "investigation"}, "name": "Example Notebook", "status": "published", "template_variables": [{"available_values": [], "default": "*", "name": "host", "prefix": "host"}], "time": {"live_span": "1h"}}, "type": "notebooks"}} When the request is sent Then the response status is 400 Bad Request @@ -98,7 +98,7 @@ Feature: Notebooks Scenario: Update a notebook returns "Bad Request" response Given new "UpdateNotebook" request And request contains "notebook_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"text": "## Some test markdown\n\n```\nvar x, y;\nx = 5;\ny = 6;\n```", "type": "markdown"}}, "id": "bzbycoya", "type": "notebook_cells"}, {"attributes": {"definition": {"requests": [{"display_type": "line", "q": "avg:system.load.1{*}", "style": {"line_type": "solid", "line_width": "normal", "palette": "dog_classic"}}], "show_legend": true, "type": "timeseries", "yaxis": {"scale": "linear"}}, "graph_size": "m", "split_by": {"keys": [], "tags": []}, "time": null}, "id": "9k6bc6xc", "type": "notebook_cells"}], "metadata": {"is_template": false, "take_snapshots": false, "type": "investigation"}, "name": "Example Notebook", "status": "published", "time": {"live_span": "1h"}}, "type": "notebooks"}} + And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"text": "## Some test markdown\n\n```\nvar x, y;\nx = 5;\ny = 6;\n```", "type": "markdown"}}, "id": "bzbycoya", "type": "notebook_cells"}, {"attributes": {"definition": {"requests": [{"display_type": "line", "q": "avg:system.load.1{*}", "style": {"line_type": "solid", "line_width": "normal", "palette": "dog_classic"}}], "show_legend": true, "type": "timeseries", "yaxis": {"scale": "linear"}}, "graph_size": "m", "split_by": {"keys": [], "tags": []}, "time": null}, "id": "9k6bc6xc", "type": "notebook_cells"}], "metadata": {"is_template": false, "take_snapshots": false, "type": "investigation"}, "name": "Example Notebook", "status": "published", "template_variables": [{"available_values": [], "default": "*", "name": "host", "prefix": "host"}], "time": {"live_span": "1h"}}, "type": "notebooks"}} When the request is sent Then the response status is 400 Bad Request @@ -106,7 +106,7 @@ Feature: Notebooks Scenario: Update a notebook returns "Conflict" response Given new "UpdateNotebook" request And request contains "notebook_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"text": "## Some test markdown\n\n```\nvar x, y;\nx = 5;\ny = 6;\n```", "type": "markdown"}}, "id": "bzbycoya", "type": "notebook_cells"}, {"attributes": {"definition": {"requests": [{"display_type": "line", "q": "avg:system.load.1{*}", "style": {"line_type": "solid", "line_width": "normal", "palette": "dog_classic"}}], "show_legend": true, "type": "timeseries", "yaxis": {"scale": "linear"}}, "graph_size": "m", "split_by": {"keys": [], "tags": []}, "time": null}, "id": "9k6bc6xc", "type": "notebook_cells"}], "metadata": {"is_template": false, "take_snapshots": false, "type": "investigation"}, "name": "Example Notebook", "status": "published", "time": {"live_span": "1h"}}, "type": "notebooks"}} + And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"text": "## Some test markdown\n\n```\nvar x, y;\nx = 5;\ny = 6;\n```", "type": "markdown"}}, "id": "bzbycoya", "type": "notebook_cells"}, {"attributes": {"definition": {"requests": [{"display_type": "line", "q": "avg:system.load.1{*}", "style": {"line_type": "solid", "line_width": "normal", "palette": "dog_classic"}}], "show_legend": true, "type": "timeseries", "yaxis": {"scale": "linear"}}, "graph_size": "m", "split_by": {"keys": [], "tags": []}, "time": null}, "id": "9k6bc6xc", "type": "notebook_cells"}], "metadata": {"is_template": false, "take_snapshots": false, "type": "investigation"}, "name": "Example Notebook", "status": "published", "template_variables": [{"available_values": [], "default": "*", "name": "host", "prefix": "host"}], "time": {"live_span": "1h"}}, "type": "notebooks"}} When the request is sent Then the response status is 409 Conflict @@ -114,7 +114,7 @@ Feature: Notebooks Scenario: Update a notebook returns "Not Found" response Given new "UpdateNotebook" request And request contains "notebook_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"text": "## Some test markdown\n\n```\nvar x, y;\nx = 5;\ny = 6;\n```", "type": "markdown"}}, "id": "bzbycoya", "type": "notebook_cells"}, {"attributes": {"definition": {"requests": [{"display_type": "line", "q": "avg:system.load.1{*}", "style": {"line_type": "solid", "line_width": "normal", "palette": "dog_classic"}}], "show_legend": true, "type": "timeseries", "yaxis": {"scale": "linear"}}, "graph_size": "m", "split_by": {"keys": [], "tags": []}, "time": null}, "id": "9k6bc6xc", "type": "notebook_cells"}], "metadata": {"is_template": false, "take_snapshots": false, "type": "investigation"}, "name": "Example Notebook", "status": "published", "time": {"live_span": "1h"}}, "type": "notebooks"}} + And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"text": "## Some test markdown\n\n```\nvar x, y;\nx = 5;\ny = 6;\n```", "type": "markdown"}}, "id": "bzbycoya", "type": "notebook_cells"}, {"attributes": {"definition": {"requests": [{"display_type": "line", "q": "avg:system.load.1{*}", "style": {"line_type": "solid", "line_width": "normal", "palette": "dog_classic"}}], "show_legend": true, "type": "timeseries", "yaxis": {"scale": "linear"}}, "graph_size": "m", "split_by": {"keys": [], "tags": []}, "time": null}, "id": "9k6bc6xc", "type": "notebook_cells"}], "metadata": {"is_template": false, "take_snapshots": false, "type": "investigation"}, "name": "Example Notebook", "status": "published", "template_variables": [{"available_values": [], "default": "*", "name": "host", "prefix": "host"}], "time": {"live_span": "1h"}}, "type": "notebooks"}} When the request is sent Then the response status is 404 Not Found