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\Endpoints\Observability\CreateObject;
19: use OpenSearch\Endpoints\Observability\DeleteObject;
20: use OpenSearch\Endpoints\Observability\DeleteObjects;
21: use OpenSearch\Endpoints\Observability\GetLocalstats;
22: use OpenSearch\Endpoints\Observability\GetObject;
23: use OpenSearch\Endpoints\Observability\ListObjects;
24: use OpenSearch\Endpoints\Observability\UpdateObject;
25:
26: /**
27: * Class ObservabilityNamespace
28: *
29: * NOTE: This file is autogenerated using util/GenerateEndpoints.php
30: */
31: class ObservabilityNamespace extends AbstractNamespace
32: {
33: /**
34: * Creates a new observability object.
35: *
36: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
37: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
38: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
39: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
40: * $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 "-".
41: *
42: * @param array $params Associative array of parameters
43: * @return array
44: */
45: public function createObject(array $params = [])
46: {
47: $body = $this->extractArgument($params, 'body');
48:
49: $endpoint = $this->endpointFactory->getEndpoint(CreateObject::class);
50: $endpoint->setParams($params);
51: $endpoint->setBody($body);
52:
53: return $this->performRequest($endpoint);
54: }
55:
56: /**
57: * Deletes specific observability object specified by ID.
58: *
59: * $params['object_id'] = (string) The ID of the Observability Object.
60: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
61: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
62: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
63: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
64: * $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 "-".
65: *
66: * @param array $params Associative array of parameters
67: * @return array
68: */
69: public function deleteObject(array $params = [])
70: {
71: $object_id = $this->extractArgument($params, 'object_id');
72:
73: $endpoint = $this->endpointFactory->getEndpoint(DeleteObject::class);
74: $endpoint->setParams($params);
75: $endpoint->setObjectId($object_id);
76:
77: return $this->performRequest($endpoint);
78: }
79:
80: /**
81: * Deletes specific observability objects specified by ID or a list of IDs.
82: *
83: * $params['objectId'] = (string) The ID of a single Observability Object to delete.
84: * $params['objectIdList'] = (string) A comma-separated list of Observability Object IDs to delete.
85: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
86: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
87: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
88: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
89: * $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 "-".
90: *
91: * @param array $params Associative array of parameters
92: * @return array
93: */
94: public function deleteObjects(array $params = [])
95: {
96: $endpoint = $this->endpointFactory->getEndpoint(DeleteObjects::class);
97: $endpoint->setParams($params);
98:
99: return $this->performRequest($endpoint);
100: }
101:
102: /**
103: * Retrieves local stats of all observability objects.
104: *
105: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
106: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
107: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
108: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
109: * $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 "-".
110: *
111: * @param array $params Associative array of parameters
112: * @return array
113: */
114: public function getLocalstats(array $params = [])
115: {
116: $endpoint = $this->endpointFactory->getEndpoint(GetLocalstats::class);
117: $endpoint->setParams($params);
118:
119: return $this->performRequest($endpoint);
120: }
121:
122: /**
123: * Retrieves specific observability object specified by ID.
124: *
125: * $params['object_id'] = (string) The ID of the Observability Object.
126: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
127: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
128: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
129: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
130: * $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 "-".
131: *
132: * @param array $params Associative array of parameters
133: * @return array
134: */
135: public function getObject(array $params = [])
136: {
137: $object_id = $this->extractArgument($params, 'object_id');
138:
139: $endpoint = $this->endpointFactory->getEndpoint(GetObject::class);
140: $endpoint->setParams($params);
141: $endpoint->setObjectId($object_id);
142:
143: return $this->performRequest($endpoint);
144: }
145:
146: /**
147: * Retrieves list of all observability objects.
148: *
149: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
150: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
151: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
152: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
153: * $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 "-".
154: *
155: * @param array $params Associative array of parameters
156: * @return array
157: */
158: public function listObjects(array $params = [])
159: {
160: $endpoint = $this->endpointFactory->getEndpoint(ListObjects::class);
161: $endpoint->setParams($params);
162:
163: return $this->performRequest($endpoint);
164: }
165:
166: /**
167: * Updates an existing observability object.
168: *
169: * $params['object_id'] = (string) The ID of the Observability Object.
170: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
171: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
172: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
173: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
174: * $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 "-".
175: *
176: * @param array $params Associative array of parameters
177: * @return array
178: */
179: public function updateObject(array $params = [])
180: {
181: $object_id = $this->extractArgument($params, 'object_id');
182: $body = $this->extractArgument($params, 'body');
183:
184: $endpoint = $this->endpointFactory->getEndpoint(UpdateObject::class);
185: $endpoint->setParams($params);
186: $endpoint->setObjectId($object_id);
187: $endpoint->setBody($body);
188:
189: return $this->performRequest($endpoint);
190: }
191:
192: }
193: