1: <?php
2:
3: declare(strict_types=1);
4:
5: /**
6: * SPDX-License-Identifier: Apache-2.0
7: *
8: * The OpenSearch Contributors require contributions made to
9: * this file be licensed under the Apache-2.0 license or a
10: * compatible open source license.
11: *
12: * Modifications Copyright OpenSearch Contributors. See
13: * GitHub history for details.
14: */
15:
16: namespace OpenSearch\Namespaces;
17:
18: use OpenSearch\Namespaces\AbstractNamespace;
19:
20: /**
21: * Class ObservabilityNamespace
22: *
23: * NOTE: This file is autogenerated using util/GenerateEndpoints.php
24: */
25: class ObservabilityNamespace extends AbstractNamespace
26: {
27: /**
28: * Creates a new observability object.
29: *
30: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
31: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
32: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
33: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
34: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
35: *
36: * @param array $params Associative array of parameters
37: * @return array
38: */
39: public function createObject(array $params = [])
40: {
41: $body = $this->extractArgument($params, 'body');
42:
43: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Observability\CreateObject::class);
44: $endpoint->setParams($params);
45: $endpoint->setBody($body);
46:
47: return $this->performRequest($endpoint);
48: }
49:
50: /**
51: * Deletes specific observability object specified by ID.
52: *
53: * $params['object_id'] = (string) The ID of the Observability Object.
54: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
55: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
56: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
57: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
58: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
59: *
60: * @param array $params Associative array of parameters
61: * @return array
62: */
63: public function deleteObject(array $params = [])
64: {
65: $object_id = $this->extractArgument($params, 'object_id');
66:
67: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Observability\DeleteObject::class);
68: $endpoint->setParams($params);
69: $endpoint->setObjectId($object_id);
70:
71: return $this->performRequest($endpoint);
72: }
73:
74: /**
75: * Deletes specific observability objects specified by ID or a list of IDs.
76: *
77: * $params['objectId'] = (string) The ID of a single Observability Object to delete.
78: * $params['objectIdList'] = (string) A comma-separated list of Observability Object IDs to delete.
79: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
80: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
81: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
82: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
83: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
84: *
85: * @param array $params Associative array of parameters
86: * @return array
87: */
88: public function deleteObjects(array $params = [])
89: {
90: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Observability\DeleteObjects::class);
91: $endpoint->setParams($params);
92:
93: return $this->performRequest($endpoint);
94: }
95:
96: /**
97: * Retrieves Local Stats of all observability objects.
98: *
99: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
100: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
101: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
102: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
103: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
104: *
105: * @param array $params Associative array of parameters
106: * @return array
107: */
108: public function getLocalstats(array $params = [])
109: {
110: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Observability\GetLocalstats::class);
111: $endpoint->setParams($params);
112:
113: return $this->performRequest($endpoint);
114: }
115:
116: /**
117: * Retrieves specific observability object specified by ID.
118: *
119: * $params['object_id'] = (string) The ID of the Observability Object.
120: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
121: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
122: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
123: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
124: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
125: *
126: * @param array $params Associative array of parameters
127: * @return array
128: */
129: public function getObject(array $params = [])
130: {
131: $object_id = $this->extractArgument($params, 'object_id');
132:
133: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Observability\GetObject::class);
134: $endpoint->setParams($params);
135: $endpoint->setObjectId($object_id);
136:
137: return $this->performRequest($endpoint);
138: }
139:
140: /**
141: * Retrieves list of all observability objects.
142: *
143: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
144: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
145: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
146: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
147: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
148: *
149: * @param array $params Associative array of parameters
150: * @return array
151: */
152: public function listObjects(array $params = [])
153: {
154: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Observability\ListObjects::class);
155: $endpoint->setParams($params);
156:
157: return $this->performRequest($endpoint);
158: }
159:
160: /**
161: * Updates an existing observability object.
162: *
163: * $params['object_id'] = (string) The ID of the Observability Object.
164: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
165: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
166: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
167: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
168: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
169: *
170: * @param array $params Associative array of parameters
171: * @return array
172: */
173: public function updateObject(array $params = [])
174: {
175: $object_id = $this->extractArgument($params, 'object_id');
176: $body = $this->extractArgument($params, 'body');
177:
178: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Observability\UpdateObject::class);
179: $endpoint->setParams($params);
180: $endpoint->setObjectId($object_id);
181: $endpoint->setBody($body);
182:
183: return $this->performRequest($endpoint);
184: }
185:
186: }
187: