Skip to content

Commit

Permalink
conflict resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
PratikDhanave committed Aug 3, 2018
2 parents 827c843 + 4369f0c commit 461517c
Show file tree
Hide file tree
Showing 5 changed files with 336 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/notification/awsnotification/awsnotification.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ resp , err := amazoncloud.DeleteTopic(deletetopic)
fmt.Println(response["body"])
```

### Start instance
### List Topic

```js

Expand Down
102 changes: 102 additions & 0 deletions examples/serverless/lambada/lambada.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# gocloud serverless - lambada

## Configure AWS credentials.

Create `amazoncloudconfig.json` in your <b>HOME/.gocloud</b> directory as follows:
```js
{
"AWSAccessKeyID": "xxxxxxxxxxxx",
"AWSSecretKey": "xxxxxxxxxxxx"
}
```

You can also set the credentials as environment variables:
```js
export AWSAccessKeyID = "xxxxxxxxxxxx"
export AWSSecretKey = "xxxxxxxxxxxx"
```

## Initialize library

```js

import "github.com/cloudlibz/gocloud/gocloud"

amazoncloud := gocloud.AmazonProvider()

```

### Create Function

```js
code := map[string]interface{}{
"ZipFile": "gocloud-ecce2422-f215-4d44-83a8-8361b457c5d9",
}

createfunction := map[string]interface{}{
"Region": "us-east-1",
"FunctionName": "gocloud3",
"Role": "arn:aws:iam::478991680879:role/service-role/bokya",
"Runtime": "nodejs6.10",
"Handler": "index.handler",
"Code": code,
}

resp, err := amazoncloud.CreateFunction(createfunction)

response := resp.(map[string]interface{})

fmt.Println(response["body"])
```

### list function

```js

listfunction := map[string]interface{}{
"Region": "us-east-1",
}


resp, err := amazoncloud.ListFunction(listfunction)


response := resp.(map[string]interface{})

fmt.Println(response["body"])
```


### list function

```js

getfunction := map[string]interface{}{
"Region": "us-east-1",
"FunctionName": "gocloud",
}

resp, err := amazoncloud.GetFunction(getfunction)

response := resp.(map[string]interface{})

fmt.Println(response["body"])
```


### Delete Function

```js

deletefunction := map[string]interface{}{
"Region": "us-east-1",
"FunctionName" : "gocloud2",
}


resp, err := amazoncloud.DeleteFunction(deletefunction)

response := resp.(map[string]interface{})

fmt.Println(response["body"])
```
231 changes: 231 additions & 0 deletions examples/streamdataprocessing/clouddataflow/clouddataflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
# gocloud data streaming - dataflow

## Configure Google Cloud credentials.

Download your service account credentials file from Google Cloud and save it as `googlecloudinfo.json` in your <b>HOME/.gocloud</b> directory.

You can also set the credentials as environment variables:
```js
export PrivateKey = "xxxxxxxxxxxx"
export Type = "xxxxxxxxxxxx"
export ProjectID = "xxxxxxxxxxxx"
export PrivateKeyID = "xxxxxxxxxxxx"
export ClientEmail = "xxxxxxxxxxxx"
export ClientID = "xxxxxxxxxxxx"
export AuthURI = "xxxxxxxxxxxx"
export TokenURI = "xxxxxxxxxxxx"
export AuthProviderX509CertURL = "xxxxxxxxxxxx"
export ClientX509CertURL = "xxxxxxxxxxxx"
```

## Initialize library

```js

import "github.com/cloudlibz/gocloud/gocloud"

googlecloud := gocloud.GoogleProvider()

```
### List Stream

```js
liststream := map[string]string{
"Project": "gocloud-206919",
}

resp, err := googlecloud.ListStream(liststream)

response := resp.(map[string]interface{})

fmt.Println(response["body"])

```

### Describe Stream

```js

describedtream := map[string]string{
"Project": "gocloud-206919",
"JobId": "2018-07-27_08_37_46-11774589915372519551",
}

resp, err := googlecloud.DescribeStream(describedtream)

response := resp.(map[string]interface{})

fmt.Println(response["body"])
```

### Create Stream

