Module pyinventory.api.property_type

Functions

def edit_property_type(client: SymphonyClient, entity_type: Entity, entity_name: str, property_type_id: str, new_property_definition: PropertyDefinition) -> List[PropertyTypeInput]

Edit specific property type on specific entity. entity_type - ["LocationType", "EquipmentType", "ServiceType", "EquipmentPortType"]

Args

entity_type ( Entity ): existing entity type
entity_name : str
existing entity name
property_type_id : str
existing property type ID

new_property_definition ( PropertyDefinition ): new property definition

Returns

List[ pyinventory.graphql.property_type_input.PropertyTypeInput ]

Raises

EntityNotFoundError: property type with external_id=property_type_external_id is not found

Example

property_types = client.edit_property_type(
    entity_type=Entity.EquipmentType,
    entity_name="Card",
    property_type_id="12345",
    property_definition=PropertyDefinition(
        property_name="new_name",
        property_kind=PropertyKind.string,
        default_value=None,
        is_fixed=False,
        external_id="ex_12345",
    ),
)
def get_property_type(client: SymphonyClient, entity_type: Entity, entity_name: str, property_type_id: str) -> PropertyTypeFragment

Get property type on specific entity. entity_type - ["LocationType", "EquipmentType", "ServiceType", "EquipmentPortType"]

Args

entity_type ( Entity ): existing entity type
entity_name : str
existing entity name
property_type_id : str
property type ID

Returns

PropertyTypeFragment object

Raises

EntityNotFoundError: if property type with id=property_type_id does not found

Example

property_type = client.get_property_type(
    entity_type=Entity.EquipmentType,
    entity_name="Card",
    property_type_id="12345",
)
def get_property_type_by_external_id(client: SymphonyClient, entity_type: Entity, entity_name: str, property_type_external_id: str) -> PropertyTypeFragment

Get property type by external ID on specific entity. entity_type - ["LocationType", "EquipmentType", "ServiceType", "EquipmentPortType"]

Args

entity_type ( Entity ): existing entity type
entity_name : str
existing entity name
property_type_external_id : str
property type external ID

Returns

PropertyTypeFragment object

Raises

EntityNotFoundError: property type with external_id=property_type_external_id is not found

Example

property_type = client.get_property_type_by_external_id(
    entity_type=Entity.EquipmentType,
    entity_name="Card",
    property_type_external_id="12345",
)
def get_property_type_id(client: SymphonyClient, entity_type: Entity, entity_name: str, property_type_name: str) -> str

Get property type ID on specific entity. entity_type - ["LocationType", "EquipmentType", "ServiceType", "EquipmentPortType"]

Args

entity_type ( Entity ): existing entity type
entity_name : str
existing entity name
property_type_name : str
property type ID

Returns

property type ID (str): property type ID
 

Raises

EntityNotFoundError: if property type with id=property_type_id does not found

Example

property_type = client.get_property_type_id(
    entity_type=Entity.EquipmentType,
    entity_name="Card",
    property_type_name="IP",
)
def get_property_types(client: SymphonyClient, entity_type: Entity, entity_name: str) -> Sequence[PropertyTypeFragment]

Get property types on specific entity. entity_type - ["LocationType", "EquipmentType", "ServiceType", "EquipmentPortType"]

Args

entity_type ( Entity ): existing entity type
entity_name : str
existing entity name

Returns

Sequence[ pyinventory.graphql.property_type_fragment.PropertyTypeFragment ]

Raises

EntityNotFoundError: if entity type does not found or does not have property types

Example

property_type = client.get_property_types(
    entity_type=Entity.EquipmentType,
    entity_name="Card",
)