Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ gen.proto.docs: ${PROTOC} ${PROTOC_GEN_DOC}
-I=proto \
-I=$(PROTOC_INCLUDE) \
--doc_out=gen/docs \
--doc_opt=gen/docs/markdown.tmpl,docs.md:=buf/*,google/*,ocf/dp/dp.rules.proto,ocf/dp/dp-admin.service.proto,ocf/dp/dp-admin.messages.proto
--doc_opt=gen/docs/markdown.tmpl,docs.md:=buf/*,google/*,ocf/dp/dp.rules.proto
@sed -n '1,/<!-- DOCS START -->/p' README.md > README.tmp
@echo "" >> README.tmp
@cat gen/docs/docs.md >> README.tmp
Expand Down
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ Forecaster represents a generative source of predicted values.

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| energy_source_filter | [EnergySource](#ocf-dp-EnergySource) | optional | Optional filter to only return locations of a specific energy source. || location_type_filter | [LocationType](#ocf-dp-LocationType) | optional | Optional filter to only return locations of a specific location type. || location_uuids_filter | [string](#string) | repeated | Optional filter to only return locations from a given set. || user_oauth_id_filter | [string](#string) | optional | Optional filter to only return locations belonging to a specific user. || permission_filter | [Permission](#ocf-dp-Permission) | optional | Optional filter to only return locations for which the user has a specific permission. || enclosing_location_uuid_filter | [string](#string) | optional | Optional filter to only return locations enclosed within a specific location. || enclosed_location_uuid_filter | [string](#string) | optional | Optional filter to only return locations that enclose a specific location. || location_names_filter | [string](#string) | repeated | Optional filter to only return locations with a specific name. |
| energy_source_filter | [EnergySource](#ocf-dp-EnergySource) | optional | Optional filter to only return locations of a specific energy source. || location_type_filter | [LocationType](#ocf-dp-LocationType) | optional | Optional filter to only return locations of a specific location type. || location_uuids_filter | [string](#string) | repeated | Optional filter to only return locations from a given set. || organisation_id_filter | [string](#string) | optional | Optional filter to only return locations belonging to a specific organisation. || enclosing_location_uuid_filter | [string](#string) | optional | Optional filter to only return locations enclosed within a specific location. || enclosed_location_uuid_filter | [string](#string) | optional | Optional filter to only return locations that enclose a specific location. || location_names_filter | [string](#string) | repeated | Optional filter to only return locations with a specific name. |
</details><a name="ocf-dp-ListLocationsResponse"></a>
<details><summary>ListLocationsResponse</summary>

Expand Down Expand Up @@ -645,6 +645,20 @@ Forecaster represents a generative source of predicted values.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| forecaster | [Forecaster](#ocf-dp-Forecaster) | | |
</details><a name="ocf-dp-UpdateLocationOwnerRequest"></a>
<details><summary>UpdateLocationOwnerRequest</summary>


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| location_uuid | [string](#string) | | || new_organisation_id | [string](#string) | | |
</details><a name="ocf-dp-UpdateLocationOwnerResponse"></a>
<details><summary>UpdateLocationOwnerResponse</summary>


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| location_uuid | [string](#string) | | || organisation_id | [string](#string) | | |
</details><a name="ocf-dp-UpdateLocationRequest"></a>
<details><summary>UpdateLocationRequest</summary>

Expand Down Expand Up @@ -740,6 +754,14 @@ UpdateLocation modifies various attributes associated with a given location.

_[UpdateLocationRequest](#ocf-dp-UpdateLocationRequest) / [UpdateLocationResponse](#ocf-dp-UpdateLocationResponse)_

<a name="UpdateLocationOwner"></a>

#### UpdateLocationOwner

UpdateLocationOwner changes the ownership of a location.

_[UpdateLocationOwnerRequest](#ocf-dp-UpdateLocationOwnerRequest) / [UpdateLocationOwnerResponse](#ocf-dp-UpdateLocationOwnerResponse)_

<a name="ListLocations"></a>

#### ListLocations
Expand Down
8 changes: 2 additions & 6 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,8 @@ func main() {
databaseUrl := strings.Trim(conf.GetString("dburl"), "\"")

var (
dataServerImpl pb.DataPlatformDataServiceServer
adminServerImpl pb.DataPlatformAdministrationServiceServer
s *grpc.Server
dataServerImpl pb.DataPlatformDataServiceServer
s *grpc.Server
)

// Create a validator to use with protovalidate interceptor
Expand All @@ -71,7 +70,6 @@ func main() {
log.Warn().Msg("running in test mode with fake data. Not for production use")

dataServerImpl = dbdy.NewDataPlatformDataServerImpl()
adminServerImpl = dbdy.NewDataPlatformAdministrationServiceServerImpl()

// For a dummy-backed server, just validate requests
s = grpc.NewServer(
Expand All @@ -85,7 +83,6 @@ func main() {
logInterceptor := ix.NewLoggingInterceptor()
txInterceptor := ix.NewTransactionInterceptor(databaseUrl, dbpg.Migrations)
dataServerImpl = dbpg.NewDataPlatformDataServiceServerImpl()
adminServerImpl = dbpg.NewDataPlatformAdministrationServiceServerImpl()

// For a postgres-backed server, validate requests and manage database transactions
s = grpc.NewServer(
Expand All @@ -109,7 +106,6 @@ func main() {
// Create the GRPC server
// * Add an interceptor for request validation
pb.RegisterDataPlatformDataServiceServer(s, dataServerImpl)
pb.RegisterDataPlatformAdministrationServiceServer(s, adminServerImpl)
grpc_health_v1.RegisterHealthServer(s, health.NewServer())
reflection.Register(s)

Expand Down
175 changes: 0 additions & 175 deletions internal/server/dummy/adminserverimpl.go

This file was deleted.

11 changes: 11 additions & 0 deletions internal/server/dummy/dataserverimpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,17 @@ func (d *DataPlatformDataServiceServerImpl) UpdateLocation(
}, nil
}

// UpdateLocationOwner implements [dp.DataPlatformDataServiceServer].
func (d *DataPlatformDataServiceServerImpl) UpdateLocationOwner(
ctx context.Context,
req *pb.UpdateLocationOwnerRequest,
) (*pb.UpdateLocationOwnerResponse, error) {
return &pb.UpdateLocationOwnerResponse{
LocationUuid: uuid.New().String(),
OrganisationId: req.NewOrganisationId,
}, nil
}

// CreateObservations implements dp.DataPlatformDataServiceServer.
func (d *DataPlatformDataServiceServerImpl) CreateObservations(
ctx context.Context,
Expand Down
Loading
Loading