Exemplo n.º 1
0
def put():
  if extra_functions.volume_check() == False:
    import storage_volume
    storage_volume.post()
  r = requests.put(url, auth = auth, data = json.dumps(payload), headers = headers)
  if r.status_code == 200:
    print 'Update services-tftp --> Succeeded!'
  else:
    print 'Update services-tftp --> Failed!'
Exemplo n.º 2
0
def put():
    if extra_functions.volume_check() == False:
        import storage_volume
        storage_volume.post()
    r = requests.put(url, auth=auth, data=json.dumps(payload), headers=headers)
    if r.status_code == 200:
        print 'Update services-tftp --> Succeeded!'
    else:
        print 'Update services-tftp --> Failed!'
Exemplo n.º 3
0
#!/usr/local/bin/python

import requests
import json
import sys
import os
import conn
import extra_functions
import storage_volume

os.system('rm *.pyc')
if extra_functions.volume_check() == False:
    storage_volume.post()

headers = conn.headers
auth = conn.auth
url = conn.url + 'tasks/initshutdown/'
payload = {
    "ini_type": "command",
    "ini_command": "rm /mnt/new_volume_test_suite/temp*",
    "ini_when": "postinit"
}


def get():
    print 'Getting tasks-initshutdown ......'
    r = requests.get(url, auth=auth)
    if r.status_code == 200:
        result = json.loads(r.text)
        i = 0
        for i in range(0, len(result)):
Exemplo n.º 4
0
#!/usr/local/bin/python

import requests
import json
import sys
import conn
import os
import extra_functions
import storage_volume

os.system('rm *.pyc')
if extra_functions.volume_check() == False:
  storage_volume.post()
result = extra_functions.volume_exist_check()
if len(result)>0:
  id = result[0]['id']
  
url = conn.url + 'storage/scrub/'
auth = conn.auth
headers = conn.headers
payload = {
          "scrub_volume": id,
          "scrub_dayweek": "7",
          "scrub_minute": "00",
          "scrub_hour": "00",
          "scrub_month": "*",
          "scrub_daymonth": "*"
}

def get():
  print 'Getting storage-scrub ......'