Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

application end point registration API yaml #321

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

maheshc01
Copy link
Collaborator

What type of PR is this?

This PR is to review and update application endpoint registration API yaml.

Add one of the following kinds:

  • bug
  • correction
  • enhancement/feature
  • cleanup
  • documentation
  • subproject management
  • tests

What this PR does / why we need it:

Initial commit of the yaml to provide ability to register application endpoints.

Which issue(s) this PR fixes:

issue #286

Fixes #

Special notes for reviewers:

This is only the initial commit and additional updates are required related to documentation, error codes etc to ensure it meets the CAMARA guidelines.

Changelog input

 release-note

Additional documentation

This section can be blank.

docs

Copy link

github-actions bot commented Nov 11, 2024

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ ACTION actionlint 2 0 0.03s
✅ JSON eslint-plugin-jsonc 1 0 0 1.38s
✅ JSON jsonlint 1 0 0.18s
✅ JSON prettier 1 1 0 0.92s
✅ JSON v8r 1 0 2.35s
✅ OPENAPI spectral 4 0 7.74s
✅ REPOSITORY git_diff yes no 0.54s
✅ REPOSITORY secretlint yes no 4.43s
✅ YAML yamllint 4 0 0.84s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

url: https://www.apache.org/licenses/LICENSE-2.0.html
description: |
Application endpoint registration allows application developers to
register one or more Application Endpoints, and retrieve, update,and
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we have a definition for "Application Endpoints" to make it more explicit?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also think that these Application Endpoints are not generic and they corresponds to the application instances running on edge cloud zones in probably distributed manner. So should we qualify the Application Endpoints in some way to indicate developers about the expectations from these endpoints i.e. edge instances?

description: |
Application endpoint registration allows application developers to
register one or more Application Endpoints, and retrieve, update,and
delete those egistrations.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose egistrations is should be "registrations"


This information can we used for various usecases like optimal end
point discovery to help end users connect to the most most optimal
instance of the application. Addtionally the information can be used
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel that if can refer or qualify applications as "edge applications" then it will make it more related to edge deployments while using generically may imply any deployment including clouds. Just a thought.

delete those egistrations.

This information can we used for various usecases like optimal end
point discovery to help end users connect to the most most optimal
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"most most optimal" should be changed to "most optimal"

items:
$ref: "#/components/schemas/ApplicationInstance"
responses:
"200":
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also consider the additional status codes which could be valid for the POST requests in alignment with other APIs and consistency.

paths:
/application-endpoints:
post:
operationId: register-application-endpoints
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the POST method should we also include "x-correlator" header as done with other APIs.?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Included "x-correlator" for all the APIs

edgeCloudRegionId:
$ref: "#/components/schemas/EdgeCloudRegionName"
ResourcesapplicationEndpoint:
type: object
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we assume that an application can expose only one endpoint or there could be more than one for different purposes? If there can be more than one which only application provider knows then this parameter should allow the multiplicity by having it as an array of objects. Also in that case with each endpoint there should be a discriminator field to allow client applications to know the purpose of a specific endpoint.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although the top level object is an array but then if application has multiple endpoints some of the information will be repeated that many times as they will be common to an application.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also had the same question about repetitive data in the array. For example, is it expected that applicationId is the same for each ApplicationInstance in the array? If any field must be the same for each item in the array, it should be factored out into a single field in a parent object that encapsulates the endpoints array. If every field in the array can be different, then what is the intent of assigning a single applicationEndpointsId to the entire array?

@maheshc01
Copy link
Collaborator Author

@urvika-v tagging Urvika for review and updates

@maheshc01 maheshc01 assigned maheshc01 and unassigned maheshc01 Nov 19, 2024
@maheshc01 maheshc01 removed their assignment Nov 19, 2024
Comment on lines +196 to +203
edgeCloudZoneId:
$ref: "#/components/schemas/EdgeCloudZoneId"
edgeCloudZoneName:
$ref: "#/components/schemas/EdgeCloudZoneName"
edgeCloudProvider:
$ref: "#/components/schemas/EdgeCloudProvider"
edgeCloudRegionId:
$ref: "#/components/schemas/EdgeCloudRegionName"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a question on the intent here. First, are these edgeCloudZone-related fields specified during the POST /application-endpoints API? If they are specified, is it expected that the Operator Platform handling the API call will verify that it has the specified Zone in it's list of zones (i.e., if I specify a random string for the Zone ID, it will reject it)? Or does it treat them as just a reference to some external Zone that it doesn't know about, so I could just put in anything there and I will just get it back out during the "find" API call?

ApplicationInstance:
description: Application instance represented
by application Endpoint definition
type: object
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest adding a required section to note which fields are required.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added "Required" section to the schema.

Comment on lines 187 to 189
applicationId:
type: string
description: Unique ID representing the Edge Application
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really the applicationId or is it the appInstanceId? In the EAM API, the appId refers to definition of an App, like a helm chart, while the appInstanceId refers to an actually deployed instance of the helm chart. I ask because this object is called ApplicationInstance but I don't see any appInstanceId field. I think it would confusing if applicationId in Discovery means something different from appId in EAM.

description: |
region of the Edge Cloud Zone.
type: string
TypesApplicationEndpointsId:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest renaming TypesApplicationEndpointsId to just ApplicationEndpointsId, as the Types prefix seems redundant.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

format: uuid
readOnly: true
additionalProperties: false
TypesApplicationProfileId:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest renaming TypesApplicationProfileId to just ApplicationProfileId, as the Types prefix seems redundant.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified "TypesApplicationProfileId" to "ApplicationProfileId"

paths:
/application-endpoints:
post:
operationId: register-application-endpoints
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to specify operationIds in camelCase, rather than dash-separated, i.e. this should be registerApplicationEndpoints. Both the EAM API and the official doc examples specify operationIds in camelCase, and it's better to be consistent across the APIs.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

- name: applicationEndpointsId
in: path
required: true
description: applicationEndpointsId param //added desc
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This description looks like it needs to be fixed, and the //added desc removed.
There's 6 instances //added desc in this file that need to be fixed.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

application.

paths:
/application-endpoints:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have expected there to also be a get method for /application-endpoints, to be able to list all of the registered applicationEndpointsId. Otherwise the client needs to maintain a database of the registered applicationEndpointsId to be able to update/delete them later.

Copy link

@urvika-v urvika-v Nov 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Added GetAll api which lists all the registered applications.

tags:
- Application Endpoint Registration
summary: Update a application Endpoint
description: Update registered application Endpoint information.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please clarify if the update completely replaces the existing array or does something else like appending to it.
Also, a minor complaint, typically the summary and description would come at the top, right after the method type (i.e. the put or get). Having it all the way at the bottom after the responses means I'm trying to understand all the details of the method before I know the general intent of the method, which is hard. I would suggest moving them up.

Copy link

@urvika-v urvika-v Nov 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the summary and the description to the top of the Schema.

tags:
- name: Application Endpoint Registration
description: |
Operations to register, read and manage an deployed instances of the
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

read and manage an deployed instances -> either read and manage a deployed instance or read and manage deployed instances. Not sure if the intent is singular or plural but right now it's a mix.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified to "read and manage deployed instances"

Updated Error codes,Description,Security Schema, required parameter and added GetAllApplicationEndpoints API
maheshc01 and others added 5 commits November 25, 2024 20:36
…ts-functionality-to-be-a-new-api

AER: Updated Error Codes, Description and added GetAllRegisteredApplicationEndpoints API
…ts-functionality-to-be-a-new-api

AER: Fixed Linting issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EDS API: Application Endpoints functionality to be a new API
4 participants