All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.aliyun.datahub.client.impl.DataHubService Maven / Gradle / Ivy

The newest version!
package com.aliyun.datahub.client.impl;

import com.aliyun.datahub.client.common.DatahubConstant;
import com.aliyun.datahub.client.impl.request.*;
import com.aliyun.datahub.client.impl.request.protobuf.GetBatchRecordsRequestPB;
import com.aliyun.datahub.client.impl.request.protobuf.GetRecordsRequestPB;
import com.aliyun.datahub.client.impl.request.protobuf.PutBatchRecordsRequestPB;
import com.aliyun.datahub.client.impl.request.protobuf.PutRecordsRequestPB;
import com.aliyun.datahub.client.model.*;
import com.aliyun.datahub.client.model.protobuf.GetBatchRecordsResultPB;
import com.aliyun.datahub.client.model.protobuf.GetRecordsResultPB;
import com.aliyun.datahub.client.model.protobuf.PutRecordsResultPB;
import retrofit2.Call;
import retrofit2.http.*;

import java.util.Map;

public interface DataHubService {
    @GET("projects")
    Call listProject(@Query("filter") String filter);

    @GET("projects/{projectName}")
    Call getProject(@Path("projectName") String projectName);

    @POST("projects/{projectName}")
    Call createProject(@Path("projectName") String projectName, @Body CreateProjectRequest request);

    @PUT("projects/{projectName}")
    Call updateProject(@Path("projectName") String projectName, @Body UpdateProjectRequest request);

    @PUT("projects/{projectName}")
    Call updateProject(@Path("projectName") String projectName, @Body UpdateProjectVpcWhiteListRequest request);

    @DELETE("projects/{projectName}")
    Call deleteProject(@Path("projectName") String projectName);

    @POST("projects/{projectName}/topics/{topicName}")
    Call createTopic(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                        @Body CreateTopicRequest request);

    @PUT("projects/{projectName}/topics/{topicName}")
    Call updateTopic(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                        @Body UpdateTopicRequest request);

    @GET("projects/{projectName}/topics/{topicName}")
    Call getTopic(@Path("projectName") String projectName, @Path("topicName") String topicName);

    @DELETE("projects/{projectName}/topics/{topicName}")
    Call deleteTopic(@Path("projectName") String projectName, @Path("topicName") String topicName);

    @GET("projects/{projectName}/topics")
    Call listTopic(@Path("projectName") String projectName, @Query("filter") String filter);

    @GET("projects/{projectName}/topics/{topicName}/shards")
    Call listShard(@Path("projectName") String projectName, @Path("topicName") String topicName);

    @POST("projects/{projectName}/topics/{topicName}/shards")
    Call splitShard(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                      @Body SplitShardRequest request);

    @POST("projects/{projectName}/topics/{topicName}/shards")
    Call mergeShard(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                      @Body MergeShardRequest request);

    @POST("projects/{projectName}/topics/{topicName}/shards")
    Call extendShard(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                        @Body ExtendShardRequest request);

    @POST("projects/{projectName}/topics/{topicName}/shards/{shardId}")
    Call getCursor(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                    @Path("shardId") String shardId,
                                    @Body GetCursorRequest request);

    @POST("projects/{projectName}/topics/{topicName}/shards")
    @Headers(DatahubConstant.X_DATAHUB_REQUEST_ACTION + ":pub")
    Call putPbRecords(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                          @Body PutRecordsRequestPB request);

    @POST("projects/{projectName}/topics/{topicName}/shards/{shardId}")
    @Headers(DatahubConstant.X_DATAHUB_REQUEST_ACTION + ":pub")
    Call putPbRecordsByShard(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                                      @Path("shardId") String shardId, @Body PutRecordsRequestPB request);

    @POST("projects/{projectName}/topics/{topicName}/shards/{shardId}")
    @Headers(DatahubConstant.X_DATAHUB_REQUEST_ACTION + ":pub")
    Call putBatchRecordsByShard(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                                         @Path("shardId") String shardId, @Body PutBatchRecordsRequestPB request);

    @POST("projects/{projectName}/topics/{topicName}/shards/{shardId}")
    @Headers(DatahubConstant.X_DATAHUB_REQUEST_ACTION + ":sub")
    Call getPBRecords(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                          @Path("shardId") String shardId, @Body GetRecordsRequestPB request);

    @POST("projects/{projectName}/topics/{topicName}/shards/{shardId}")
    @Headers(DatahubConstant.X_DATAHUB_REQUEST_ACTION + ":sub")
    Call getBatchRecords(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                                  @Path("shardId") String shardId, @Body GetBatchRecordsRequestPB request);

    @POST("projects/{projectName}/topics/{topicName}")
    Call appendField(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                        @Body AppendFieldRequest request);

    @POST("projects/{projectName}/topics/{topicName}/shards/{shardId}")
    Call getMeterInfo(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                          @Path("shardId") String shardId,
                                          @Body GetMeterInfoRequest request);

    @GET("projects/{projectName}/topics/{topicName}/connectors?mode=id")
    Call listConnector(@Path("projectName") String projectName, @Path("topicName") String topicName);

    @POST("projects/{projectName}/topics/{topicName}/connectors/{connectorType}")
    Call createConnector(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                                @Path("connectorType") String connectorType,
                                                @Body CreateConnectorRequest request);

    @GET("projects/{projectName}/topics/{topicName}/connectors/{connectorId}")
    Call getConnector(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                          @Path("connectorId") String connectorId);

    @POST("projects/{projectName}/topics/{topicName}/connectors/{connectorId}")
    Call updateConnector(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                                @Path("connectorId") String connectorId, @Body UpdateConnectorRequest request);

    @DELETE("projects/{projectName}/topics/{topicName}/connectors/{connectorId}")
    Call deleteConnector(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                                @Path("connectorId") String connectorId);

    @GET("projects/{projectName}/topics/{topicName}/connectors/{connectorId}?donetime")
    Call getConnectorDoneTime(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                                          @Path("connectorId") String connectorId);

    @POST("projects/{projectName}/topics/{topicName}/connectors/{connectorId}")
    Call reloadConnector(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                                @Path("connectorId") String connectorId, @Body ReloadConnectorRequest request);

    @POST("projects/{projectName}/topics/{topicName}/connectors/{connectorId}")
    Call updateConnectorState(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                                          @Path("connectorId") String connectorId, @Body UpdateConnectorStateRequest request);

    @POST("projects/{projectName}/topics/{topicName}/connectors/{connectorId}")
    Call updateConnectorOffset(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                                            @Path("connectorId") String connectorId, @Body UpdateConnectorOffsetRequest request);

    @POST("projects/{projectName}/topics/{topicName}/connectors/{connectorId}")
    Call getConnectorShardStatus(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                                                @Path("connectorId") String connectorId, @Body GetConnectorShardStatusRequest request);

    @POST("projects/{projectName}/topics/{topicName}/connectors/{connectorId}")
    Call getConnectorShardStatusByShard(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                                                   @Path("connectorId") String connectorId, @Body GetConnectorShardStatusRequest request);

    @POST("projects/{projectName}/topics/{topicName}/connectors/{connectorId}")
    Call appendConnectorField(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                                          @Path("connectorId") String connectorId, @Body AppendConnectorFieldRequest request);

    @POST("projects/{projectName}/topics/{topicName}/subscriptions")
    Call createSubscription(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                                      @Body CreateSubscriptionRequest request);

    @GET("projects/{projectName}/topics/{topicName}/subscriptions/{subId}")
    Call getSubscription(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                                @Path("subId") String subId);

    @DELETE("projects/{projectName}/topics/{topicName}/subscriptions/{subId}")
    Call deleteSubscription(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                                      @Path("subId") String subId);

    @POST("projects/{projectName}/topics/{topicName}/subscriptions")
    Call listSubscription(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                                  @Body ListSubscriptionRequest request);

    @PUT("projects/{projectName}/topics/{topicName}/subscriptions/{subId}")
    Call updateSubscription(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                                      @Path("subId") String subId, @Body UpdateSubscriptionRequest request);

    @PUT("projects/{projectName}/topics/{topicName}/subscriptions/{subId}")
    Call updateSubscriptionState(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                                                @Path("subId") String subId, @Body UpdateSubscriptionRequest request);

    @POST("projects/{projectName}/topics/{topicName}/subscriptions/{subId}/offsets")
    Call openSubscriptionSession(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                                                @Path("subId") String subId, @Body OpenSubscriptionSessionRequest request);

    @POST("projects/{projectName}/topics/{topicName}/subscriptions/{subId}/offsets")
    Call getSubscriptionOffset(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                                            @Path("subId") String subId, @Body GetSubscriptionOffsetRequest request);

    @PUT("projects/{projectName}/topics/{topicName}/subscriptions/{subId}/offsets")
    Call commitSubscriptionOffset(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                                                  @Path("subId") String subId, @Body CommitSubscriptionOffsetRequest request);

    @PUT("projects/{projectName}/topics/{topicName}/subscriptions/{subId}/offsets")
    Call resetSubscriptionOffset(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                                                @Path("subId") String subId, @Body ResetSubscriptionOffsetRequest request);

    @POST("projects/{projectName}/topics/{topicName}/subscriptions/{consumerGroup}")
    Call heartbeat(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                    @Path("consumerGroup") String consumerGroup, @Body HeartbeatRequest request);

    @POST("projects/{projectName}/topics/{topicName}/subscriptions/{consumerGroup}")
    Call joinGroup(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                    @Path("consumerGroup") String consumerGroup, @Body JoinGroupRequest request);

    @POST("projects/{projectName}/topics/{topicName}/subscriptions/{consumerGroup}")
    Call syncGroup(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                    @Path("consumerGroup") String consumerGroup, @Body SyncGroupRequest request);

    @POST("projects/{projectName}/topics/{topicName}/subscriptions/{consumerGroup}")
    Call leaveGroup(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                      @Path("consumerGroup") String consumerGroup, @Body LeaveGroupRequest request);

    @POST("projects/{projectName}/topics/{topicName}/alarms")
    Call createAlarmRule(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                                @Body CreateAlarmRuleRequest request);

    @PUT("projects/{projectName}/topics/{topicName}/alarms/{alarmId}")
    Call updateAlarmRule(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                                @Path("alarmId") String alarmId, @Body UpdateAlarmRuleRequest request);

    @GET("projects/{projectName}/topics/{topicName}/alarms/{alarmId}")
    Call getAlarmRule(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                          @Path("alarmId") String alarmId);

    @DELETE("projects/{projectName}/topics/{topicName}/alarms/{alarmId}")
    Call deleteAlarmRule(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                                @Path("alarmId") String alarmId);

    @POST("projects/{projectName}/topics/{topicName}/alarms")
    Call listAlarmRule(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                            @Body ListAlarmRuleRequest request);
    @POST("projects/{projectName}/topics/{topicName}")
    Call listMetaLog(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                        @Body ListMetaLogRequest request);
    @POST("projects/{projectName}/topics/{topicName}")
    Call listTopicSchema(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                                @Body ListTopicSchemaRequest request);

    @POST("projects/{projectName}/topics/{topicName}")
    Call getTopicSchema(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                                @Body GetTopicSchemaRequest request);

    @POST("projects/{projectName}/topics/{topicName}")
    Call registerTopicSchema(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                              @Body RegisterTopicSchemaRequest request);

    @POST("projects/{projectName}/topics/{topicName}")
    Call deleteTopicSchema(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                                    @Body DeleteTopicSchemaRequest request);

    @GET("projects/{projectName}/groups")
    Call listKafkaGroup(@Path("projectName") String projectName);

    @POST("projects/{projectName}/groups/{groupName}")
    Call createKafkaGroup(@Path("projectName") String projectName,
                                                  @Path("groupName") String groupName,
                                                  @Body CreateKafkaGroupRequest request);

    @PUT("projects/{projectName}/groups/{groupName}")
    Call updateKafkaGroup(@Path("projectName") String projectName,
                                                  @Path("groupName") String groupName,
                                                  @Body UpdateKafkaGroupRequest request);

    @GET("projects/{projectName}/groups/{groupName}")
    Call getKafkaGroup(@Path("projectName") String projectName,
                                            @Path("groupName") String groupName);

    @DELETE("projects/{projectName}/groups/{groupName}")
    Call deleteKafkaGroup(@Path("projectName") String projectName,
                                                  @Path("groupName") String groupName);

    @POST("projects/{projectName}/groups/{groupName}")
    Call listSubscriptionByKafkaGroup(@Path("projectName") String projectName,
                                                                          @Path("groupName") String groupName,
                                                                          @Body ListSubscriptionByKafkaGroupRequest request);

    @POST("projects/{projectName}/groups/{groupName}")
    Call updateTopicsForKafkaGroup(@Path("projectName") String projectName,
                                                                    @Path("groupName") String groupName,
                                                                    @Body UpdateTopicsForKafkaGroupRequest request);

    @POST("projects/{projectName}/topics/{topicName}")
    Call getTopicMetric(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                              @Body GetTopicMetricRequest request);

    @POST("projects/{projectName}/topics/{topicName}")
    Call getWriteToken(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                       @Body GetTokenRequest request);

    @POST("projects/{projectName}/topics/{topicName}/subscriptions/{subId}")
    Call getReadToken(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                      @Path("subId") String subId, @Body GetTokenRequest request);

    @POST("projects/{projectName}/topics/{topicName}/shards/{shardId}")
    Call getCursor(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                          @Path("shardId") String shardId,
                                          @Body GetCursorRequest request, @HeaderMap Map headers);

    @POST("projects/{projectName}/topics/{topicName}/shards/{shardId}")
    @Headers(DatahubConstant.X_DATAHUB_REQUEST_ACTION + ":sub")
    Call getPBRecords(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                          @Path("shardId") String shardId, @Body GetRecordsRequestPB request, @HeaderMap Map headers);

    @POST("projects/{projectName}/topics/{topicName}/shards/{shardId}")
    @Headers(DatahubConstant.X_DATAHUB_REQUEST_ACTION + ":sub")
    Call getBatchRecords(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                                  @Path("shardId") String shardId, @Body GetBatchRecordsRequestPB request, @HeaderMap Map headers);

    @POST("projects/{projectName}/topics/{topicName}/shards/{shardId}")
    @Headers(DatahubConstant.X_DATAHUB_REQUEST_ACTION + ":pub")
    Call putPbRecordsByShard(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                                      @Path("shardId") String shardId, @Body PutRecordsRequestPB request, @HeaderMap Map headers);

    @POST("projects/{projectName}/topics/{topicName}/shards/{shardId}")
    @Headers(DatahubConstant.X_DATAHUB_REQUEST_ACTION + ":pub")
    Call putBatchRecordsByShard(@Path("projectName") String projectName, @Path("topicName") String topicName,
                                                         @Path("shardId") String shardId, @Body PutBatchRecordsRequestPB request, @HeaderMap Map headers);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy