Code Monkey home page Code Monkey logo

pyribbon's Introduction

consentFactory

Collection of scripts to share with others

pyribbon's People

Contributors

consentfactory avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

sagostin

pyribbon's Issues

Help to use Update method in pyribbon

Hi there i want to use this pyribbon class for an app i am writing

i need to update an Output Field value in a transformation table

image

q_resource = "transformationtable/20/transformationentry/9"
#resource_data = {'Description:'UPDATE TEST Entry DESCRIPTION 7'}
resource_data = 'OutputFieldValue=12345'
sbc = self.session_creator()
if sbc is not None:
try:
get_response = sbc.update(q_resource, resource_data)

im not sure what syntax to use when calling the update method to reference the outputfieldvalue

Ribbon SBC 5000 does not work

Hi,

I just testet with SBC 5000, it does not work, as - perhaps only in my case - the SBC does not use this login URL above:

fertig@hornisse:..projects/sbc > python3 ribbonapitest.py
Traceback (most recent call last):
  File "ribbonapitest.py", line 64, in <module>
    sys.exit(main())
  File "ribbonapitest.py", line 45, in main
    session = session_creator()
  File "ribbonapitest.py", line 37, in session_creator
    open_response = session.open()
  File "/home/fertig/projects/sbc/pyribbon.py", line 21, in open
    response.raise_for_status()
  File "/usr/lib/python3.6/site-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error:  for url: https://192.xxx.xxx.xxx/rest/login
fertig@hornisse:..projects/sbc >

When I tested this (month ago), this first code test worked:

import requests
import xmltodict
import json
import pprint
import sys
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)

sbc = "192.xxx.xxx.xxx"
username = "restapitest"
password = "xxxxxxxxxxxxxxxxxxxx"

url = 'https://%s/api/config/addressContext/' % sbc
headers = {}

try:
  r = requests.get(url, headers=headers, auth=(username, password), verify=False)
  # print r.status_code, r.history
except Exception, why:
  print "error contacting sbc:", why
  sys.exit(1)

responsedict = {}
if r.ok:
  responsedict = dict(xmltodict.parse(r.text))

print(json.dumps(responsedict, indent=4))

If you're still working on this code, perhaps I could help you extend this for SBC 5000

Christian

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.