Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GS-16 Feature/add namespaces #36

Open
wants to merge 20 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
bcffd2b
GS-10 Move fabrications operation to fabricator namespace
chrisroggi May 30, 2018
e2e643c
GS-7 Move activist operations to activist namespace
chrisroggi May 30, 2018
5537396
GS-3 Move archivist operations to archivist namespace
chrisroggi May 30, 2018
8ca74fe
GS-14 Move curator operations to curator namespace
chrisroggi May 30, 2018
5548f56
GS-8 Move distributor operations to distributor namespace
chrisroggi May 30, 2018
36ce1d5
GS-11 Move historian operations to historian namespace
chrisroggi May 30, 2018
1e3a02a
GS-13 Move portal operations to portal namespace
chrisroggi May 30, 2018
d3d137c
GS-9 Move quartermaster operations to quartermaster namespace
chrisroggi May 30, 2018
daafd3b
GS-12 Move regent operations to regent namespace
chrisroggi May 30, 2018
cd6c2b9
GS-8 Add package to distributor operations
chrisroggi May 30, 2018
65c01f3
GS-10 Add package to fabricator operation
chrisroggi May 30, 2018
43d22dd
GS-11 Add package to historian operations
chrisroggi May 30, 2018
d42f248
GS-13 Add package to portal operations
chrisroggi May 30, 2018
0bdf8f1
GS-9 Add package to quartermaster operations
chrisroggi May 30, 2018
e448d1e
GS-12 Add package to regent operation
chrisroggi May 30, 2018
cfcaa5f
GS-14 Add package to curator operation
chrisroggi May 30, 2018
79d1cb1
GS-3 Update archivist examples with artifacts operations
chrisroggi May 31, 2018
8b28a95
GS-3 Update sample controllers with artifacts operations
chrisroggi May 31, 2018
80663ca
GS-8 Update distributor examples with distribution/destination operat…
chrisroggi May 31, 2018
8c2835b
GS-16 Allow other packages to access resource fields
chrisroggi May 31, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions examples/archivist/querying_for_artifacts/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ import (
"fmt"

"../../../unimatrix"
"../../../unimatrix/archivist"
)

func main() {
unimatrix.SetURL("http://us-west-2.api.acceptance.unimatrix.io")
operation := unimatrix.NewRealmOperation(
"5cbc6bb3db90e2f1236e005f9054776c",
"artifacts",
)
operation := archivist.NewArtifactsOperation("5cbc6bb3db90e2f1236e005f9054776c")

// assign query parameters directly with a map[string][]string
parameters := map[string][]string{"test": []string{"test_value"}}
Expand Down
6 changes: 2 additions & 4 deletions examples/archivist/response_metadata/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ import (
"fmt"

"../../../unimatrix"
"../../../unimatrix/archivist"
)

func main() {
unimatrix.SetURL("http://us-west-2.api.acceptance.unimatrix.io")
operation := unimatrix.NewRealmOperation(
"5cbc6bb3db90e2f1236e005f9054776c",
"artifacts",
)
operation := archivist.NewArtifactsOperation("5cbc6bb3db90e2f1236e005f9054776c")

// create a new query
query := unimatrix.NewQuery().
Expand Down
6 changes: 2 additions & 4 deletions examples/archivist/retrieving_artifact/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ import (
"fmt"

"../../../unimatrix"
"../../../unimatrix/archivist"
)

func main() {
unimatrix.SetURL("http://us-west-2.api.acceptance.unimatrix.io")
operation := unimatrix.NewRealmOperation(
"1e338862026376dd593425404a4f75c0",
"artifacts",
)
operation := archivist.NewArtifactsOperation("1e338862026376dd593425404a4f75c0")

query := unimatrix.NewQuery().Where("uuid", "643a9e056300d54eed7a14066513f435")
operation.AssignParameters(query.Parameters())
Expand Down
8 changes: 3 additions & 5 deletions examples/archivist/retrieving_artifact_associations/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ import (
"fmt"

"../../../unimatrix"
"../../../unimatrix/archivist"
)

func main() {
unimatrix.SetURL("http://us-west-2.api.acceptance.unimatrix.io")
operation := unimatrix.NewRealmOperation(
"5cbc6bb3db90e2f1236e005f9054776c",
"artifacts",
)
operation := archivist.NewArtifactsOperation("5cbc6bb3db90e2f1236e005f9054776c")

query := unimatrix.NewQuery().
Where("uuid", "0b801213aed8e27a14df83b8dc02e16e").
Expand All @@ -21,7 +19,7 @@ func main() {
operation.AssignParameters(query.Parameters())
response, _ := operation.Read()
resources, _ := response.Resources()
artifact := resources[0]
artifact := archivist.Artifact{&resources[0]}

// get all associations as ResourceAssociations type - map[string][]Resource
associations, _ := artifact.Associations()
Expand Down
6 changes: 2 additions & 4 deletions examples/archivist/retrieving_artifact_errors/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ import (
"fmt"

"../../../unimatrix"
"../../../unimatrix/archivist"
)

func main() {
operation := unimatrix.NewRealmOperation(
"1e338862026376dd593425404a4f75c0",
"artifacts",
)
operation := archivist.NewArtifactsOperation("1e338862026376dd593425404a4f75c0")

query := unimatrix.NewQuery().
Where("uuid", "does-not-exist")
Expand Down
6 changes: 2 additions & 4 deletions examples/archivist/writing_and_destroying_artifact/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"os"

"../../../unimatrix"
"../../../unimatrix/archivist"
)

func main() {
Expand All @@ -18,10 +19,7 @@ func main() {

// new operation
unimatrix.SetURL("http://us-west-2.api.acceptance.unimatrix.io")
operation := unimatrix.NewRealmOperation(
"1e338862026376dd593425404a4f75c0",
"artifacts",
)
operation := archivist.NewArtifactsOperation("1e338862026376dd593425404a4f75c0")
operation.SetAccessToken(accessToken)

// create artifact
Expand Down
6 changes: 2 additions & 4 deletions examples/archivist/writing_and_destroying_artifacts/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"os"

"../../../unimatrix"
"../../../unimatrix/archivist"
)

func main() {
Expand All @@ -18,10 +19,7 @@ func main() {

// new operation
unimatrix.SetURL("http://us-west-2.api.acceptance.unimatrix.io")
operation := unimatrix.NewRealmOperation(
"1e338862026376dd593425404a4f75c0",
"artifacts",
)
operation := archivist.NewArtifactsOperation("1e338862026376dd593425404a4f75c0")
operation.SetAccessToken(accessToken)

// create artifacts
Expand Down
6 changes: 2 additions & 4 deletions examples/archivist/writing_artifact_errors/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@ import (
"os"

"../../../unimatrix"
"../../../unimatrix/archivist"
)

func main() {
accessToken := "1234"

// new operation
unimatrix.SetURL("http://us-west-2.api.acceptance.unimatrix.io")
operation := unimatrix.NewRealmOperation(
"1e338862026376dd593425404a4f75c0",
"artifacts",
)
operation := archivist.NewArtifactsOperation("1e338862026376dd593425404a4f75c0")
operation.SetAccessToken(accessToken)

// create artifact
Expand Down
12 changes: 4 additions & 8 deletions examples/distributor/distributing_and_removing_artifact/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"time"

"../../../unimatrix"
"../../../unimatrix/archivist"
"../../../unimatrix/distributor"
)

func main() {
Expand All @@ -19,10 +21,7 @@ func main() {

// new artifact operation
unimatrix.SetURL("http://us-west-2.api.acceptance.unimatrix.io")
artifactOperation := unimatrix.NewRealmOperation(
"1e338862026376dd593425404a4f75c0",
"artifacts",
)
artifactOperation := archivist.NewArtifactsOperation("1e338862026376dd593425404a4f75c0")
artifactOperation.SetAccessToken(accessToken)

// create artifact for distribution
Expand All @@ -42,10 +41,7 @@ func main() {

// new distribution operation
unimatrix.SetURL("http://us-west-2.api.acceptance.unimatrix.io")
distributionOperation := unimatrix.NewRealmOperation(
"1e338862026376dd593425404a4f75c0",
"distributions",
)
distributionOperation := distributor.NewDistributionsOperation("1e338862026376dd593425404a4f75c0")
distributionOperation.SetAccessToken(accessToken)

// create distribution
Expand Down
6 changes: 2 additions & 4 deletions examples/distributor/querying_for_destinations/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"os"

"../../../unimatrix"
"../../../unimatrix/distributor"
)

func main() {
Expand All @@ -18,10 +19,7 @@ func main() {

// new operation
unimatrix.SetURL("http://us-west-2.api.acceptance.unimatrix.io")
operation := unimatrix.NewRealmOperation(
"1e338862026376dd593425404a4f75c0",
"destinations",
)
operation := distributor.NewDestinationsOperation("1e338862026376dd593425404a4f75c0")
operation.SetAccessToken(accessToken)

// query := unimatrix.NewQuery()
Expand Down
6 changes: 2 additions & 4 deletions examples/distributor/querying_for_distributions/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"os"

"../../../unimatrix"
"../../../unimatrix/distributor"
)

func main() {
Expand All @@ -18,10 +19,7 @@ func main() {

// new operation
unimatrix.SetURL("http://us-west-2.api.acceptance.unimatrix.io")
operation := unimatrix.NewRealmOperation(
"1e338862026376dd593425404a4f75c0",
"distributions",
)
operation := distributor.NewDistributionsOperation("1e338862026376dd593425404a4f75c0")
operation.SetAccessToken(accessToken)

// query := unimatrix.NewQuery()
Expand Down
6 changes: 2 additions & 4 deletions examples/distributor/response_metadata/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"os"

"../../../unimatrix"
"../../../unimatrix/distributor"
)

func main() {
Expand All @@ -18,10 +19,7 @@ func main() {

// new operation
unimatrix.SetURL("http://us-west-2.api.acceptance.unimatrix.io")
operation := unimatrix.NewRealmOperation(
"1e338862026376dd593425404a4f75c0",
"destinations",
)
operation := distributor.NewDestinationsOperation("1e338862026376dd593425404a4f75c0")
operation.SetAccessToken(accessToken)

response, _ := operation.Read()
Expand Down
6 changes: 2 additions & 4 deletions examples/distributor/retrieving_destination/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"os"

"../../../unimatrix"
"../../../unimatrix/distributor"
)

func main() {
Expand All @@ -18,10 +19,7 @@ func main() {

// new operation
unimatrix.SetURL("http://us-west-2.api.acceptance.unimatrix.io")
operation := unimatrix.NewRealmOperation(
"1e338862026376dd593425404a4f75c0",
"destinations",
)
operation := distributor.NewDestinationsOperation("1e338862026376dd593425404a4f75c0")
operation.SetAccessToken(accessToken)

query := unimatrix.NewQuery().
Expand Down
6 changes: 2 additions & 4 deletions examples/distributor/retrieving_distribution/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"os"

"../../../unimatrix"
"../../../unimatrix/distributor"
)

func main() {
Expand All @@ -18,10 +19,7 @@ func main() {

// new operation
unimatrix.SetURL("http://us-west-2.api.acceptance.unimatrix.io")
operation := unimatrix.NewRealmOperation(
"1e338862026376dd593425404a4f75c0",
"distributions",
)
operation := distributor.NewDistributionsOperation("1e338862026376dd593425404a4f75c0")
operation.SetAccessToken(accessToken)

query := unimatrix.NewQuery().
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"os"

"../../../unimatrix"
"../../../unimatrix/distributor"
)

func main() {
Expand All @@ -18,10 +19,7 @@ func main() {

// new operation
unimatrix.SetURL("http://us-west-2.api.acceptance.unimatrix.io")
operation := unimatrix.NewRealmOperation(
"1e338862026376dd593425404a4f75c0",
"destinations",
)
operation := distributor.NewDestinationsOperation("1e338862026376dd593425404a4f75c0")
operation.SetAccessToken(accessToken)

// create destination
Expand Down
3 changes: 2 additions & 1 deletion samples/assets_controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"os"

"../../unimatrix"
"../../unimatrix/archivist"
)

// Test Command
Expand All @@ -23,7 +24,7 @@ func main() {
assetUuid := os.Args[2]

// Read
operation := unimatrix.NewRealmOperation(realmUuid, "artifacts")
operation := archivist.NewArtifactsOperation(realmUuid)

query := unimatrix.NewQuery().
Where("type_name", "asset_artifact").
Expand Down
3 changes: 2 additions & 1 deletion samples/genres_controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"os"

"../../unimatrix"
"../../unimatrix/archivist"
)

// Test Command
Expand All @@ -22,7 +23,7 @@ func main() {
realmUuid := os.Args[1]

// Query
operation := unimatrix.NewRealmOperation(realmUuid, "artifacts")
operation := archivist.NewArtifactsOperation(realmUuid)

query := unimatrix.NewQuery().
Where("type_name", "genre_artifact")
Expand Down
6 changes: 4 additions & 2 deletions samples/schedules_controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"strings"

"../../unimatrix"
"../../unimatrix/archivist"
)

// Test Command
Expand Down Expand Up @@ -40,7 +41,7 @@ func main() {
}

// Query
operation := unimatrix.NewRealmOperation(realmUuid, "artifacts")
operation := archivist.NewArtifactsOperation(realmUuid)

// - Filtered by Stations
query := unimatrix.NewQuery().
Expand All @@ -67,7 +68,8 @@ func main() {
var stationScheduleEvents = make(map[string][]unimatrix.Resource)

for _, resource := range resources {
categories, _ := resource.RelatedArtifacts("category")
artifact := archivist.Artifact{&resource}
categories, _ := artifact.RelatedArtifacts("category")
category := categories[0]
typeName, _ := category.AttributeAsString("type_name")

Expand Down
3 changes: 2 additions & 1 deletion samples/search_controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"strings"

"../../unimatrix"
"../../unimatrix/archivist"
)

// Test Command
Expand Down Expand Up @@ -78,7 +79,7 @@ func main() {
}

// Search Query
operation := unimatrix.NewRealmOperation(realmUuid, "artifacts")
operation := archivist.NewArtifactsOperation(realmUuid)

resourceTypePresent := false

Expand Down
Loading