openshift-online/ocm-sdk-go

`service_logs` API exposes unimplemented POST method for `/api/service_logs/v1/cluster_logs/clusters/{uuid}/cluster_logs`

Closed this issue · 4 comments

The service_logs API as currently generated makes the Add method available by way of the ClusterLogsClient for the path /api/service_logs/v1/cluster_logs/clusters/{uuid}/cluster_logs. The backend however only implements List for this path making the sdk somewhat confusing.

// ClusterLogs returns the target 'cluster_logs' resource.
//
// Reference to the list of cluster logs for a specific cluster uuid.
func (c *ClusterClient) ClusterLogs() *ClusterLogsClient {
return NewClusterLogsClient(
c.transport,
path.Join(c.path, "cluster_logs"),
)
}

@gshilin-sdb @Lir10 I think that @Ajpantuso is right. I believe this happens because in the model we are using the same ClusterLogs resource for both .../v1/cluster_logs and .../v1/clusters/{uuid}/cluster_logs. That resource definition contains the List and Add methods, but for .../v1/clusters/{uuid}/cluster_logs we want List only. To fix that we will have to create a new resource similar to the existing ClusterLogs but with the List method only. @gshilin-sdb @Lir10 can you take care of that?

Lir10 commented

sure I'll work on that shortly

This is being resolved by @Lir10 in openshift-online/ocm-api-model#501. Once that is merged we will re-generate the code of the SDK.

This has been fixed in release 0.1.245 of the SDK.