Cisco Packet Tracer Extensions API 8.1.0
API for communication between Cisco Packet Tracer application and its extension applications and modules.
Public Member Functions | List of all members
Cloud Class Reference

Cloud is a cloud device. More...

Inheritance diagram for Cloud:
Device

Public Member Functions

bool addPhoneConnection (string, string)
 Associates a phone number to a port. More...
 
void removePhoneConnection (string)
 Removes the phone number from the port. More...
 
bool addSubLinkConnection (string, string, string, string)
 Adds a sublink connection between the two specified ports. More...
 
bool removeSubLinkConnection (string, string)
 Removes the sublink connection. More...
 
bool addPortConnection (string, string)
 Adds the port connection. More...
 
bool removePortConnection (string)
 Removes the port connection. More...
 
bool removeAllPortConnection (string)
 Removes all port connections. More...
 
bool setDslConnection (string, bool)
 Sets the DSL or cable connection. More...
 
int getSubLinkConnectionCount ()
 Return the number of sublink connection. More...
 
pair< CloudSubLink, CloudSubLinkgetSubLinkConnectionAt (int)
 Return the Sublink Connection at an index. More...
 
int getPortConnectionCount ()
 Return the number of port connections. More...
 
vector< string > getPortStrConnections ()
 Return a list of connection with port names. More...
 
bool isDslConnection (string)
 Check if the port is used in a Dsl Connection. More...
 
void removeSubLinkConnectionAt (int)
 Remove sublink connection at an index. More...
 
vector< string > getSubLinkConnectionInfo ()
 Get Sublink Connection Info (from port, from sublink, to port, to sublink) More...
 
int getHardwareQueueCount ()
 Get the number of hardware queue. More...
 
HardwareQueue getHardwareQueueAt (int)
 Remove hardware queue at an index. More...
 
- Public Member Functions inherited from Device
void setName (QString)
 Sets the display name of this device. More...
 
QString getName ()
 Returns the display name of this device. More...
 
void nameChanged (QString, QString)
 IPC event. More...
 
void setPower (bool)
 Sets the power on or off. More...
 
void addSound (QString, QString)
 Adds sound to the device. More...
 
void playSound (QString, int)
 Play sound to the device. More...
 
void stopSound (QString)
 Stop playing sound on the device. More...
 
void stopSounds ()
 Stops playing all sounds on the device. More...
 
void destroySounds ()
 Destroy all of the sounds on the device. More...
 
bool getPower ()
 Returns the current power state of this device. More...
 
double getXCoordinate ()
 Returns the current x-coordinate position in the Logical workspace for this device. More...
 
double getYCoordinate ()
 Returns the current y-coordinate position in the Logical workspace for this device. More...
 
double getCenterXCoordinate ()
 Returns the current x-coordinate position in the Logical workspace for this device. More...
 
double getCenterYCoordinate ()
 Returns the current y-coordinate position in the Logical workspace for this device. More...
 
double getAreaTopY ()
 Returns the current topmost y-coordinate position in the for this device. More...
 
double getAreaLeftX ()
 Returns the current leftmost x-coordinate position in the for this device. More...
 
bool moveToLocationCentered (int, int)
 Moves this device to the specified location for its center in Logical workspace. More...
 
bool moveToLocation (int, int)
 Moves this device to the specified location in Logical workspace. More...
 
int getXPhysicalWS ()
 Returns the current x-coordinate position in the Physical workspace for this device. More...
 
int getYPhysicalWS ()
 Returns the current y-coordinate position in the Physical workspace for this device. More...
 
double getGlobalXPhysicalWS ()
 Returns the current global x-coordinate position in the Physical workspace for this device. More...
 
double getGlobalYPhysicalWS ()
 Returns the current global y-coordinate position in the Physical workspace for this device. More...
 
bool moveToLocInPhysicalWS (int, int)
 Moves this device to the specified location in Physical workspace. More...
 
bool moveByInPhysicalWS (int, int)
 Moves this device by the specified amount in Physical workspace. More...
 
void powerChanged (bool)
 IPC event. More...
 
void poweringOff ()
 IPC event. More...
 
DeviceType getType ()
 Returns the type of this device. More...
 
string getModel ()
 Returns the model of this device. More...
 
DeviceDescriptor getDescriptor ()
 Returns the device descriptor that user can get information on the device like type, model, module supported.. More...
 
string getSerialNumber ()
 Returns the device serial number. More...
 
Port getPort (string)
 Returns the Port object with the specified port name. More...
 
int getPortCount ()
 Returns the number of ports in this device. More...
 
Port getPortAt (int)
 Returns the Port object at the specified index. More...
 
Process getProcess (string)
 Returns the Process object associated the process name. More...
 
int getUsbPortCount ()
 Return the number of usb port. More...
 
UsbPort getUsbPortAt (int)
 Returns the usb port at a specified index. More...
 
Module getRootModule ()
 Returns the root module of the device. More...
 
bool addModule (string, ModuleType, string)
 Adds a specific module to a particular slot. More...
 
bool removeModule (string)
 Removes the module from the slot. More...
 
void moduleAdded (ModuleType, string, string)
 This event is emitted when a module is added. More...
 
void moduleRemoved (ModuleType, string, string)
 This event is emitted when a module is removed. More...
 
void portAdded (string)
 This event is emitted when a port is added. More...
 
void portRemoved (string)
 This event is emitted when a port is removed. More...
 
void portRemoving (string)
 This event is emitted when a port is being removed but before it is actually removed. This is useful for script modules to clean up things before the port is removed. More...
 
TerminalLine getCommandLine ()
 Returns the command line TerminalLine object. More...
 
void addCustomVar (QString, QString)
 Adds a custom variable. More...
 
bool removeCustomVar (QString)
 Removes a custom variable. More...
 
bool hasCustomVar (QString)
 Returns true if this device has a custom variable with the specified name. More...
 
QString getCustomVarStr (QString)
 Returns the value of the variable with the specified name. More...
 
int getCustomVarsCount ()
 Returns the number of custom variables this device has. More...
 
QString getCustomVarNameAt (int)
 Returns the name of the custom variable at the specified index. More...
 
QString getCustomVarValueStrAt (int)
 Returns the value of the custom variable at the specified index. More...
 
void setCustomInterface (QString)
 Set custom interface to the device. More...
 
QString getCustomInterface ()
 Get custom interface name on the device. More...
 
QString serializeToXml ()
 Returns the serialization string of this device. More...
 
QString activityTreeToXml ()
 Returns the serialization string of this device's activity tree. More...
 
PhysicalObject getPhysicalObject ()
 Get custom interface name on the device. More...
 
QString getCustomLogicalImage ()
 Get custom logical image path. More...
 
void setCustomLogicalImage (QString)
 Set custom logical image path. More...
 
QString getCustomPhysicalImage ()
 Get custom physical image path. More...
 
void setCustomPhysicalImage (QString)
 Set custom physical image path. More...
 
vector< string > getSupportedModule ()
 Get a vector of supported modules. More...
 
void setTime (int, int, int, int, int, int)
 Set time to the device. More...
 
long getUpTime ()
 Set time to the device. More...
 
vector< string > getPorts ()
 Set time to the device. More...
 
double getDeviceExternalAttributeValue (string)
 Get device external attribute value. More...
 
void setDeviceExternalAttributes (QString)
 Set device external attribute value. More...
 
void addDeviceExternalAttributes (QString)
 Add device external attribute value. More...
 
void subtractDeviceExternalAttributes (QString)
 Remove some of the device external attribute value pairs from the current list. More...
 
QString getDeviceExternalAttributes ()
 Returns the list of external attributes and associated values. More...
 
void clearDeviceExternalAttributes ()
 
bool isOutdated ()
 
bool restoreToDefault (bool, bool)
 
void updateTemplateCreationTime ()
 
bool runProject (string, string)
 Runs a programming project in the mcu. More...
 
bool stopProject (string)
 Stops a programming project in the mcu. More...
 
bool isProjectRunning (string)
 Checks if a programming project with the given name is running. More...
 
bool runCodeInProject (string, string)
 Runs additional code in the given project. More...
 
void addProgrammingSerialOutputs (string)
 Writes to the programming output. Text appears in the programming output dialog. More...
 
string getProgrammingSerialOutputs ()
 Gets the programming output. It is the text that appears in the programming output dialog. More...
 
void clearProgrammingSerialOutputs ()
 Clears the programming output dialog. More...
 
UserDesktopAppConfig addUserDesktopApp (string)
 
UserDesktopAppConfig addUserDesktopAppFrom (UserDesktopAppConfig)
 
UserDesktopAppConfig addUserDesktopAppFromGlobal (string)
 
int getUserDesktopAppCount ()
 
UserDesktopAppConfig getUserDesktopAppAt (int)
 
UserDesktopAppConfig getUserDesktopAppByDir (string)
 
UserDesktopAppConfig getUserDesktopAppById (string)
 
void removeUserDesktopApp (string)
 
void relinkUserDesktopApp (string, string)
 
bool isDesktopAvailable ()
 

Detailed Description

Cloud is a cloud device.

Member Function Documentation

◆ addPhoneConnection()

bool Cloud::addPhoneConnection ( string  ,
string   
)

Associates a phone number to a port.

Parameters
number,thetelephone number. The format is 5551239999.
portName,portNamecan be one of the following plus a port number where appropriate: Console, Aux, Ethernet, FastEthernet, GigabitEthernet, Serial, Wireless, Loopback, Vlan, Modem, Coaxial, Rs232, Async. Example: FastEthernet0/0
Returns
bool, true if successful, otherwise false.

◆ addPortConnection()

bool Cloud::addPortConnection ( string  ,
string   
)

