user
09/07/2022, 2:35 PMimport {ListObjectsCommand, S3Client} from "@aws-sdk/client-s3";
import { fromIni } from "@aws-sdk/credential-providers";
const client = new S3Client({
credentials: fromIni({profile: 'local'}),
endpoint: "<http://localhost:8000>",
});
var input = {
Bucket:"call-center3"
};
const command = new ListObjectsCommand(input);
const response = await client.send(command);
console.log(response)
user
09/07/2022, 2:38 PMlocal
profile in the file is pointing to lakeFS.
2. Unlike S3, lakeFS has branches. When you try to list objects from a repository you need to pass a prefix as well for the branch (must) and a prefix under the branch (optional).user
09/07/2022, 2:51 PMuser
09/07/2022, 2:52 PM/
user
09/07/2022, 3:01 PMimport {ListObjectsCommand,ListObjectsV2Command,ListBucketsCommand, S3Client} from "@aws-sdk/client-s3";
import { fromIni } from "@aws-sdk/credential-providers";
const client = new S3Client({
credentials: fromIni({profile: 'local'}),
endpoint: "<http://localhost:8000>",
bucketEndpoint: false,
});
var input = {
Bucket:"call-center3",
Prefix:"main/"
};
const command = new ListBucketsCommand({});
const response = await client.send(command);
console.log(response)
user
09/07/2022, 3:01 PM{
'$metadata': {
httpStatusCode: 200,
requestId: undefined,
extendedRequestId: undefined,
cfId: undefined,
attempts: 1,
totalRetryDelay: 0
},
Buckets: [
{ Name: 'call-center', CreationDate: 2022-09-06T14:45:37.661Z },
{ Name: 'call-center2', CreationDate: 2022-09-06T14:51:10.171Z },
{ Name: 'call-center3', CreationDate: 2022-09-06T15:06:38.831Z }
],
Owner: { DisplayName: '', ID: '' }
}
user
09/07/2022, 3:02 PMuser
09/07/2022, 3:02 PMimport {ListObjectsCommand,ListObjectsV2Command,ListBucketsCommand, S3Client} from "@aws-sdk/client-s3";
import { fromIni } from "@aws-sdk/credential-providers";
const client = new S3Client({
credentials: fromIni({profile: 'local'}),
endpoint: "<http://localhost:8000>",
bucketEndpoint: false,
});
var input = {
Bucket:"call-center3",
Prefix:"main/"
};
const command = new ListObjectsV2Command(input);
const response = await client.send(command);
console.log(response)
Produces this response :
{
'$metadata': {
httpStatusCode: 200,
requestId: undefined,
extendedRequestId: undefined,
cfId: undefined,
attempts: 1,
totalRetryDelay: 0
}
}
user
09/07/2022, 3:03 PMuser
09/07/2022, 3:03 PMuser
09/07/2022, 3:03 PMmain
branch?user
09/07/2022, 3:03 PMuser
09/07/2022, 3:03 PMuser
09/07/2022, 3:08 PMuser
09/07/2022, 3:09 PMuser
09/07/2022, 3:10 PMuser
09/07/2022, 3:10 PMuser
09/07/2022, 3:10 PMuser
09/07/2022, 3:12 PMdocker logs <container_id>
user
09/07/2022, 3:16 PMuser
09/07/2022, 3:17 PMuser
09/07/2022, 3:19 PMlogging:
level: trace
Yes, container needs to restart. But not deleted.user
09/07/2022, 3:51 PMlogging:
format: json
level: TRACE
output: "-"
I then restarted my container and added a file through the UI. I don't see an increased level of logging. Do you have any idea what I have done wrong?user
09/07/2022, 3:52 PMLAKEFS_LOGGING_LEVEL=TRACE
user
09/07/2022, 3:54 PMdocker-compose
?user
09/07/2022, 3:56 PMuser
09/07/2022, 3:57 PMuser
09/07/2022, 4:59 PMtime="2022-09-07T16:56:23Z" level=debug msg="performing S3 action" func=pkg/gateway.EnrichWithOperation.func1.1 file="build/pkg/gateway/middleware.go:116" action=list_repos message_type=action
time="2022-09-07T16:56:23Z" level=debug msg="HTTP call ended" func=net/http.HandlerFunc.ServeHTTP file="usr/local/go/src/net/http/server.go:2047" host=localhost log_audit=API method=GET path=/ request_id=62baec00-fc16-444a-9042-1b8a0027e927 sent_bytes=529 service_name=s3_gateway status_code=200 took=25.8603ms user=admin
time="2022-09-07T16:56:23Z" level=debug msg="performing S3 action" func=pkg/gateway.EnrichWithOperation.func1.1 file="build/pkg/gateway/middleware.go:116" action=list_repos message_type=action
time="2022-09-07T16:56:23Z" level=debug msg="HTTP call ended" func=net/http.HandlerFunc.ServeHTTP file="usr/local/go/src/net/http/server.go:2047" host=call-center2.localhost log_audit=API method=GET path="/?prefix=main%2F" request_id=a98659cc-ae3a-44de-a5ef-ce01f248c4f4 sent_bytes=529 service_name=s3_gateway status_code=200 took=2.7925ms user=admin
user
09/07/2022, 5:09 PMlist_repos
as lakeFS writes it)user
09/07/2022, 5:12 PMuser
09/07/2022, 5:12 PMuser
09/07/2022, 5:14 PMuser
09/07/2022, 5:18 PMAmazonS3 s3client = AmazonS3Client.builder()
.withCredentials((new AWSStaticCredentialsProvider(credentials)))
.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration("host", "region"))
.withPathStyleAccessEnabled(true)
.build();
user
09/07/2022, 5:25 PMuser
09/07/2022, 5:25 PMconst client = new S3Client({
credentials: fromIni({profile: 'local'}),
endpoint: "<http://localhost:8000>",
bucketEndpoint: false,
forcePathStyle:true
});
user
09/07/2022, 5:26 PMuser
09/07/2022, 5:26 PMuser
09/07/2022, 5:27 PM