Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
237 changes: 5 additions & 232 deletions code/API_definitions/network-slice-assignment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@
sinkCredential:
description: A sink credential provides authentication or authorization information necessary to enable delivery of events to a target.
allOf:
- $ref: "#/components/schemas/SinkCredential"
- $ref: "../common/CAMARA_event_common.yaml#/components/schemas/SinkCredential"
Device:
description: |
End-user equipment able to connect to a mobile network. Examples of devices include smartphones or IoT sensors/actuators.
Expand Down Expand Up @@ -623,7 +623,7 @@
serviceArea is a geographical area where the network slice will be reserved.
It can be defined as a circle or a polygon.
allOf:
- $ref: "#/components/schemas/Area"
- $ref: "../common/CAMARA_common.yaml#/components/schemas/Area"
sliceQosProfile:
description: |
sliceQosProfile is a set of quality of service parameters that define the requirements for the network slice.
Expand All @@ -639,7 +639,7 @@
sinkCredential:
description: A sink credential provides authentication or authorization information necessary to enable delivery of events to a target.
allOf:
- $ref: "#/components/schemas/SinkCredential"
- $ref: "../common/CAMARA_event_common.yaml#/components/schemas/SinkCredential"
required:
- serviceTime
- serviceArea
Expand Down Expand Up @@ -754,94 +754,6 @@
required:
- startDate

Area:
description: Base schema for all areas
type: object
properties:
areaType:
$ref: "#/components/schemas/AreaType"
required:
- areaType
discriminator:
propertyName: areaType
mapping:
CIRCLE: "#/components/schemas/Circle"
POLYGON: "#/components/schemas/Polygon"

AreaType:
type: string
description: |
Type of this area.
CIRCLE - The area is defined as a circle.
POLYGON - The area is defined as a polygon.
enum:
- CIRCLE
- POLYGON

Circle:
description: Circular area
allOf:
- $ref: "#/components/schemas/Area"
- type: object
required:
- center
- radius
properties:
center:
$ref: "#/components/schemas/Point"
radius:
type: number
description: Distance from the center in meters
minimum: 1

Polygon:
description: Polygonal area. The Polygon should be a simple polygon, i.e. should not intersect itself.
allOf:
- $ref: "#/components/schemas/Area"
- type: object
required:
- boundary
properties:
boundary:
$ref: "#/components/schemas/PointList"

PointList:
description: List of points defining a polygon
type: array
items:
$ref: "#/components/schemas/Point"
minItems: 3
maxItems: 15

Point:
type: object
description: Coordinates (latitude, longitude) defining a location in a map
required:
- latitude
- longitude
properties:
latitude:
$ref: "#/components/schemas/Latitude"
longitude:
$ref: "#/components/schemas/Longitude"
example:
latitude: 31.22529
longitude: 121.48905

Latitude:
description: Latitude component of a location
type: number
format: double
minimum: -90
maximum: 90

Longitude:
description: Longitude component of location
type: number
format: double
minimum: -180
maximum: 180

ErrorInfo:
type: object
description: A structured error response providing details about a failed request, including the HTTP status code, an error code, and a human-readable message
Expand All @@ -865,49 +777,6 @@
maxLength: 512
description: A human-readable description of what the event represents

CloudEvent:
type: object
description: |
CloudEvents 1.0 specification envelope.
This schema is the stable base for all CAMARA event notifications.
It imposes no constraints on `type` values or `data` structure —
those concerns belong to the API-specific and lifecycle group schemas.
required:
- id
- source
- specversion
- type
- time
properties:
id:
type: string
maxLength: 256
description: Identifier of this event, unique within the source context.
source:
$ref: "#/components/schemas/Source"
type:
type: string
maxLength: 512
description: |
Identifies the event type. CAMARA APIs use reverse-DNS notation:
`org.camaraproject.<api-name>.<event-version>.<event-name>`
The api-name segment makes each type globally unique across API groups.
specversion:
type: string
description: Version of the specification to which this event conforms (must be 1.0 if it conforms to cloudevents 1.0.2 version)
enum:
- "1.0"
datacontenttype:
type: string
description: 'media-type that describes the event payload encoding, must be "application/json" for CAMARA APIs'
enum:
- application/json
data:
type: object
description: Event details payload. Structure is defined by each concrete event schema.
time:
$ref: "#/components/schemas/DateTime"

ApiEventType:
type: string
description: |
Expand All @@ -925,16 +794,16 @@
Adding a new event type only requires updating ApiEventType and the
discriminator mapping below — the CloudEvent base never changes.
allOf:
- $ref: "#/components/schemas/CloudEvent"
- $ref: "../common/CAMARA_event_common.yaml#/components/schemas/CloudEvent"
- type: object
properties:
type:
$ref: "#/components/schemas/ApiEventType"
discriminator:
propertyName: "type"
propertyName: type
mapping:
org.camaraproject.network-slice-assignment.v0.status-changed: "#/components/schemas/AssignmentDeviceEvent"
AssignmentDeviceEvent:

Check notice on line 806 in code/API_definitions/network-slice-assignment.yaml

View workflow job for this annotation

GitHub Actions / validation / Validate

Component may be unused

[S-211] Potentially unused component has been detected. | Suggestion%3A Spectral does not follow discriminator mappings — verify the schema is truly unused.
description: Event to notify about device assignment status change
allOf:
- $ref: "#/components/schemas/ApiNotificationEvent"
Expand All @@ -957,77 +826,6 @@
WARN: This optional field in CloudEvents specification is required in CAMARA APIs implementation.
example: '2018-04-05T17:31:00Z'

Source:
type: string
format: uri-reference
minLength: 1
maxLength: 2048
description: |
Identifies the context in which an event happened - be a non-empty `URI-reference` like:
- URI with a DNS authority:
* https://github.com/cloudevents
* mailto:cncf-wg-serverless@lists.cncf.io
- Universally-unique URN with a UUID:
* urn:uuid:6e8bc430-9c3a-11d9-9669-0800200c9a66
- Application-specific identifier:
* /cloudevents/spec/pull/123
* 1-555-123-4567
example: "https://notificationSendServer12.example.com"

SinkCredential:
description: A sink credential provides authentication or authorization information necessary to enable delivery of events to a target.
type: object
properties:
credentialType:
type: string
enum:
- ACCESSTOKEN
- PRIVATE_KEY_JWT
description: |
The type of the credential - MUST be set to ACCESSTOKEN or PRIVATE_KEY_JWT for now
discriminator:
propertyName: credentialType
mapping:
ACCESSTOKEN: "#/components/schemas/AccessTokenCredential"
PRIVATE_KEY_JWT: "#/components/schemas/PrivateKeyJWTCredential"
required:
- credentialType
AccessTokenCredential:
type: object
description: An access token credential. This type of credential is meant to be used by API Consumers that have limited capabilities to handle authorization requests.
allOf:
- $ref: "#/components/schemas/SinkCredential"
- type: object
properties:
accessToken:
description: REQUIRED. An access token is a token granting access to the target resource.
type: string
maxLength: 4096
accessTokenExpiresUtc:
type: string
format: date-time
maxLength: 64
description: |
REQUIRED. An absolute (UTC) timestamp at which the token shall be considered expired.
In the case of an ACCESS_TOKEN_EXPIRED termination reason, implementation should notify the client before the expiration date.
If the access token is a JWT and registered "exp" (Expiration Time) claim is present, the two expiry times should match.
It must follow [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) and must have time zone.
example: "2023-07-03T12:27:08.312Z"
accessTokenType:
description: REQUIRED. Type of the access token (See [OAuth 2.0](https://tools.ietf.org/html/rfc6749#section-7.1)).
type: string
enum:
- bearer
required:
- accessToken
- accessTokenExpiresUtc
- accessTokenType
PrivateKeyJWTCredential:
type: object
description: Use PRIVATE_KEY_JWT to get an access token. The authorization server information needed for this type of sink credential (token endpoint, client ID, JWKS URL) is shared upfront between the client and the CAMARA entity. This type of credential is to be used by clients that have an authorization server.
allOf:
- $ref: "#/components/schemas/SinkCredential"

responses:
Generic400:
description: Bad Request
Expand Down Expand Up @@ -1169,31 +967,6 @@
status: 410
code: GONE
message: Access to the target resource is no longer available.
NetworkSliceBooking422:
description: Unprocessable Content
headers:
x-correlator:
$ref: "#/components/headers/x-correlator"
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 422
code:
enum:
- NETWORK_SLICE_BOOKING.RESOURCES_NOT_APPLICABLE
examples:
NETWORK_SLICE_BOOKING_422_RESOURCES_NOT_APPLICABLE:
description: Request cannot be processed due to business logic validation failure, e.g. service area is not supported or resources are insufficient
value:
status: 422
code: NETWORK_SLICE_BOOKING.RESOURCES_NOT_APPLICABLE
message: The request resources are not applicable for slice creation.
Generic422:
description: Unprocessable Content
headers:
Expand Down
Loading