Applying Host Catalog comments to Projects (#105)
* NewService for the project service now returns a non pointer and an error. * Replacing t.Fatal calls with require.NoError calls. * Initialize empty slices following the recommended way. * Don't inline the prefix strings when validating requests. * Check error when cleaning up the test. * Add check that update updates the time. * Use google.golang.org/protobuf where possible instead of github.com/golang/protobuf. * Shorten the validateX function names. * Inline API responses. * Change test cleanup error logging to t.Errorf. * Remove unneeded creation of an extra project. * Inline regex check for invalid id. * Build the pb.Project inline when converting from db to wire proto. * Change stored repos into repo creating functions. * Using iam.TestScopes instead of creating them myself. * Remove out of date comments. * Update name to match go test naming standards. * Adding project service comments. * Using scopeType's new prefix method inside scope.go * Setting test project's name and desc to default to pass tests. * Change host catalog to project in test. * Fixing merge errors. * Fixing some more merge errors. * Fix typo in comments. * Fix typos in project_service.go. * Update error indicating provided id and the expected prefix. * Make the RepoFactory types in a common directory.
This commit is contained in:
1 parent
b016498d96
commit
6804c98b0b
11 files changed
+321
-245
No files matched your search
@@ -933,10 +933,36 @@ const _ = grpc.SupportPackageIsVersion6
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||
type ProjectServiceClient interface {
|
||||
// GetProject returns a stored Project if present. The provided request
|
||||
// must include the org and project id for the project being retrieved. If
|
||||
// any of those ids are missing, malformed or reference a non existing
|
||||
// resource an error is returned.
|
||||
GetProject(ctx context.Context, in *GetProjectRequest, opts ...grpc.CallOption) (*GetProjectResponse, error)
|
||||
// ListProjects returns a list of stored projects which exist inside the org
|
||||
// referenced inside the request. The request must include the org id for
|
||||
// the projects being retrieved. If the org id is missing, malformed, or
|
||||
// reference a non existing organization, an error is returned.
|
||||
ListProjects(ctx context.Context, in *ListProjectsRequest, opts ...grpc.CallOption) (*ListProjectsResponse, error)
|
||||
// CreateProject creates and stores a project in watchtower. The provided
|
||||
// request must include the org id in which the project will be created.
|
||||
// If the org id is missing, malformed or references a non existing
|
||||
// organization, an error is returned. If a name is provided that is in
|
||||
// use in another project in the same organization, an error is returned.
|
||||
CreateProject(ctx context.Context, in *CreateProjectRequest, opts ...grpc.CallOption) (*CreateProjectResponse, error)
|
||||
// UpdateProject updates an existing project in watchtower. The provided
|
||||
// project must not have any read only fields set. The update mask must be
|
||||
// included in the request and contain at least 1 mutable field. To unset
|
||||
// a field's value, include the field in the update mask and don't set it
|
||||
// in the provided project. An error is returned if either the organization
|
||||
// or project ids are missing or reference a non existing resource. An error
|
||||
// is also returned if the request attempts to update the name to one that is
|
||||
// already in use in this organization.
|
||||
UpdateProject(ctx context.Context, in *UpdateProjectRequest, opts ...grpc.CallOption) (*UpdateProjectResponse, error)
|
||||
// DeleteProject remotes a project and all child resources from Watchtower.
|
||||
// If the provided org or project ids are malformed or not provided an error
|
||||
// is returned. No error is returned if either ids reference resources that
|
||||
// do not exist as the response itself specifies if the resource existed
|
||||
// before the DeleteProject request was received.
|
||||
DeleteProject(ctx context.Context, in *DeleteProjectRequest, opts ...grpc.CallOption) (*DeleteProjectResponse, error)
|
||||
}
|
||||
|
||||
@@ -995,10 +1021,36 @@ func (c *projectServiceClient) DeleteProject(ctx context.Context, in *DeleteProj
|
||||
|
||||
// ProjectServiceServer is the server API for ProjectService service.
|
||||
type ProjectServiceServer interface {
|
||||
// GetProject returns a stored Project if present. The provided request
|
||||
// must include the org and project id for the project being retrieved. If
|
||||
// any of those ids are missing, malformed or reference a non existing
|
||||
// resource an error is returned.
|
||||
GetProject(context.Context, *GetProjectRequest) (*GetProjectResponse, error)
|
||||
// ListProjects returns a list of stored projects which exist inside the org
|
||||
// referenced inside the request. The request must include the org id for
|
||||
// the projects being retrieved. If the org id is missing, malformed, or
|
||||
// reference a non existing organization, an error is returned.
|
||||
ListProjects(context.Context, *ListProjectsRequest) (*ListProjectsResponse, error)
|
||||
// CreateProject creates and stores a project in watchtower. The provided
|
||||
// request must include the org id in which the project will be created.
|
||||
// If the org id is missing, malformed or references a non existing
|
||||
// organization, an error is returned. If a name is provided that is in
|
||||
// use in another project in the same organization, an error is returned.
|
||||
CreateProject(context.Context, *CreateProjectRequest) (*CreateProjectResponse, error)
|
||||
// UpdateProject updates an existing project in watchtower. The provided
|
||||
// project must not have any read only fields set. The update mask must be
|
||||
// included in the request and contain at least 1 mutable field. To unset
|
||||
// a field's value, include the field in the update mask and don't set it
|
||||
// in the provided project. An error is returned if either the organization
|
||||
// or project ids are missing or reference a non existing resource. An error
|
||||
// is also returned if the request attempts to update the name to one that is
|
||||
// already in use in this organization.
|
||||
UpdateProject(context.Context, *UpdateProjectRequest) (*UpdateProjectResponse, error)
|
||||
// DeleteProject remotes a project and all child resources from Watchtower.
|
||||
// If the provided org or project ids are malformed or not provided an error
|
||||
// is returned. No error is returned if either ids reference resources that
|
||||
// do not exist as the response itself specifies if the resource existed
|
||||
// before the DeleteProject request was received.
|
||||
DeleteProject(context.Context, *DeleteProjectRequest) (*DeleteProjectResponse, error)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user