Skip to content

Commit

Permalink
[CI] Plugin template has been built
Browse files Browse the repository at this point in the history
  • Loading branch information
forest-extension-admin committed May 23, 2024
1 parent 65eaa70 commit 95982cf
Show file tree
Hide file tree
Showing 2 changed files with 128 additions and 0 deletions.
Empty file added src/plugin/__init__.py
Empty file.
128 changes: 128 additions & 0 deletions src/plugin/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
from spaceone.inventory.plugin.collector.lib.server import CollectorPluginServer

app = CollectorPluginServer()


@app.route('Collector.init')
def collector_init(params: dict) -> dict:
""" init plugin by options
Args:
params (CollectorInitRequest): {
'options': 'dict', # Required
'domain_id': 'str'
}
Returns:
PluginResponse: {
'metadata': 'dict'
}
"""
pass


@app.route('Collector.verify')
def collector_verify(params: dict) -> None:
""" Verifying collector plugin
Args:
params (CollectorVerifyRequest): {
'options': 'dict', # Required
'secret_data': 'dict', # Required
'schema': 'str',
'domain_id': 'str'
}
Returns:
None
"""
pass


@app.route('Collector.collect')
def collector_collect(params: dict) -> dict:
""" Collect external data
Args:
params (CollectorCollectRequest): {
'options': 'dict', # Required
'secret_data': 'dict', # Required
'schema': 'str',
'task_options': 'dict',
'domain_id': 'str'
}
Returns:
Generator[ResourceResponse, None, None]
{
'state': 'SUCCESS | FAILURE',
'resource_type': 'inventory.CloudService | inventory.CloudServiceType | inventory.Region',
'cloud_service_type': CloudServiceType,
'cloud_service': CloudService,
'region': Region,
'match_keys': 'list',
'error_message': 'str'
'metadata': 'dict'
}
CloudServiceType
{
'name': 'str', # Required
'group': 'str', # Required
'provider': 'str', # Required
'is_primary': 'bool',
'is_major': 'bool',
'metadata': 'dict', # Required
'service_code': 'str',
'tags': 'dict'
'labels': 'list'
}
CloudService
{
'name': 'str',
'cloud_service_type': 'str', # Required
'cloud_service_group': 'str', # Required
'provider': 'str', # Required
'ip_addresses' : 'list',
'account' : 'str',
'instance_type': 'str',
'instance_size': 'float',
'region_code': 'str',
'data': 'dict' # Required
'metadata': 'dict' # Required
'reference': 'dict'
'tags' : 'dict'
}
Region
{
'name': 'str',
'region_code': 'str', # Required
'provider': 'str', # Required
'tags': 'dict'
}
Only one of the cloud_service_type, cloud_service and region fields is required.
"""
pass


@app.route('Job.get_tasks')
def job_get_tasks(params: dict) -> dict:
""" Get job tasks
Args:
params (JobGetTaskRequest): {
'options': 'dict', # Required
'secret_data': 'dict', # Required
'domain_id': 'str'
}
Returns:
TasksResponse: {
'tasks': 'list'
}
"""
pass

0 comments on commit 95982cf

Please sign in to comment.