Skip to content

Commit

Permalink
Regenerate client from commit de88df87 of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Apr 4, 2022
1 parent 3ba20b1 commit bd3b2f8
Show file tree
Hide file tree
Showing 16 changed files with 706 additions and 32 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.2",
"regenerated": "2022-04-04 09:25:03.516890",
"spec_repo_commit": "e6337d88"
"regenerated": "2022-04-04 14:22:32.090987",
"spec_repo_commit": "de88df87"
},
"v2": {
"apigentools_version": "1.6.2",
"regenerated": "2022-04-04 09:25:03.528785",
"spec_repo_commit": "e6337d88"
"regenerated": "2022-04-04 14:22:32.105903",
"spec_repo_commit": "de88df87"
}
}
}
7 changes: 4 additions & 3 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9333,8 +9333,9 @@ components:
type: string
type: array
type:
default: gauge
description: The type of the metric either `count`, `gauge`, or `rate`.
default: ''
description: The type of the metric. Valid types are "",`count`, `gauge`,
and `rate`.
example: rate
type: string
required:
Expand Down Expand Up @@ -22982,7 +22983,7 @@ paths:
3.2 megabytes (3200000 bytes). Compressed payloads must have a decompressed
size of less than 62 megabytes (62914560 bytes).\n\nIf you\u2019re submitting
metrics directly to the Datadog API without using DogStatsD, expect:\n\n-
64 bits for the timestamp\n- 32 bits for the value\n- 20 bytes for the metric
64 bits for the timestamp\n- 64 bits for the value\n- 20 bytes for the metric
names\n- 50 bytes for the timeseries\n- The full payload is approximately
100 bytes. However, with the DogStatsD API,\ncompression is applied, which
reduces the payload size."
Expand Down
173 changes: 173 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2506,6 +2506,14 @@ components:
required:
- data
type: object
IntakePayloadAccepted:
description: The payload accepted for intake.
properties:
status:
description: The status of the intake payload.
example: ok
type: string
type: object
ListApplicationKeysResponse:
description: Response for a list of application keys.
properties:
Expand Down Expand Up @@ -3770,6 +3778,14 @@ components:
pattern: ^[A-Za-z][A-Za-z0-9\.\-\_:\/]*$
type: string
type: array
MetricContentEncoding:
default: deflate
description: HTTP header used to compress the media-type.
enum:
- deflate
type: string
x-enum-varnames:
- DEFLATE
MetricCustomAggregation:
description: A time and space aggregation combination for use in query.
example:
Expand Down Expand Up @@ -4164,6 +4180,22 @@ components:
type: array
readOnly: true
type: object
MetricsPayload:
description: The metrics' payload.
properties:
series:
description: A list of time series to submit to Datadog.
example:
- metric: system.load.1
points:
- - 1475317847
- 0.7
items:
$ref: '#/components/schemas/Series'
type: array
required:
- series
type: object
NullableRelationshipToUser:
description: Relationship to user.
properties:
Expand Down Expand Up @@ -4404,6 +4436,26 @@ components:
type: string
x-enum-varnames:
- PERMISSIONS
Point:
description: Array of timeseries points.
example:
- 1575317847
- 0.5
items:
description: 'Each point is of the form `[POSIX_timestamp, numeric_value]`.
The timestamp should be in seconds and current.
The numeric value format should be a 64bit float gauge-type value.
Current is defined as not more than 10 minutes in the future or more than
1 hour in the past.'
format: double
nullable: true
type: number
maxItems: 2
minItems: 2
type: array
ProcessSummariesMeta:
description: Response metadata object.
properties:
Expand Down Expand Up @@ -6399,6 +6451,53 @@ components:
x-enum-varnames:
- TIMESTAMP_ASCENDING
- TIMESTAMP_DESCENDING
Series:
description: 'A metric to submit to Datadog.
See [Datadog metrics](https://docs.datadoghq.com/developers/metrics/#custom-metrics-properties).'
properties:
host:
description: The name of the host that produced the metric.
example: test.example.com
type: string
interval:
default: null
description: If the type of the metric is rate or count, define the corresponding
interval.
example: 20
format: int64
nullable: true
type: integer
metric:
description: The name of the timeseries.
example: system.load.1
type: string
points:
description: Points relating to a metric. All points must be tuples with
timestamp and a scalar value (cannot be a string). Timestamps should be
in POSIX time in seconds, and cannot be more than ten minutes in the future
or more than one hour in the past.
items:
$ref: '#/components/schemas/Point'
type: array
tags:
description: A list of tags associated with the metric.
example:
- environment:test
items:
description: Individual tags.
type: string
type: array
type:
default: ''
description: The type of the metric. Valid types are "",`count`, `gauge`,
and `rate`.
example: rate
type: string
required:
- metric
- points
type: object
ServiceAccountCreateAttributes:
description: Attributes of the created user.
properties:
Expand Down Expand Up @@ -11159,6 +11258,80 @@ paths:
x-unstable: '**Note**: This endpoint is in public beta.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
/api/v2/series:
post:
description: "The metrics end-point allows you to post time-series data that
can be graphed on Datadog\u2019s dashboards.\nThe maximum payload size is
500 kilobytes (512000 bytes). Compressed payloads must have a decompressed
size of less than 5 megabytes (5242880 bytes).\n\nIf you\u2019re submitting
metrics directly to the Datadog API without using DogStatsD, expect:\n\n-
64 bits for the timestamp\n- 64 bits for the value\n- 20 bytes for the metric
names\n- 50 bytes for the timeseries\n- The full payload is approximately
100 bytes."
operationId: SubmitMetrics
parameters:
- description: HTTP header used to compress the media-type.
in: header
name: Content-Encoding
required: true
schema:
$ref: '#/components/schemas/MetricContentEncoding'
requestBody:
content:
application/json:
examples:
dynamic-points:
description: "Post time-series data that can be graphed on Datadog\u2019s
dashboards."
externalValue: examples/metrics/dynamic-points.json.sh
summary: Dynamic Points
x-variables:
NOW: $(date +%s)
schema:
$ref: '#/components/schemas/MetricsPayload'
required: true
responses:
'202':
content:
application/json:
schema:
$ref: '#/components/schemas/IntakePayloadAccepted'
description: Payload accepted
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Bad Request
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Authentication error
'408':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Request timeout
'413':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Payload too large
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
summary: Submit metrics
tags:
- Metrics
x-codegen-request-body-name: body
x-menu-order: 1
x-undo:
type: safe
/api/v2/service_accounts:
post:
description: Create a service account for your organization.
Expand Down
40 changes: 40 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,14 @@ incidents\_response
:undoc-members:
:show-inheritance:

intake\_payload\_accepted
-------------------------

.. automodule:: datadog_api_client.v2.model.intake_payload_accepted
:members:
:undoc-members:
:show-inheritance:

list\_application\_keys\_response
---------------------------------

Expand Down Expand Up @@ -1881,6 +1889,14 @@ metric\_bulk\_tag\_config\_tag\_name\_list
:undoc-members:
:show-inheritance:

metric\_content\_encoding
-------------------------

.. automodule:: datadog_api_client.v2.model.metric_content_encoding
:members:
:undoc-members:
:show-inheritance:

metric\_custom\_aggregation
---------------------------

Expand Down Expand Up @@ -2089,6 +2105,14 @@ metrics\_and\_metric\_tag\_configurations\_response
:undoc-members:
:show-inheritance:

metrics\_payload
----------------

.. automodule:: datadog_api_client.v2.model.metrics_payload
:members:
:undoc-members:
:show-inheritance:

nullable\_relationship\_to\_user
--------------------------------

Expand Down Expand Up @@ -2209,6 +2233,14 @@ permissions\_type
:undoc-members:
:show-inheritance:

point
-----

.. automodule:: datadog_api_client.v2.model.point
:members:
:undoc-members:
:show-inheritance:

process\_summaries\_meta
------------------------

Expand Down Expand Up @@ -3249,6 +3281,14 @@ security\_monitoring\_signals\_sort
:undoc-members:
:show-inheritance:

series
------

.. automodule:: datadog_api_client.v2.model.series
:members:
:undoc-members:
:show-inheritance:

service\_account\_create\_attributes
------------------------------------

Expand Down
20 changes: 20 additions & 0 deletions examples/v2/metrics/SubmitMetrics.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""
Submit metrics returns "Payload accepted" response
"""

from datetime import datetime
from datadog_api_client.v2 import ApiClient, Configuration
from datadog_api_client.v2.api.metrics_api import MetricsApi
from datadog_api_client.v2.model.metric_content_encoding import MetricContentEncoding
from datadog_api_client.v2.model.metrics_payload import MetricsPayload
from datadog_api_client.v2.model.point import Point
from datadog_api_client.v2.model.series import Series

body = MetricsPayload(series=[Series(metric="system.load.1", points=[Point([datetime.now().timestamp(), 0.7])])])

configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = MetricsApi(api_client)
response = api_instance.submit_metrics(content_encoding=MetricContentEncoding("deflate"), body=body)

print(response)
2 changes: 1 addition & 1 deletion src/datadog_api_client/v1/api/metrics_api.py

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

2 changes: 1 addition & 1 deletion src/datadog_api_client/v1/model/series.py

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

Loading

0 comments on commit bd3b2f8

Please sign in to comment.