Adds the port connection.

Parameters
portName1,portNamecan be one of the following plus a port number where appropriate: Console, Aux, Ethernet, FastEthernet, GigabitEthernet, Serial, Wireless, Loopback, Vlan, Modem, Coaxial, Rs232, Async. Example: FastEthernet0/0
portName2,seeportName1 description.
Returns
bool, true if successful, otherwise false.

◆ addSubLinkConnection()

bool Cloud::addSubLinkConnection ( string  ,
string  ,
string  ,
string   
)

Adds a sublink connection between the two specified ports.

Parameters
portName1,portNamecan be one of the following plus a port number where appropriate: Console, Aux, Ethernet, FastEthernet, GigabitEthernet, Serial, Wireless, Loopback, Vlan, Modem, Coaxial, Rs232, Async. Example: FastEthernet0/0
subLinkName1,thename of the sublink associated to portName1.
portName2,seeportName1 description.
subLinkName1,thename of the sublink associated to portName2.
Returns
bool, true if successful, otherwise false.

◆ getHardwareQueueAt()

HardwareQueue Cloud::getHardwareQueueAt ( int  )

Remove hardware queue at an index.

Parameters
index,theindex at which the hardware queue is at
Returns
HardwareQueue, HardwareQueue object

◆ getHardwareQueueCount()

int Cloud::getHardwareQueueCount ( )

Get the number of hardware queue.

Returns
int, number of hardware queue

◆ getPortConnectionCount()

int Cloud::getPortConnectionCount ( )

Return the number of port connections.

Returns
int, number of port connection

◆ getPortStrConnections()

vector< string > Cloud::getPortStrConnections ( )

Return a list of connection with port names.

Returns
vector<string>, list of connection with port names

◆ getSubLinkConnectionAt()

pair< CloudSubLink, CloudSubLink > Cloud::getSubLinkConnectionAt ( int  )

Return the Sublink Connection at an index.

Parameters
index,theindex location in the queue of the desired sublink connection
Returns
pair<CloudSubLink, CloudSubLink>, from and to sublink pair

◆ getSubLinkConnectionCount()

int Cloud::getSubLinkConnectionCount ( )

Return the number of sublink connection.

Returns
int, number of sublink connection

◆ getSubLinkConnectionInfo()

vector< string > Cloud::getSubLinkConnectionInfo ( )

Get Sublink Connection Info (from port, from sublink, to port, to sublink)

Returns
vector<string>, list of sublink connection info in string format

◆ isDslConnection()

bool Cloud::isDslConnection ( string  )

Check if the port is used in a Dsl Connection.

Returns
vector<string>, list of connection with port names

◆ removeAllPortConnection()

bool Cloud::removeAllPortConnection ( string  )

Removes all port connections.

Parameters
portName,portNamecan be one of the following plus a port number where appropriate: Console, Aux, Ethernet, FastEthernet, GigabitEthernet, Serial, Wireless, Loopback, Vlan, Modem, Coaxial, Rs232, Async. Example: FastEthernet0/0
Returns
bool, true if successful, otherwise false.

◆ removePhoneConnection()

void Cloud::removePhoneConnection ( string  )

Removes the phone number from the port.

Parameters
number,thetelephone number to remove.

◆ removePortConnection()

bool Cloud::removePortConnection ( string  )

Removes the port connection.

Parameters
portName,portNamecan be one of the following plus a port number where appropriate: Console, Aux, Ethernet, FastEthernet, GigabitEthernet, Serial, Wireless, Loopback, Vlan, Modem, Coaxial, Rs232, Async. Example: FastEthernet0/0
Returns
bool, true if successful, otherwise false.

◆ removeSubLinkConnection()

bool Cloud::removeSubLinkConnection ( string  ,
string   
)

Removes the sublink connection.

Parameters
portName,portNamecan be one of the following plus a port number where appropriate: Console, Aux, Ethernet, FastEthernet, GigabitEthernet, Serial, Wireless, Loopback, Vlan, Modem, Coaxial, Rs232, Async. Example: FastEthernet0/0
subLinkName,thename of the sublink associated to portName.
Returns
bool, true if successful, otherwise false.

◆ removeSubLinkConnectionAt()

void Cloud::removeSubLinkConnectionAt ( int  )

Remove sublink connection at an index.

Parameters
index,theindex at which the sublink connection should be removed
Returns
none

◆ setDslConnection()

bool Cloud::setDslConnection ( string  ,
bool   
)

Sets the DSL or cable connection.

Parameters
portName,portNamecan be one of the following plus a port number where appropriate: Console, Aux, Ethernet, FastEthernet, GigabitEthernet, Serial, Wireless, Loopback, Vlan, Modem, Coaxial, Rs232, Async. Example: FastEthernet0/0
bDsl,truefor DSL connection, false for cable connection.
Returns
bool, true if successful, otherwise false.

The documentation for this class was generated from the following file: