Giter Club home page Giter Club logo

gglib's People

Contributors

mengesb avatar

Watchers

 avatar

Forkers

funan-w

gglib's Issues

Validate values against commonlookuplist() where applicable

There are several methods with optional or required parameters that need to be validated against commonlookuplist().

Example:

    def gridimageedit(self,          params={}):
        """https://wiki.gogrid.com/index.php/API:grid.image.edit

        RBAC: Super User, System User

        Required (ONLY ONE of the following)
            - id             : The ID of the image to edit.
                               Valid values: regex(^[0-9]+$)
                               Type: string
            - name           : The name of the image to edit.
                               Valid values: regex(^GSI-[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{8}$)
                               Type: string
            - image          : The ID or name of the image to edit.
                               Type: string
        Optional
            - friendlyName   : The edited friendly name of the image.
                               Type: string
            - description    : The edited descriptive text to describe this image.
                               Type: string
            - isPublic       : Will the image will be visible to the entire GoGrid community?
                               Type: boolean
            - image.minram   : Set the minimum ram value.
                               Valid values: commonlookuplist() with 'lookup' set to 'image.minram'
                               Type: string
            - image.type     : The ID or name of the server type.
                               Valid values: commonlookuplist() with 'lookup' set to 'image.type'
                               Type: string
        """

Above we see that image.minram and image.type have specific valid values that can be obtained from commonlookuplist(). We should fetch the valid values, and compare against the valid values fetched to ensure we're providing a valid parameter value for anything using commonlookuplist()

Items to be investigated:

  • datacenter on global class
  • image.minram on gridimageedit
  • image.type on gridimageedit/gridimagelist/gridimagesave
  • image.state on gridimagelist
  • ip.state on gridiplist
  • ip.type on gridiplist
  • job.objecttype on gridjoblist
  • job.state on gridjoblist
  • loadbalancer.type on gridloadbalanceradd
  • loadbalancer.persistence on gridloadbalanceradd
  • server.ram on gridserveradd/gridserveredit
  • server.type on gridserveredit/gridserverlist
  • datacenter on gridloadbalancerlist - lookup loadbalancer.datacenter

Enforce regex where applicable

There are some value constraints for some keys in various places, such as validating an IP (which could also be validated against lookup), or string limitations (must start with [a-zA-Z] and <= 20 [a-zA-Z0-9\ ] characters.

These constraints should be applied and warnings emitted where applicable.

Proof read

The whole code style, syntax, and style needs to be proof read through and through.

Ensure:

  • Same style is applied to ALL methods
  • Same logging level of information applied to ALL methods
  • Reasonably sane sentences (brief and possibly broken, but point made AND understood)

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.