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

Drafts a template for API object definitions #940

Merged
merged 6 commits into from
Jun 20, 2019
Merged
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
73 changes: 73 additions & 0 deletions shared/api-definitions-ex.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
[[sample-object]]
=== Object1 API objects
jrodewig marked this conversation as resolved.
Show resolved Hide resolved
++++
<titleabbrev>Object1</titleabbrev>
jrodewig marked this conversation as resolved.
Show resolved Hide resolved
++++
// ***************************************
// These pages complement API reference pages. They provide details about the
// objects in API request bodies or response bodies.
// They do not need to map 1:1 to API response bodies unless these pages are
// automatically generated.
// These pages are typically nested under an API definitions page.
// For an example of definitions that map specific objects to APIs, see:
// https://www.elastic.co/guide/en/cloud-enterprise/current/definitions.html
// For an example of definitions that apply to multiple APIs, see:
// https://www.elastic.co/guide/en/elasticsearch/reference/master/api-definitions.html
// ***************************************

//Provide a brief description

Is a cool thing.

// Guidelines for API object documentation
// ***************************************
// * Use a definition list.
// * Include the data type.
// * Include default values as the last sentence of the first paragraph.
// * Include a range of valid values, if applicable.
// * For nested objects, link to a separate definition list.
// ***************************************

[float]
lcawl marked this conversation as resolved.
Show resolved Hide resolved
[[sample-object-properties]]
==== Properties

////
For example:

`analysis_config`::
(object) The analysis configuration, which specifies how to analyze the data.
See <<ml-analysisconfig, analysis configuration objects>>.

`job_id`::
(string) The unique identifier for the job. This identifier can contain
lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It
must start and end with alphanumeric characters.
////

[float]
[[sample-object-example]]
==== Example
// Optional. Be aware that if you add examples they need to be kept up-to-date.

////
[source,js]
----
{
"job_id": "total-requests",
"analysis_config": {
"bucket_span": "10m",
"detectors": [
{
"detector_description": "Sum of total",
"function": "sum",
"field_name": "total",
"detector_index": 0
}
],
"influencers": [ ]
},
...
}
----
////
jrodewig marked this conversation as resolved.
Show resolved Hide resolved