Welcome to MICO Developer Documentation’s documentation!¶
MICO-Admin UI¶
The MICO-Admin UI uses the Angular framework (v7) with the Angular Material component library.
local testing¶
To run the frontend locally first install all dependencys and the start the development server.
cd mico-admin
npm install
npm run start
Then open http://localhost:4200 in your browser.
Hint
The frontend (in development mode) expects the backend at http://localhost:8080. You can use kubectl to forward traffic to a backend running in a cluster.
configuration¶
The backend api url can be set in the /mico-admin/src/environments/environment.ts
.
The docker container uses the environment variable MICO_REST_API
to setup a forwarding proxy in nginx.
Documentation of Core Components¶
TypeScript Doc¶
app/api/api.service¶
API Service¶
-
class
ApiService
()¶ exported from
src/app/api/api.service
Service to interact with the mico api.
-
ApiService.
canonizeStreamUrl
(streamURL)¶ Canonize a resource url.
(Remove schema, host, port, api path prefix and leading/trailing slashes.)
Arguments: - streamURL (string) – resource url
Returns: string –
-
ApiService.
deleteAllApplicationVersions
(shortName)¶ delete all versions of an application uses: DELETE application/{shortName}
Arguments: - shortName (string) – shortName of the application versions to be deleted
Returns: Observable –
-
ApiService.
deleteAllServiceVersions
(shortName)¶ delete all versions of a service uses: DELETE services/{shortName}
Arguments: - shortName (string) – shortName of the service versions to be deleted
Returns: Observable –
-
ApiService.
deleteApplication
(shortName, version)¶ Deletes a specific application version uses: DELETE applications/{shortName}/{version}
Arguments: - shortName (string) – shortName of the application
- version (string) – version of the application
Returns: Observable –
-
ApiService.
deleteApplicationKafkaFaasConnector
(applicationShortName, applicationVersion, instanceId)¶ Deletes an includes relationship from an application to a service uses: DELETE applications/{applicationShortName}/{applicationVersion}/kafka-faas-connector/{instanceId}
Arguments: - applicationShortName (string) – the applications shortName
- applicationVersion (string) – the applications version
- instanceId (string) – the kafka faas connector instance id
Returns: Observable –
-
ApiService.
deleteApplicationServices
(applicationShortName, applicationVersion, serviceShortName)¶ Deletes an includes relationship from an application to a service uses: DELETE applications/{shortName}/{version}/services
Arguments: - applicationShortName (string) – the applications shortName
- applicationVersion (string) – the applications version
- serviceShortName (any) – the services shortName
Returns: Observable –
-
ApiService.
deleteService
(shortName, version)¶ Arguments: - shortName (any) –
- version (any) –
Returns: Observable –
-
ApiService.
deleteServiceDependee
(serviceShortName, serviceVersion, dependeeShortName, dependeeVersion)¶ deletes a depends on relation of a service uses: DELETE services/{shortName}/{version}/dependees
Arguments: - serviceShortName (string) – shortName of the depending service
- serviceVersion (string) – version of the depending service
- dependeeShortName (string) – shortName of the depended service
- dependeeVersion (string) – version of the depended service
Returns: Observable –
-
ApiService.
deleteServiceInterface
(shortName, version, serviceInterfaceName)¶ Deletes a service interface uses: DELETE services/{shortName}/{version}/interfaces/{serviceInterfaceName}
Arguments: - shortName (string) – the services shortName
- version (string) – the services version
- serviceInterfaceName (string) – the interfaces name
Returns: Observable –
-
ApiService.
getApplication
(shortName, version)¶ get an application based on its shortName and version uses: GET applications/{shortName}/{version}
Arguments: - shortName (string) – of the application
- version (string) – of the application
Returns: Observable –
-
ApiService.
getApplicationDeploymentStatus
(applicationShortName, applicationVersion)¶ Returns the deployment status of a specified application uses: GET applications/{applicationShortName}/{applicationVersion}/deploymentStatus
Arguments: - applicationShortName (string) – shortName of the application
- applicationVersion (string) – version of the application
Returns: Observable –
-
ApiService.
getApplicationKafkaFaasConnector
(applicationShortName, applicationVersion, instanceId)¶ Get an existing kafka faas connector deployment info uses: GET applications/{applicationShortName}/{applicationVersion}/kafka-faas-connector/{instanceId}
Arguments: - applicationShortName (string) – the applications shortName
- applicationVersion (string) – the applications version
- instanceId (string) – the kafka faas connector instance id this gets a specific instance
Returns: Observable –
-
ApiService.
getApplicationStatus
(shortName, version)¶ returns runtime information (status) about a specific application and its services uses GET applications/{shortName}/{version}/status
Arguments: - shortName (string) – the applications shortName
- version (string) – the applications version
Returns: Observable –
-
ApiService.
getApplicationVersions
(shortName)¶ Get all versions of an application based on its shortName uses: GET application/{shortName}
Arguments: - shortName (string) – the shortName of the applicaton
Returns: Observable –
-
ApiService.
getApplications
()¶ Get application list uses: GET application
Returns: Observable –
-
ApiService.
getJobStatus
(applicationShortName, applicationVersion)¶ retrieves the status of a deployment uses: GET jobs/{applicationShortName}/{applicationVersion}/status
Arguments: - applicationShortName (string) – shortName of the application
- applicationVersion (string) – version of the application
Returns: Observable –
-
ApiService.
getModelDefinitions
()¶ Returns: Observable –
-
ApiService.
getOpenFaaSFunctions
()¶ Retrieves the function list of the OpenFaaS Portal from the backend.
Returns: Observable –
-
ApiService.
getOpenFaaSIp
()¶ Retrieves the IP address of the OpenFaaS Portal from the backend.
Returns: Observable –
-
ApiService.
getService
(shortName, version)¶ Get a specific version of a service uses: GET services/{shortName}/{version}
Arguments: - shortName (any) – unique short name of the service
- version (any) – service version to be returned
Returns: Observable –
-
ApiService.
getServiceDependees
(shortName, version)¶ Get all services a specific service depends on. uses: GET services/{shortName}/{version}/dependees
Arguments: - shortName (any) – unique short name of the service
- version (any) – service version to be returned
Returns: Observable –
-
ApiService.
getServiceDependencyGraph
(shortName, version)¶ Get full dependency graph of service uses: GET services/{shortName}/{version}/dependencyGraph
Arguments: - shortName (any) – unique short name of the service
- version (any) – service version to be returned
Returns: Observable –
-
ApiService.
getServiceDependers
(shortName, version)¶ Get all services depending on a specific service uses: GET services/{shortName}/{version}/dependers
Arguments: - shortName (any) – unique short name of the service
- version (any) – service version to be returned
Returns: Observable –
-
ApiService.
getServiceDeploymentInformation
(applicationShortName, applicationVersion, serviceShortName)¶ Returns the deployment information of an applications included service uses: GET applications/{applicationShortName}/{applicationVersion}/deploymentInformation/{serviceShortName}
Arguments: - applicationShortName (string) – shortName of the application
- applicationVersion (string) – version of the application
- serviceShortName (any) – shortName of the service
Returns: Observable –
-
ApiService.
getServiceInterfacePublicIp
(serviceShortName, serviceVersion, instanceId, interfaceShortName)¶ Gets the public IP of a deployed service uses: services/{shortName}/{version}/interaces/{interfaceName}/publicIP
Arguments: - serviceShortName (string) – shortName of the service
- serviceVersion (string) – version of the service
- instanceId (string) – the instance id of the service deployment information
- interfaceShortName (string) – name of the serviceInterface
Returns: Observable –
-
ApiService.
getServiceInterfaces
(shortName, version)¶ get all service interfaces of a specified service uses: GET services/{shortName}/{version}/interfaces
Arguments: - shortName (any) – shortName of the service
- version (any) – version of the service
Returns: Observable –
-
ApiService.
getServiceStatus
(shortName, version)¶ returns runtime information (status) about a specific service uses GET services/{shortName}/{version}/status
Arguments: - shortName (string) – the services shortName
- version (string) – the services version
Returns: Observable –
-
ApiService.
getServiceVersions
(shortName)¶ Get all versions of a service based on its shortName uses: GET services/{shortName}
Arguments: - shortName (any) – the serices shortName
Returns: Observable –
-
ApiService.
getServiceVersionsViaGithub
(url)¶ takes an url to a github repository and returns the available versions of the repository. uses: GET services/import/github
Arguments: - url (string) – url to the github repository
Returns: Observable –
-
ApiService.
getServiceYamlConfig
(shortName, version)¶ Get a yaml string containing a services kubeconfig uses: GET services/{shortName}/{version}/yaml
Arguments: - shortName (string) – unique short name of the service
- version (string) – service version
Returns: Observable –
-
ApiService.
getServices
()¶ Get a list of all services uses: GET services
Returns: Observable –
-
ApiService.
getStreamSource
(streamURL, defaultSubject)¶ Fetch the stream source for the given resource url.
Arguments: - streamURL (string) – resource url
- defaultSubject (<TODO>) – function to create a new streamSource if needed (default: BehaviourSubject)
Returns: Subject –
-
ApiService.
getTopics
()¶ Get all known used kafka topics from the backend.
Returns: Observable –
-
ApiService.
new ApiService
(rest, snackBar)¶ Arguments: - rest (src/app/api/api-base-function.service.ApiBaseFunctionService) –
- snackBar (MatSnackBar) –
Returns: src/app/api/api.service.ApiService –
-
ApiService.
pollDeploymentJobStatus
(applicationShortName, applicationVersion)¶ Polls the deployment job of a given application and provides feedback if the deployment failed/ was successful. Also stops polling after 10 minutes
Arguments: - applicationShortName (string) – applicationShortName of the application to be polled
- applicationVersion (string) – applicationVersion of the application to be polled
Returns: Subscription –
-
ApiService.
pollServiceInterfacePublicIp
(serviceShortName, serviceVersion, instanceId, interfaceName)¶ Polls the public ip of a services interface until a public ip is available. Also ends the polling after 3 minutes.
Arguments: - serviceShortName (string) – serviceShortName of the interface to be polled
- serviceVersion (string) – serviceVersion of the interface to be polled
- instanceId (string) – the instance id of the service deployment information
- interfaceName (string) – interfaceName of the interface to be polled
Returns: Subscription –
-
ApiService.
polling
¶ type: Map
-
ApiService.
postApplication
(data)¶ Creates a new application uses: POST applications
Arguments: - data (any) – object holding the applications information
Returns: Observable –
-
ApiService.
postApplicationDeployCommand
(shortName, version)¶ commands the mico-core application to deploy an application uses: POST applications/{shortName}/{version}/deploy
Arguments: - shortName (string) – the applications shortName
- version (string) – the applications version
Returns: Observable –
-
ApiService.
postApplicationKafkaFaasConnector
(applicationShortName, applicationVersion, connectorVersion, instanceId)¶ Adds a new kafka faas connector to the application or update an existing one uses: POST applications/{applicationShortName}/{applicationVersion}/kafka-faas-connector[/{instanceId}]?version={kafkaFaasConnectorVersion}
Arguments: - applicationShortName (string) – the applications shortName
- applicationVersion (string) – the applications version
- connectorVersion (string) – the kafka faas connector version if omitted latest version is used
- instanceId (string) – the kafka faas connector instance id if present this updates a specific instance to this version instead of adding a new instance
Returns: Observable –
-
ApiService.
postApplicationServices
(applicationShortName, applicationVersion, serviceShortName, serviceVersion)¶ Adds an includes relationship from an appliction to a service uses: POST applications/{applicationShortName}/{applicationVersion}/services/{serviceShortName}/{serviceVersion}
Arguments: - applicationShortName (string) – the applications shortName
- applicationVersion (string) – the applications version
- serviceShortName (string) – the services shortName
- serviceVersion (string) – the services version
Returns: Observable –
-
ApiService.
postApplicationUndeployCommand
(shortName, version)¶ commands the mico-core application to undeploy an application uses: POST applications/{shortName}/{version}/undeploy
Arguments: - shortName (string) – the applications shortName
- version (string) – the applications version
Returns: Observable –
-
ApiService.
postService
(data)¶ Creates a new service uses: POST services
Arguments: - data (any) – object holding the services information
Returns: Observable –
-
ApiService.
postServiceDependee
(serviceShortName, serviceVersion, dependee)¶ Adds a depends on relation from a service to an other service (dependee) uses: POST services/{shortName}/{version}/dependees
Arguments: - serviceShortName (any) – shortName of the depending service
- serviceVersion (any) – version of the depending service
- dependee (any) – object holding the dependee
Returns: Observable –
-
ApiService.
postServiceInterface
(shortName, version, data)¶ Adds a new service interface to a service uses: POST services/{shortName}/{version}/interfaces
Arguments: - shortName (any) – shortName of the service
- version (any) – version of the service
- data (any) – object holding the interfaces information
Returns: Observable –
-
ApiService.
postServiceViaGithub
(url, version)¶ crawls a specific version from a github repository uses: POST services/import/github
Arguments: - url (string) – url to the github repository
- version (string) – version to be crawled
Returns: Observable –
-
ApiService.
promoteApplication
(shortName, version, newVersion)¶ Creates a new application version from an existing application uses: POST applications/{shortName}/{version}/promote
Arguments: - shortName (any) – shortName of the application
- version (any) – version of the application
- newVersion (string) – the new version of the application
Returns: Observable –
-
ApiService.
promoteService
(shortName, version, newVersion)¶ Creates a new service version from an existing service uses: POST services/{shortName}/{version}/promote
Arguments: - shortName (any) – shortName of the service
- version (any) – version of the service
- newVersion (string) – the new version of the service
Returns: Observable –
-
ApiService.
putApplication
(shortName, version, data)¶ Updates an existing application uses: PUT applications/{shortName}/{version}
Arguments: - shortName (any) – shortName of the application
- version (any) – version of the application
- data (any) – object holding the updated application information
Returns: Observable –
-
ApiService.
putApplicationKafkaFaasConnector
(applicationShortName, applicationVersion, instanceId, data)¶ Updates the deployment information of a kafka faas connector instance. uses: PUT applications/{applicationShortName}/{applicationVersion}/kafka-faas-connector/{instanceId}
Arguments: - applicationShortName (string) – shortName of the application
- applicationVersion (string) – version of the application
- instanceId (string) – instance id of the kafka faas connector
- data (any) – object holding the updated deployment information
Returns: Observable –
-
ApiService.
putService
(shortName, version, data)¶ Updates a services information uses: PUT service/{shortName}/{version}
Arguments: - shortName (any) – the services shortName
- version (any) – the services version
- data (any) – object holding the services updated version
Returns: Observable –
-
ApiService.
putServiceDeploymentInformation
(applicationShortName, applicationVersion, serviceShortName, data)¶ Updates the deployment information of an applications service uses: PUT applications/{applicationShortName}/{applicationVersion}/deploymentInformation/{serviceShortName}
Arguments: - applicationShortName (string) – shortName of the application
- applicationVersion (string) – version of the application
- serviceShortName (any) – shortName of the service
- data (any) – object holding the updated deployment information
Returns: Observable –
-
ApiService.
putServiceInterface
(shortName, version, serviceInterfaceName, serviceData)¶ Updates a service interface uses: PUT services/{shortName}/{version}/interfaces/{serviceInterfaceName}
Arguments: - shortName (string) – the services shortName
- version (string) – the services version
- serviceInterfaceName (string) – the interfaces name
- serviceData (any) –
Returns: Observable –
-
ApiService.
rest
¶ type: src/app/api/api-base-function.service.ApiBaseFunctionService
-
ApiService.
snackBar
¶ type: MatSnackBar
-
ApiService.
startApplicationStatusPolling
(applicationShortName, applicationVersion)¶ Starts the polling for ‘pollApplicationStatus’. Only one subscriptions is returned at a time, to avoid multiple polling of the same information. Otherwise ‘undefined’ is returned.
Arguments: - applicationShortName (string) – shortName of the application
- applicationVersion (string) – version of the application
Returns: Subscription –
-
ApiService.
streams
¶ type: Map
-
Model Service¶
-
class
ModelsService
()¶ exported from
src/app/api/models.service
-
ModelsService.
apiService
¶ type: src/app/api/api.service.ApiService
-
ModelsService.
canonizeModelUri
(modelUri)¶ Canonize a resource url.
(Remove schema, host, port, api path prefix and leading/trailing slashes.)
Arguments: - modelUri (string) –
Returns: string –
-
ModelsService.
filterModel
(properties, isBlacklist)¶ Return a stream filter for api models. (use with map in observable pipe)
Arguments: - properties (Iterable) – the property keys to filter for (array/set or other iterable) Use Empty iterable or null to deactivate filter
- isBlacklist (boolean) – if true the filter ill be appliead as blacklist. (default=whitelest/false)
Returns: <TODO> –
-
ModelsService.
getCacheSource
(cacheURL)¶ Fetch the cache source for the given model url.
Arguments: - cacheURL (string) –
Returns: AsyncSubject –
-
ModelsService.
getModel
(modelUrl)¶ Get a model for the modelUrl.
Observable only sends a value if the model was found. Times out after 2s
Arguments: - modelUrl (any) – modelUrl
Returns: Observable –
-
ModelsService.
handleArrayProperties
(propRef)¶ Handle array type properties.
Replaces items with ApiModelRef to nestedModelCache if needed
Arguments: - propRef (src/app/api/models.service.PropertyRef) – input PropertyRef
Returns: Observable –
-
ModelsService.
handleComplexProperties
(model)¶ Check all properties of model for complex properties like arrays or objects.
Replaces all nested models with ApiModelRefs to nestedModelCache
Arguments: - model (src/app/api/apimodel.ApiModel) – input model
Returns: Observable –
-
ModelsService.
handleNumericPropertyKeys
(property)¶ Convert all property keys that should have numeric values (like ‘minimum’).
Arguments: - property (src/app/api/models.service.PropertyRef) – input PropertyRef
Returns: Observable –
-
ModelsService.
handleObjectProperties
(propRef)¶ Handle object type properties.
Replaces prop with ApiModelRef to nestedModelCache if needed
Arguments: - propRef (src/app/api/models.service.PropertyRef) – input PropertyRef
Returns: Observable –
-
ModelsService.
localModels
¶ type: <TODO>
-
ModelsService.
mergeModels
(targetModel, sourceModel)¶ Merge two ApiModels into one model.
Arguments: - targetModel (src/app/api/apimodel.ApiModel) – the model to be merged into
- sourceModel (src/app/api/apimodel.ApiModel) – the model to be merged
Returns: src/app/api/apimodel.ApiModel –
-
ModelsService.
mergeProperties
(targetModel, sourceModel)¶ Merge properties of two ApiModels into one merged properties object.
Arguments: - targetModel (src/app/api/apimodel.ApiModel) – the model to be merged into
- sourceModel (src/app/api/apimodel.ApiModel) – the model to be merged
Returns: <TODO> –
-
ModelsService.
modelCache
¶ type: Map
-
ModelsService.
nestedModelCache
¶ type: Map
-
ModelsService.
new ModelsService
(apiService)¶ Arguments: - apiService (src/app/api/api.service.ApiService) –
Returns: src/app/api/models.service.ModelsService –
-
ModelsService.
onlyRequired
(model)¶ Stream filter that filters out all not required properties of the model.
Arguments: - model (src/app/api/apimodel.ApiModel) – input api model
Returns: <TODO> –
-
ModelsService.
resolveModel
(modelUrl)¶ Resolve the modelUrl and return the corresponding model.
Arguments: - modelUrl (string) – resource url
Returns: Observable –
-
ModelsService.
resolveModelLinks
(model)¶ Resolve all model links and return an observable of pure ApiModels
starting with the first model of an allOf and recursively applying itself
Arguments: - | src/app/api/apimodel.ApiModelRef | src/app/api/apimodel.ApiModel model (src/app/api/apimodel.ApiModelAllOf) – input model
Returns: Observable –
-
ModelsService.
resolveProperties
(model)¶ Resolves all properties to actual ApiModels.
Arguments: - model (src/app/api/apimodel.ApiModel) – input model
Returns: Observable –
-
app/forms¶
FormGroup Service¶
-
class
FormGroupService
()¶ exported from
src/app/forms/form-group.service
-
FormGroupService.
modelToFormGroup
(model)¶ Create a new FormGroup for use with reactive forms.
Arguments: - model (src/app/api/apimodel.ApiModel) – the source ApiModel to create a FormGroup for
Returns: FormGroup –
-
FormGroupService.
new FormGroupService
()¶ Returns: src/app/forms/form-group.service.FormGroupService –
-
app/forms/mico-form¶
Mico Form Component¶
-
@Input() modelUrl: string
A string identifying the jsonschema model to use. Example:
local/servicePOST
-
@Input() filter: string[] = []
A list of properties to filter by.
-
@Input() isBlacklist: boolean = false
If property filter is whitelist or blacklist.
-
@Input() debug: boolean = false
If form renders debug data.
-
@Output() valid: EventEmitter<boolean>
If form is valid.
-
@Output() data: EventEmitter<any>
Form data as js object.
<mico-form [modelUrl]="'local/servicePOST'" [filter]="['name']" (data)="data = $event"></mico-form>
-
class
MicoFormComponent
()¶ exported from
src/app/forms/mico-form/mico-form.component
- Implements:
OnInit()
OnChanges()
Dynamic form component that renders a form from the given modelUrl.
-
MicoFormComponent.
_startData
¶ type: <TODO>
-
MicoFormComponent.
data
¶ type: EventEmitter
-
MicoFormComponent.
debug
¶ type: boolean
-
MicoFormComponent.
filter
¶ type: string[]
-
MicoFormComponent.
form
¶ type: FormGroup
-
MicoFormComponent.
formGroup
¶ type: src/app/forms/form-group.service.FormGroupService
-
MicoFormComponent.
formSubscription
¶ type: Subscription
-
MicoFormComponent.
isBlacklist
¶ type: boolean
-
MicoFormComponent.
model
¶ type: src/app/api/apimodel.ApiModel
-
MicoFormComponent.
modelUrl
¶ type: string
-
MicoFormComponent.
models
¶ type: src/app/api/models.service.ModelsService
-
MicoFormComponent.
new MicoFormComponent
(models, formGroup)¶ Arguments: - models (src/app/api/models.service.ModelsService) –
- formGroup (src/app/forms/form-group.service.FormGroupService) –
Returns: src/app/forms/mico-form/mico-form.component.MicoFormComponent –
-
MicoFormComponent.
ngOnChanges
(changes)¶ Arguments: - changes (SimpleChanges) –
-
MicoFormComponent.
ngOnInit
()¶
-
MicoFormComponent.
onlyRequired
¶ type: boolean
-
MicoFormComponent.
properties
¶ type: src/app/api/apimodel.ApiModel | src/app/api/apimodel.ApiModelRef[]
-
MicoFormComponent.
startData
¶ type: <TODO>
-
MicoFormComponent.
trackByFn
(index, item)¶ Arguments: - index (any) –
- item (any) –
Returns: any –
-
MicoFormComponent.
valid
¶ type: EventEmitter
Mockups¶
MICO-Core¶
Integration Tests¶
Integration Tests are implemented with JUnit 4.
Implementation¶
Integration tests are marked with the annotation @Category(IntegrationTests.class)
.
To add a new integration test, write a JUnit test and annotate the class with the annotation above.
Special Dockerfiles¶
To run integration tests on Jenkins there exists a special Dockerfile, named Dockerfile.mico-core.integrationtests, which runs the integration tests on 3.6-jdk-alpine Docker container. Build the Dockerfile and run the image to test same as Jenkins does. The Dockerfile runs all tests with the annotation above using the follwing command: .. code:: bash
mvn failsafe:integration-test
Requirements¶
ImageBuilderIntegrationTests require credentials to Docker Hub. Provide the credentials base64 encoded as environment variables:
- DOCKERHUB_USERNAME_BASE64
- DOCKERHUB_PASSWORD_BASE64
To encode the username and the password with base64 you could use
echo -n "username" | base64 -w 0
echo -n "password" | base64 -w 0
There are also integration tests which need some Kubernetes credentials.
At the moment we cannot support this within our integration test environment.
So until fixed, integration tests using Kubernetes won’t work.
You can ignore them with adding the @Ignore
annotation on class level.
Javadoc¶
io.github.ust.mico.core¶
MicoCoreApplication¶
-
public class
MicoCoreApplication
implements ApplicationListener<ApplicationReadyEvent>¶ Entry point for the MICO core application.
Fields¶
-
GitHubCrawler
gitHubCrawler
¶
-
KafkaFaasConnectorConfig
kafkaFaasConnectorConfig
¶
-
MicoServiceBroker
micoServiceBroker
¶
Methods¶
-
public void
onApplicationEvent
(ApplicationReadyEvent event)¶ Runs when application is ready. Add KafkaFaasConnector in latest version to the database, if the current profile is not ‘unit-testing’ (e.g. Travis CI).
Parameters: - event – the
ApplicationReadyEvent
- event – the
-
public RestTemplate
restTemplate
(RestTemplateBuilder builder)¶ Parameters: - builder –
See also: RealDeanZhao/autowire-resttemplate.md
io.github.ust.mico.core.broker¶
BackgroundJobBroker¶
-
public class
BackgroundJobBroker
¶ Broker to operate with jobs.
Constructors¶
-
public
BackgroundJobBroker
(MicoBackgroundJobRepository jobRepository, MicoApplicationRepository applicationRepository)¶
Methods¶
-
public void
deleteAllJobs
()¶ Delete all jobs in the database. If a future of a job is still running, it will be cancelled.
-
public List<MicoServiceBackgroundJob>
getAllJobs
()¶ Retrieves all jobs saved in database.
Returns: a List
ofMicoServiceBackgroundJob
.
-
public Optional<MicoServiceBackgroundJob>
getJobById
(String id)¶ Retrieves a job by id.
Parameters: - id – the id of the job.
Returns:
-
public Optional<MicoServiceBackgroundJob>
getJobByMicoServiceInstanceId
(String instanceId, MicoServiceBackgroundJob.Type type)¶ Return a
MicoServiceBackgroundJob
for a giveninstanceId
andMicoServiceBackgroundJob.Type
.Parameters: - instanceId – instance ID of a
MicoServiceDeploymentInfo
- type – the
MicoServiceBackgroundJob.Type
Returns: the optional job. Is empty if no job exists for the given
instanceId
- instanceId – instance ID of a
-
public MicoApplicationJobStatus
getJobStatusByApplicationShortNameAndVersion
(String shortName, String version)¶ Retrieves the job status of a
MicoApplication
.Parameters: - shortName – the short name of the
MicoApplication
. - version – the version of the
MicoApplication
.
Returns: the
MicoApplicationJobStatus
with the status and jobs.- shortName – the short name of the
-
public List<MicoServiceBackgroundJob>
getJobsByMicoService
(String micoServiceShortName, String micoServiceVersion, MicoServiceBackgroundJob.Type type)¶ Return
MicoServiceBackgroundJob
s for a givenMicoService
andMicoServiceBackgroundJob.Type
.Parameters: - micoServiceShortName – the short name of a
MicoService
- micoServiceVersion – the version of a
MicoService
- type – the
MicoServiceBackgroundJob.Type
Returns: the job list. Is empty if no job exists for the given
MicoService
- micoServiceShortName – the short name of a
-
void
saveFutureOfJob
(MicoServiceDeploymentInfo micoServiceDeploymentInfo, MicoServiceBackgroundJob.Type type, CompletableFuture<?> future)¶ Saves a future of a job to the database.
Parameters: - micoServiceDeploymentInfo – the
MicoServiceDeploymentInfo
- future – the future as a
CompletableFuture
- type – the
MicoServiceBackgroundJob.Type
- micoServiceDeploymentInfo – the
-
public MicoServiceBackgroundJob
saveJob
(MicoServiceBackgroundJob job)¶ Save a job to the database.
Parameters: - job – the
MicoServiceBackgroundJob
Returns: the saved
MicoServiceBackgroundJob
- job – the
-
void
saveNewStatus
(MicoServiceDeploymentInfo micoServiceDeploymentInfo, MicoServiceBackgroundJob.Type type, MicoServiceBackgroundJob.Status newStatus)¶ Saves a new status of a job to the database.
Parameters: - micoServiceDeploymentInfo – the
MicoServiceDeploymentInfo
- type – the
MicoServiceBackgroundJob.Type
- newStatus – the new
MicoServiceBackgroundJob.Status
- micoServiceDeploymentInfo – the
-
void
saveNewStatus
(MicoServiceDeploymentInfo micoServiceDeploymentInfo, MicoServiceBackgroundJob.Type type, MicoServiceBackgroundJob.Status newStatus, String errorMessage)¶ Saves a new status of a job to the database.
Parameters: - micoServiceDeploymentInfo – the
MicoServiceDeploymentInfo
- type – the
MicoServiceBackgroundJob.Type
- newStatus – the new
MicoServiceBackgroundJob.Status
- errorMessage – the optional error message if the job has failed
- micoServiceDeploymentInfo – the
DeploymentBroker¶
-
public class
DeploymentBroker
¶
Methods¶
-
public void
checkIfKafkaFaasConnectorIsDeployable
(MicoServiceDeploymentInfo kfConnectorDeploymentInfo)¶ Checks if the properties of the
MicoServiceDeploymentInfo
are valid so the corresponding KafkaFaasConnector is considered deployable.Parameters: - kfConnectorDeploymentInfo – the
MicoServiceDeploymentInfo
Throws: - DeploymentRequirementsOfKafkaFaasConnectorNotMetException – if the requirements are not met
- kfConnectorDeploymentInfo – the
-
public MicoApplicationJobStatus
deployApplication
(String shortName, String version, boolean rebuildImages)¶ Deploys an application with all its included services and KafkaFaasConnector instances.
Parameters: - shortName – the short name of the
MicoApplication
- version – the version of the
MicoApplication
Throws: - MicoApplicationNotFoundException – if the
MicoApplication
does not exist - MicoServiceInterfaceNotFoundException – if the
MicoServiceInterface
does not exist
Returns: - shortName – the short name of the
-
public void
undeployApplication
(String shortName, String version)¶ Undeploys an application with all its included services and KafkaFaasConnector instances.
Parameters: - shortName – the short name of the
MicoApplication
- version – the version of the
MicoApplication
Throws: - MicoApplicationNotFoundException – if the
MicoApplication
does not exist - MicoApplicationIsDeployingException – if the
MicoApplication
is currently deploying
- shortName – the short name of the
KafkaFaasConnectorDeploymentInfoBroker¶
-
public class
KafkaFaasConnectorDeploymentInfoBroker
¶
Methods¶
-
public List<MicoServiceDeploymentInfo>
getKafkaFaasConnectorDeploymentInformation
(String micoApplicationShortName, String micoApplicationVersion)¶ Fetches a list of
MicoServiceDeploymentInfos
of all KafkaFaasConnector instances associated with the specifiedMicoApplication
.Parameters: - micoApplicationShortName – the shortName of the micoApplication
- micoApplicationVersion – the version of the micoApplication
Throws: - MicoApplicationNotFoundException – if there is no such micoApplication
Returns: the list of
MicoServiceDeploymentInfos
-
public Optional<MicoServiceDeploymentInfo>
getKafkaFaasConnectorDeploymentInformation
(String micoApplicationShortName, String micoApplicationVersion, String instanceId)¶ Filters the list of
MicoServiceDeploymentInfo
fromKafkaFaasConnectorDeploymentInfoBroker.getKafkaFaasConnectorDeploymentInformation(String,String)
for a specificinstanceId
.Parameters: - micoApplicationShortName – the short name of the
MicoApplication
- micoApplicationVersion – the version of the
MicoApplication
- instanceId – the instance ID of the
MicoServiceDeploymentInfo
Throws: - MicoApplicationNotFoundException – if the
MicoApplication
does not exist.
Returns: a single
MicoServiceDeploymentInfo
with an instance ID equal to the give one.- micoApplicationShortName – the short name of the
-
public MicoServiceDeploymentInfo
updateKafkaFaasConnectorDeploymentInformation
(String instanceId, KFConnectorDeploymentInfoRequestDTO kfConnectorDeploymentInfoRequestDTO)¶ Updates an existing
MicoServiceDeploymentInfo
in the database based on the values of aKFConnectorDeploymentInfoRequestDTO
object.Parameters: - instanceId – the instance ID of the
MicoServiceDeploymentInfo
- kfConnectorDeploymentInfoRequestDTO – the
KFConnectorDeploymentInfoRequestDTO
Throws: - KafkaFaasConnectorInstanceNotFoundException – if there is no
MicoServiceDeploymentInfo
for the requestedinstanceId
stored in the database
Returns: the new
MicoServiceDeploymentInfo
stored in the database- instanceId – the instance ID of the
MicoApplicationBroker¶
-
public class
MicoApplicationBroker
¶
Methods¶
-
public MicoServiceDeploymentInfo
addKafkaFaasConnectorInstanceToMicoApplicationByVersion
(String applicationShortName, String applicationVersion, String kfConnectorVersion)¶ Adds a new KafkaFaasConnector instance to the
kafkaFaasConnectorDeploymentInfos
of theMicoApplication
. An unique instance ID will be created that is returned as part of aMicoServiceDeploymentInfo
.Parameters: - applicationShortName – the short name of the
MicoApplication
- applicationVersion – the version of the
MicoApplication
- kfConnectorVersion – the version of the KafkaFaasConnector (
MicoService
Throws: - MicoApplicationNotFoundException – if the
MicoApplication
does not exist - MicoApplicationIsNotUndeployedException – if the
MicoApplication
is not undeployed - KafkaFaasConnectorVersionNotFoundException – if the version of the KafkaFaasConnector does not exist in MICO
Returns: the
MicoServiceDeploymentInfo
including the newly created instance ID- applicationShortName – the short name of the
-
public MicoServiceDeploymentInfo
addMicoServiceToMicoApplicationByShortNameAndVersion
(String applicationShortName, String applicationVersion, String serviceShortName, String serviceVersion, Optional<String> instanceIdOptional)¶ Adds a
MicoService
to aMicoApplication
. If an instance ID is provided, the existingMicoServiceDeploymentInfo
will be reused.Parameters: - applicationShortName – the short name of the
MicoApplication
- applicationVersion – the version of the
MicoApplication
- serviceShortName – the short name of the
MicoService
- serviceVersion – the version of the
MicoService
- instanceIdOptional – the optional instance if of the
MicoServiceDeploymentInfo
Throws: - MicoApplicationNotFoundException – if the
MicoApplication
does not exist - MicoServiceNotFoundException – if the
MicoService
does not exist - MicoServiceAddedMoreThanOnceToMicoApplicationException – if the
MicoService
is added more than once to theMicoApplication
- MicoApplicationIsNotUndeployedException – if the
MicoApplication
is not undeployed - MicoTopicRoleUsedMultipleTimesException – if a role of a
MicoTopicRole
is used multiple times - MicoServiceDeploymentInformationNotFoundException – if the
MicoServiceDeploymentInfo
does not exist - KubernetesResourceException – if there is an error with Kubernetes
- MicoApplicationDoesNotIncludeMicoServiceException – if the
MicoApplication
does not include theMicoService
, if it is expected - KafkaFaasConnectorNotAllowedHereException – if a KafkaFaasConnector is provided instead of a normal
MicoService
Returns: the
MicoServiceDeploymentInfo
that was created or reused- applicationShortName – the short name of the
-
public MicoApplication
copyAndUpgradeMicoApplicationByShortNameAndVersion
(String shortName, String version, String newVersion)¶
-
public MicoApplication
createMicoApplication
(MicoApplication micoApplication)¶
-
public MicoApplicationDeploymentStatus
getApplicationDeploymentStatus
(String shortName, String version)¶
-
public MicoApplicationStatusResponseDTO
getApplicationStatus
(String shortName, String version)¶
-
public Iterable<Link>
getLinksOfMicoApplication
(MicoApplication application)¶
-
public MicoApplication
getMicoApplicationByShortNameAndVersion
(String shortName, String version)¶
-
MicoApplication
getMicoApplicationForMicoService
(String applicationShortName, String applicationVersion, String serviceShortName)¶ Returns the
MicoApplication
for the provided short name and version if it exists and if it includes theMicoService
with the provided short name.Parameters: - applicationShortName – the short name of the
MicoApplication
- applicationVersion – the version of the
MicoApplication
- serviceShortName – the short name of the
MicoService
Throws: - MicoApplicationNotFoundException – if the
MicoApplication
does not exist - MicoApplicationDoesNotIncludeMicoServiceException – if the
MicoApplication
does not include theMicoService
with the provided short name
Returns: the
MicoApplication
- applicationShortName – the short name of the
-
public List<MicoApplication>
getMicoApplications
()¶
-
public List<MicoApplication>
getMicoApplicationsByShortName
(String shortName)¶
-
public List<MicoApplication>
getMicoApplicationsUsingMicoService
(String serviceShortName, String serviceVersion)¶
-
public List<MicoService>
getMicoServicesOfMicoApplicationByShortNameAndVersion
(String shortName, String version)¶
-
public void
removeAllKafkaFaasConnectorInstancesFromMicoApplication
(String applicationShortName, String applicationVersion)¶ Removes all KafkaFaasConnector instances from the
MicoApplication
.Parameters: - applicationShortName – the short name of the
MicoApplication
- applicationVersion – the version of the
MicoApplication
Throws: - MicoApplicationNotFoundException – if the
MicoApplication
does not exist - MicoApplicationIsNotUndeployedException – if the
MicoApplication
is not undeployed
- applicationShortName – the short name of the
-
public void
removeKafkaFaasConnectorInstanceFromMicoApplicationByInstanceId
(String applicationShortName, String applicationVersion, String instanceId)¶ Removes a KafkaFaasConnector instance that has the requested instance ID from the
MicoApplication
.Parameters: - applicationShortName – the short name of the
MicoApplication
- applicationVersion – the version of the
MicoApplication
- instanceId – the instance ID of the
MicoServiceDeploymentInfo
Throws: - MicoApplicationNotFoundException – if the
MicoApplication
does not exist - MicoApplicationIsNotUndeployedException – if the
MicoApplication
is not undeployed - KafkaFaasConnectorInstanceNotFoundException – if the instance of the KafkaFaasConnector does not exist in MICO
- MicoApplicationDoesNotIncludeKFConnectorInstanceException – if the
MicoApplication
does not include the KafkaFaasConnector deployment with the provided instance ID
- applicationShortName – the short name of the
-
public MicoApplication
removeMicoServiceFromMicoApplicationByShortNameAndVersion
(String applicationShortName, String applicationVersion, String serviceShortName)¶
-
public MicoServiceDeploymentInfo
updateKafkaFaasConnectorInstanceOfMicoApplicationByVersionAndInstanceId
(String applicationShortName, String applicationVersion, String kfConnectorVersion, String instanceId)¶ Updates an existing KafkaFaasConnector instance of the
MicoApplication
to a new version.Parameters: - applicationShortName – the short name of the
MicoApplication
- applicationVersion – the version of the
MicoApplication
- kfConnectorVersion – the version of the KafkaFaasConnector (
MicoService
- instanceId – the instance ID of an existing
MicoServiceDeploymentInfo
. It will be reused to update its version
Throws: - MicoApplicationNotFoundException – if the
MicoApplication
does not exist - MicoApplicationIsNotUndeployedException – if the
MicoApplication
is not undeployed - KafkaFaasConnectorVersionNotFoundException – if the version of the KafkaFaasConnector does not exist in MICO
- KafkaFaasConnectorInstanceNotFoundException – if there is no instance for the provided instance ID
Returns: the existing
MicoServiceDeploymentInfo
with the new version- applicationShortName – the short name of the
-
public MicoApplication
updateMicoApplication
(String shortName, String version, MicoApplication micoApplication)¶
MicoServiceBroker¶
-
public class
MicoServiceBroker
¶
Methods¶
-
public boolean
checkIfDependencyAlreadyExists
(MicoService service, MicoService serviceDependee)¶
-
public MicoService
deleteAllDependees
(MicoService service)¶
-
public MicoService
deleteDependencyBetweenServices
(MicoService service, MicoService serviceToDelete)¶
-
public void
deleteService
(MicoService service)¶
-
public List<MicoService>
findDependers
(MicoService service)¶
-
public List<MicoService>
getAllServicesAsList
()¶
-
public List<MicoService>
getAllVersionsOfServiceFromDatabase
(String shortName)¶
-
public List<MicoService>
getDependeesByMicoService
(MicoService service)¶
-
public MicoServiceDependencyGraphResponseDTO
getDependencyGraph
(MicoService micoServiceRoot)¶
-
public List<MicoService>
getDependers
(MicoService serviceToLookFor)¶
-
public String
getLatestKFConnectorVersion
()¶ Returns the latest version of the KafkaFaaSConnector (according to the database)
Throws: - KafkaFaasConnectorLatestVersionNotFound – if no KafkaFaasConnector can be found
Returns: the latest version of the KafkaFaaSConnector
-
public MicoService
getServiceById
(Long id)¶
-
public MicoService
getServiceFromDatabase
(String shortName, String version)¶
-
public MicoServiceDeploymentInfo
getServiceInstanceFromDatabase
(String shortName, String version, String instanceId)¶
-
public String
getServiceYamlByShortNameAndVersion
(String shortName, String version)¶ Return yaml for a
MicoService
for the give shortName and version.Parameters: - shortName – the short name of the
MicoService
. - version – version the version of the
MicoService
.
Returns: the kubernetes YAML for the
MicoService
.- shortName – the short name of the
-
public MicoService
persistNewDependencyBetweenServices
(MicoService service, MicoService serviceDependee)¶
-
public MicoService
persistService
(MicoService newService)¶
-
public MicoService
promoteService
(MicoService service, String newVersion)¶
-
public MicoService
updateExistingService
(MicoService service)¶
MicoServiceDeploymentInfoBroker¶
-
public class
MicoServiceDeploymentInfoBroker
¶
Methods¶
-
public void
cleanUpTanglingNodes
()¶ Cleans up tangling nodes related to a
MicoServiceDeploymentInfo
in the database. In case addition properties (stored as separate node entity) such as labels, environment variables have been removed from a service deployment information, the standardsave()
function of the service deployment information repository will not delete those “tangling” (without relationships) labels (nodes), hence the manual clean up.
-
MicoServiceDeploymentInfo
createOrReuseOpenFaaSFunctionsInDatabase
(MicoServiceDeploymentInfo serviceDeploymentInfo)¶ Checks if the given OpenFaaS function name is already present in the database. If so it will be reused. Otherwise a new node will be created.
Parameters: - serviceDeploymentInfo – the
MicoServiceDeploymentInfo
Returns: the updated
MicoServiceDeploymentInfo
- serviceDeploymentInfo – the
-
MicoServiceDeploymentInfo
createOrReuseTopicsInDatabase
(MicoServiceDeploymentInfo serviceDeploymentInfo)¶ Checks if topics with the same name already exists in the database. If so reuse them by setting the id of the existing Neo4j node and save them. If not create them in the database.
Parameters: - serviceDeploymentInfo – the
MicoServiceDeploymentInfo
containing topics
- serviceDeploymentInfo – the
-
public MicoServiceDeploymentInfo
getExistingServiceDeploymentInfo
(MicoApplication micoApplication, MicoService micoService)¶ Retrieves the
MicoServiceDeploymentInfo
that is used for the deployment of the requestedMicoService
as part of aMicoApplication
. There must not be zero or more than one service deployment information stored. If that’s the case, anIllegalStateException
will be thrown.Parameters: - micoApplication – the
MicoApplication
- micoService – the
MicoService
Throws: - IllegalStateException – if there is no or more than one service deployment information stored
Returns: the one and only existing
MicoServiceDeploymentInfo
- micoApplication – the
-
public MicoServiceDeploymentInfo
getMicoServiceDeploymentInformation
(String applicationShortName, String applicationVersion, String serviceShortName)¶ Returns the
MicoServiceDeploymentInfo
stored in the database.Parameters: - applicationShortName – the short name of the
MicoApplication
- applicationVersion – the version of the
MicoApplication
- serviceShortName – the short name of the
MicoService
Throws: - MicoServiceDeploymentInformationNotFoundException – if there is no
MicoServiceDeploymentInfo
stored in the database - MicoApplicationNotFoundException – if there is no
MicoApplication
with the specified short name and version - MicoApplicationDoesNotIncludeMicoServiceException – if there is no service included in the specified
MicoApplication
with the particular short name
Returns: the
MicoServiceDeploymentInfo
stored in the database- applicationShortName – the short name of the
-
void
setDefaultDeploymentInformationForKafkaEnabledService
(MicoServiceDeploymentInfo micoServiceDeploymentInfo)¶ Sets the default environment variables for Kafka-enabled MicoServices. See
MicoEnvironmentVariable.DefaultNames
for a complete list.Parameters: - micoServiceDeploymentInfo – The
MicoServiceDeploymentInfo
with an corresponding MicoService
- micoServiceDeploymentInfo – The
-
public MicoServiceDeploymentInfo
updateMicoServiceDeploymentInformation
(String applicationShortName, String applicationVersion, String serviceShortName, MicoServiceDeploymentInfoRequestDTO serviceDeploymentInfoDTO)¶ Updates an existing
MicoServiceDeploymentInfo
in the database based on the values of aMicoServiceDeploymentInfoRequestDTO
object.Parameters: - applicationShortName – the short name of the
MicoApplication
- applicationVersion – the version of the
MicoApplication
- serviceShortName – the short name of the
MicoService
- serviceDeploymentInfoDTO – the
MicoServiceDeploymentInfoRequestDTO
Throws: - MicoApplicationNotFoundException – if there is no
MicoApplication
with the specified short name and version - MicoApplicationDoesNotIncludeMicoServiceException – if there is no service included in the specified
MicoApplication
with the particular short name - MicoServiceDeploymentInformationNotFoundException – if there is no
MicoServiceDeploymentInfo
stored in the database - KubernetesResourceException – if there are problems with retrieving Kubernetes resource information
- MicoTopicRoleUsedMultipleTimesException – if a
MicoTopicRole
is used multiple times
Returns: the new
MicoServiceDeploymentInfo
stored in the database- applicationShortName – the short name of the
MicoServiceInterfaceBroker¶
-
public class
MicoServiceInterfaceBroker
¶
Methods¶
-
public void
deleteMicoServiceInterface
(MicoService micoService, String serviceInterfaceName)¶
-
public MicoServiceInterface
getInterfaceOfServiceByName
(String shortName, String version, String interfaceName)¶
-
public List<MicoServiceInterface>
getInterfacesOfService
(String shortName, String version)¶
-
public MicoServiceInterface
persistMicoServiceInterface
(MicoService micoService, MicoServiceInterface micoServiceInterface)¶
-
public MicoServiceInterface
updateMicoServiceInterface
(MicoService micoService, String serviceInterfaceName, MicoServiceInterface micoServiceInterface)¶
OpenFaasBroker¶
-
public class
OpenFaasBroker
¶
Fields¶
-
MicoKubernetesClient
micoKubernetesClient
¶
-
MicoKubernetesConfig
micoKubernetesConfig
¶
-
OpenFaaSConfig
openFaaSConfig
¶
Methods¶
-
public Optional<URL>
getExternalAddress
()¶ Requests the external address of the OpenFaaS UI and returns it or
null
if OpenFaaS does not exist.Throws: - MalformedURLException – if the address is not in the URL format.
- KubernetesResourceException – if the IP address or the ports of the external gateway svc can’t be retrieved
Returns: the external address of the OpenFaaS UI or
null
.
io.github.ust.mico.core.configuration¶
KafkaConfig¶
-
public class
KafkaConfig
¶ Configuration of the Kafka connection.
Methods¶
-
public List<MicoEnvironmentVariable>
getDefaultEnvironmentVariablesForKafka
()¶
-
public List<MicoTopicRole>
getDefaultTopics
(MicoServiceDeploymentInfo sdi)¶
KafkaFaasConnectorConfig¶
-
public class
KafkaFaasConnectorConfig
¶ Configuration of the KafkaFaasConnector deployment.
MicoKubernetesBuildBotConfig¶
-
public class
MicoKubernetesBuildBotConfig
¶ Configuration of the build bot (
TektonPipelinesController
)
MicoKubernetesConfig¶
-
public class
MicoKubernetesConfig
¶ Configuration that includes information about the MICO Kubernetes cluster
MicoRedisConfiguration¶
-
public class
MicoRedisConfiguration
¶ Configuration that includes information about Redis Database
OpenFaaSConfig¶
-
public class
OpenFaaSConfig
¶ Configuration for the OpenFaaS connection.
Methods¶
-
public List<MicoEnvironmentVariable>
getDefaultEnvironmentVariablesForOpenFaaS
()¶
RequestLoggingFilterConfig.MicoRequestLoggingFilter¶
-
public static class
MicoRequestLoggingFilter
extends CommonsRequestLoggingFilter¶
Methods¶
-
protected boolean
shouldNotFilter
(HttpServletRequest request)¶
WebConfig¶
-
public class
WebConfig
extends WebMvcConfigurerAdapter¶
Fields¶
-
CorsConfig
corsUserConfig
¶
Methods¶
-
public FilterRegistrationBean<CorsFilter>
corsFilter
()¶ Based on https://github.com/springfox/springfox/issues/2215#issuecomment-446178059
io.github.ust.mico.core.configuration.extension¶
io.github.ust.mico.core.dto.request¶
CrawlingInfoRequestDTO¶
-
public class
CrawlingInfoRequestDTO
¶ DTO for the information needed by a Crawler (e.g.,
GitHubCrawler
) for crawling a service from a remote repository intended to use with requests only.
KFConnectorDeploymentInfoRequestDTO¶
-
public class
KFConnectorDeploymentInfoRequestDTO
¶ DTO for
MicoServiceDeploymentInfo
specialised for a KafkaFaasConnector intended to use with requests only.
Constructors¶
-
public
KFConnectorDeploymentInfoRequestDTO
(MicoServiceDeploymentInfo kfConnectorDeploymentInfo)¶ Creates an instance of
KFConnectorDeploymentInfoRequestDTO
based on aMicoServiceDeploymentInfo
.Parameters: - kfConnectorDeploymentInfo – the
MicoServiceDeploymentInfo
.
- kfConnectorDeploymentInfo – the
MicoApplicationRequestDTO¶
-
public class
MicoApplicationRequestDTO
¶ DTO for a
MicoApplication
intended to use with requests only. Note that the services are not included.
Constructors¶
-
public
MicoApplicationRequestDTO
(MicoApplication application)¶ Creates an instance of
MicoApplicationRequestDTO
based on aMicoApplication
.Parameters: - application – the
MicoApplication
.
- application – the
MicoEnvironmentVariableRequestDTO¶
-
public class
MicoEnvironmentVariableRequestDTO
¶ DTO for a
MicoEnvironmentVariable
intended to use with requests only.
Constructors¶
-
public
MicoEnvironmentVariableRequestDTO
(MicoEnvironmentVariable environmentVariable)¶ Creates an instance of
MicoEnvironmentVariableRequestDTO
based on aMicoEnvironmentVariable
.Parameters: - environmentVariable – the
MicoEnvironmentVariable
.
- environmentVariable – the
MicoInterfaceConnectionRequestDTO¶
-
public class
MicoInterfaceConnectionRequestDTO
¶ DTO for the information needed to connect a
MicoService
to anMicoServiceInterface
of anotherMicoService
intended to use with requests only.
Constructors¶
-
public
MicoInterfaceConnectionRequestDTO
(MicoInterfaceConnection interfaceConnection)¶ Creates an instance of
MicoInterfaceConnectionRequestDTO
based on aMicoInterfaceConnection
.Parameters: - interfaceConnection – the
MicoInterfaceConnection
.
- interfaceConnection – the
MicoLabelRequestDTO¶
MicoServiceDeploymentInfoRequestDTO¶
-
public class
MicoServiceDeploymentInfoRequestDTO
¶ DTO for
MicoServiceDeploymentInfo
intended to use with requests only.
Constructors¶
-
public
MicoServiceDeploymentInfoRequestDTO
(MicoServiceDeploymentInfo serviceDeploymentInfo)¶ Creates an instance of
MicoServiceDeploymentInfoRequestDTO
based on aMicoServiceDeploymentInfo
.Parameters: - serviceDeploymentInfo – the
MicoServiceDeploymentInfo
.
- serviceDeploymentInfo – the
MicoServiceInterfaceRequestDTO¶
-
public class
MicoServiceInterfaceRequestDTO
¶ DTO for a
MicoServiceInterface
intended to use with requests only.
Constructors¶
-
public
MicoServiceInterfaceRequestDTO
(MicoServiceInterface serviceInterface)¶ Creates an instance of
MicoServiceInterfaceRequestDTO
based on aMicoServiceInterface
.Parameters: - serviceInterface – the
MicoServiceInterface
.
- serviceInterface – the
MicoServicePortRequestDTO¶
-
public class
MicoServicePortRequestDTO
¶ DTO for a
MicoServicePort
intended to use with requests only.
Constructors¶
-
public
MicoServicePortRequestDTO
(MicoServicePort servicePort)¶ Creates an instance of
MicoServicePortRequestDTO
based on aMicoServicePort
.Parameters: - servicePort – the
MicoServicePort
.
- servicePort – the
MicoServiceRequestDTO¶
-
public class
MicoServiceRequestDTO
¶ DTO for a
MicoService
intended to use with requests only. Note that theMicoServiceDependencies
andMicoServiceInterfaces
are not included.
Constructors¶
-
public
MicoServiceRequestDTO
(MicoService service)¶ Creates an instance of
MicoServiceRequestDTO
based on aMicoService
.Parameters: - service – the
MicoService
.
- service – the
MicoTopicRequestDTO¶
-
public class
MicoTopicRequestDTO
¶
Constructors¶
-
public
MicoTopicRequestDTO
(MicoTopicRole micoTopicRole)¶ Creates an instance of
MicoTopicRequestDTO
based on aMicoTopicRole
that includes theMicoTopic
and a role.Parameters: - micoTopicRole – the
MicoTopicRole
.
- micoTopicRole – the
MicoVersionRequestDTO¶
-
public class
MicoVersionRequestDTO
¶ DTO for a version intended to use with requests only, e.g., with a request to promote a new version of a
MicoApplication
.
io.github.ust.mico.core.dto.response¶
KFConnectorDeploymentInfoResponseDTO¶
-
public class
KFConnectorDeploymentInfoResponseDTO
extends KFConnectorDeploymentInfoRequestDTO¶ DTO for
MicoServiceDeploymentInfo
intended to use with responses only.
Constructors¶
-
public
KFConnectorDeploymentInfoResponseDTO
(MicoServiceDeploymentInfo kfConnectorDeploymentInfo)¶ Creates an instance of
KFConnectorDeploymentInfoResponseDTO
based on aMicoServiceDeploymentInfo
.Parameters: - kfConnectorDeploymentInfo – the
MicoServiceDeploymentInfo
.
- kfConnectorDeploymentInfo – the
KubernetesDeploymentInfoResponseDTO¶
-
public class
KubernetesDeploymentInfoResponseDTO
¶ DTO for
KubernetesDeploymentInfo
intended to use with responses only.
Constructors¶
-
public
KubernetesDeploymentInfoResponseDTO
(KubernetesDeploymentInfo kubernetesDeploymentInfo)¶ Creates an instance of
KubernetesDeploymentInfoResponseDTO
based on aKubernetesDeploymentInfo
.Parameters: - kubernetesDeploymentInfo – the
KubernetesDeploymentInfo
.
- kubernetesDeploymentInfo – the
MicoApplicationJobStatusResponseDTO¶
-
public class
MicoApplicationJobStatusResponseDTO
¶ DTO for a
MicoApplicationJobStatus
intended to use with responses only.
Constructors¶
-
public
MicoApplicationJobStatusResponseDTO
(MicoApplicationJobStatus applicationJobStatus)¶ Creates a
MicoApplicationJobStatusDTO
based on aMicoApplicationJobStatus
.Parameters: - applicationJobStatus – the
MicoApplicationJobStatus
.
- applicationJobStatus – the
MicoApplicationResponseDTO¶
-
public class
MicoApplicationResponseDTO
extends MicoApplicationRequestDTO¶ DTO for a
MicoApplication
intended to use with responses only. Note that neither the services nor their deployment information is included. Contains the current deployment status of this application (may be unknown).
Constructors¶
-
public
MicoApplicationResponseDTO
(MicoApplication application)¶ Creates an instance of
MicoApplicationResponseDTO
based on aMicoApplication
. Note that the deployment status is not set since it cannot be inferred from theMicoApplication
itselfParameters: - application – the
MicoApplication
.
- application – the
-
public
MicoApplicationResponseDTO
(MicoApplication application, MicoApplicationDeploymentStatus deploymentStatus)¶ Creates an instance of
MicoApplicationResponseDTO
based on aMicoApplication
and aMicoApplicationDeploymentStatus
.Parameters: - application – the
MicoApplication
. - deploymentStatus – the
MicoApplicationDeploymentStatus
.
- application – the
MicoApplicationWithServicesResponseDTO¶
-
public class
MicoApplicationWithServicesResponseDTO
extends MicoApplicationResponseDTO¶ DTO for a
MicoApplication
intended to use with responses only. Additionally includes all of services of the application.
Constructors¶
-
public
MicoApplicationWithServicesResponseDTO
(MicoApplication application)¶ Creates an instance of
MicoApplicationWithServicesResponseDTO
based on aMicoApplication
. Note that the deployment status is not set since it cannot be inferred from theMicoApplication
itselfParameters: - application – the
MicoApplication
.
- application – the
-
public
MicoApplicationWithServicesResponseDTO
(MicoApplication application, MicoApplicationDeploymentStatus deploymentStatus)¶ Creates an instance of
MicoApplicationWithServicesResponseDTO
based on aMicoApplication
and aMicoApplicationDeploymentStatus
.Parameters: - application – the
MicoApplication
. - deploymentStatus – the
MicoApplicationDeploymentStatus
.
- application – the
MicoEnvironmentVariableResponseDTO¶
-
public class
MicoEnvironmentVariableResponseDTO
extends MicoEnvironmentVariableRequestDTO¶ DTO for a
MicoEnvironmentVariable
intended to use with responses only.
Constructors¶
-
public
MicoEnvironmentVariableResponseDTO
(MicoEnvironmentVariable environmentVariable)¶ Creates an instance of
MicoEnvironmentVariableResponseDTO
based on aMicoEnvironmentVariable
.Parameters: - environmentVariable – the
MicoEnvironmentVariable
.
- environmentVariable – the
MicoInterfaceConnectionResponseDTO¶
-
public class
MicoInterfaceConnectionResponseDTO
extends MicoInterfaceConnectionRequestDTO¶ DTO for a
MicoInterfaceConnection
intended to use with responses only.
Constructors¶
-
public
MicoInterfaceConnectionResponseDTO
(MicoInterfaceConnection interfaceConnection)¶ Creates an instance of
MicoInterfaceConnectionResponseDTO
based on aMicoInterfaceConnection
.Parameters: - interfaceConnection – the
MicoInterfaceConnection
.
- interfaceConnection – the
MicoLabelResponseDTO¶
-
public class
MicoLabelResponseDTO
extends MicoLabelRequestDTO¶ DTO for a
MicoLabel
intended to use with responses only.
MicoServiceBackgroundJobResponseDTO¶
-
public class
MicoServiceBackgroundJobResponseDTO
¶ DTO for a
MicoServiceBackgroundJob
intended to use with responses only.
Constructors¶
-
public
MicoServiceBackgroundJobResponseDTO
(MicoServiceBackgroundJob serviceBackgroundJob)¶ Creates a
MicoBackgroundJobResponseDTO
based on aMicoServiceBackgroundJob
.Parameters: - serviceBackgroundJob – the
MicoServiceBackgroundJob
.
Return: a
MicoServiceBackgroundJobResponseDTO
with all the values of the givenMicoServiceBackgroundJob
.- serviceBackgroundJob – the
MicoServiceDependencyGraphEdgeResponseDTO¶
-
public class
MicoServiceDependencyGraphEdgeResponseDTO
¶ DTO for the edge of the dependency graph of a
MicoService
.
Constructors¶
-
public
MicoServiceDependencyGraphEdgeResponseDTO
(MicoService source, MicoService target)¶ Creates an instance of
MicoServiceDependencyGraphEdgeResponseDTO
based on a sourceMicoService
and a targetMicoService
.Parameters: - source – the source
MicoService
. - target – the target
MicoService
.
- source – the source
MicoServiceDependencyGraphResponseDTO¶
-
public class
MicoServiceDependencyGraphResponseDTO
¶ DTO for the dependency graph of a
MicoService
.
MicoServiceDeploymentInfoResponseDTO¶
-
public class
MicoServiceDeploymentInfoResponseDTO
extends MicoServiceDeploymentInfoRequestDTO¶ DTO for
MicoServiceDeploymentInfo
intended to use with responses only.
Constructors¶
-
public
MicoServiceDeploymentInfoResponseDTO
(MicoServiceDeploymentInfo serviceDeploymentInfo)¶ Creates an instance of
MicoServiceDeploymentInfoResponseDTO
based on aMicoServiceDeploymentInfo
.Parameters: - serviceDeploymentInfo – the
MicoServiceDeploymentInfo
.
- serviceDeploymentInfo – the
MicoServiceInterfaceResponseDTO¶
-
public class
MicoServiceInterfaceResponseDTO
extends MicoServiceInterfaceRequestDTO¶ DTO for a
MicoServiceInterface
intended to use with responses only.
Constructors¶
-
public
MicoServiceInterfaceResponseDTO
(MicoServiceInterface serviceInterface)¶ Creates an instance of
MicoServiceInterfaceResponseDTO
based on aMicoServiceInterface
.Parameters: - serviceInterface – the
MicoServiceInterface
.
- serviceInterface – the
MicoServicePortResponseDTO¶
-
public class
MicoServicePortResponseDTO
extends MicoServicePortRequestDTO¶ DTO for a
MicoServicePort
intended to use with responses only.
Constructors¶
-
public
MicoServicePortResponseDTO
(MicoServicePort servicePort)¶ Creates an instance of
MicoServicePortResponseDTO
based on aMicoServicePort
.Parameters: - servicePort – the
MicoServicePort
.
- servicePort – the
MicoServiceResponseDTO¶
-
public class
MicoServiceResponseDTO
extends MicoServiceRequestDTO¶ DTO for a
MicoService
intended for use with responses only. Note that theMicoServiceDependencies
andMicoServiceInterfaces
are not included.
Constructors¶
-
public
MicoServiceResponseDTO
(MicoService service)¶ Creates an instance of
MicoServiceResponseDTO
based on aMicoService
.Parameters: - service – the
MicoService
.
- service – the
MicoTopicResponseDTO¶
-
public class
MicoTopicResponseDTO
extends MicoTopicRequestDTO¶ DTO for a
MicoTopic
for response only use
Constructors¶
-
public
MicoTopicResponseDTO
(MicoTopicRole micoTopicRole)¶ Creates an instance of
MicoTopicResponseDTO
based on aMicoTopicRole
.Parameters: - micoTopicRole –
MicoTopicRole
.
- micoTopicRole –
io.github.ust.mico.core.dto.response.internal¶
io.github.ust.mico.core.dto.response.status¶
KubernetesNodeMetricsResponseDTO¶
-
public class
KubernetesNodeMetricsResponseDTO
¶ DTO for the average CPU load and the average memory usage of all
Pods
running on a KubernetesNode
intended to use with responses only.
KubernetesPodInformationResponseDTO¶
-
public class
KubernetesPodInformationResponseDTO
¶ Represents basic information for a Pod in Kubernetes intended to use with responses only..
KubernetesPodMetricsResponseDTO¶
-
public class
KubernetesPodMetricsResponseDTO
¶ Contains information about CPU/memory load of a
Pod
intended to use with responses only..
MicoApplicationDeploymentStatusResponseDTO¶
-
public class
MicoApplicationDeploymentStatusResponseDTO
¶ DTO for a
MicoApplicationDeploymentStatus
intended to use with responses only.
Constructors¶
-
public
MicoApplicationDeploymentStatusResponseDTO
(MicoApplicationDeploymentStatus applicationDeploymentStatus)¶ Creates an instance of
MicoApplicationDeploymentStatusResponseDTO
based on aMicoApplicationDeploymentStatus
.Parameters: - applicationDeploymentStatus – the
applicationDeploymentStatus
.
- applicationDeploymentStatus – the
MicoApplicationStatusResponseDTO¶
-
public class
MicoApplicationStatusResponseDTO
¶ DTO for the status information of a
MicoApplication
intended to use with responses only.
MicoMessageResponseDTO¶
-
public class
MicoMessageResponseDTO
¶ DTO for a
MicoMessage
intended to use with responses only.
Constructors¶
-
public
MicoMessageResponseDTO
(MicoMessage message)¶ Creates an instance of
MicoMessageResponseDTO
based on aMicoMessage
.Parameters: - message – the
message
.
- message – the
MicoServiceInterfaceStatusResponseDTO¶
-
public class
MicoServiceInterfaceStatusResponseDTO
¶ DTO for the status information of a
MicoServiceInterface
that is mapped to a Kubernetes Service intended to use with responses only.
MicoServiceStatusResponseDTO¶
-
public class
MicoServiceStatusResponseDTO
¶ DTO for the status information of a
MicoService
intended to use with responses only..
io.github.ust.mico.core.exception¶
DeploymentException¶
DeploymentRequirementsOfKafkaFaasConnectorNotMetException¶
Constructors¶
-
public
DeploymentRequirementsOfKafkaFaasConnectorNotMetException
(MicoServiceDeploymentInfo serviceDeploymentInfo, String reason)¶
-
public
DeploymentRequirementsOfKafkaFaasConnectorNotMetException
(MicoServiceDeploymentInfo serviceDeploymentInfo)¶
GlobalExceptionHandler¶
-
public class
GlobalExceptionHandler
¶ Global exception handler
Inspired by Petri Kainulainen https://www.petrikainulainen.net/programming/spring-framework/spring-from-the-trenches-adding-validation-to-a-rest-api/
Methods¶
-
public ValidationErrorResponseDTO
methodArgumentNotValidException
(MethodArgumentNotValidException ex)¶
ImageBuildException¶
KafkaFaasConnectorInstanceNotFoundException¶
KafkaFaasConnectorLatestVersionNotFound¶
KafkaFaasConnectorNotAllowedHereException¶
KafkaFaasConnectorVersionNotFoundException¶
KubernetesResourceException¶
-
public class
KubernetesResourceException
extends Exception¶ Used to indicate that there is a problem concerning a Kubernetes resource, e.g., a Deployment cannot be found or there are multiple results for a query for a resource that is expected to be unique.
Constructors¶
MicoApplicationDoesNotIncludeKFConnectorInstanceException¶
MicoApplicationDoesNotIncludeMicoServiceException¶
MicoApplicationIsDeployingException¶
MicoApplicationIsNotUndeployedException¶
MicoServiceAddedMoreThanOnceToMicoApplicationException¶
MicoServiceAlreadyAddedToMicoApplicationException¶
MicoServiceAlreadyExistsException¶
MicoServiceDeploymentInformationNotFoundException¶
MicoServiceHasDependersException¶
MicoServiceInstanceDoesNotMatchShortNameAndVersionException¶
MicoServiceInstanceNotFoundException¶
MicoServiceInterfaceAlreadyExistsException¶
MicoServiceInterfaceNotFoundException¶
MicoServiceIsUsedByMicoApplicationsException¶
MicoTopicRoleUsedMultipleTimesException¶
NotInitializedException¶
PrometheusRequestFailedException¶
ShortNameOfMicoApplicationDoesNotMatchException¶
VersionNotSupportedException¶
io.github.ust.mico.core.model¶
KubernetesDeploymentInfo¶
-
public class
KubernetesDeploymentInfo
¶ Information about the Kubernetes resources that are created through an actual deployment of a
MicoService
.Instances of this class are persisted as nodes in the Neo4j database.
Methods¶
-
public KubernetesDeploymentInfo
applyValuesFrom
(KubernetesDeploymentInfoResponseDTO kubernetesDeploymentInfoDto)¶ Applies the values of all properties of a
KubernetesDeploymentInfoResponseDTO
to thisKubernetesDeploymentInfo
. Note that the id will not be affected.Parameters: - kubernetesDeploymentInfoDto – the
KubernetesDeploymentInfoResponseDTO
.
Returns: this
KubernetesDeploymentInfo
with the values of the properties of the givenKubernetesDeploymentInfoResponseDTO
.- kubernetesDeploymentInfoDto – the
-
public static KubernetesDeploymentInfo
valueOf
(KubernetesDeploymentInfoResponseDTO kubernetesDeploymentInfoDto)¶ Creates a new
KubernetesDeploymentInfo
based on aKubernetesDeploymentInfoResponseDTO
. Note that the id will be set tonull
.Parameters: - kubernetesDeploymentInfoDto – the
KubernetesDeploymentInfoResponseDTO
.
Returns: - kubernetesDeploymentInfoDto – the
MicoApplication¶
-
public class
MicoApplication
¶ Represents an application as a set of
MicoService
s in the context of MICO.Instances of this class are persisted as nodes in the Neo4j database.
Methods¶
-
public MicoVersion
getMicoVersion
()¶
-
public static MicoApplication
valueOf
(MicoApplicationRequestDTO applicationDto)¶ Creates a new
MicoApplication
based on aMicoApplicationRequestDTO
. Note that the id will be set tonull
.Parameters: - applicationDto – the
MicoApplicationRequestDTO
.
Returns: - applicationDto – the
MicoApplicationDeploymentStatus¶
-
public class
MicoApplicationDeploymentStatus
¶ Wraps the deployment status of a
MicoApplication
and some messages (optional) with more detailed information.Note that this class is only used for business logic purposes and instances are not persisted.
Methods¶
-
public static final MicoApplicationDeploymentStatus
deployed
(String... messages)¶ Creates a new
MicoApplicationDeploymentStatus
instance with the valueValue.DEPLOYED
as well as aMicoMessage
with the given message content and typeInfo
.Parameters: - messages – one or messages.
Returns:
-
public static final MicoApplicationDeploymentStatus
deployed
(List<String> messages)¶ Creates a new
MicoApplicationDeploymentStatus
instance with the valueValue.DEPLOYED
as well as aMicoMessage
with the given message content and typeInfo
.Parameters: - messages – the
List
of messages asString
.
Returns: - messages – the
-
public static final MicoApplicationDeploymentStatus
deployed
(String message, Type messageType)¶ Creates a new
MicoApplicationDeploymentStatus
instance with the valueValue.DEPLOYED
as well as aMicoMessage
with the given message content and type.Parameters: - message – the content of the message.
- messageType – the
Type
of the message.
Returns:
-
public static final MicoApplicationDeploymentStatus
incomplete
(String... messages)¶ Creates a new
MicoApplicationDeploymentStatus
instance with the valueValue.INCOMPLETE
as well as aMicoMessage
with the given message content and typeError
.Parameters: - messages – one or messages.
Returns:
-
public static final MicoApplicationDeploymentStatus
incomplete
(List<String> messages)¶ Creates a new
MicoApplicationDeploymentStatus
instance with the valueValue.INCOMPLETE
as well as aMicoMessage
with the given message content and typeError
.Parameters: - messages – the
List
of messages asString
.
Returns: - messages – the
-
public static final MicoApplicationDeploymentStatus
incomplete
(String message, Type messageType)¶ Creates a new
MicoApplicationDeploymentStatus
instance with the valueValue.INCOMPLETE
as well as aMicoMessage
with the given message content and type.Parameters: - message – the content of the message.
- messageType – the
Type
of the message.
Returns:
-
public static final MicoApplicationDeploymentStatus
pending
(String... messages)¶ Creates a new
MicoApplicationDeploymentStatus
instance with the valueValue.PENDING
as well as aMicoMessage
with the given message content and typeInfo
.Parameters: - messages – one or messages.
Returns:
-
public static final MicoApplicationDeploymentStatus
pending
(List<String> messages)¶ Creates a new
MicoApplicationDeploymentStatus
instance with the valueValue.PENDING
as well as aMicoMessage
with the given message content and typeInfo
.Parameters: - messages – the
List
of messages asString
.
Returns: - messages – the
-
public static final MicoApplicationDeploymentStatus
pending
(String message, Type messageType)¶ Creates a new
MicoApplicationDeploymentStatus
instance with the valueValue.PENDING
as well as aMicoMessage
with the given message content and type.Parameters: - message – the content of the message.
- messageType – the
Type
of the message.
Returns:
-
public static final MicoApplicationDeploymentStatus
undeployed
(String... messages)¶ Creates a new
MicoApplicationDeploymentStatus
instance with the valueValue.UNDEPLOYED
as well as aMicoMessage
with the given message content and typeInfo
.Parameters: - messages – one or messages.
Returns:
-
public static final MicoApplicationDeploymentStatus
undeployed
(List<String> messages)¶ Creates a new
MicoApplicationDeploymentStatus
instance with the valueValue.UNDEPLOYED
as well as aMicoMessage
with the given message content and typeInfo
.Parameters: - messages – the
List
of messages asString
.
Returns: - messages – the
-
public static final MicoApplicationDeploymentStatus
undeployed
(String message, Type messageType)¶ Creates a new
MicoApplicationDeploymentStatus
instance with the valueValue.UNDEPLOYED
as well as aMicoMessage
with the given message content and type.Parameters: - message – the content of the message.
- messageType – the
Type
of the message.
Returns:
-
public static final MicoApplicationDeploymentStatus
unknown
(String... messages)¶ Creates a new
MicoApplicationDeploymentStatus
instance with the valueValue.UNKNOWN
as well as aMicoMessage
with the given message content and typeInfo
.Parameters: - messages – one or messages.
Returns:
-
public static final MicoApplicationDeploymentStatus
unknown
(List<String> messages)¶ Creates a new
MicoApplicationDeploymentStatus
instance with the valueValue.UNKNOWN
as well as aMicoMessage
with the given message content and typeInfo
.Parameters: - messages – the
List
of messages asString
.
Returns: - messages – the
-
public static final MicoApplicationDeploymentStatus
unknown
(String message, Type messageType)¶ Creates a new
MicoApplicationDeploymentStatus
instance with the valueValue.UNKNOWN
as well as aMicoMessage
with the given message content and type.Parameters: - message – the content of the message.
- messageType – the
Type
of the message.
Returns:
MicoApplicationDeploymentStatus.Value¶
-
public enum
Value
¶ Enumeration for the different values of a
MicoApplicationDeploymentStatus
.
Enum Constants¶
-
public static final MicoApplicationDeploymentStatus.Value
DEPLOYED
¶ Indicates that a
MicoApplication
with all itsMicoService
has been deployed successfully.
-
public static final MicoApplicationDeploymentStatus.Value
INCOMPLETE
¶ Indicates that the deployment / undeployment of a
MicoApplication
did not complete due to at least oneMicoService
of theMicoApplication
that couldn’t be deployed / undeployed successfully.
-
public static final MicoApplicationDeploymentStatus.Value
PENDING
¶ Indicates that a
MicoApplication
is currently being deployed / undeployed.
-
public static final MicoApplicationDeploymentStatus.Value
UNDEPLOYED
¶ Indicates that a
MicoApplication
with all itsMicoService
has been undeployed successfully.
-
public static final MicoApplicationDeploymentStatus.Value
UNKNOWN
¶ Indicates that the current deployment status of a
MicoApplication
is not known.
MicoApplicationJobStatus¶
-
public class
MicoApplicationJobStatus
¶ Represents the job status for a
MicoApplication
. Contains a list of jobs.Note that this class is only used for business logic purposes and instances are not persisted.
MicoEnvironmentVariable¶
-
public class
MicoEnvironmentVariable
¶ An environment variable represented as a simple key-value pair. Necessary since Neo4j does not allow to persist properties of composite types.
Instances of this class are persisted as nodes in the Neo4j database.
Methods¶
-
public static MicoEnvironmentVariable
valueOf
(MicoEnvironmentVariableRequestDTO environmentVariableDto)¶ Creates a new
MicoEnvironmentVariable
based on aMicoEnvironmentVariableRequestDTO
. Note that the id will be set tonull
.Parameters: - environmentVariableDto – the
MicoEnvironmentVariableRequestDTO
.
Returns: - environmentVariableDto – the
MicoEnvironmentVariable.DefaultNames¶
-
public enum
DefaultNames
¶ The default environment variables for a Kafka-enabled MicoServices.
Enum Constants¶
-
public static final MicoEnvironmentVariable.DefaultNames
KAFKA_BOOTSTRAP_SERVERS
¶
-
public static final MicoEnvironmentVariable.DefaultNames
KAFKA_GROUP_ID
¶
-
public static final MicoEnvironmentVariable.DefaultNames
KAFKA_TOPIC_DEAD_LETTER
¶
-
public static final MicoEnvironmentVariable.DefaultNames
KAFKA_TOPIC_INPUT
¶
-
public static final MicoEnvironmentVariable.DefaultNames
KAFKA_TOPIC_INVALID_MESSAGE
¶
-
public static final MicoEnvironmentVariable.DefaultNames
KAFKA_TOPIC_OUTPUT
¶
-
public static final MicoEnvironmentVariable.DefaultNames
KAFKA_TOPIC_TEST_MESSAGE_OUTPUT
¶
-
public static final MicoEnvironmentVariable.DefaultNames
OPENFAAS_FUNCTION_NAME
¶
-
public static final MicoEnvironmentVariable.DefaultNames
OPENFAAS_GATEWAY
¶
MicoInterfaceConnection¶
-
public class
MicoInterfaceConnection
¶ An interface connection contains the the information needed to connect a
MicoService
to anMicoServiceInterface
of anotherMicoService
.Instances of this class are persisted as nodes in the Neo4j database.
Methods¶
-
public static MicoInterfaceConnection
valueOf
(MicoInterfaceConnectionRequestDTO interfaceConnectionDTO)¶ Creates a new
MicoInterfaceConnection
based on aMicoInterfaceConnectionRequestDTO
.Parameters: - interfaceConnectionDTO – the
MicoInterfaceConnectionRequestDTO
.
Returns: - interfaceConnectionDTO – the
MicoLabel¶
-
public class
MicoLabel
¶ A label represented as a simple key-value pair. Necessary since Neo4j does not allow to persist properties of composite types.
Instances of this class are persisted as nodes in the Neo4j database.
Methods¶
-
public static MicoLabel
valueOf
(MicoLabelRequestDTO labelDto)¶ Creates a new
MicoLabel
based on aMicoLabelRequestDTO
. Note that the id will be set tonull
.Parameters: - labelDto – the
MicoLabelRequestDTO
.
Returns: a
MicoLabel
.- labelDto – the
MicoMessage¶
-
public class
MicoMessage
¶ A simple message associated with a
Type
.Note that this class is only used for business logic purposes and instances are not persisted.
Methods¶
-
public static final MicoMessage
error
(String content)¶ Creates a new
MicoMessage
instance with the typeType.ERROR
and the given message content.Parameters: - content – the message content as
String
.
Returns: a
MicoMessage
.- content – the message content as
-
public static final MicoMessage
info
(String content)¶ Creates a new
MicoMessage
instance with the typeType.INFO
and the given message content.Parameters: - content – the message content as
String
.
Returns: a
MicoMessage
.- content – the message content as
-
public static final MicoMessage
warning
(String content)¶ Creates a new
MicoMessage
instance with the typeType.WARNING
and the given message content.Parameters: - content – the message content as
String
.
Returns: a
MicoMessage
.- content – the message content as
MicoMessage.Type¶
-
public enum
Type
¶ Enumeration for all types of a
MicoInfoMessage
.
Enum Constants¶
-
public static final MicoMessage.Type
ERROR
¶
-
public static final MicoMessage.Type
INFO
¶
-
public static final MicoMessage.Type
WARNING
¶
MicoPortType¶
-
public enum
MicoPortType
¶ Enumeration for all port types, e.g., TCP, supported by MICO.
Enum Constants¶
-
public static final MicoPortType
TCP
¶ Transmission Control Protocol.
-
public static final MicoPortType
UDP
¶ User Datagram Protocol.
MicoService¶
-
public class
MicoService
¶ Represents a service in the context of MICO.
Instances of this class are persisted as nodes in the Neo4j database.
Methods¶
-
public MicoVersion
getMicoVersion
()¶
-
public static MicoService
valueOf
(MicoServiceRequestDTO serviceDto)¶ Creates a new
MicoService
based on aMicoServiceRequestDTO
. Note that the id will be set tonull
.Parameters: - serviceDto – the
MicoServiceRequestDTO
.
Returns: a
MicoService
.- serviceDto – the
MicoServiceBackgroundJob¶
-
public class
MicoServiceBackgroundJob
implements Serializable¶ Background job for a
MicoService
.Instances of this class are persisted in the Redis database.
MicoServiceBackgroundJob.Status¶
-
public enum
Status
¶
Enum Constants¶
-
public static final MicoServiceBackgroundJob.Status
DONE
¶
-
public static final MicoServiceBackgroundJob.Status
ERROR
¶
-
public static final MicoServiceBackgroundJob.Status
PENDING
¶
-
public static final MicoServiceBackgroundJob.Status
RUNNING
¶
-
public static final MicoServiceBackgroundJob.Status
UNDEFINED
¶
MicoServiceBackgroundJob.Type¶
-
public enum
Type
¶
Enum Constants¶
-
public static final MicoServiceBackgroundJob.Type
BUILD
¶
MicoServiceCrawlingOrigin¶
-
public enum
MicoServiceCrawlingOrigin
¶ Enumeration for the various places a service may originate from.
Enum Constants¶
-
public static final MicoServiceCrawlingOrigin
DOCKER
¶ Indicates that a service originates from Docker.
-
public static final MicoServiceCrawlingOrigin
GITHUB
¶ Indicates that a service originates from some GitHub repository.
-
public static final MicoServiceCrawlingOrigin
NOT_DEFINED
¶ Undefined.
MicoServiceDependency¶
-
public class
MicoServiceDependency
¶ Represents a dependency of a
MicoService
.Instances of this class are persisted as relationships between nodes of the type
MicoService
in the Neo4j database.
MicoServiceDeploymentInfo¶
-
public class
MicoServiceDeploymentInfo
¶ Represents the information necessary for deploying a
MicoApplication
. DTO isMicoServiceDeploymentInfoResponseDTO
.Instances of this class are persisted as nodes in the Neo4j database.
Methods¶
-
public MicoServiceDeploymentInfo
applyValuesFrom
(MicoServiceDeploymentInfoRequestDTO serviceDeploymentInfoDto)¶ Applies the values of all properties of a
MicoServiceDeploymentInfoRequestDTO
to thisMicoServiceDeploymentInfo
. Note that the id will not be affected.Parameters: - serviceDeploymentInfoDto – the
MicoServiceDeploymentInfoRequestDTO
.
Returns: this
MicoServiceDeploymentInfo
with the values of the properties of the givenMicoServiceDeploymentInfoRequestDTO
.- serviceDeploymentInfoDto – the
-
public MicoServiceDeploymentInfo
applyValuesFrom
(MicoServiceDeploymentInfoResponseDTO serviceDeploymentInfoDto)¶ Applies the values of all properties of a
MicoServiceDeploymentInfoResponseDTO
to thisMicoServiceDeploymentInfo
. Note that the id will not be affected.Parameters: - serviceDeploymentInfoDto – the
MicoServiceDeploymentInfoResponseDTO
.
Returns: this
MicoServiceDeploymentInfo
with the values of the properties of the givenMicoServiceDeploymentInfoResponseDTO
.- serviceDeploymentInfoDto – the
MicoServiceDeploymentInfo.ImagePullPolicy¶
-
public enum
ImagePullPolicy
¶ Enumeration for the different policies specifying when to pull an image.
Enum Constants¶
-
public static final MicoServiceDeploymentInfo.ImagePullPolicy
ALWAYS
¶
-
public static final MicoServiceDeploymentInfo.ImagePullPolicy
IF_NOT_PRESENT
¶
-
public static final MicoServiceDeploymentInfo.ImagePullPolicy
NEVER
¶
MicoServiceInterface¶
-
public class
MicoServiceInterface
¶ Represents a interface, e.g., REST API, of a
MicoService
.Instances of this class are persisted as nodes in the Neo4j database.
Methods¶
-
public static MicoServiceInterface
valueOf
(MicoServiceInterfaceRequestDTO serviceInterfaceDto)¶ Creates a new
MicoServiceInterface
based on aMicoServiceInterfaceRequestDTO
. Note that the id will be set tonull
.Parameters: - serviceInterfaceDto – the
MicoServiceInterfaceRequestDTO
.
Returns: - serviceInterfaceDto – the
MicoServicePort¶
-
public class
MicoServicePort
¶ Represents a basic port with a port number and port type (protocol).
Instances of this class are persisted as nodes in the Neo4j database.
Methods¶
-
public static MicoServicePort
valueOf
(MicoServicePortRequestDTO servicePortDto)¶ Creates a new
MicoServicePort
based on aMicoServicePortRequestDTO
. Note that the id will be set tonull
.Parameters: - servicePortDto – the
MicoServicePortRequestDTO
.
Returns: - servicePortDto – the
MicoTopic¶
-
public class
MicoTopic
¶ A Topic represented a kafka-topic Instances of this class are persisted as nodes in the neo4j database Possible roles for the topics are INPUT, OUTPUT, DEAD_LETTER, INVALID_MESSAGE, TEST_MESSAGE_OUTPUT
MicoTopicRole¶
-
public class
MicoTopicRole
¶ Represents a role of a
MicoTopic
.An instance of this class is persisted as a relationship between a
MicoServiceDeploymentInfo
and aMicoTopic
node in the Neo4j database.
Methods¶
-
public static MicoTopicRole
valueOf
(MicoTopicRequestDTO topicDto, MicoServiceDeploymentInfo serviceDeploymentInfo)¶ Creates a new
MicoTopicRole
based on aMicoTopicRequestDTO
.
MicoTopicRole.Role¶
-
public enum
Role
¶
Enum Constants¶
-
public static final MicoTopicRole.Role
DEAD_LETTER
¶
-
public static final MicoTopicRole.Role
INPUT
¶
-
public static final MicoTopicRole.Role
INVALID_MESSAGE
¶
-
public static final MicoTopicRole.Role
OUTPUT
¶
-
public static final MicoTopicRole.Role
TEST_MESSAGE_OUTPUT
¶
MicoVersion¶
-
public class
MicoVersion
implements Comparable<MicoVersion>¶ Wrapper for a
Version
that adds the functionality for a version prefix, so that versions like, e.g., ‘v1.2.3’ are possible.Note that this class is only used for business logic purposes and instances are not persisted.
Methods¶
-
public int
compareTo
(MicoVersion other)¶ Compares this version to the other version.
This method does not take into account the versions’ build metadata. If you want to compare the versions’ build metadata use the
Version.compareWithBuildsTo
method or theVersion.BUILD_AWARE_ORDER
comparator.Parameters: - other – the other version to compare to.
Returns: a negative integer, zero or a positive integer if this version is less than, equal to or greater the the specified version.
See also:
.compareWithBuildsTo(MicoVersionother)
-
public int
compareWithBuildsTo
(MicoVersion other)¶ Compare this version to the other version taking into account the build metadata.
The method makes use of the
Version.BUILD_AWARE_ORDER
comparator.Parameters: - other – the other version to compare to
Returns: integer result of comparison compatible with that of the
Comparable.compareTo
methodSee also:
.BUILD_AWARE_ORDER
-
public static MicoVersion
forIntegers
(int major, int minor, int patch)¶ Creates a new instance of
MicoVersion
for the specified version numbers.Parameters: - major – the major version number.
- minor – the minor version number.
- patch – the patch version number.
Throws: - IllegalArgumentException – if a negative integer is passed.
Returns: a new instance of the
MicoVersion
class.
-
public static MicoVersion
forIntegersWithPrefix
(String prefix, int major, int minor, int patch)¶ Creates a new instance of
MicoVersion
for the specified version numbers with the specified prefix string.Parameters: - prefix – the prefix string.
- major – the major version number.
- minor – the minor version number.
- patch – the patch version number.
Throws: - IllegalArgumentException – if a negative integer is passed.
Returns: a new instance of the
MicoVersion
class.
-
public int
getMajorVersion
()¶ Returns the major version number.
Returns: the major version number
-
public int
getMinorVersion
()¶ Returns the minor version number.
Returns: the minor version number
-
public int
getPatchVersion
()¶ Returns the patch version number.
Returns: the patch version number
-
public boolean
greaterThan
(MicoVersion other)¶ Checks if this version is greater than the other version.
Parameters: - other – the other version to compare to.
Returns: true
if this version is greater than the other version orfalse
otherwise.
-
public boolean
greaterThanOrEqualTo
(MicoVersion other)¶ Checks if this version is greater than or equal to the other version.
Parameters: - other – the other version to compare to.
Returns: true
if this version is greater than or equal to the other version orfalse
otherwise.
-
public MicoVersion
incrementBuildMetadata
()¶ Increments the build metadata.
Returns: the updated instance of the MicoVersion
class.
-
public MicoVersion
incrementMajorVersion
()¶ Increments the major version.
Returns: the updated instance of the MicoVersion
class.
-
public MicoVersion
incrementMajorVersion
(String preRelease)¶ Increments the major version and appends the pre-release version.
Parameters: - preRelease – the pre-release version to append.
Throws: - IllegalArgumentException – if the input string is
NULL
or empty. - ParseException – when invalid version string is provided.
- UnexpectedCharacterException – is a special case of
ParseException
.
Returns: the updated instance of the
MicoVersion
class.
-
public MicoVersion
incrementMinorVersion
()¶ Increments the minor version.
Returns: the updated instance of the MicoVersion
class.
-
public MicoVersion
incrementMinorVersion
(String preRelease)¶ Increments the minor version and appends the pre-release version.
Parameters: - preRelease – the pre-release version to append.
Throws: - IllegalArgumentException – if the input string is
NULL
or empty. - ParseException – when invalid version string is provided.
- UnexpectedCharacterException – is a special case of
ParseException
.
Returns: the updated instance of the
MicoVersion
class.
-
public MicoVersion
incrementPatchVersion
()¶ Increments the path version.
Returns: the updated instance of the MicoVersion
class.
-
public MicoVersion
incrementPatchVersion
(String preRelease)¶ Increments the patch version and appends the pre-release version.
Parameters: - preRelease – the pre-release version to append.
Throws: - IllegalArgumentException – if the input string is
NULL
or empty. - ParseException – when invalid version string is provided.
- UnexpectedCharacterException – is a special case of
ParseException
.
Returns: the updated instance of the
MicoVersion
class.
-
public MicoVersion
incrementPreReleaseVersion
()¶ Increments the pre-release version.
Returns: the updated instance of the MicoVersion
class.
-
public boolean
lessThan
(MicoVersion other)¶ Checks if this version is less than the other version.
Parameters: - other – the other version to compare to.
Returns: true
if this version is less than the other version orfalse
otherwise.
-
public boolean
lessThanOrEqualTo
(MicoVersion other)¶ Checks if this version is less than or equal to the other version.
Parameters: - other – the other version to compare to.
Returns: true
if this version is less than or equal to the other version orfalse
otherwise.
-
public MicoVersion
setBuildMetadata
(String build)¶ Sets the build metadata.
Parameters: - build – the build metadata to set.
Throws: - IllegalArgumentException – if the input string is
NULL
or empty. - ParseException – when invalid version string is provided.
- UnexpectedCharacterException – is a special case of
ParseException
.
Returns: the updated instance of the
MicoVersion
class.
-
public MicoVersion
setPreReleaseVersion
(String preRelease)¶ Sets the pre-release version.
Parameters: - preRelease – the pre-release version to set.
Throws: - IllegalArgumentException – if the input string is
NULL
or empty. - ParseException – when invalid version string is provided.
- UnexpectedCharacterException – is a special case of
ParseException
.
Returns: the updated instance of the
MicoVersion
class.
-
public static MicoVersion
valueOf
(String version)¶ Creates a new instance of
MicoVersion
as a result of parsing the specified version string. Prefixes are possible as everything before the first digit in the given version string is treated as a prefix to the actual semantic version. Note that the prefix can only consist of letters.Parameters: - version – the version string to parse (may include a prefix).
Throws: - VersionNotSupportedException – if the version is not a semantic version with a string prefix.
Returns: a new instance of the
MicoVersion
class.
io.github.ust.mico.core.persistence¶
KubernetesDeploymentInfoRepository¶
-
public interface
KubernetesDeploymentInfoRepository
extends Neo4jRepository<KubernetesDeploymentInfo, Long>¶
Methods¶
-
void
cleanUp
()¶ Deletes all
KubernetesDeploymentInfo
nodes that do not have any relationship to another node.
MicoApplicationRepository¶
-
public interface
MicoApplicationRepository
extends Neo4jRepository<MicoApplication, Long>¶
Methods¶
-
List<MicoApplication>
findAll
()¶
-
List<MicoApplication>
findAll
(int depth)¶
-
List<MicoApplication>
findAllByUsedService
(String shortName, String version)¶ Find all applications that are using the given service.
Parameters: - shortName – the shortName of the
MicoService
- version – the version of the
MicoService
Returns: a list of
MicoApplication
- shortName – the shortName of the
-
List<MicoApplication>
findAllByUsedServiceInstance
(String instanceId)¶ Find all applications that are using the given service.
Parameters: - instanceId – the instance ID of the
MicoServiceDeploymentInfo
Returns: a list of
MicoApplication
- instanceId – the instance ID of the
-
List<MicoApplication>
findByShortName
(String shortName)¶
MicoBackgroundJobRepository¶
-
public interface
MicoBackgroundJobRepository
extends CrudRepository<MicoServiceBackgroundJob, String>¶
Methods¶
-
List<MicoServiceBackgroundJob>
findAll
()¶
-
List<MicoServiceBackgroundJob>
findByInstanceId
(String instanceId)¶
-
Optional<MicoServiceBackgroundJob>
findByInstanceIdAndType
(String instanceId, MicoServiceBackgroundJob.Type type)¶
-
List<MicoServiceBackgroundJob>
findByServiceShortNameAndServiceVersion
(String micoServiceShortName, String micoServiceVersion)¶
-
List<MicoServiceBackgroundJob>
findByServiceShortNameAndServiceVersionAndType
(String micoServiceShortName, String micoServiceVersion, MicoServiceBackgroundJob.Type type)¶
MicoEnvironmentVariableRepository¶
-
public interface
MicoEnvironmentVariableRepository
extends Neo4jRepository<MicoEnvironmentVariable, Long>¶
MicoInterfaceConnectionRepository¶
-
public interface
MicoInterfaceConnectionRepository
extends Neo4jRepository<MicoInterfaceConnection, Long>¶
MicoLabelRepository¶
MicoServiceDependencyRepository¶
-
public interface
MicoServiceDependencyRepository
extends Neo4jRepository<MicoServiceDependency, Long>¶
MicoServiceDeploymentInfoRepository¶
-
public interface
MicoServiceDeploymentInfoRepository
extends Neo4jRepository<MicoServiceDeploymentInfo, Long>¶
Methods¶
-
void
deleteAllByApplication
(String applicationShortName)¶ Deletes all deployment information for all versions of an application including the ones for the KafkaFaasConnectors. All additional properties of a
MicoServiceDeploymentInfo
that are stored as a separate node entity and connected to it via a[:HAS]
relationship will be deleted too, if they are used exclusively by this deployment information. Exclusively means that there must only be one single edge connected to the particular property (relatedNode
, seesize
operator inWHERE
clause). If that’s the case, it’s possible to delete this related node safely.Also works with a KafkaFaasConnector instance.
Parameters: - applicationShortName – the short name of the
MicoApplication
.
- applicationShortName – the short name of the
-
void
deleteAllByApplication
(String applicationShortName, String applicationVersion)¶ Deletes all deployment information for a particular application including the ones for the KafkaFaasConnectors. All additional properties of a
MicoServiceDeploymentInfo
that are stored as a separate node entity and connected to it via a[:HAS]
relationship will be deleted too, if they are used exclusively by this deployment information. Exclusively means that there must only be one single edge connected to the particular property (relatedNode
, seesize
operator inWHERE
clause). If that’s the case, it’s possible to delete this related node safely.Also works with a KafkaFaasConnector instance.
Parameters: - applicationShortName – the short name of the
MicoApplication
. - applicationVersion – the version of the
MicoApplication
.
- applicationShortName – the short name of the
-
void
deleteByApplicationAndService
(String applicationShortName, String applicationVersion, String serviceShortName)¶ Deletes the deployment information for a particular application and service. All additional properties of a
MicoServiceDeploymentInfo
that are stored as a separate node entity and connected to it via a[:HAS]
relationship will be deleted too, if they are used exclusively by this deployment information. Exclusively means that there must only be one single edge connected to the particular property (relatedNode
, seesize
operator inWHERE
clause). If that’s the case, it’s possible to delete this related node safely.Also works with a KafkaFaasConnector instance.
Parameters: - applicationShortName – the short name of the
MicoApplication
. - applicationVersion – the version of the
MicoApplication
. - serviceShortName – the short name of the
MicoService
.
- applicationShortName – the short name of the
-
void
deleteByApplicationAndService
(String applicationShortName, String applicationVersion, String serviceShortName, String serviceVersion)¶ Deletes the deployment information for a particular application and service. All additional properties of a
MicoServiceDeploymentInfo
that are stored as a separate node entity and connected to it via a[:HAS]
relationship will be deleted too, if they are used exclusively by this deployment information. Exclusively means that there must only be one single edge connected to the particular property (relatedNode
, seesize
operator inWHERE
clause). If that’s the case, it’s possible to delete this related node safely.Also works with a KafkaFaasConnector instance.
Parameters: - applicationShortName – the short name of the
MicoApplication
. - applicationVersion – the version of the
MicoApplication
. - serviceShortName – the short name of the
MicoService
. - serviceVersion – the version of the
MicoService
.
- applicationShortName – the short name of the
-
List<MicoServiceDeploymentInfo>
findAllByApplication
(String applicationShortName, String applicationVersion)¶ Retrieves all service deployment information of a particular application. Also includes these which are used for the deployments of KafkaFaasConnector instances.
Parameters: - applicationShortName – the short name of the
MicoApplication
. - applicationVersion – the version of the
MicoApplication
.
Returns: a
List
ofMicoServiceDeploymentInfo
instances.- applicationShortName – the short name of the
-
List<MicoServiceDeploymentInfo>
findAllByService
(String serviceShortName, String serviceVersion)¶ Retrieves all service deployment information of a service. Note that one service can be used by (included in) multiple applications. Also works with a KafkaFaasConnector instance.
Parameters: - serviceShortName – the short name of the
MicoService
. - serviceVersion – the version of the
MicoService
.
Returns: a
List
ofMicoServiceDeploymentInfo
instances.- serviceShortName – the short name of the
-
List<MicoServiceDeploymentInfo>
findByApplicationAndService
(String applicationShortName, String applicationVersion, String serviceShortName)¶ Retrieves the deployment information for a particular application and service. Also works with a KafkaFaasConnector instance.
Parameters: - applicationShortName – the short name of the
MicoApplication
. - applicationVersion – the version of the
MicoApplication
. - serviceShortName – the short name of the
MicoService
.
Returns: - applicationShortName – the short name of the
-
List<MicoServiceDeploymentInfo>
findByApplicationAndService
(String applicationShortName, String applicationVersion, String serviceShortName, String serviceVersion)¶ Retrieves the deployment information for a particular application and service. Also works with a KafkaFaasConnector instance.
Parameters: - applicationShortName – the short name of the
MicoApplication
. - applicationVersion – the version of the
MicoApplication
. - serviceShortName – the short name of the
MicoService
. - serviceVersion – the version of the
MicoService
.
Returns: - applicationShortName – the short name of the
-
Optional<MicoServiceDeploymentInfo>
findByInstanceId
(String instanceId)¶
-
List<MicoServiceDeploymentInfo>
findKFConnectorSDIsByApplication
(String applicationShortName, String applicationVersion)¶ Retrieves all service deployment information that are used for KafkaFaasConnectors of a particular application.
Parameters: - applicationShortName – the short name of the
MicoApplication
. - applicationVersion – the version of the
MicoApplication
.
Returns: a
List
ofMicoServiceDeploymentInfo
instances.- applicationShortName – the short name of the
-
List<MicoServiceDeploymentInfo>
findMicoServiceSDIsByApplication
(String applicationShortName, String applicationVersion)¶ Retrieves all service deployment information that are used for normal MicoServices of a particular application.
Parameters: - applicationShortName – the short name of the
MicoApplication
. - applicationVersion – the version of the
MicoApplication
.
Returns: a
List
ofMicoServiceDeploymentInfo
instances.- applicationShortName – the short name of the
MicoServiceInterfaceRepository¶
-
public interface
MicoServiceInterfaceRepository
extends Neo4jRepository<MicoServiceInterface, Long>¶
MicoServicePortRepository¶
-
public interface
MicoServicePortRepository
extends Neo4jRepository<MicoServicePort, Long>¶
MicoServiceRepository¶
-
public interface
MicoServiceRepository
extends Neo4jRepository<MicoService, Long>¶
Methods¶
-
List<MicoService>
findAll
()¶
-
List<MicoService>
findAll
(int depth)¶
-
List<MicoService>
findAllByApplication
(String applicationShortName, String applicationVersion)¶ Finds all services that are included by a given application.
Parameters: - applicationShortName – the short name of the
MicoApplication
. - applicationVersion – the version of the
MicoApplication
.
Returns: a list of
MicoServices
.- applicationShortName – the short name of the
-
Optional<MicoService>
findAllByApplicationAndServiceShortName
(String applicationShortName, String applicationVersion, String serviceShortName)¶ Finds the service that is included in a given application for a given service short name.
Parameters: - applicationShortName – the short name of the
MicoApplication
. - applicationVersion – the version of the
MicoApplication
. - serviceShortName – the short name of the
MicoService
.
Returns: a list of
MicoServices
.- applicationShortName – the short name of the
-
List<MicoService>
findByShortName
(String shortName)¶
-
Optional<MicoService>
findByShortNameAndVersion
(String shortName, String version)¶
-
List<MicoService>
findDependees
(String shortName, String version)¶ Finds all services (dependees) the given service (depender) depends on.
Parameters: - shortName – the short name of the
MicoService
(depender). - version – the version of the
MicoService
(depender).
Returns: a list of
MicoServices
.- shortName – the short name of the
-
List<MicoService>
findDependeesIncludeDepender
(String shortName, String version)¶ Finds all services (dependees) the given service (depender) depends on as well as the service (depender) itself.
Parameters: - shortName – the short name of the
MicoService
(depender). - version – the version of the
MicoService
(depender).
Returns: a list of
MicoServices
including all dependees as well as the depender.- shortName – the short name of the
-
List<MicoService>
findDependers
(String shortName, String version)¶ Finds all services (dependers) that depend on the given service (dependee).
Parameters: - shortName – the short name of the
MicoService
(dependee). - version – the version of the
MicoService
(dependee).
Returns: a list of
MicoServices
.- shortName – the short name of the
MicoTopicRepository¶
OpenFaaSFunctionRepository¶
-
public interface
OpenFaaSFunctionRepository
extends Neo4jRepository<OpenFaaSFunction, Long>¶
io.github.ust.mico.core.resource¶
ApplicationResource¶
-
public class
ApplicationResource
¶
Methods¶
-
public ResponseEntity<Resource<KFConnectorDeploymentInfoResponseDTO>>
addKafkaFaasConnectorInstanceToApplication
(String applicationShortName, String applicationVersion, String kfConnectorVersion)¶
-
public ResponseEntity<Resource<MicoServiceDeploymentInfoResponseDTO>>
addServiceToApplication
(String applicationShortName, String applicationVersion, String serviceShortName, String serviceVersion, String instanceId)¶ Currently we don’t support multiple instance deployment for normal MICO services. Covered by MICO#743. Therefore this API endpoint is not required at the moment.
-
public ResponseEntity<Resource<MicoApplicationWithServicesResponseDTO>>
createApplication
(MicoApplicationRequestDTO applicationDto)¶
-
public ResponseEntity<Resources<Resource<MicoApplicationWithServicesResponseDTO>>>
getAllApplications
()¶
-
public ResponseEntity<Resource<MicoApplicationWithServicesResponseDTO>>
getApplicationByShortNameAndVersion
(String shortName, String version)¶
-
public ResponseEntity<Resource<MicoApplicationDeploymentStatusResponseDTO>>
getApplicationDeploymentStatus
(String shortName, String version)¶
-
public ResponseEntity<Resources<Resource<MicoApplicationWithServicesResponseDTO>>>
getApplicationsByShortName
(String shortName)¶
-
public ResponseEntity<Resources<Resource<MicoServiceResponseDTO>>>
getServicesOfApplication
(String shortName, String version)¶
-
public ResponseEntity<Resource<MicoApplicationStatusResponseDTO>>
getStatusOfApplication
(String shortName, String version)¶
-
public ResponseEntity<Resource<MicoApplicationWithServicesResponseDTO>>
promoteApplication
(String shortName, String version, MicoVersionRequestDTO newVersionDto)¶
-
public ResponseEntity<Resource<MicoApplicationWithServicesResponseDTO>>
updateApplication
(String shortName, String version, MicoApplicationRequestDTO applicationRequestDto)¶
BackgroundJobResource¶
-
public class
BackgroundJobResource
¶
Methods¶
-
public ResponseEntity<Resources<Resource<MicoServiceBackgroundJobResponseDTO>>>
getAllJobs
()¶
-
public ResponseEntity<Resource<MicoServiceBackgroundJobResponseDTO>>
getJobById
(String id)¶
-
public ResponseEntity<Resource<MicoApplicationJobStatusResponseDTO>>
getJobStatusByApplicationShortNameAndVersion
(String shortName, String version)¶
KafkaFaasConnectorDeploymentInfoResource¶
-
public class
KafkaFaasConnectorDeploymentInfoResource
¶
Methods¶
-
public ResponseEntity<Resources<Resource<KFConnectorDeploymentInfoResponseDTO>>>
getKafkaFaasConnectorDeploymentInformation
(String shortName, String version)¶
-
public ResponseEntity<Resource<KFConnectorDeploymentInfoResponseDTO>>
getKafkaFaasConnectorDeploymentInformationInstance
(String shortName, String version, String instanceId)¶
-
protected static Resource<KFConnectorDeploymentInfoResponseDTO>
getKfConnectorDeploymentInfoResponseDTOResource
(String applicationShortName, String applicationVersion, MicoServiceDeploymentInfo micoServiceDeploymentInfo)¶ Wraps a
KFConnectorDeploymentInfoResponseDTO
into a HATEOAS resource with a link to the application and a self-link.Parameters: - applicationShortName – the short name of the
MicoApplication
- applicationVersion – the version of the
MicoApplication
- micoServiceDeploymentInfo – the
MicoServiceDeploymentInfo
Returns: The resource containing the
KFConnectorDeploymentInfoResponseDTO
.- applicationShortName – the short name of the
-
public ResponseEntity<Resource<KFConnectorDeploymentInfoResponseDTO>>
updateKafkaFaasConnectorDeploymentInfo
(String shortName, String version, String instanceId, KFConnectorDeploymentInfoRequestDTO kfConnectorDeploymentInfoRequestDTO)¶
OpenFaasResource¶
-
public class
OpenFaasResource
¶
Fields¶
-
OpenFaaSConfig
openFaaSConfig
¶
-
OpenFaasBroker
openFaasBroker
¶
ServiceDeploymentInfoResource¶
-
public class
ServiceDeploymentInfoResource
¶
Methods¶
-
public ResponseEntity<Resource<MicoServiceDeploymentInfoResponseDTO>>
getServiceDeploymentInformation
(String shortName, String version, String serviceShortName)¶
-
public ResponseEntity<Resource<MicoServiceDeploymentInfoResponseDTO>>
updateServiceDeploymentInformation
(String shortName, String version, String serviceShortName, MicoServiceDeploymentInfoRequestDTO serviceDeploymentInfoRequestDto)¶
ServiceInterfaceResource¶
-
public class
ServiceInterfaceResource
¶
Methods¶
-
public ResponseEntity<Resource<MicoServiceInterfaceResponseDTO>>
createServiceInterface
(String shortName, String version, MicoServiceInterfaceRequestDTO serviceInterfaceRequestDto)¶ This is not transactional. At the moment we have only one user. If this changes transactional support is a must. FIXME Add transactional support
Parameters: - shortName – the name of the MICO service
- version – the version of the MICO service
- serviceInterfaceRequestDto – the
MicoServiceInterfaceRequestDTO
Returns: the created MICO service interface
-
public ResponseEntity<Resource<MicoServiceInterfaceResponseDTO>>
getInterfaceByName
(String shortName, String version, String serviceInterfaceName)¶
-
public ResponseEntity<Resources<Resource<MicoServiceInterfaceResponseDTO>>>
getInterfacesOfService
(String shortName, String version)¶
-
public ResponseEntity<Resource<MicoServiceInterfaceResponseDTO>>
updateServiceInterface
(String shortName, String version, String serviceInterfaceName, MicoServiceInterfaceRequestDTO updatedServiceInterfaceRequestDto)¶ Updates an existing MICO service interface.
Parameters: - shortName – the name of a
MicoService
- version – the version a
MicoService
- serviceInterfaceName – the name of a
MicoServiceInterface
- updatedServiceInterfaceRequestDto – the
MicoServiceInterfaceRequestDTO
Returns: the updated
MicoServiceInterfaceResponseDTO
- shortName – the name of a
ServiceResource¶
-
public class
ServiceResource
¶
Fields¶
Methods¶
-
public ResponseEntity<Resource<MicoServiceResponseDTO>>
createService
(MicoServiceRequestDTO serviceDto)¶
-
public ResponseEntity<Resources<Resource<MicoServiceResponseDTO>>>
getDependees
(String shortName, String version)¶
-
public ResponseEntity<Resource<MicoServiceDependencyGraphResponseDTO>>
getDependencyGraph
(String shortName, String version)¶
-
public ResponseEntity<Resources<Resource<MicoServiceResponseDTO>>>
getDependers
(String shortName, String version)¶
-
public ResponseEntity<Resource<MicoServiceResponseDTO>>
getServiceByShortNameAndVersion
(String shortName, String version)¶
-
static Iterable<Link>
getServiceLinks
(MicoService service)¶
-
public ResponseEntity<Resources<Resource<MicoServiceResponseDTO>>>
getServiceList
()¶
-
static Resource<MicoServiceResponseDTO>
getServiceResponseDTOResource
(MicoService service)¶
-
static List<Resource<MicoServiceResponseDTO>>
getServiceResponseDTOResourcesList
(List<MicoService> services)¶
-
public ResponseEntity<Resource<MicoYamlResponseDTO>>
getServiceYamlByShortNameAndVersion
(String shortName, String version)¶ Return yaml for a
MicoService
for the give shortName and version.Parameters: - shortName – the short name of the
MicoService
. - version – version the version of the
MicoService
.
Returns: the kubernetes YAML for the
MicoService
.- shortName – the short name of the
-
public ResponseEntity<Resources<Resource<MicoServiceStatusResponseDTO>>>
getStatusListOfService
(String shortName, String version)¶
-
public ResponseEntity<Resource<MicoServiceStatusResponseDTO>>
getStatusOfServiceInstance
(String shortName, String version, String instanceId)¶
-
public ResponseEntity<Resources<Resource<MicoVersionRequestDTO>>>
getVersionsFromGitHub
(String url)¶
-
public ResponseEntity<Resources<Resource<MicoServiceResponseDTO>>>
getVersionsOfService
(String shortName)¶
-
public ResponseEntity<Resource<MicoServiceResponseDTO>>
importMicoServiceFromGitHub
(CrawlingInfoRequestDTO crawlingInfo)¶
-
public ResponseEntity<Resource<MicoServiceResponseDTO>>
promoteService
(String shortName, String version, MicoVersionRequestDTO newVersionDto)¶
-
public ResponseEntity<Resource<MicoServiceResponseDTO>>
updateService
(String shortName, String version, MicoServiceRequestDTO serviceDto)¶
io.github.ust.mico.core.service¶
GitHubCrawler¶
-
public class
GitHubCrawler
¶
Constructors¶
-
public
GitHubCrawler
(RestTemplate restTemplate, KubernetesNameNormalizer kubernetesNameNormalizer)¶
Methods¶
-
public MicoService
crawlGitHubRepoLatestRelease
(String gitHubRepoUrl, String dockerfilePath)¶
-
public MicoService
crawlGitHubRepoLatestRelease
(String gitHubRepoUrl)¶
-
public MicoService
crawlGitHubRepoSpecificRelease
(String gitHubRepoUrl, String version, String dockerfilePath)¶
-
public MicoService
crawlGitHubRepoSpecificRelease
(String gitHubRepoUrl, String version)¶
ImageBuilderHealthIndicator¶
-
public class
ImageBuilderHealthIndicator
implements HealthIndicator¶
Constructors¶
-
public
ImageBuilderHealthIndicator
(TektonPipelinesController imageBuilder)¶
MicoKubernetesClient¶
-
public class
MicoKubernetesClient
¶ Provides accessor methods for creating deployments and services in Kubernetes as well as getter methods to retrieve existing Kubernetes deployments and services.
Constructors¶
-
public
MicoKubernetesClient
(MicoKubernetesConfig micoKubernetesConfig, MicoKubernetesBuildBotConfig buildBotConfig, KubernetesClient kubernetesClient, TektonPipelinesController imageBuilder, BackgroundJobBroker backgroundJobBroker, MicoApplicationRepository applicationRepository, MicoServiceDeploymentInfoRepository serviceDeploymentInfoRepository, KubernetesDeploymentInfoRepository kubernetesDeploymentInfoRepository)¶
Methods¶
-
public Deployment
createMicoServiceInstance
(MicoServiceDeploymentInfo serviceDeploymentInfo)¶ Create a Kubernetes deployment based on a
MicoServiceDeploymentInfo
.Parameters: - serviceDeploymentInfo – the
MicoServiceDeploymentInfo
Returns: the Kubernetes
Deployment
resource object- serviceDeploymentInfo – the
-
public Service
createMicoServiceInterface
(MicoServiceInterface micoServiceInterface, MicoServiceDeploymentInfo micoServiceDeploymentInfo)¶ Create a Kubernetes service based on a MICO service interface.
Parameters: - micoServiceInterface – the
MicoServiceInterface
- micoServiceDeploymentInfo – the
MicoServiceDeploymentInfo
Returns: the Kubernetes
Service
resource- micoServiceInterface – the
-
public void
createOrUpdateInterfaceConnections
(MicoApplication micoApplication)¶ Creates or updates all interface connections of the given
MicoApplication
.Parameters: - micoApplication – the
MicoApplication
- micoApplication – the
-
public String
createServiceName
(MicoServiceDeploymentInfo serviceDeploymentInfo, MicoServiceInterface serviceInterface)¶ Creates the name of the Kubernetes service based on the
serviceDeploymentInfo
and theserviceInterfaceName
.Parameters: - serviceDeploymentInfo – the
MicoServiceDeploymentInfo
- serviceInterface – the
MicoServiceInterface
Returns: the created string that should be used as the name of the Kubernetes service
- serviceDeploymentInfo – the
-
public MicoApplicationDeploymentStatus
getApplicationDeploymentStatus
(MicoApplication micoApplication)¶ Indicates whether a
MicoApplication
is currently deployed.In order to determine the application deployment status of the given
MicoApplication
the following points are checked:- the current
MicoApplicationJobStatus
(deployment may be scheduled, running or finished with an error - the stored
MicoServiceDeploymentInfo
andKubernetesDeploymentInfo
- the actual information retrieved from Kubernetes regarding deployments for
MicoServices
and Kubernetes Services forMicoServiceInterfaces
Note that the returned
MicoApplicationDeploymentStatus
contains info messages with further information in case theMicoApplication
currently is not deployed.Parameters: - micoApplication – the
MicoApplication
.
Returns: - the current
-
public Optional<Deployment>
getDeploymentOfMicoServiceInstance
(MicoServiceDeploymentInfo serviceDeploymentInfo)¶ Returns a Kubernetes
Deployment
instance that corresponds to the providedMicoServiceDeploymentInfo
, if it is already deployed to the Kubernetes cluster. Labels are used for the lookup.Parameters: - serviceDeploymentInfo – the
MicoServiceDeploymentInfo
Returns: an
Optional
with theDeployment
of the Kubernetes service, or an emptyOptional
if there is no Kubernetes deployment of theMicoService
.- serviceDeploymentInfo – the
-
public List<Deployment>
getDeploymentsOfMicoService
(MicoService micoService)¶ Returns a list of Kubernetes
Deployment
instances that corresponds to theMicoService
Labels are used for the lookup.Parameters: - micoService – the
MicoService
Returns: a list of Kubernetes
Deployments
. It is empty if there is no Kubernetes deployment of theMicoService
.- micoService – the
-
public Optional<Service>
getInterfaceByNameOfMicoServiceInstance
(MicoServiceDeploymentInfo serviceDeploymentInfo, String micoServiceInterfaceName)¶ Check if the
MicoServiceInterface
is already created for theMicoService
in the Kubernetes cluster. Labels are used for the lookup.Parameters: - serviceDeploymentInfo – the
MicoServiceDeploymentInfo
- micoServiceInterfaceName – the name of a
MicoServiceInterface
Returns: an
Optional
with the KubernetesService
, or an emptyOptional
if there is no KubernetesService
for thisMicoServiceInterface
.- serviceDeploymentInfo – the
-
public List<Service>
getInterfacesOfMicoService
(MicoService micoService)¶ Looks up if there are any interfaces created for the
MicoService
in the Kubernetes cluster. If so, it returns them as a list of KubernetesService
objects. Labels are used for the lookup.Parameters: - micoService – the
MicoService
Returns: the list of Kubernetes
Service
objects- micoService – the
-
public List<Service>
getInterfacesOfMicoServiceInstance
(MicoServiceDeploymentInfo serviceDeploymentInfo)¶ Looks up if there are any interfaces created for the
MicoServiceDeploymentInfo
in the Kubernetes cluster. If so, it returns them as a list of KubernetesService
objects. Labels are used for the lookup.Parameters: - serviceDeploymentInfo – the
MicoServiceDeploymentInfo
Returns: the list of Kubernetes
Service
objects- serviceDeploymentInfo – the
-
public PasswordAuthentication
getOpenFaasCredentials
()¶ Requests the OpenFaaS credentials from a Kubernetes secret.
Returns: the username and the password
-
public List<Pod>
getPodsCreatedByDeploymentOfMicoServiceInstance
(MicoServiceDeploymentInfo serviceDeploymentInfo)¶ Looks up if the
MicoServiceDeploymentInfo
is already deployed to the Kubernetes cluster. If so, it returns the list of KubernetesPod
objects that belongs to theDeployment
. Labels are used for the lookup.Parameters: - serviceDeploymentInfo – the
MicoServiceDeploymentInfo
Returns: the list of Kubernetes
Pod
objects- serviceDeploymentInfo – the
-
public Optional<String>
getPublicIpOfKubernetesService
(String name, String namespace)¶ Requests the public IP of a Kubernetes service and returns it or an empty
Optional
if the service has no public IP.Parameters: - name – the name of the service.
- namespace – the namespace which contains the service.
Throws: - KubernetesResourceException – if there is no such service.
Returns: the public ip of a service or an empty optional.
-
public List<Integer>
getPublicPortsOfKubernetesService
(String name, String namespace)¶ Requests the list of public ports of a service. It returns the list of ports or an empty list if there are none.
Parameters: - name – the name of the service.
- namespace – the namespace which contains the service.
Throws: - KubernetesResourceException – if there is no such service.
Returns: a list of ports or an empty list.
-
public Optional<Service>
getService
(String name, String namespace)¶ Requests the service with the given name in the given namespace or
null
if there is no such serviceParameters: - name – the name of the service.
- namespace – the namespace which contains the service.
Returns: the service in the namespace and with the given name or
null
.
-
public String
getYaml
(MicoService micoService)¶ Retrieves the yaml(s) for all Kubernetes deployments of a MicoService and the yaml(s) for all Kubernetes services of the including interfaces (if there are any).
Parameters: - micoService – the
MicoService
Throws: - JsonProcessingException – if there is a error processing the content.
Returns: the kubernetes YAML for the
MicoService
.- micoService – the
-
public String
getYaml
(MicoServiceDeploymentInfo serviceDeploymentInfo)¶ Retrieves the yaml for a MicoServiceDeploymentInfo, contains the interfaces if they exist.
Parameters: - serviceDeploymentInfo – the
MicoServiceDeploymentInfo
Throws: - JsonProcessingException – if there is a error processing the content.
Returns: the kubernetes YAML for the
MicoService
.- serviceDeploymentInfo – the
-
public boolean
isApplicationDeployed
(MicoApplication micoApplication)¶ Checks whether a given
MicoApplication
is currently deployed.Parameters: - micoApplication – the
MicoApplication
.
Returns: true
if and only ifgetApplicationDeploymentStatus(MicoApplication)
returns aMicoApplicationDeploymentStatus
withDeployed
;false
otherwise.- micoApplication – the
-
public boolean
isApplicationUndeployed
(MicoApplication micoApplication)¶ Checks whether a given
MicoApplication
is currently undeployed.Parameters: - micoApplication – the
MicoApplication
.
Returns: true
if and only ifgetApplicationDeploymentStatus(MicoApplication)
returns aMicoApplicationDeploymentStatus
withUndeployed
;false
otherwise.- micoApplication – the
-
public boolean
isMicoServiceDeployed
(MicoService micoService)¶ Checks if a
MicoService
is already deployed at least with one instance.Parameters: - micoService – the
MicoService
Returns: true
if theMicoService
is deployed.- micoService – the
-
public boolean
isMicoServiceInstanceDeployed
(MicoServiceDeploymentInfo serviceDeploymentInfo)¶ Checks if a
MicoService
instance is already deployed.Parameters: - serviceDeploymentInfo – the
MicoServiceDeploymentInfo
Returns: true
if theMicoService
is deployed.- serviceDeploymentInfo – the
-
public Optional<Deployment>
scaleIn
(MicoServiceDeploymentInfo serviceDeploymentInfo, int numberOfReplicas)¶ Performs a scale in of a Kubernetes deployment based on some service deployment information by a given number of replicas to remove.
Note that the Kubernetes deployment will be undeployed if and only if the given number of replicas is less than or equal to 0.
Parameters: - serviceDeploymentInfo – the
MicoServiceDeploymentInfo
. - numberOfReplicas – the number of replicas to remove.
Throws: - KubernetesResourceException – if the Kubernetes deployment can’t be found
- serviceDeploymentInfo – the
-
public Optional<Deployment>
scaleOut
(MicoServiceDeploymentInfo serviceDeploymentInfo, int numberOfReplicas)¶ Performs a scale out of a Kubernetes deployment based on some service deployment information by a given number of replicas to add.
Parameters: - serviceDeploymentInfo – the
MicoServiceDeploymentInfo
. - numberOfReplicas – the number of replicas to add.
Returns: the Kubernetes
Deployment
.- serviceDeploymentInfo – the
-
public void
undeployApplication
(MicoApplication application)¶ Undeploys an application. Note that
MicoServices
included in this application will not be undeployed, if and only if they are included in at least one other application. In this case the corresponding Kubernetes deployment will be scaled in.Parameters: - application – the
MicoApplication
.
- application – the
MicoStatusService¶
-
public class
MicoStatusService
¶ Provides functionality to retrieve status information for a
MicoApplication
or a particularMicoService
.
Constructors¶
-
public
MicoStatusService
(PrometheusConfig prometheusConfig, MicoKubernetesClient micoKubernetesClient, RestTemplate restTemplate, MicoServiceDeploymentInfoRepository serviceDeploymentInfoRepository, MicoApplicationRepository micoApplicationRepository)¶
Methods¶
-
public MicoApplicationStatusResponseDTO
getApplicationStatus
(MicoApplication micoApplication)¶ Get status information for a
MicoApplication
.Parameters: - micoApplication – the application the status is requested for
Returns: MicoApplicationStatusResponseDTO
containing a list ofMicoServiceStatusResponseDTO
for status information of a singleMicoService
.
-
public MicoServiceInterfaceStatusResponseDTO
getPublicIpOfKubernetesService
(MicoServiceDeploymentInfo serviceDeploymentInfo, MicoServiceInterface serviceInterface)¶ Get the public IP of a
MicoServiceInterface
by providing the corresponding KubernetesService
.Parameters: - serviceDeploymentInfo – is the
MicoServiceDeploymentInfo
, that has aMicoServiceInterface
, which is deployed on Kubernetes - serviceInterface – the
MicoServiceInterface
, that is deployed as a Kubernetes service
Throws: - KubernetesResourceException – if it’s not possible to get the Kubernetes service
Returns: the public IP of the provided Kubernetes Service
- serviceDeploymentInfo – is the
-
public MicoServiceStatusResponseDTO
getServiceInstanceStatus
(MicoServiceDeploymentInfo serviceDeploymentInfo)¶ Get status information for a single
MicoServiceDeploymentInfo
if it is deployed: # available replicas, # requested replicas, pod metrics (CPU load, memory usage).Parameters: - serviceDeploymentInfo – the
MicoServiceDeploymentInfo
.
Returns: the
MicoServiceStatusResponseDTO
which contains status information for a specific instance of aMicoService
.- serviceDeploymentInfo – the
-
public List<MicoServiceInterfaceStatusResponseDTO>
getServiceInterfaceStatus
(MicoServiceDeploymentInfo serviceDeploymentInfo, List<MicoMessageResponseDTO> errorMessages)¶ Get the status information for all
MicoServiceInterfaces
of theMicoService
.Parameters: - serviceDeploymentInfo – is the
MicoServiceDeploymentInfo
that includes the service for which the status information of the MicoServiceInterfaces is requested. - errorMessages – is the list of error messages, which is empty if no error occurs.
Returns: a list of
MicoServiceInterfaceStatusResponseDTO
, one DTO per MicoServiceInterface.- serviceDeploymentInfo – is the
-
public List<MicoServiceStatusResponseDTO>
getServiceStatus
(MicoService micoService)¶ Get status information for all instances of a
MicoService
and return them as a list: # available replicas, # requested replicas, pod metrics (CPU load, memory usage).Parameters: - micoService – the
MicoService
.
Returns: the list of
MicoServiceStatusResponseDTOs
which contains status information for all instances of aMicoService
.- micoService – the
io.github.ust.mico.core.service.imagebuilder¶
TektonPipelinesController¶
-
public class
TektonPipelinesController
implements ImageBuilder¶ Builds container images by using Tekton Pipelines and Kaniko.
Constructors¶
-
public
TektonPipelinesController
(KubernetesClient kubernetesClient, MicoKubernetesBuildBotConfig buildBotConfig, KubernetesNameNormalizer kubernetesNameNormalizer)¶ Create a
ImageBuilder
to be able to build Docker images in the cluster.Parameters: - kubernetesClient – the
KubernetesClient
- buildBotConfig – the build bot configuration for the image builder
- kubernetesNameNormalizer – the
KubernetesNameNormalizer
- kubernetesClient – the
Methods¶
-
public CompletableFuture<String>
build
(MicoService micoService)¶ Builds an OCI image based on a Git repository provided by a
MicoService
. The result of the returnedCompletableFuture
is the Docker image URI.Parameters: - micoService – the MICO service for which the image should be build
Throws: - NotInitializedException – if the image builder was not initialized
Returns: the
CompletableFuture
that executes the build. The result is the Docker image URI.
-
public String
createImageUrl
(String serviceShortName)¶ Creates an image name based on the DockerHub registry name and service’s short name.
Parameters: - serviceShortName – the short name of the
MicoService
.
Returns: the image name.
- serviceShortName – the short name of the
-
public void
init
(ContextRefreshedEvent cre)¶ Initialize the image builder every time the application context is refreshed.
Parameters: - cre – the
ContextRefreshedEvent
- cre – the
-
public void
init
()¶ Initialize the image builder. This is required to be able to use the image builder. It’s not required to trigger the initialization manually, because the method is triggered by application context refresh events.
Throws: - NotInitializedException – if there are errors during initialization
-
public void
initilizeBuildPipeline
(String namespace)¶ Initialize the Tekton build-and-push pipeline. This is required to be able to use the image builder.
Parameters: - namespace – the namespace for Tekton pipeline resources.
Throws: - IOException – if there are errors when reading Tekton definition files
io.github.ust.mico.core.util¶
CollectionUtils¶
-
public class
CollectionUtils
¶ Provides some utility functions for easy creation of collections.
FutureUtils¶
-
public class
FutureUtils
¶ Provides some utility functions for
Future
/CompletableFuture
.
Methods¶
-
public static <T> CompletableFuture<List<T>>
all
(List<CompletableFuture<T>> futures)¶ Waits for all futures to complete and returns a list of results. If any future completes exceptionally then the resulting future will also complete exceptionally.
Parameters: - futures – the
CompletableFutures
- <T> – the generic type of the
CompletableFutures
Returns: the list of
CompletableFutures
- futures – the
KubernetesNameNormalizer¶
-
public class
KubernetesNameNormalizer
¶ Normalizes names to be valid Kubernetes resource names.
Fields¶
-
public static final int
MICO_NAME_MAX_SIZE
¶ A max limit of the MICO names (
MicoApplication
,MicoService
andMicoServiceInterface
) is required because they are used as values of Kubernetes labels that have a limit of 63. Furthermore the name is used to create a UID that adds 9 characters to it. Therefore the limit have to be set to 54.
Methods¶
-
public String
createBuildName
(String serviceShortName, String serviceVersion)¶ Creates a build name based on the short name and version of a service.
Parameters: - serviceShortName – the short name of the
MicoService
. - serviceVersion – the version of the
MicoService
.
Returns: the name of the //@link Build.
- serviceShortName – the short name of the
-
public String
createBuildName
(MicoService service)¶ Creates a build name based on a service.
Parameters: - service – the
MicoService
.
Returns: the name of the //@link Build.
- service – the
Patterns¶
-
public class
Patterns
¶ Contains regular expressions that are used for pattern matching.
Fields¶
-
public static final String
KAFKA_TOPIC_NAME_MESSAGE
¶ Message is used if a match with the
Patterns.KAFKA_TOPIC_NAME_REGEX
fails.
-
public static final String
KUBERNETES_ENV_VAR_NAME_MESSAGE
¶ Message is used if a match with the
Patterns.KUBERNETES_ENV_VAR_NAME_REGEX
fails.
-
public static final String
KUBERNETES_LABEL_KEY_MESSAGE
¶ Message is used if a match with the
Patterns.KUBERNETES_LABEL_KEY_REGEX
fails.
-
public static final String
KUBERNETES_LABEL_KEY_REGEX
¶ Valid label keys have two segments: an optional prefix and name, separated by a slash (/). The name segment is required and must be 63 characters or less, beginning and ending with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (.), not longer than 253 characters in total, followed by a slash (/).
-
public static final String
KUBERNETES_LABEL_VALUE_MESSAGE
¶ Message is used if a match with the
Patterns.KUBERNETES_LABEL_VALUE_REGEX
fails.
-
public static final String
KUBERNETES_NAMING_MESSAGE
¶ Message is used if a match with the
Patterns.KUBERNETES_NAMING_REGEX
fails.
-
public static final String
OPEN_FAAS_FUNCTION_NAME_MESSAGE
¶ Message is used if a match with the
Patterns.OPEN_FAAS_FUNCTION_NAME_REGEX
fails.
-
public static final String
SEMANTIC_VERSIONING_MESSAGE
¶ Message is used if a match with the
Patterns.SEMANTIC_VERSION_WITH_PREFIX_REGEX
fails.
PrometheusValueDeserializer¶
RandomStringFactory¶
-
public class
RandomStringFactory
¶ Provides functionality to generate random
String
.
RestTemplates¶
-
public class
RestTemplates
¶
Fields¶
-
MicoKubernetesClient
micoKubernetesClient
¶
Methods¶
-
public RestTemplate
getAuthenticatedOpenFaaSRestTemplate
(RestTemplateBuilder builder)¶ Constructs the rest template to be able to connect the OpenFaaS Portal. It uses the OpenFaaS credentials that are stored inside a Kubernetes secret. The Spring Bean Request Scope in proxy mode
ScopedProxyMode.TARGET_CLASS
is used, so that it will be instantiated when it is needed (prevents errors during application context is loading).Parameters: - builder – the
RestTemplateBuilder
Returns: the
RestTemplate
- builder – the
UIDUtils¶
-
public class
UIDUtils
¶
Methods¶
-
public final String
uidFor
(MicoApplication application)¶
-
public final String
uidFor
(MicoService service)¶
-
public final String
uidFor
(MicoServiceInterface serviceInterface)¶
Code Documentation for the MICO-Core.
User documentation for MICO.
List of Architectural Design Decisions.