Discover Packages
github.com/radius-project/radius
pkg
corerp
directory
Version:
v0.40.0-rc1
Opens a new window with list of versions in this module.
Published: Nov 7, 2024
License: Apache-2.0
Opens a new window with license information.
README
README
¶
Applications.Core RP
WIP - This doc will be updated iteratively.
Layout
/pkg/corerp/api : API version specific models
/pkg/corerp/datamodel : API version agnostic models to implement operation controller and store resource metadata.
/pkg/corerp/frontend/controller : Per-operation controller implementations.
/pkg/corerp/frontend/handler : HTTP server handler and routers.
/pkg/corerp/frontend/middleware : HTTP server middleware.
/pkg/corerp/frontend/hostingoptions : Hosting options for resource provider service.
/pkg/corerp/frontend/servicecontext : Service context extracted from ARM proxy request header.
Add new resource type and its controller
Ensure that you update openapi spec in /swagger
Generate resource type models in /pkg/corerp/api by following the instruction.
Define api version agnostic datamodel in /pkg/corerp/datamodel and its converters between datamodel and api models.
Define routes for new resource type and its operation APIs in routes.go .
Create resource type directory under /pkg/frontend/controller/
and related go files by referring to environments controller .
Implement operation controllers and tests.
Register handlers in handlers.go .
How to Run and Test Core RP
Update StorageProvider section of cmd/applications-rp/radius-dev.yaml
by adding your Cosmos DB URL and key
With cmd/applications-rp/main.go
file open, go to Run And Debug
view in VS Code and click Run
You should have the service up and running at localhost:8080
now
To create or update an environment, here is an example curl command:
curl --location --request PUT 'http://localhost:8080/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0?api-version=2023-10-01-preview' \
--header 'X-Ms-Arm-Resource-System-Data: {"lastModifiedBy":"fake@hotmail.com","lastModifiedByType":"User","lastModifiedAt":"2022-03-22T18:54:52.6857175Z"}' \
--header 'Content-Type: application/json' \
--data-raw '{
"properties": {
"compute": {
"kind": "Kubernetes",
"resourceId": "test-override-2"
}
}
}'
To get information about an environment, here is an example curl command:
curl --location --request GET 'http://localhost:8080/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/?api-version=2023-10-01-preview'
You should also be able to see all changes in Cosmos DB
References
Expand ▾
Collapse ▴
Directories
¶
api
backend
deployment
Package deployment is a generated GoMock package.
Package deployment is a generated GoMock package.
frontend
Package handlers is a generated GoMock package.
Package handlers is a generated GoMock package.
processors
extenders
extenders contains the resource processor for extenders.
extenders contains the resource processor for extenders.
Package renderers is a generated GoMock package.
Package renderers is a generated GoMock package.
Click to show internal directories.
Click to hide internal directories.