Skip to main content

python lib for scs, scs version <= 3.8

Project description

Python3 lib for scs

python version > = 3.10

from pyscs.scs import SCS

scs = SCS()
# set script can be stop right now
msg, code = scs.can_stop()
if code == 200:
    print("success")
elif code == 201:
    print("warning: " + msg)
else:
    print(msg)

# set script can not be stop except exec scs.can_stop()
msg, code = scs.can_not_stop()
if code == 200:
    print("success")
elif code == 201:
    print("warning: " + msg)
else:
    print(msg)


from pyscs import Script
# add script or server
s = Script("test", "python test.py")
# When dir is not empty and is not exist and get is not empty, It will command get first
s.dir = "/home/test"
s.get = "cd /home && git clone xxxx"
msg, code = scs.add_script(s)
if code == 200:
    print("success")
elif code == 201:
    print("warning: " + msg)
else:
    print(msg)

# del script or server on scsd
# test is pname
msg, code = scs.del_script("test")
if code == 200:
    print("success")
elif code == 201:
    print("warning: " + msg)
else:
    print(msg)



# set alert like add script

a = Alert()
# When dir is not empty and is not exist and get is not empty, It will command get first
a.pname = "alert"
a.name = "test"
a.title = "some thing broken"
a.broken = True
a.reason = "error"
msg, code = scs.set_alert(a)
if code == 200:
    print("success")
elif code == 201:
    print("warning: " + msg)
else:
    print(msg)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyscs-3.8.4.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyscs-3.8.4-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file pyscs-3.8.4.tar.gz.

File metadata

  • Download URL: pyscs-3.8.4.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for pyscs-3.8.4.tar.gz
Algorithm Hash digest
SHA256 d98d6f0b5a798eeee1ae1a0b76885c3ccf7d739294f02fb47ef9e61a3437465a
MD5 c5ef920ef9b5916a6389026837a709f3
BLAKE2b-256 4cf60347d1cfaea8fbc12d873a640b83bbb98e5e1d45b6041aca347af5da21bf

See more details on using hashes here.

File details

Details for the file pyscs-3.8.4-py3-none-any.whl.

File metadata

  • Download URL: pyscs-3.8.4-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for pyscs-3.8.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7fdfe47e16751e3c8dd7627466e3bf2e998c582659997097cabecc2cdd4000d3
MD5 c902ee6a89a0e7a18ec0f9e77daf8ce7
BLAKE2b-256 90f545cc0f8b5dc5d79cbb11be83238c3c6b6911e204e44bbdf7076817fa00ed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page