```js

userAgent :=make(map[string]interface{})

support := make(map[string]interface{})

support["Status"]= "STALE"
support["URL"] = "https://cloud.google.com/dataflow/support"


userAgent["Name"] = "Google Cloud Dataflow SDK for Java"

userAgent["BuildDate"] = "2017-09-01 05:54"

userAgent["Version"] = "2.1.0"

userAgent["Support"] = support

version := make(map[string]interface{})

version["Major"] = "6"

version["JobType"] = "JAVA_BATCH_AUTOSCALING"

environment := make(map[string]interface{})

environment["UserAgent"] = userAgent
environment["Version"] = version

stageStates := []map[string]interface{}{
{
"ExecutionStageName": "F19",
"ExecutionStageState": "JOB_STATE_DONE",
"CurrentStateTime": "2018-07-27T15:39:00.225Z",
},
{
"ExecutionStageName": "s10",
"ExecutionStageState": "JOB_STATE_DONE",
"CurrentStateTime": "2018-07-27T15:39:00.430Z",
},
{
"ExecutionStageName": "s44-close-shuffle15",
"ExecutionStageState": "JOB_STATE_DONE",
"CurrentStateTime": "2018-07-27T15:38:51.161Z",
},
{
"ExecutionStageName": "F20",
"ExecutionStageState": "JOB_STATE_DONE",
"CurrentStateTime": "2018-07-27T15:38:51.072Z",
},
{
"ExecutionStageName": "F18",
"ExecutionStageState": "JOB_STATE_DONE",
"CurrentStateTime": "2018-07-27T15:39:05.296Z",
},
{
"ExecutionStageName": "s44-open-shuffle13",
"ExecutionStageState": "JOB_STATE_DONE",
"CurrentStateTime": "2018-07-27T15:37:56.465Z",
},
}

createstream := map[string]interface{}{

"ProjectID": "gocloud-206919",
"View": "JOB_VIEW_ALL",
"Location" : "us-central1",
"CurrentState" : "JOB_STATE_DONE",
"ClientRequestID" :"20180727153742037_7574",
"ID" : "2018-07-27_08_37_46-11774589915372519551",
"Name" : "dataflow-intro",
"Type" : "JOB_TYPE_BATCH",
"StageStates" : stageStates,
"Environment" : environment,
}

resp, err := googlecloud.CreateStream(createstream)


response := resp.(map[string]interface{})

fmt.Println(response["body"])
```

### Update stream

```js

userAgent :=make(map[string]interface{})

support := make(map[string]interface{})

support["Status"]= "STALE"
support["URL"] = "https://cloud.google.com/dataflow/support"


userAgent["Name"] = "Google Cloud Dataflow SDK for Java"

userAgent["BuildDate"] = "2017-09-01 05:54"

userAgent["Version"] = "2.1.0"

userAgent["Support"] = support

version := make(map[string]interface{})

version["Major"] = "6"

version["JobType"] = "JAVA_BATCH_AUTOSCALING"

environment := make(map[string]interface{})

environment["UserAgent"] = userAgent
environment["Version"] = version

stageStates := []map[string]interface{}{
{
"ExecutionStageName": "F19",
"ExecutionStageState": "JOB_STATE_DONE",
"CurrentStateTime": "2018-07-27T15:39:00.225Z",
},
{
"ExecutionStageName": "s10",
"ExecutionStageState": "JOB_STATE_DONE",
"CurrentStateTime": "2018-07-27T15:39:00.430Z",
},
{
"ExecutionStageName": "s44-close-shuffle15",
"ExecutionStageState": "JOB_STATE_DONE",
"CurrentStateTime": "2018-07-27T15:38:51.161Z",
},
{
"ExecutionStageName": "F20",
"ExecutionStageState": "JOB_STATE_DONE",
"CurrentStateTime": "2018-07-27T15:38:51.072Z",
},
{
"ExecutionStageName": "F18",
"ExecutionStageState": "JOB_STATE_DONE",
"CurrentStateTime": "2018-07-27T15:39:05.296Z",
},
{
"ExecutionStageName": "s44-open-shuffle13",
"ExecutionStageState": "JOB_STATE_DONE",
"CurrentStateTime": "2018-07-27T15:37:56.465Z",
},
}

updatestream := map[string]interface{}{

"ProjectID": "gocloud-206919",
"View": "JOB_VIEW_ALL",
"Location" : "us-central1",
"CurrentState" : "JOB_STATE_DONE",
"ClientRequestID" :"20180727153742037_7574",
"ID" : "2018-07-27_08_37_46-11774589915372519551",
"Name" : "dataflow-intro",
"Type" : "JOB_TYPE_BATCH",
"StageStates" : stageStates,
"Environment" : environment,
}

resp, err := googlecloud.UpdateStream(updatestream)


response := resp.(map[string]interface{})

fmt.Println(response["body"])
```
2 changes: 1 addition & 1 deletion serverless/lambda/lambda_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestCreateFunction(t *testing.T) {
"ZipFile": "gocloud-ecce2422-f215-4d44-83a8-8361b457c5d9",
}

deletedunction := map[string]interface{}{
createfunction := map[string]interface{}{
"Region": "us-east-1",
"FunctionName": "gocloud3",
"Role": "arn:aws:iam::478991680879:role/service-role/bokya",
Expand Down
2 changes: 1 addition & 1 deletion streamdataprocessing/clouddataflow/clouddataflow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestListStream(t *testing.T) {
func TestDescribeStream(t *testing.T) {
var clouddataflow Clouddataflow

liststream := map[string]string{
describedtream := map[string]string{
"Project": "gocloud-206919",
"JobId": "2018-07-27_08_37_46-11774589915372519551",
}
Expand Down

0 comments on commit 461517c

Please sign in to comment.