diff --git a/interfaces/interuss/automated_testing b/interfaces/interuss/automated_testing index e5e5ff2..7edfa5e 160000 --- a/interfaces/interuss/automated_testing +++ b/interfaces/interuss/automated_testing @@ -1 +1 @@ -Subproject commit e5e5ff2a3f1ae6a381402e9ce5f9efb37d3b9876 +Subproject commit 7edfa5ee3540875ee5b2fc0487938c9610d94924 diff --git a/src/uas_standards/interuss/automated_testing/flight_planning/v1/api.py b/src/uas_standards/interuss/automated_testing/flight_planning/v1/api.py index 5da417f..3b37ce7 100644 --- a/src/uas_standards/interuss/automated_testing/flight_planning/v1/api.py +++ b/src/uas_standards/interuss/automated_testing/flight_planning/v1/api.py @@ -1,4 +1,4 @@ -"""Data types and operations from Flight Planning Automated Testing Interface 0.1.0 OpenAPI""" +"""Data types and operations from Flight Planning Automated Testing Interface 0.3.0 OpenAPI""" # This file is autogenerated; do not modify manually! @@ -12,9 +12,13 @@ from implicitdict import ImplicitDict, StringBasedDateTime -API_VERSION = "0.1.0" +API_VERSION = "0.3.0" """Version of Flight Planning Automated Testing Interface OpenAPI specification from which the objects in this package were generated.""" +FlightPlanID = str +"""String identifying a user flight plan. Format matches a version-4 UUID according to RFC 4122.""" + + class StatusResponseStatus(str, Enum): """The status of the USS automated testing interface. - `Starting`: the USS is starting and the automated test driver should wait before sending requests. @@ -32,14 +36,11 @@ class StatusResponse(ImplicitDict): - `Ready`: the USS is ready to receive test requests. """ - system_version: Optional[str] - """Arbitrary string representing the version of the USS system to be tested.""" - api_name: Optional[str] """Indication of the API implemented at this URL. Must be "Flight Planning Automated Testing Interface".""" api_version: Optional[str] - """Indication of the API version implemented at this URL. Must be "v0.1.0" when implementing this version of the API.""" + """Indication of the API version implemented at this URL. Must be "v0.3.0" when implementing this version of the API.""" class FlightPlanAdditionalInformation(ImplicitDict): @@ -62,10 +63,11 @@ class BasicFlightPlanInformationUsageState(str, Enum): class BasicFlightPlanInformationUasState(str, Enum): """State of the user's UAS associated with this flight plan. - - `Nominal`: The user or UAS reports or implies that it is performing nominally. + - `Nominal`: The user or UAS reports or implies that it is performing nominally, or has not indicated + `OffNominal` or `Contingent`. - `OffNominal`: The user or UAS reports or implies that it is temporarily not performing nominally, but - expects to be able to recover to normal operation. + may expect to be able to recover to normal operation. - `Contingent`: The user or UAS reports or implies that it is not performing nominally and may be unable to recover to normal operation. @@ -76,95 +78,106 @@ class BasicFlightPlanInformationUasState(str, Enum): Contingent = "Contingent" -class UpsertFlightPlanResponseResult(str, Enum): - """The result of the flight plan submission. If any option other than `Planned` or `ReadyToFly` is specified, the `notes` field should be populated with the reason for the unsuccessful outcome. +class ExecutionStyle(str, Enum): + """The style of execution of a specified flight planning action that the operator would like the USS to perform. + + - `Hypothetical`: The user does not want the USS to actually perform any action regarding the actual flight plan. Instead, the user would like to know the likely outcome if the action were hypothetically attempted. The response to this request will not refer to an actual flight plan, or an actual state change in an existing flight plan, but rather a hypothetical flight plan or a hypothetical change to an existing flight plan. + + - `IfAllowed`: The user would like to perform the requested action if it is allowed. If the requested action is allowed, the USS should actually perform the action (e.g., actually create a new ASTM F3548-21 operational intent). If the requested action is not allowed, the USS should indicate that the action is Rejected and not perform the action. The response to this request will refer to an actual flight plan when appropriate, and never refer to a hypothetical flight plan or status. + + - `InReality`: The user is communicating an actual state of reality. The USS should consider the user to be actually performing (or attempting to perform) this action, regardless of whether or not the action is allowed under relevant UTM rules. + """ + + Hypothetical = "Hypothetical" + IfAllowed = "IfAllowed" + InReality = "InReality" + - - `Planned`: The data submitted in the flight plan intent was valid and the flight plan was successfully processed by the USS and is now authorized, but the user may not yet start flying (even if within the time bounds of the flight plan). +class PlanningActivityResult(str, Enum): + """The result of a flight planning activity. - - `ReadyToFly`: The flight plan is ready for the operator to begin flying within the bounds (including time) of the flight plan. + - `Completed`: The user's flight plan has been updated according to the situation specified by the user. - - `Rejected`: The data provided in the flight plan was invalid and/or could not be used to successfully authorize the flight. The reason for rejection may include a disallowed conflict with another flight. + - `Rejected`: The updates the user requested to their flight plan are not allowed according to the rules under which the flight plan is being managed. The reasons for rejection may include a disallowed conflict with another flight during preflight. - - `Failed`: The USS was not able to successfully authorize the flight plan due to a problem with the USS or a downstream system + - `Failed`: The USS was not able to successfully authorize or update the flight plan due to a problem with the USS or a downstream system. - - `NotSupported`: The USS does not support the attempted interaction. For instance, if the request specified a high-priority flight and the USS does not support management of high-priority flights. + - `NotSupported`: The USS's implementation does not support the attempted interaction. For instance, if the request specified a high-priority flight and the USS does not support management of high-priority flights. """ - Planned = "Planned" - ReadyToFly = "ReadyToFly" + Completed = "Completed" Rejected = "Rejected" Failed = "Failed" NotSupported = "NotSupported" -UpsertFlightPlanResponseIncludesAdvisories = str -"""Indication of whether any advisories or conditions were provided to the user along with the result of this flight planning attempt. +class FlightPlanStatus(str, Enum): + """The status of the user's flight plan. - - `Unknown`: It is unknown or irrelevant whether advisories or conditions were provided to the user + - `NotPlanned`: The USS has not created an authorized flight plan for the user. - - `Yes`: At least one advisory or condition was provided to the user. + - `Planned`: The USS has created an authorized flight plan for the user, but the user may not yet start flying (even if within the time bounds of the flight plan). - - `No`: No advisories or conditions were provided to the user. + - `OkToFly`: The flight plan is in a state such that it is ok for the user to nominally fly within the bounds (including time) of the flight plan. -Acceptable values: -* Unknown -* True -* False -""" + - `OffNominal`: The flight plan now reflects the user's actions, but the flight plan is not in a nominal state (e.g., the USS has placed the ASTM F3548-21 operational intent into one of the Nonconforming or Contingent states). + - `Closed`: The flight plan was closed successfully by the USS and is now out of the UTM system. + """ -class UpsertFlightPlanResponse(ImplicitDict): - result: UpsertFlightPlanResponseResult - """The result of the flight plan submission. If any option other than `Planned` or `ReadyToFly` is specified, the `notes` field should be populated with the reason for the unsuccessful outcome. + NotPlanned = "NotPlanned" + Planned = "Planned" + OkToFly = "OkToFly" + OffNominal = "OffNominal" + Closed = "Closed" - - `Planned`: The data submitted in the flight plan intent was valid and the flight plan was successfully processed by the USS and is now authorized, but the user may not yet start flying (even if within the time bounds of the flight plan). - - `ReadyToFly`: The flight plan is ready for the operator to begin flying within the bounds (including time) of the flight plan. +class AdvisoryInclusion(str, Enum): + """Indication of whether any advisories or conditions were provided to the user along with the result of an associated flight planning attempt. - - `Rejected`: The data provided in the flight plan was invalid and/or could not be used to successfully authorize the flight. The reason for rejection may include a disallowed conflict with another flight. + - `Unknown`: It is unknown or irrelevant whether advisories or conditions were provided to the user - - `Failed`: The USS was not able to successfully authorize the flight plan due to a problem with the USS or a downstream system + - `AtLeastOneAdvisoryOrCondition`: At least one advisory or condition was provided to the user. - - `NotSupported`: The USS does not support the attempted interaction. For instance, if the request specified a high-priority flight and the USS does not support management of high-priority flights. + - `NoAdvisoriesOrConditions`: No advisories or conditions were provided to the user. """ - notes: Optional[str] - """Human-readable explanation of the observed result. This explanation may be made available to a human reviewing the test results, and ideally should explain why an undesirable result was obtained. For instance, if the injection attempt Failed, then these notes may indicate that the attempt failed because the DSS indicated 400 to a valid request (perhaps also including the valid request as proof).""" + Unknown = "Unknown" + AtLeastOneAdvisoryOrCondition = "AtLeastOneAdvisoryOrCondition" + NoAdvisoriesOrConditions = "NoAdvisoriesOrConditions" - includes_advisories: Optional[UpsertFlightPlanResponseIncludesAdvisories] = "Unknown" - """Indication of whether any advisories or conditions were provided to the user along with the result of this flight planning attempt. - - `Unknown`: It is unknown or irrelevant whether advisories or conditions were provided to the user - - - `Yes`: At least one advisory or condition was provided to the user. +class UpsertFlightPlanResponse(ImplicitDict): + planning_result: PlanningActivityResult + """The result of the flight plan creation or update attempt. If any option other than `Completed` is specified, the `notes` field should be populated with the reason for the unsuccessful outcome.""" - - `No`: No advisories or conditions were provided to the user. - """ + notes: Optional[str] + """Human-readable explanation of the observed result. This explanation may be made available to a human reviewing the test results, and ideally should explain why an undesirable result was obtained. For instance, if the injection attempt Failed, then these notes may indicate that the attempt failed because the DSS indicated 400 to a valid request (perhaps also including the valid request as proof).""" + flight_plan_status: FlightPlanStatus + """The status of the user's flight plan following the flight planning activity.""" -class DeleteFlightPlanResponseResult(str, Enum): - """The result of attempted flight plan cancellation/closure. + includes_advisories: Optional[AdvisoryInclusion] + """Nature of advisories included in the response to the user regarding their attempt to perform this flight planning activity.""" - - `Closed`: The flight plan was closed successfully by the USS and is now out of the UTM system. - - `Failed`: The flight plan could not be closed successfully by the USS. - """ +class DeleteFlightPlanResponse(ImplicitDict): + planning_result: PlanningActivityResult + """The result of attempted flight plan cancellation/closure. If any option other than `Completed` is specified, the `notes` field should be populated with the reason for the unsuccessful outcome.""" - Closed = "Closed" - Failed = "Failed" + notes: Optional[str] + """Human-readable explanation of the observed result.""" + flight_plan_status: FlightPlanStatus + """The status of the user's flight plan following the flight planning activity.""" -class DeleteFlightPlanResponse(ImplicitDict): - result: DeleteFlightPlanResponseResult - """The result of attempted flight plan cancellation/closure. + includes_advisories: Optional[AdvisoryInclusion] + """Nature of advisories included in the response to the user regarding their attempt to cancel/close their flight plan.""" - - `Closed`: The flight plan was closed successfully by the USS and is now out of the UTM system. - - `Failed`: The flight plan could not be closed successfully by the USS. - """ +class ClearAreaOutcomeDetails(ImplicitDict): + """Optional free-form structured data to augment `message`.""" - notes: Optional[str] - """Human-readable explanation of the observed result.""" class ClearAreaOutcome(ImplicitDict): @@ -174,6 +187,9 @@ class ClearAreaOutcome(ImplicitDict): message: Optional[str] """If the USS was unable to clear the entire area, this message can provide information on the problem encountered.""" + details: Optional[ClearAreaOutcomeDetails] + """Optional free-form structured data to augment `message`.""" + class ClearAreaResponse(ImplicitDict): outcome: ClearAreaOutcome @@ -335,10 +351,6 @@ class Time(ImplicitDict): format: TimeFormat = TimeFormat.RFC3339 -UUIDv4Format = str -"""String whose format matches a version-4 UUID according to RFC 4122.""" - - class ASTMF354821OpIntentInformation(ImplicitDict): """Information provided about a flight plan that is necessary for ASTM F3548-21.""" @@ -442,7 +454,7 @@ class Volume4D(ImplicitDict): class BasicFlightPlanInformation(ImplicitDict): - """Basic information about a flight plan that an operator and/or UAS can be expected to provide in most flight planning scenarios.""" + """Basic information about a flight plan that a user and/or UAS can be expected to provide in most flight planning scenarios.""" usage_state: BasicFlightPlanInformationUsageState """User's current usage of the flight plan. @@ -455,20 +467,18 @@ class BasicFlightPlanInformation(ImplicitDict): uas_state: BasicFlightPlanInformationUasState """State of the user's UAS associated with this flight plan. - - `Nominal`: The user or UAS reports or implies that it is performing nominally. + - `Nominal`: The user or UAS reports or implies that it is performing nominally, or has not indicated + `OffNominal` or `Contingent`. - `OffNominal`: The user or UAS reports or implies that it is temporarily not performing nominally, but - expects to be able to recover to normal operation. + may expect to be able to recover to normal operation. - `Contingent`: The user or UAS reports or implies that it is not performing nominally and may be unable to recover to normal operation. """ - nominal_area: Optional[List[Volume4D]] = [] - """User nominally intends or intended to fly in this entire area. If authorizations are required and cannot be granted to cover this entire area, the plan should be rejected.""" - - off_nominal_area: Optional[List[Volume4D]] = [] - """While experiencing an off-nominal situation, the user's aircraft may travel anywhere in this area. If the flight_state is nominal, this field must be empty or omitted.""" + area: Optional[List[Volume4D]] = [] + """The complete area in which the user intends to fly, or may fly, as known by the user. The user intends to fly, or may fly, anywhere in this entire area.""" class ClearAreaRequest(ImplicitDict): @@ -476,7 +486,7 @@ class ClearAreaRequest(ImplicitDict): """Unique string identifying this request. If a second request with an identical ID is received, the USS may return the same response from the previous operation rather than attempting to clear the area again (the USS may also attempt to clear the area again).""" extent: Volume4D - """The USS should cancel and remove any flight plan where any part of that flight plan intersects this area.""" + """The USS should cancel and remove any flight plan it manages where any part of that flight plan intersects this area.""" class FlightPlan(ImplicitDict): @@ -495,9 +505,15 @@ class FlightPlan(ImplicitDict): class UpsertFlightPlanRequest(ImplicitDict): - intended_flight: FlightPlan + """Client request to emulate a user performing a flight planning action.""" + + flight_plan: FlightPlan + """Complete new or updated information about the flight describing the flight planning action to be taken.""" - request_id: UUIDv4Format + execution_style: ExecutionStyle + """Style of execution for the requested flight planning action.""" + + request_id: str """ID uniquely identifying the upsertion request. If additional requests are received with the same request_id, the response from the first request should be returned, or an error indicated.""" diff --git a/src/uas_standards/interuss/automated_testing/geo_awareness/v1/api.py b/src/uas_standards/interuss/automated_testing/geo_awareness/v1/api.py index c965ec4..11f17bc 100644 --- a/src/uas_standards/interuss/automated_testing/geo_awareness/v1/api.py +++ b/src/uas_standards/interuss/automated_testing/geo_awareness/v1/api.py @@ -1,4 +1,4 @@ -"""Data types and operations from Geo-Awareness Automated Test Interfaces 0.1.0 OpenAPI""" +"""Data types and operations from Geo-Awareness Automated Test Interfaces 0.2.0 OpenAPI""" # This file is autogenerated; do not modify manually! @@ -12,7 +12,7 @@ from implicitdict import ImplicitDict, StringBasedDateTime -API_VERSION = "0.1.0" +API_VERSION = "0.2.0" """Version of Geo-Awareness Automated Test Interfaces OpenAPI specification from which the objects in this package were generated.""" UUIDv4Format = str @@ -36,9 +36,6 @@ class StatusResponse(ImplicitDict): - `Ready`: the USS is ready to receive test requests. """ - version: Optional[str] - """Arbitrary string representing the version of the USS system to be tested.""" - class GeozoneHttpsSourceFormat(str, Enum): """The format of the response expected from the source.""" diff --git a/src/uas_standards/interuss/automated_testing/geospatial_map/v1/api.py b/src/uas_standards/interuss/automated_testing/geospatial_map/v1/api.py index 66e5091..dc01891 100644 --- a/src/uas_standards/interuss/automated_testing/geospatial_map/v1/api.py +++ b/src/uas_standards/interuss/automated_testing/geospatial_map/v1/api.py @@ -1,4 +1,4 @@ -"""Data types and operations from Geospatial Map Provider Automated Testing Interface 0.1.0 OpenAPI""" +"""Data types and operations from Geospatial Map Provider Automated Testing Interface 0.2.0 OpenAPI""" # This file is autogenerated; do not modify manually! @@ -12,7 +12,7 @@ from implicitdict import ImplicitDict, StringBasedDateTime -API_VERSION = "0.1.0" +API_VERSION = "0.2.0" """Version of Geospatial Map Provider Automated Testing Interface OpenAPI specification from which the objects in this package were generated.""" UUIDv4Format = str @@ -36,14 +36,11 @@ class StatusResponse(ImplicitDict): - `Ready`: the USS is ready to receive test requests. """ - system_version: Optional[str] - """Arbitrary string representing the version of the USS system to be tested.""" - api_name: Optional[str] """Indication of the API implemented at this URL. Must be "Geospatial Map Provider Automated Testing Interface".""" api_version: Optional[str] - """Indication of the API version implemented at this URL. Must be "v0.1.0" when implementing this version of the API.""" + """Indication of the API version implemented at this URL. Must be "v0.2.0" when implementing this version of the API.""" class GeospatialHttpsSourceFormat(str, Enum): diff --git a/src/uas_standards/interuss/automated_testing/rid/v1/injection.py b/src/uas_standards/interuss/automated_testing/rid/v1/injection.py index af3f6b7..a37fc04 100644 --- a/src/uas_standards/interuss/automated_testing/rid/v1/injection.py +++ b/src/uas_standards/interuss/automated_testing/rid/v1/injection.py @@ -238,6 +238,23 @@ class UASID(ImplicitDict): """An altitude, in meters, above the WGS84 ellipsoid.""" +class RIDHeightReference(str, Enum): + """The reference datum above which the height is reported.""" + + TakeoffLocation = "TakeoffLocation" + GroundLevel = "GroundLevel" + + +class RIDHeight(ImplicitDict): + """A relative altitude for the purposes of remote ID.""" + + distance: float + """Distance above reference datum. This value is provided in meters and must have a minimum resolution of 1 meter.""" + + reference: RIDHeightReference + """The reference datum above which the height is reported.""" + + OperatorId = str """CAA-issued registration/license ID for the remote pilot or operator. """ @@ -285,23 +302,6 @@ class RIDOperationalStatus(str, Enum): """Ground speed of flight in meters per second.""" -class RIDHeightReference(str, Enum): - """The reference datum above which the height is reported.""" - - TakeoffLocation = "TakeoffLocation" - GroundLevel = "GroundLevel" - - -class RIDHeight(ImplicitDict): - """A relative altitude for the purposes of remote ID.""" - - distance: float - """Distance above reference datum. This value is provided in meters and must have a minimum resolution of 1 meter.""" - - reference: RIDHeightReference - """The reference datum above which the height is reported.""" - - class RIDAircraftPosition(ImplicitDict): """Position of an aircraft as reported for remote ID purposes.""" @@ -311,6 +311,8 @@ class RIDAircraftPosition(ImplicitDict): alt: Altitude + height: Optional[RIDHeight] + accuracy_h: Optional[HorizontalAccuracy] """Horizontal error that is likely to be present in this reported position. Required when `extrapolated` field is true and always in the entry for the current state.""" diff --git a/src/uas_standards/interuss/automated_testing/scd/v1/api.py b/src/uas_standards/interuss/automated_testing/scd/v1/api.py index 9f52f18..d4d7984 100644 --- a/src/uas_standards/interuss/automated_testing/scd/v1/api.py +++ b/src/uas_standards/interuss/automated_testing/scd/v1/api.py @@ -1,4 +1,4 @@ -"""Data types and operations from Strategic Coordination Test Data Injection 0.1.0 OpenAPI""" +"""Data types and operations from Strategic Coordination Test Data Injection 0.2.0 OpenAPI""" # This file is autogenerated; do not modify manually! @@ -12,7 +12,7 @@ from implicitdict import ImplicitDict, StringBasedDateTime -API_VERSION = "0.1.0" +API_VERSION = "0.2.0" """Version of Strategic Coordination Test Data Injection OpenAPI specification from which the objects in this package were generated.""" class StatusResponseStatus(str, Enum): @@ -32,9 +32,6 @@ class StatusResponse(ImplicitDict): - `Ready`: the USS is ready to receive test requests. """ - version: Optional[str] - """Arbitrary string representing the version of the USS system to be tested.""" - UUIDv4Format = str """String whose format matches a version-4 UUID according to RFC 4122.""" diff --git a/src/uas_standards/interuss/automated_testing/versioning/api.py b/src/uas_standards/interuss/automated_testing/versioning/api.py new file mode 100644 index 0000000..3f282f1 --- /dev/null +++ b/src/uas_standards/interuss/automated_testing/versioning/api.py @@ -0,0 +1,51 @@ +"""Data types and operations from Versioning Automated Testing Interface 0.1.0 OpenAPI""" + +# This file is autogenerated; do not modify manually! + +from __future__ import annotations + +from enum import Enum +from typing import Dict, Optional + +from uas_standards import Operation + +from implicitdict import ImplicitDict + + +API_VERSION = "0.1.0" +"""Version of Versioning Automated Testing Interface OpenAPI specification from which the objects in this package were generated.""" + +SystemBoundaryIdentifier = str +"""Identifier of a system boundary, known to both the client and the USS separate from this API, for which a USS can provide a version. While the format is not prescribed by this API, any value must be URL-safe. It is recommended to use an approach similar to reverse-order Internet domain names and Java packages where the global scope is described with increasingly-precise identifiers joined by periods. For instance, the system boundary containing the mandatory Network Identification U-space service might be identified with `gov.eu.uspace.v1.netid` because the authority defining this system boundary is a governmental organization (specifically, the European Union) with requirements imposed on the system under test by the U-space regulation (first version) -- specifically, the Network Identification Service section.""" + + +VersionIdentifier = str +"""Identifier of a particular version of a system (defined by a known system boundary). While the format is not prescribed by this API, a semantic version (https://semver.org/) prefixed with a `v` is recommended.""" + + +class GetVersionResponse(ImplicitDict): + system_identity: Optional[SystemBoundaryIdentifier] + """The requested system identity/boundary.""" + + system_version: Optional[VersionIdentifier] + """The USS's version for the system with the specified system identity/boundary.""" + + +class OperationID(str, Enum): + GetVersion = "GetVersion" + + +OPERATIONS: Dict[OperationID, Operation] = { + OperationID.GetVersion: Operation( + id="GetVersion", + path="/versions/{system_identity}", + verb="GET", + request_body_type=None, + response_body_type={ + 200: GetVersionResponse, + 401: None, + 403: None, + 404: None, + } + ), +} diff --git a/src/uas_standards/interuss/automated_testing/versioning/constants.py b/src/uas_standards/interuss/automated_testing/versioning/constants.py new file mode 100644 index 0000000..9f1fe8f --- /dev/null +++ b/src/uas_standards/interuss/automated_testing/versioning/constants.py @@ -0,0 +1,5 @@ +from enum import Enum + + +class Scope(str, Enum): + ReadSystemVersions = "interuss.versioning.read_system_versions" diff --git a/tools/openapi_conversion/generate_apis.sh b/tools/openapi_conversion/generate_apis.sh index aed0453..7ca71c9 100755 --- a/tools/openapi_conversion/generate_apis.sh +++ b/tools/openapi_conversion/generate_apis.sh @@ -77,3 +77,11 @@ docker container run -it \ openapi-python-converter \ --api /resources/interfaces/interuss/automated_testing/flight_planning/v1/flight_planning.yaml \ --python_output /resources/src/uas_standards/interuss/automated_testing/flight_planning/v1/api.py + +echo "Versioning for automated testing" +mkdir -p $(pwd)/../../src/uas_standards/interuss/automated_testing/versioning +docker container run -it \ + -v "$(pwd)/../..:/resources" \ + openapi-python-converter \ + --api /resources/interfaces/interuss/automated_testing/versioning/versioning.yaml \ + --python_output /resources/src/uas_standards/interuss/automated_testing/versioning/api.py