Skip to content

Instantly share code, notes, and snippets.

View mallow111's full-sized avatar

Min Wang mallow111

View GitHub Profile
@mallow111
mallow111 / main.go
Created June 22, 2017 22:14 — forked from superbrothers/main.go
http request with context in Go
package main
import (
"context"
"fmt"
"log"
"net/http"
"time"
)
#!/bin/bash
# Set up the packages we need
apt-get update
apt-get install git vim -y
# Clone the devstack repo
git clone https://github.com/openstack-dev/devstack.git /tmp/devstack
cat <<EOF > /tmp/devstack/localrc
#Create LB
http://localhost:9876/v1/loadbalancers
{
"name": "loadbalancer1",
"description": "simple lb",
"vip": {"subnet_id": "ac7d27ae-7ace-459f-ae11-a4568abd227a"}
}
#Create LIstener
http://localhost:9876/v1/loadbalancers/0c59f9c3-13e2-47ad-bf7e-fd533c51e918/listeners