feat(health): add Oracle health check endpoint and models
- Implemented OracleRequestBuilder for connectivity checks. - Added OracleHealthCheckResponse and related models. - Updated OpenAPI documentation for new endpoint.
This commit is contained in:
parent
5ae52a5097
commit
e2ca09f962
9 changed files with 450 additions and 3 deletions
|
|
@ -8,6 +8,7 @@ use Microsoft\Kiota\Abstractions\BaseRequestBuilder;
|
|||
use Microsoft\Kiota\Abstractions\HttpMethod;
|
||||
use Microsoft\Kiota\Abstractions\RequestAdapter;
|
||||
use Microsoft\Kiota\Abstractions\RequestInformation;
|
||||
use Uwil\ArcadiaKiotaOpenApiClient\Health\Oracle\OracleRequestBuilder;
|
||||
use Uwil\ArcadiaKiotaOpenApiClient\Models\HealthCheckResponse;
|
||||
|
||||
/**
|
||||
|
|
@ -15,6 +16,13 @@ use Uwil\ArcadiaKiotaOpenApiClient\Models\HealthCheckResponse;
|
|||
*/
|
||||
class HealthRequestBuilder extends BaseRequestBuilder
|
||||
{
|
||||
/**
|
||||
* The oracle property
|
||||
*/
|
||||
public function oracle(): OracleRequestBuilder {
|
||||
return new OracleRequestBuilder($this->pathParameters, $this->requestAdapter);
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new HealthRequestBuilder and sets the default values.
|
||||
* @param array<string, mixed>|string $pathParametersOrRawUrl Path parameters for the request or a String representing the raw URL.
|
||||
|
|
|
|||
73
client/Health/Oracle/OracleRequestBuilder.php
Normal file
73
client/Health/Oracle/OracleRequestBuilder.php
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
<?php
|
||||
|
||||
namespace Uwil\ArcadiaKiotaOpenApiClient\Health\Oracle;
|
||||
|
||||
use Exception;
|
||||
use Http\Promise\Promise;
|
||||
use Microsoft\Kiota\Abstractions\BaseRequestBuilder;
|
||||
use Microsoft\Kiota\Abstractions\HttpMethod;
|
||||
use Microsoft\Kiota\Abstractions\RequestAdapter;
|
||||
use Microsoft\Kiota\Abstractions\RequestInformation;
|
||||
use Uwil\ArcadiaKiotaOpenApiClient\Models\OracleHealthCheckResponse;
|
||||
|
||||
/**
|
||||
* Builds and executes requests for operations under /health/oracle
|
||||
*/
|
||||
class OracleRequestBuilder extends BaseRequestBuilder
|
||||
{
|
||||
/**
|
||||
* Instantiates a new OracleRequestBuilder and sets the default values.
|
||||
* @param array<string, mixed>|string $pathParametersOrRawUrl Path parameters for the request or a String representing the raw URL.
|
||||
* @param RequestAdapter $requestAdapter The request adapter to use to execute the requests.
|
||||
*/
|
||||
public function __construct($pathParametersOrRawUrl, RequestAdapter $requestAdapter) {
|
||||
parent::__construct($requestAdapter, [], '{+baseurl}/health/oracle');
|
||||
if (is_array($pathParametersOrRawUrl)) {
|
||||
$this->pathParameters = $pathParametersOrRawUrl;
|
||||
} else {
|
||||
$this->pathParameters = ['request-raw-url' => $pathParametersOrRawUrl];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Vérifie exclusivement la connectivité à la base Oracle Arcadia.Cette sonde est destinée au monitoring externe (ex: UptimeRobot) et ne teste ni cache ni SMTP.
|
||||
* @param OracleRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
|
||||
* @return Promise<OracleHealthCheckResponse|null>
|
||||
* @throws Exception
|
||||
*/
|
||||
public function get(?OracleRequestBuilderGetRequestConfiguration $requestConfiguration = null): Promise {
|
||||
$requestInfo = $this->toGetRequestInformation($requestConfiguration);
|
||||
$errorMappings = [
|
||||
'503' => [OracleHealthCheckResponse::class, 'createFromDiscriminatorValue'],
|
||||
];
|
||||
return $this->requestAdapter->sendAsync($requestInfo, [OracleHealthCheckResponse::class, 'createFromDiscriminatorValue'], $errorMappings);
|
||||
}
|
||||
|
||||
/**
|
||||
* Vérifie exclusivement la connectivité à la base Oracle Arcadia.Cette sonde est destinée au monitoring externe (ex: UptimeRobot) et ne teste ni cache ni SMTP.
|
||||
* @param OracleRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
|
||||
* @return RequestInformation
|
||||
*/
|
||||
public function toGetRequestInformation(?OracleRequestBuilderGetRequestConfiguration $requestConfiguration = null): RequestInformation {
|
||||
$requestInfo = new RequestInformation();
|
||||
$requestInfo->urlTemplate = $this->urlTemplate;
|
||||
$requestInfo->pathParameters = $this->pathParameters;
|
||||
$requestInfo->httpMethod = HttpMethod::GET;
|
||||
if ($requestConfiguration !== null) {
|
||||
$requestInfo->addHeaders($requestConfiguration->headers);
|
||||
$requestInfo->addRequestOptions(...$requestConfiguration->options);
|
||||
}
|
||||
$requestInfo->tryAddHeader('Accept', "application/json");
|
||||
return $requestInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
|
||||
* @param string $rawUrl The raw URL to use for the request builder.
|
||||
* @return OracleRequestBuilder
|
||||
*/
|
||||
public function withUrl(string $rawUrl): OracleRequestBuilder {
|
||||
return new OracleRequestBuilder($rawUrl, $this->requestAdapter);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
namespace Uwil\ArcadiaKiotaOpenApiClient\Health\Oracle;
|
||||
|
||||
use Microsoft\Kiota\Abstractions\BaseRequestConfiguration;
|
||||
use Microsoft\Kiota\Abstractions\RequestOption;
|
||||
|
||||
/**
|
||||
* Configuration for the request such as headers, query parameters, and middleware options.
|
||||
*/
|
||||
class OracleRequestBuilderGetRequestConfiguration extends BaseRequestConfiguration
|
||||
{
|
||||
/**
|
||||
* Instantiates a new OracleRequestBuilderGetRequestConfiguration and sets the default values.
|
||||
* @param array<string, array<string>|string>|null $headers Request headers
|
||||
* @param array<RequestOption>|null $options Request options
|
||||
*/
|
||||
public function __construct(?array $headers = null, ?array $options = null) {
|
||||
parent::__construct($headers ?? [], $options ?? []);
|
||||
}
|
||||
|
||||
}
|
||||
149
client/Models/OracleHealthCheckResponse.php
Normal file
149
client/Models/OracleHealthCheckResponse.php
Normal file
|
|
@ -0,0 +1,149 @@
|
|||
<?php
|
||||
|
||||
namespace Uwil\ArcadiaKiotaOpenApiClient\Models;
|
||||
|
||||
use DateTime;
|
||||
use Microsoft\Kiota\Abstractions\ApiException;
|
||||
use Microsoft\Kiota\Abstractions\Serialization\AdditionalDataHolder;
|
||||
use Microsoft\Kiota\Abstractions\Serialization\Parsable;
|
||||
use Microsoft\Kiota\Abstractions\Serialization\ParseNode;
|
||||
use Microsoft\Kiota\Abstractions\Serialization\SerializationWriter;
|
||||
|
||||
/**
|
||||
* Résultat de la sonde de connectivité Oracle.
|
||||
*/
|
||||
class OracleHealthCheckResponse extends ApiException implements AdditionalDataHolder, Parsable
|
||||
{
|
||||
/**
|
||||
* @var array<string, mixed>|null $additionalData Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
|
||||
*/
|
||||
private ?array $additionalData = null;
|
||||
|
||||
/**
|
||||
* @var OracleHealthCheckResponse_oracle|null $oracle The oracle property
|
||||
*/
|
||||
private ?OracleHealthCheckResponse_oracle $oracle = null;
|
||||
|
||||
/**
|
||||
* @var OracleHealthCheckResponse_status|null $status État de santé global de la connectivité Oracle.
|
||||
*/
|
||||
private ?OracleHealthCheckResponse_status $status = null;
|
||||
|
||||
/**
|
||||
* @var DateTime|null $timestamp Horodatage de la vérification au format RFC 3339 UTC.
|
||||
*/
|
||||
private ?DateTime $timestamp = null;
|
||||
|
||||
/**
|
||||
* Instantiates a new OracleHealthCheckResponse and sets the default values.
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->setAdditionalData([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new instance of the appropriate class based on discriminator value
|
||||
* @param ParseNode $parseNode The parse node to use to read the discriminator value and create the object
|
||||
* @return OracleHealthCheckResponse
|
||||
*/
|
||||
public static function createFromDiscriminatorValue(ParseNode $parseNode): OracleHealthCheckResponse {
|
||||
return new OracleHealthCheckResponse();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
|
||||
* @return array<string, mixed>|null
|
||||
*/
|
||||
public function getAdditionalData(): ?array {
|
||||
return $this->additionalData;
|
||||
}
|
||||
|
||||
/**
|
||||
* The deserialization information for the current model
|
||||
* @return array<string, callable(ParseNode): void>
|
||||
*/
|
||||
public function getFieldDeserializers(): array {
|
||||
$o = $this;
|
||||
return [
|
||||
'oracle' => fn(ParseNode $n) => $o->setOracle($n->getObjectValue([OracleHealthCheckResponse_oracle::class, 'createFromDiscriminatorValue'])),
|
||||
'status' => fn(ParseNode $n) => $o->setStatus($n->getEnumValue(OracleHealthCheckResponse_status::class)),
|
||||
'timestamp' => fn(ParseNode $n) => $o->setTimestamp($n->getDateTimeValue()),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the oracle property value. The oracle property
|
||||
* @return OracleHealthCheckResponse_oracle|null
|
||||
*/
|
||||
public function getOracle(): ?OracleHealthCheckResponse_oracle {
|
||||
return $this->oracle;
|
||||
}
|
||||
|
||||
/**
|
||||
* The primary error message.
|
||||
* @return string
|
||||
*/
|
||||
public function getPrimaryErrorMessage(): string {
|
||||
return parent::getMessage();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the status property value. État de santé global de la connectivité Oracle.
|
||||
* @return OracleHealthCheckResponse_status|null
|
||||
*/
|
||||
public function getStatus(): ?OracleHealthCheckResponse_status {
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the timestamp property value. Horodatage de la vérification au format RFC 3339 UTC.
|
||||
* @return DateTime|null
|
||||
*/
|
||||
public function getTimestamp(): ?DateTime {
|
||||
return $this->timestamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes information the current object
|
||||
* @param SerializationWriter $writer Serialization writer to use to serialize this model
|
||||
*/
|
||||
public function serialize(SerializationWriter $writer): void {
|
||||
$writer->writeObjectValue('oracle', $this->getOracle());
|
||||
$writer->writeEnumValue('status', $this->getStatus());
|
||||
$writer->writeDateTimeValue('timestamp', $this->getTimestamp());
|
||||
$writer->writeAdditionalData($this->getAdditionalData());
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
|
||||
* @param array<string,mixed> $value Value to set for the AdditionalData property.
|
||||
*/
|
||||
public function setAdditionalData(?array $value): void {
|
||||
$this->additionalData = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the oracle property value. The oracle property
|
||||
* @param OracleHealthCheckResponse_oracle|null $value Value to set for the oracle property.
|
||||
*/
|
||||
public function setOracle(?OracleHealthCheckResponse_oracle $value): void {
|
||||
$this->oracle = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the status property value. État de santé global de la connectivité Oracle.
|
||||
* @param OracleHealthCheckResponse_status|null $value Value to set for the status property.
|
||||
*/
|
||||
public function setStatus(?OracleHealthCheckResponse_status $value): void {
|
||||
$this->status = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the timestamp property value. Horodatage de la vérification au format RFC 3339 UTC.
|
||||
* @param DateTime|null $value Value to set for the timestamp property.
|
||||
*/
|
||||
public function setTimestamp(?DateTime $value): void {
|
||||
$this->timestamp = $value;
|
||||
}
|
||||
|
||||
}
|
||||
113
client/Models/OracleHealthCheckResponse_oracle.php
Normal file
113
client/Models/OracleHealthCheckResponse_oracle.php
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
<?php
|
||||
|
||||
namespace Uwil\ArcadiaKiotaOpenApiClient\Models;
|
||||
|
||||
use Microsoft\Kiota\Abstractions\Serialization\AdditionalDataHolder;
|
||||
use Microsoft\Kiota\Abstractions\Serialization\Parsable;
|
||||
use Microsoft\Kiota\Abstractions\Serialization\ParseNode;
|
||||
use Microsoft\Kiota\Abstractions\Serialization\SerializationWriter;
|
||||
|
||||
class OracleHealthCheckResponse_oracle implements AdditionalDataHolder, Parsable
|
||||
{
|
||||
/**
|
||||
* @var array<string, mixed>|null $additionalData Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
|
||||
*/
|
||||
private ?array $additionalData = null;
|
||||
|
||||
/**
|
||||
* @var string|null $connection Nom de la connexion Oracle vérifiée.
|
||||
*/
|
||||
private ?string $connection = null;
|
||||
|
||||
/**
|
||||
* @var OracleHealthCheckResponse_oracle_status|null $status État de la connectivité Oracle.
|
||||
*/
|
||||
private ?OracleHealthCheckResponse_oracle_status $status = null;
|
||||
|
||||
/**
|
||||
* Instantiates a new OracleHealthCheckResponse_oracle and sets the default values.
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->setAdditionalData([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new instance of the appropriate class based on discriminator value
|
||||
* @param ParseNode $parseNode The parse node to use to read the discriminator value and create the object
|
||||
* @return OracleHealthCheckResponse_oracle
|
||||
*/
|
||||
public static function createFromDiscriminatorValue(ParseNode $parseNode): OracleHealthCheckResponse_oracle {
|
||||
return new OracleHealthCheckResponse_oracle();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
|
||||
* @return array<string, mixed>|null
|
||||
*/
|
||||
public function getAdditionalData(): ?array {
|
||||
return $this->additionalData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the connection property value. Nom de la connexion Oracle vérifiée.
|
||||
* @return string|null
|
||||
*/
|
||||
public function getConnection(): ?string {
|
||||
return $this->connection;
|
||||
}
|
||||
|
||||
/**
|
||||
* The deserialization information for the current model
|
||||
* @return array<string, callable(ParseNode): void>
|
||||
*/
|
||||
public function getFieldDeserializers(): array {
|
||||
$o = $this;
|
||||
return [
|
||||
'connection' => fn(ParseNode $n) => $o->setConnection($n->getStringValue()),
|
||||
'status' => fn(ParseNode $n) => $o->setStatus($n->getEnumValue(OracleHealthCheckResponse_oracle_status::class)),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the status property value. État de la connectivité Oracle.
|
||||
* @return OracleHealthCheckResponse_oracle_status|null
|
||||
*/
|
||||
public function getStatus(): ?OracleHealthCheckResponse_oracle_status {
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes information the current object
|
||||
* @param SerializationWriter $writer Serialization writer to use to serialize this model
|
||||
*/
|
||||
public function serialize(SerializationWriter $writer): void {
|
||||
$writer->writeStringValue('connection', $this->getConnection());
|
||||
$writer->writeEnumValue('status', $this->getStatus());
|
||||
$writer->writeAdditionalData($this->getAdditionalData());
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
|
||||
* @param array<string,mixed> $value Value to set for the AdditionalData property.
|
||||
*/
|
||||
public function setAdditionalData(?array $value): void {
|
||||
$this->additionalData = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the connection property value. Nom de la connexion Oracle vérifiée.
|
||||
* @param string|null $value Value to set for the connection property.
|
||||
*/
|
||||
public function setConnection(?string $value): void {
|
||||
$this->connection = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the status property value. État de la connectivité Oracle.
|
||||
* @param OracleHealthCheckResponse_oracle_status|null $value Value to set for the status property.
|
||||
*/
|
||||
public function setStatus(?OracleHealthCheckResponse_oracle_status $value): void {
|
||||
$this->status = $value;
|
||||
}
|
||||
|
||||
}
|
||||
10
client/Models/OracleHealthCheckResponse_oracle_status.php
Normal file
10
client/Models/OracleHealthCheckResponse_oracle_status.php
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Uwil\ArcadiaKiotaOpenApiClient\Models;
|
||||
|
||||
use Microsoft\Kiota\Abstractions\Enum;
|
||||
|
||||
class OracleHealthCheckResponse_oracle_status extends Enum {
|
||||
public const UP = "up";
|
||||
public const DOWN = "down";
|
||||
}
|
||||
10
client/Models/OracleHealthCheckResponse_status.php
Normal file
10
client/Models/OracleHealthCheckResponse_status.php
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Uwil\ArcadiaKiotaOpenApiClient\Models;
|
||||
|
||||
use Microsoft\Kiota\Abstractions\Enum;
|
||||
|
||||
class OracleHealthCheckResponse_status extends Enum {
|
||||
public const HEALTHY = "healthy";
|
||||
public const UNHEALTHY = "unhealthy";
|
||||
}
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"descriptionHash": "09DCF433E66EDE385A77F26E40760781CED2654D8E763F51606579B841EDEE325875398D750AC5124A30FDD0D8255A45F18D11AE59D23D71F36A4CF19FEDB3E5",
|
||||
"descriptionLocation": "../openapi.yaml",
|
||||
"descriptionHash": "F285857D9D98C1F8E567FC1574173A7FDB61535FFA064CD78F1E4F9FE6583631D32477A8EAFEF1BA63148FC91BF153405DA3444881CCDD067CADF53E4CDD5DCF",
|
||||
"descriptionLocation": "../documentation/openapi.yaml",
|
||||
"lockFileVersion": "1.0.0",
|
||||
"kiotaVersion": "1.34.1-Version suffix set to preview.202608200001",
|
||||
"kiotaVersion": "1.35.0",
|
||||
"clientClassName": "ApiClient",
|
||||
"typeAccessModifier": "Private",
|
||||
"clientNamespaceName": "Uwil\\ArcadiaKiotaOpenApiClient",
|
||||
|
|
|
|||
|
|
@ -60,6 +60,30 @@ paths:
|
|||
schema:
|
||||
$ref: "#/components/schemas/HealthCheckResponse"
|
||||
|
||||
/health/oracle:
|
||||
get:
|
||||
tags:
|
||||
- System
|
||||
summary: Sonde dédiée à la connectivité Oracle
|
||||
description: |
|
||||
Vérifie exclusivement la connectivité à la base Oracle Arcadia.
|
||||
Cette sonde est destinée au monitoring externe (ex: UptimeRobot) et ne teste ni cache ni SMTP.
|
||||
operationId: checkOracleHealth
|
||||
security: []
|
||||
responses:
|
||||
"200":
|
||||
description: Connectivité Oracle opérationnelle.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/OracleHealthCheckResponse"
|
||||
"503":
|
||||
description: Connectivité Oracle indisponible.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/OracleHealthCheckResponse"
|
||||
|
||||
/employees:
|
||||
get:
|
||||
tags:
|
||||
|
|
@ -681,6 +705,44 @@ components:
|
|||
- "null"
|
||||
description: Message d'erreur éventuel en cas d'échec.
|
||||
|
||||
OracleHealthCheckResponse:
|
||||
type: object
|
||||
description: Résultat de la sonde de connectivité Oracle.
|
||||
required:
|
||||
- status
|
||||
- timestamp
|
||||
- oracle
|
||||
properties:
|
||||
status:
|
||||
type: string
|
||||
enum:
|
||||
- healthy
|
||||
- unhealthy
|
||||
description: État de santé global de la connectivité Oracle.
|
||||
example: "healthy"
|
||||
timestamp:
|
||||
type: string
|
||||
format: date-time
|
||||
description: Horodatage de la vérification au format RFC 3339 UTC.
|
||||
example: "2026-08-21T14:30:00Z"
|
||||
oracle:
|
||||
type: object
|
||||
required:
|
||||
- status
|
||||
- connection
|
||||
properties:
|
||||
status:
|
||||
type: string
|
||||
enum:
|
||||
- up
|
||||
- down
|
||||
description: État de la connectivité Oracle.
|
||||
example: "up"
|
||||
connection:
|
||||
type: string
|
||||
description: Nom de la connexion Oracle vérifiée.
|
||||
example: "arcadia"
|
||||
|
||||
Brand:
|
||||
type: object
|
||||
description: Représentation canonique d'une marque dans Arcadia API.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue