Module pyinventory.api.location_type
Functions
def add_location_type(client: SymphonyClient, name: str, properties: List[Tuple[str, str, Union[datetime.date, float, int, str, bool, Tuple[float, float], NoneType], Union[bool, NoneType]]], map_zoom_level: int = 8) -> LocationType
-
This function creates new location type.
Args
name
:str
- location type name
properties (List[Tuple[str, str, Optional[PropertyValue], Optional[bool]]]): - str - type name - str - enum["string", "int", "bool", "float", "date", "enum", "range", "email", "gps_location", "equipment", "location", "service", "datetime_local"] - PropertyValue - default property value - bool - fixed value flag
map_zoom_level
:int
- map zoom level
Returns
LocationType
objectRaises
FailedOperationException
- internal inventory error
Example
location_type = client.add_location_type( name="city", properties=[("Contact", "email", None, True)], map_zoom_level=5, )
def delete_location_type_with_locations(client: SymphonyClient, location_type: LocationType) -> NoneType
-
Delete locaton type with existing locations.
Args
location_type (
LocationType
): location type objectRaises
EntityNotFoundError
: if location_type does not existExample
client.delete_location_type_with_locations(location_type=location_type)
def delete_locations_by_location_type(client: SymphonyClient, location_type: LocationType) -> NoneType
-
Delete locatons by location type.
Args
location_type (
LocationType
): location type objectRaises
EntityNotFoundError
: if location_type does not existExample
client.delete_locations_by_location_type(location_type=location_type)