-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'connector' into 'main'
Add Connector See merge request su_pub/ansible-i-doit!13
- Loading branch information
Showing
4 changed files
with
282 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
#!/usr/bin/python | ||
|
||
# Autogenerated by build.py DO NOT EDIT HERE | ||
|
||
# -*- coding: utf-8 -*- | ||
from __future__ import (absolute_import, division, print_function) | ||
__metaclass__ = type | ||
|
||
|
||
DOCUMENTATION = r''' | ||
author: | ||
- Sven Anders (during work by ScaleUp Technologies) (@tabacha) | ||
description: Adds C__CATG__CONNECTOR category to an object if not there | ||
or update values | ||
extends_documentation_fragment: | ||
- scaleuptechnologies.idoit.idoit_option | ||
- scaleuptechnologies.idoit.category_options | ||
- scaleuptechnologies.idoit.multi_category_options | ||
module: idoit_cat_connector | ||
options: | ||
connection_type: | ||
description: Schuko, ... | ||
type: str | ||
connection_type_id: | ||
description: Id of connection_type | ||
type: int | ||
connector_sibling: | ||
description: Assinged Input or Output id | ||
type: int | ||
description: | ||
description: Description of the Model | ||
type: str | ||
in_or_output: | ||
description: input (1) or output (2) | ||
type: int | ||
interface: | ||
description: Speed of the interface | ||
type: str | ||
interface_id: | ||
description: Id of Interface | ||
type: int | ||
title: | ||
description: Title | ||
type: str | ||
short_description: Create or update a connector category to an object | ||
''' | ||
|
||
EXAMPLES = r''' | ||
- name: Set a new Power Port | ||
scaleuptechnologies.idoit.idoit_cat_connector: | ||
connection_type: Schuko | ||
idoit: '{{ idoit_access }}' | ||
in_or_output: 1 | ||
obj_id: 1320 | ||
title: '01' | ||
''' | ||
|
||
RETURN = r''' | ||
changed: | ||
description: Are there changes? | ||
returned: always | ||
type: bool | ||
data: | ||
description: New data | ||
sample: | ||
description: '' | ||
firmware: '' | ||
manufacturer_id: 5 | ||
model_id: 22 | ||
product_id: '' | ||
serial: Test 42 | ||
service_tag: CZJ037040C | ||
type: complex | ||
id: | ||
description: Category Id of the saved category | ||
type: int | ||
return: | ||
description: I-Doit API Result | ||
type: complex | ||
''' | ||
|
||
IDOIT_SPEC = r''' | ||
category: C__CATG__CONNECTOR | ||
fields: | ||
connection_type: | ||
description: Schuko, ... | ||
description_id: Id of connection_type | ||
type: dialog | ||
connector_sibling: | ||
description: Assinged Input or Output id | ||
type: int | ||
description: | ||
description: Description of the Model | ||
type: html | ||
interface: | ||
description: Speed of the interface | ||
description_id: Id of Interface | ||
type: dialog | ||
title: | ||
description: Title | ||
type: str | ||
type: | ||
ansible_name: in_or_output | ||
description: input (1) or output (2) | ||
type: int | ||
single_value_cat: false | ||
''' | ||
|
||
from ansible_collections.scaleuptechnologies.idoit.plugins.module_utils.idoit import IdoitCategoryModule | ||
import yaml | ||
|
||
|
||
def run_module(): | ||
module = IdoitCategoryModule( | ||
idoit_spec=yaml.safe_load(IDOIT_SPEC), | ||
) | ||
module.run() | ||
|
||
|
||
def main(): | ||
run_module() | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
#!/usr/bin/python | ||
|
||
# Autogenerated by build.py DO NOT EDIT HERE | ||
|
||
# -*- coding: utf-8 -*- | ||
from __future__ import (absolute_import, division, print_function) | ||
__metaclass__ = type | ||
|
||
|
||
DOCUMENTATION = r''' | ||
author: | ||
- Scaleup Technologies | ||
- Sven Anders (@tabacha) | ||
description: Gets C__CATG__CONNECTOR category values | ||
extends_documentation_fragment: | ||
- scaleuptechnologies.idoit.idoit_option | ||
- scaleuptechnologies.idoit.category_options | ||
module: idoit_cat_connector_info | ||
options: {} | ||
short_description: Get values from a connector category to an object | ||
''' | ||
|
||
EXAMPLES = r''' | ||
name: Search for a category for object 1320 | ||
scaleuptechnologies.idoit.idoit_cat_connector_info: | ||
idoit: '{{ idoit_access }}' | ||
obj_id: 1320 | ||
''' | ||
|
||
RETURN = r''' | ||
changed: | ||
description: Are there changes? | ||
returned: always | ||
type: bool | ||
data: | ||
description: Data of the category | ||
returned: always | ||
type: complex | ||
''' | ||
|
||
IDOIT_SPEC = r''' | ||
category: C__CATG__CONNECTOR | ||
fields: | ||
connection_type: | ||
description: Schuko, ... | ||
description_id: Id of connection_type | ||
type: dialog | ||
connector_sibling: | ||
description: Assinged Input or Output id | ||
type: int | ||
description: | ||
description: Description of the Model | ||
type: html | ||
interface: | ||
description: Speed of the interface | ||
description_id: Id of Interface | ||
type: dialog | ||
title: | ||
description: Title | ||
type: str | ||
type: | ||
ansible_name: in_or_output | ||
description: input (1) or output (2) | ||
type: int | ||
single_value_cat: false | ||
''' | ||
|
||
from ansible_collections.scaleuptechnologies.idoit.plugins.module_utils.idoit import IdoitCategoryInfoModule | ||
import yaml | ||
|
||
|
||
def run_module(): | ||
module = IdoitCategoryInfoModule( | ||
idoit_spec=yaml.safe_load(IDOIT_SPEC), | ||
) | ||
module.run() | ||
|
||
|
||
def main(): | ||
run_module() | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
category: C__CATG__CONNECTOR | ||
basename: connector | ||
single_value_cat: False | ||
fields: | ||
title: | ||
description: Title | ||
type: str | ||
type: | ||
type: int | ||
ansible_name: in_or_output | ||
description: input (1) or output (2) | ||
connection_type: | ||
type: dialog | ||
description: Schuko, ... | ||
description_id: Id of connection_type | ||
interface: | ||
type: dialog | ||
description: Speed of the interface | ||
description_id: Id of Interface | ||
description: | ||
type: html | ||
description: Description of the Model | ||
connector_sibling: | ||
type: int | ||
description: Assinged Input or Output id | ||
doc_examples: | ||
- name: Set a new Power Port | ||
scaleuptechnologies.idoit.idoit_cat_connector: | ||
idoit: "{{ idoit_access }}" | ||
obj_id: 1320 | ||
title: "01" | ||
in_or_output: 1 | ||
connection_type: Schuko |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters