Create a Diagram
post
/api/diagram/Diagrams
Creates a new diagram.
The minimum required properties in the request body are:
The minimum required properties in the request body are:
- DiagramName
- DiagramTypeID
- Width
- Height
- DiagramGroupID
- SVG
Request
There are no request parameters for this operation.
Supported Media Types
- application/json
Root Schema : schema
Type:
Show Source
object
-
AutoFit: boolean
Whether the diagram display should automatically fit into the panel (true) or not (false), disregarding the size configuration.Example:
false
-
DiagramGroupID: string
The initial diagram group.Example:
1
-
DiagramName: string
The diagram name.
To avoid confusion with numeric IDs, the name value cannot be integers only or integers prefixed with the + or - symbols only. It must contain letters or other characters. For example, 1234, +1234, and -1234 are not valid, but US1234, US+1234 and US_1234 are.Example:New Diagram
-
DiagramTypeID: integer
Allowed Values:
[ 1, 2 ]
The diagram type ID. Can be basic (1) or dynamic device (2).Example:1
-
Height: integer
The height of the diagram.Example:
400
-
Message: string
The revision commit message.Example:
Changing the shape
-
SVG: string
The diagram SVG (actual layout definition).Example:
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mon="namespace" version="1.1" baseProfile="full" width="600" height="400" preserveAspectRatio="none" zoomAndPan="magnify" style="border-right:solid 1px #dbdee4;" > <defs> <linearGradient id="Gradient1BeigeFill" x1="100%" y1="100%" x2="0%" y2="0%" spreadMethod="pad" gradientUnits="objectBoundingBox"> <stop offset="0" stop-color="rgb(238,232,170)"/> <stop offset="1" stop-color="rgb(133,129,95)"/> </linearGradient> <linearGradient id="Gradient1BeigeStroke" x1="0%" y1="0%" x2="100%" y2="100%" spreadMethod="pad" gradientUnits="objectBoundingBox"> <stop offset="0" stop-color="rgb(238,232,170)"/> <stop offset="1" stop-color="rgb(133,129,95)"/> </linearGradient> <linearGradient id="Gradient1GrayFill" x1="100%" y1="100%" x2="0%" y2="0%" spreadMethod="pad" gradientUnits="objectBoundingBox"> <stop offset="0" stop-color="rgb(221,221,221)"/> <stop offset="1" stop-color="rgb(102,102,102)"/> </linearGradient> <linearGradient id="Gradient1GrayStroke" x1="0%" y1="0%" x2="100%" y2="100%" spreadMethod="pad" gradientUnits="objectBoundingBox"> <stop offset="0" stop-color="rgb(221,221,221)"/> <stop offset="1" stop-color="rgb(102,102,102)"/> </linearGradient> <linearGradient id="Gradient1GreenFill" x1="100%" y1="100%" x2="0%" y2="0%" spreadMethod="pad" gradientUnits="objectBoundingBox"> <stop offset="0" stop-color="rgb(0,255,0)"/> <stop offset="1" stop-color="rgb(0,102,0)"/> </linearGradient> <linearGradient id="Gradient1GreenStroke" x1="0%" y1="0%" x2="100%" y2="100%" spreadMethod="pad" gradientUnits="objectBoundingBox"> <stop offset="0" stop-color="rgb(0,255,0)"/> <stop offset="1" stop-color="rgb(0,102,0)"/> </linearGradient> <linearGradient id="Gradient1BlueFill" x1="100%" y1="100%" x2="0%" y2="0%" spreadMethod="pad" gradientUnits="objectBoundingBox"> <stop offset="0" stop-color="rgb(102,204,255)"/> <stop offset="1" stop-color="rgb(0,51,102)"/> </linearGradient> <linearGradient id="Gradient1BlueStroke" x1="0%" y1="0%" x2="100%" y2="100%" spreadMethod="pad" gradientUnits="objectBoundingBox"> <stop offset="0" stop-color="rgb(102,204,255)"/> <stop offset="1" stop-color="rgb(0,51,102)"/> </linearGradient> <linearGradient id="Gradient1PurpleFill" x1="100%" y1="100%" x2="0%" y2="0%" spreadMethod="pad" gradientUnits="objectBoundingBox"> <stop offset="0" stop-color="rgb(204,0,255)"/> <stop offset="1" stop-color="rgb(51,0,102)"/> </linearGradient> <linearGradient id="Gradient1PurpleStroke" x1="0%" y1="0%" x2="100%" y2="100%" spreadMethod="pad" gradientUnits="objectBoundingBox"> <stop offset="0" stop-color="rgb(204,0,255)"/> <stop offset="1" stop-color="rgb(51,0,102)"/> </linearGradient> <linearGradient id="Gradient1YellowFill" x1="100%" y1="100%" x2="0%" y2="0%" spreadMethod="pad" gradientUnits="objectBoundingBox"> <stop offset="0" stop-color="rgb(255,255,0)"/> <stop offset="1" stop-color="rgb(102,102,0)"/> </linearGradient> <linearGradient id="Gradient1YellowStroke" x1="0%" y1="0%" x2="100%" y2="100%" spreadMethod="pad" gradientUnits="objectBoundingBox"> <stop offset="0" stop-color="rgb(255,255,0)"/> <stop offset="1" stop-color="rgb(102,102,0)"/> </linearGradient> <linearGradient id="Gradient1OrangeFill" x1="100%" y1="100%" x2="0%" y2="0%" spreadMethod="pad" gradientUnits="objectBoundingBox"> <stop offset="0" stop-color="rgb(255,153,0)"/> <stop offset="1" stop-color="rgb(102,51,0)"/> </linearGradient> <linearGradient id="Gradient1OrangeStroke" x1="0%" y1="0%" x2="100%" y2="100%" spreadMethod="pad" gradientUnits="objectBoundingBox"> <stop offset="0" stop-color="rgb(255,153,0)"/> <stop offset="1" stop-color="rgb(102,51,0)"/> </linearGradient> <linearGradient id="Gradient1RedFill" x1="100%" y1="100%" x2="0%" y2="0%" spreadMethod="pad" gradientUnits="objectBoundingBox"> <stop offset="0" stop-color="rgb(255,0,0)"/> <stop offset="1" stop-color="rgb(102,0,0)"/> </linearGradient> <linearGradient id="Gradient1RedStroke" x1="0%" y1="0%" x2="100%" y2="100%" spreadMethod="pad" gradientUnits="objectBoundingBox"> <stop offset="0" stop-color="rgb(255,0,0)"/> <stop offset="1" stop-color="rgb(102,0,0)"/> </linearGradient> <linearGradient id="Gradient2BlueFill" x1="0%" y1="0%" x2="100%" y2="100%" spreadMethod="pad" gradientUnits="objectBoundingBox"> <stop offset="0" stop-color="#CEDBF0"/> <stop offset="1" stop-color="#5088D4"/> </linearGradient> <linearGradient id="Gradient2BlueStroke" x1="100%" y1="100%" x2="0%" y2="0%" spreadMethod="pad" gradientUnits="objectBoundingBox"> <stop offset="0" stop-color="rgb(255,255,255)"/> <stop offset="1" stop-color="rgb(0,51,102)"/> </linearGradient> <linearGradient id="Gradient1Fill" x1="100%" y1="100%" x2="0%" y2="0%" spreadMethod="pad" gradientUnits="objectBoundingBox"> <stop offset="0" stop-color="black" stop-opacity="0"/> <stop offset="1" stop-color="black" stop-opacity="0.7"/> </linearGradient> <linearGradient id="Gradient1Stroke" x1="0%" y1="0%" x2="100%" y2="100%" spreadMethod="pad" gradientUnits="objectBoundingBox"> <stop offset="0" stop-color="black" stop-opacity="0"/> <stop offset="1" stop-color="black" stop-opacity="0.7"/> </linearGradient> <clipPath id="DiagramClipping"> <rect id="DiagramClippingArea" x="0" y="0" width="600" height="400"/> </clipPath> </defs> <style type="text/css"> <![CDATA[ {literal} .SolidBeige { fill: #EEE8AA; stroke: #EEE8AA; } .SolidGray { fill: #B4B4B4; stroke: #B4B4B4; } .SolidGreen { fill: #00CD00; stroke: #00CD00; } .SolidPurple { fill: #B23AEE; stroke: #B23AEE; } .SolidBlue { fill: #63B8FF; stroke: #63B8FF; } .SolidYellow { fill: #FFFF00; stroke: #FFFF00; } .SolidOrange { fill: #FFB329; stroke: #FFB329; } .SolidRed { fill: #FF0000; stroke: #FF0000; } .Gradient1Beige { fill: url(#Gradient1BeigeFill); stroke: url(#Gradient1BeigeStroke); } .Gradient1Gray { fill: url(#Gradient1GrayFill); stroke: url(#Gradient1GrayStroke); } .Gradient1Green { fill: url(#Gradient1GreenFill); stroke: url(#Gradient1GreenStroke); } .Gradient1Purple { fill: url(#Gradient1PurpleFill); stroke: url(#Gradient1PurpleStroke); } .Gradient1Blue { fill: url(#Gradient1BlueFill); stroke: url(#Gradient1BlueStroke); } .Gradient1Yellow { fill: url(#Gradient1YellowFill); stroke: url(#Gradient1YellowStroke); } .Gradient1Orange { fill: url(#Gradient1OrangeFill); stroke: url(#Gradient1OrangeStroke); } .Gradient1Red { fill: url(#Gradient1RedFill); stroke: url(#Gradient1RedStroke); } .Gradient2Blue { fill: url(#Gradient2BlueFill); stroke: #5088D4; } {/literal} ]]> </style> <g id="Diagram" clip-path="url(#DiagramClipping)"> <rect id="Background" x="0" y="0" width="600" height="400" fill="#ffffff" mon:RefreshRate="60" mon:LastWidgetID="0"/> <image id="BackgroundImage" x="0" y="0" width="600" height="400" preserveAspectRatio="none" xlink:href="" display="none"/> </g> <g id="Widgets" clip-path="url(#DiagramClipping)"> <g xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="Widget_1" transform="translate(391, 71) rotate(0, 32, 32)" WidgetType="EventEllipse" FilterType="FilterID" FilterGroupName="//Global" FilterValueName="All Events" DisplayName="Default" LinkType="EventList" LinkTarget="SameTab" LinkValue="" LinkExtra="" MenuID="0" Theme="Gradient1" SoundName="" > <ellipse cx="32" cy="32" rx="32" ry="32" stroke-width="2" class="Gradient1Gray"/> </g><g xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="Widget_2" transform="translate(248, 65) rotate(-180, 32, 32)" WidgetType="MetricEllipse" TimeRange="now-24h..now" ManualPollCycles="undefined" ThresholdTypeID="1" LinkType="Back" LinkTarget="" LinkValue="" LinkExtra="" MenuID="0" Theme="Gradient1" MetricTypeName="" InstanceName="" RetentionPolicy="" MetricField="undefined" WarningThresholdName="" WarningManualThresholdOperator="" WarningManualThresholdValue="" WarningThresholdSoundName="" CriticalThresholdName="" CriticalManualThresholdOperator="" CriticalManualThresholdValue="" CriticalThresholdSoundName="" DeviceName="device1" DeviceZoneID="1" DeviceZoneName="Default First Zone" > <ellipse cx="32" cy="32" rx="32" ry="32" stroke-width="2" class="Gradient1Gray"/> </g><g xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="Widget_3" transform="translate(382, 202) rotate(-180, 35, 35)" WidgetType="MetricEllipse" TimeRange="now-24h..now" ManualPollCycles="undefined" ThresholdTypeID="1" LinkType="MetricGraph" LinkTarget="SameTab" LinkValue="" LinkExtra="" MenuID="0" Theme="Gradient1" MetricTypeName="" InstanceName="" RetentionPolicy="" MetricField="undefined" WarningThresholdName="" WarningManualThresholdOperator="" WarningManualThresholdValue="" WarningThresholdSoundName="" CriticalThresholdName="" CriticalManualThresholdOperator="" CriticalManualThresholdValue="" CriticalThresholdSoundName="" DeviceName="device1" DeviceZoneID="1" DeviceZoneName="Default First Zone" > <ellipse cx="32" cy="32" rx="32" ry="32" stroke-width="2" class="Gradient1Gray"/> </g></g> </svg>
-
Width: integer
The width of the diagram.Example:
600
Response
Supported Media Types
- application/json
200 Response
Successful operation
Root Schema : schema
Match All
Show Source
-
object
SuccessfulAddOperation
The response body for a successful add operation.
-
object
type
Nested Schema : SuccessfulAddOperation
Type:
object
The response body for a successful add operation.
Show Source
-
message: string
The response message.Example:
Added record
-
success: boolean
Whether the operation was a success (true) or a failure (false).Example:
true
Nested Schema : type
Type:
Show Source
object
-
data: array
data
The properties of the new diagram.
-
total: integer
The total number of results regardless of paging.Example:
1
Nested Schema : diagramDiagramsRead
Type:
Show Source
object
-
AutoFit: boolean
Whether the diagram display should automatically fit into the panel (true) or not (false), disregarding the size configuration.Example:
0
-
DiagramGroupID: string
The initial diagram group.Example:
1
-
DiagramGroupName: string
The name of the diagram group.Example:
Root
-
DiagramID: integer
The diagram ID.Example:
4
-
DiagramName: string
The name of the diagram.Example:
New Diagram
-
DiagramTypeID: integer
Allowed Values:
[ 1, 2 ]
The diagram type ID. Can be basic (1) or dynamic device (2).Example:1
-
DiagramTypeName: string
Allowed Values:
[ "Basic", "Dynamic Devices" ]
The name of the diagram type.Example:Basic
-
Height: integer
The height of the diagram.Example:
400
-
Revision: string
The latest revision number.Example:
3
-
TimestampModified: string
The timestamp of last modification.Example:
2023-08-09 05:47:46
-
Width: integer
The width of the diagram.Example:
600
Default Response
Failed operation
Root Schema : schema
Type:
Show Source
object
-
errors: array
errors
The list of errors reported. Validation errors will be keyed by record field.
-
message: string
The response message.Example:
Exception thrown
-
success: boolean
Whether the operation was a success (true) or a failure (false).Example:
false
Nested Schema : errors
Type:
array
The list of errors reported. Validation errors will be keyed by record field.
Show Source
-
Array of:
object items
An error.
Nested Schema : items
Type:
object
An error.