initial commit
This commit is contained in:
commit
d1cfc3cc70
8 changed files with 383 additions and 0 deletions
23
cmd/curl_examples.sh
Executable file
23
cmd/curl_examples.sh
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
#!/bin/bash
|
||||
|
||||
key="<your api key>"
|
||||
url="https://api.msrc.microsoft.com"
|
||||
apiversion="?api-version=2016-08-01"
|
||||
updates="/Updates"
|
||||
|
||||
#all updates
|
||||
curl -H "api-key: ${key}" ${url}${updates}${apiversion}
|
||||
|
||||
#updates by id
|
||||
id=2016-Sep
|
||||
#id=CVE-1234-5678
|
||||
#id=2016
|
||||
curl -H "api-key: ${key}" "${url}${updates}('${id}')${apiversion}"
|
||||
|
||||
#by id
|
||||
cvrfid=2017-Jan
|
||||
#cvrfid=CVE-1234-5678
|
||||
#cvrfid=2016
|
||||
cvrf="/cvrf/"
|
||||
|
||||
curl -H "Accept: application/json" -H "api-key: ${key}" "${url}${cvrf}${cvrfid}${apiversion}"
|
||||
19
cmd/main.go
Normal file
19
cmd/main.go
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"git.giftfish.de/ston1th/msrcgo"
|
||||
)
|
||||
|
||||
func main() {
|
||||
apikey := os.Args[1]
|
||||
c := msrcgo.NewClient(apikey)
|
||||
all, err := c.GetAllUpdates()
|
||||
fmt.Println(all, err)
|
||||
jan, err := c.GetUpdateID("2017-Jan")
|
||||
fmt.Println(jan, err)
|
||||
cvrf, err := c.GetCVRF("2017-Jan")
|
||||
fmt.Println(cvrf, err)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue