GithubHelp home page GithubHelp logo

urlmap-editor's Introduction

This script is used for editing URL maps in a more robust fashion than that allowed with 'GCloud compute url-maps edit'. It is most useful for appending path rules to an existing path matcher, which is something the GCloud tool does not currently support.

Usage

usage: urlmap-editor.py [-h] --pathmatcher PATHMATCHER [PATHMATCHER ...]
                        --pathrules PATHRULES [PATHRULES ...] --hostrule
                        HOSTRULE [HOSTRULE ...] --file FILE

optional arguments:
  -h, --help            show this help message and exit
  --pathmatcher PATHMATCHER [PATHMATCHER ...]
                        path matcher parameters (name/defaultService)
  --pathrules PATHRULES [PATHRULES ...]
                        path rule parameters (path/service)
  --hostrule HOSTRULE [HOSTRULE ...]
                        host rule parameters (hosts/pathMatcher)
  --file FILE           The filename of the URL map to use

An URL map editor for manipulating host rules and path matchers. All denoted
parameters i.e., hostrule parameters take key=value pairs. All supplementary
parameters denoted as valid for various options i.e., defaultService for
--pathmatcher, are required.

Notes and examples

The syntax defined above very much resembles the keys as defined in the exported copy of a URL map i.e., defaultService. As an example, the below would add a defaultService rule to a path matcher called foomatcher, associated to the host 'example.com' which points to a backend bucket called foo-bucket:

$ ./urlmap-editor.py --hostrule hosts=example.com pathMatcher=foomatcher --pathmatcher name=foomatcher defaultService=https://www.googleapis.com/compute/v1/projects/$project/global/backendBuckets/foobucket --file foomap.yaml

Another example, this time we add a path rule pointing to a backend bucket called bar-bucket:

$ ./urlmap-editor.py --hostrule hosts=example.com --pathmatcher name=foomatcher --pathmatcher name=foomatcher defaultService=https://www.googleapis.com/compute/v1/$project/global/backendBuckets/foo-bucket --pathrules path=/bar/* service=https://www.googleapis.com/compute/v1/projects/$project/global/backendBuckets/bar-bucket --file=foomap.yaml

And later on, you can append another path rule to a backend bucket called 'baz-bucket' and retain the same path matcher:

$ ./urlmap-editor.py --hostrule hosts=example.com --pathmatcher name=foomatcher --pathmatcher name=foomatcher defaultService=https://www.googleapis.com/compute/v1/$project/global/backendBuckets/foo-bucket --pathrules path=/baz/* service=https://www.googleapis.com/compute/v1/projects/$project/global/backendBuckets/baz-bucket --file=foomap.yaml

Make sure to substitute '$project' with your actual GCP project ID.

urlmap-editor's People

Contributors

igueths avatar

Watchers

 avatar

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.